-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
50 lines (47 loc) · 1.89 KB
/
index.html
File metadata and controls
50 lines (47 loc) · 1.89 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="description" content="Luau Playground - Run Luau code in your browser" />
<link rel="icon" href="/favicon.svg" />
<title>Luau Playground</title>
<link rel="preload" href="/font/BuilderSans-Regular.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/font/BuilderMono-Regular.woff2" as="font" type="font/woff2" crossorigin />
<script>
// Prevent viewport zooming on iOS from focusing the editor
(function() {
var ua = navigator.userAgent;
var isIOS =
/iPhone|iPod|iPad/.test(ua) ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
if (!isIOS) return;
var viewport = document.querySelector('meta[name="viewport"]');
if (!viewport) return;
viewport.setAttribute(
'content',
'width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover'
);
})();
// Prevent theme flash - must run synchronously before CSS
(function() {
var theme = localStorage.getItem('theme');
var isDark = theme === 'dark' ||
(theme !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches);
if (isDark) {
document.documentElement.classList.add('dark');
}
document.documentElement.style.background = isDark ? '#0a0a0f' : '#fafafa';
})();
// Start WASM fetch immediately (before module scripts load)
window.__wasmPromises = {
luau: fetch('/wasm/luau.wasm').then(function(r) { return r.arrayBuffer(); })
};
</script>
<!--app-head-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>