-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (51 loc) · 2.26 KB
/
Copy pathindex.html
File metadata and controls
51 lines (51 loc) · 2.26 KB
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
<!doctype html>
<html lang="en" data-theme="gokstad">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#150f09" />
<script>
// Apply the saved theme before first paint to avoid a flash. Must be
// kept in step with DEFAULT_THEME / pickDefaultTheme in src/theme.ts —
// this inline copy exists only because that module can't run before
// the first paint it's guarding against.
try {
var t = localStorage.getItem("brandubh.theme");
if (!t) {
t = "gokstad";
localStorage.setItem("brandubh.theme", t);
}
// …and the same for resolveTheme: a reload mid-Tablut or mid-Copenhagen
// lands back on the 9×9 or 11×11 board, so a board-specific theme has to
// fall back here too or the held-over paint is a flash of the wrong
// board, which is the one thing this script exists to prevent. Only what
// is *painted* changes; the stored choice above is left as the player set
// it. The surface keys are listed rather than derived because this copy
// cannot import them — add a board, add its key here.
//
// This list is NOT "the surfaces": it is "the surfaces that fall
// Ballinderry back". `morris.surface.v1` is deliberately absent, because
// a 24-hole peg board is a truthful Morris board and the theme is kept
// there — see ADR-0008, and `npm run check:morris`, which asserts it.
if (
t === "ballinderry" &&
(localStorage.getItem("tablut.surface.v1") === "1" ||
localStorage.getItem("copenhagen.surface.v1") === "1")
) {
t = "gokstad";
}
document.documentElement.setAttribute("data-theme", t);
} catch (e) {}
</script>
<meta
name="description"
content="Brandubh — the Irish 7x7 hnefatafl. Play the King's escape or the raiders' hunt against a friend or the AI."
/>
<title>Brandubh · Irish Hnefatafl</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>