-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (43 loc) · 1.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!--
Adapted from https://github.com/yewang/besogo/blob/gh-pages/stable.html
and https://github.com/yewang/besogo/blob/112894275939b319abf4791b204528109c3a8db7/testing.html
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SGF Viewer</title>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="css/besogo.css">
<link rel="stylesheet" type="text/css" href="css/board-flat.css">
<!-- JS -->
<script src="https://github.com/yewang/besogo/releases/download/v0.0.2-alpha/besogo.min.js"></script>
</head>
<body>
<div id="viewer"></div>
<details>
<summary>Raw SGF string</summary>
<code id="sgf_str"></code>
</details>
<script type="text/javascript">
(function () {
const div_viewer = document.getElementById("viewer");
const div_sgf_str = document.getElementById("sgf_str");
// window.location.hash = "#any_hash_key=any_value"
const urlParams = new URLSearchParams(window.location.hash.substring(1));
const sgf_str = urlParams.get("sgf");
if (sgf_str != null) {
div_viewer.innerText = sgf_str;
div_sgf_str.innerText = sgf_str;
}
// See https://github.com/yewang/besogo/blob/112894275939b319abf4791b204528109c3a8db7/js/besogo.js
// for how besogo.create works.
besogo.create(div_viewer, {});
// Show game info on load.
const gameinfo_container = document.getElementsByClassName("besogo-gameInfo");
gameinfo_container[0].style["display"] = "table";
})();
</script>
</body>
</html>