-
Notifications
You must be signed in to change notification settings - Fork 431
Expand file tree
/
Copy pathindex.html
More file actions
109 lines (100 loc) · 2.89 KB
/
index.html
File metadata and controls
109 lines (100 loc) · 2.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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Wasm Browser Benchmark</title>
<link rel="icon" href="data:," />
<style>
:root {
color-scheme: dark;
--bg: #0b1020;
--panel: rgba(13, 21, 42, 0.88);
--panel-border: rgba(255, 255, 255, 0.12);
--text: #e8edf7;
--muted: #94a3b8;
--accent: #7dd3fc;
--accent-2: #a78bfa;
}
html,
body {
margin: 0;
min-height: 100%;
background:
radial-gradient(circle at top left, rgba(125, 211, 252, 0.16), transparent 28%),
radial-gradient(circle at top right, rgba(167, 139, 250, 0.2), transparent 26%),
linear-gradient(180deg, #070b15 0%, var(--bg) 100%);
color: var(--text);
font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
sans-serif;
}
body {
display: grid;
place-items: center;
padding: 24px;
box-sizing: border-box;
}
main {
width: min(900px, 100%);
border: 1px solid var(--panel-border);
background: var(--panel);
backdrop-filter: blur(18px);
border-radius: 20px;
padding: 28px;
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
h1 {
margin: 0 0 8px;
font-size: clamp(1.8rem, 4vw, 3rem);
line-height: 1.05;
}
p {
margin: 0;
color: var(--muted);
}
pre {
margin: 24px 0 0;
padding: 18px;
overflow: auto;
border-radius: 16px;
background: rgba(2, 6, 23, 0.6);
border: 1px solid rgba(148, 163, 184, 0.18);
color: var(--text);
white-space: pre-wrap;
}
.status {
margin-top: 20px;
color: var(--accent);
font-weight: 600;
letter-spacing: 0.01em;
}
.meta {
margin-top: 8px;
color: var(--muted);
font-size: 0.95rem;
}
</style>
</head>
<body>
<main>
<h1>Wasm Browser Benchmark</h1>
<p>
Runs the C and Rust solvers in an actual browser context and compares their average solve
time.
</p>
<div class="status" id="status">Waiting to load wasm modules...</div>
<div class="meta" id="meta"></div>
<pre id="output"></pre>
</main>
<script type="module">
const status = document.getElementById("status");
status.textContent = "Booting benchmark...";
import(`/browser/bench.js?cache=${Date.now()}`).catch((error) => {
status.textContent = "Failed to boot.";
console.error(error);
const output = document.getElementById("output");
output.textContent = `${error?.stack ?? error?.message ?? String(error)}\n`;
});
</script>
</body>
</html>