-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
129 lines (129 loc) · 4.92 KB
/
index.html
File metadata and controls
129 lines (129 loc) · 4.92 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
(function () {
var stored = localStorage.getItem("phuzzle-theme");
var themes = ["light", "dark", "space", "ocean", "forest", "sunset"];
var colors = {
light: "#f3f7ff",
dark: "#1a2128",
space: "#1a1735",
ocean: "#132a4a",
forest: "#182d22",
sunset: "#3d2412",
};
var theme;
if (stored && themes.indexOf(stored) !== -1) {
theme = stored;
} else {
theme = window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark"
: "light";
}
document.documentElement.className = "theme-" + theme;
var m = document.querySelector('meta[name="theme-color"]');
if (!m) {
m = document.createElement("meta");
m.name = "theme-color";
document.head.appendChild(m);
}
if (colors[theme]) m.setAttribute("content", colors[theme]);
})();
</script>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-visual"
/>
<meta
name="description"
content="Solve beautiful jigsaw puzzles in your browser. Play the daily, keep your streak alive, or jump into Quick Play and Puzzle Packs."
/>
<meta name="color-scheme" content="light dark" />
<meta name="robots" content="index,follow" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/icon-192.png" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="canonical" href="https://phuzzle.vercel.app/" />
<meta property="og:title" content="Phuzzle – Jigsaw puzzles, reimagined" />
<meta
property="og:description"
content="Solve beautiful jigsaw puzzles in your browser. Relax, race the clock, or play with a friend."
/>
<meta property="og:image" content="https://phuzzle.vercel.app/og-image.webp" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:url" content="https://phuzzle.vercel.app/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Phuzzle" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Phuzzle – Jigsaw puzzles, reimagined" />
<meta
name="twitter:description"
content="Solve beautiful jigsaw puzzles in your browser. Relax, race the clock, or play with a friend."
/>
<meta name="twitter:image" content="https://phuzzle.vercel.app/og-image.webp" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Phuzzle" />
<title>Phuzzle</title>
</head>
<body>
<div id="root"></div>
<script>
// Reload when a lazy-loaded chunk fails (stale cache after deploy).
// Unregister SW and use cache-busting URL so we fetch fresh index.html.
(function () {
function isChunkLoadError(msg) {
return (
msg &&
(msg.includes("Failed to fetch dynamically imported module") ||
msg.includes("Importing a module script failed") ||
msg.includes("Loading chunk") ||
msg.includes("ChunkLoadError") ||
msg.includes("Unable to preload CSS") ||
msg.includes("preload"))
);
}
function hardReload() {
var key = "phuzzle:reload";
var last = parseInt(sessionStorage.getItem(key) || "0", 10);
if (Date.now() - last < 5000) return;
sessionStorage.setItem(key, String(Date.now()));
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.getRegistrations()
.then(function (regs) {
regs.forEach(function (r) {
r.unregister();
});
doReload();
})
.catch(doReload);
} else {
doReload();
}
}
function doReload() {
var q = location.search ? location.search + "&" : "?";
location.replace(location.pathname + q + "_cb=" + Date.now());
}
window.addEventListener("error", function (e) {
if (isChunkLoadError(e.message)) {
e.preventDefault();
hardReload();
}
});
window.addEventListener("unhandledrejection", function (e) {
var msg = (e.reason && e.reason.message) || String(e.reason || "");
if (isChunkLoadError(msg)) {
e.preventDefault();
hardReload();
}
});
window.addEventListener("vite:preloadError", hardReload);
})();
</script>
<script type="module" src="/src/app/main.tsx"></script>
</body>
</html>