Skip to content

Commit 7ca076a

Browse files
committed
[Feat] add wasm not supported page
1 parent ef46ce3 commit 7ca076a

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

app/index.html

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link data-trunk rel="rust" data-bin="highlight_worker" data-type="worker" />
1212
</head>
1313
<body style="margin:0;min-height:100vh;display:flex;flex-direction:column;align-items:center;background:#000000;color:#e2e8f0;">
14-
<div style="flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;">
14+
<div id="boot-loading" style="flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;">
1515
<svg width="64" height="46" viewBox="0 0 40 29" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Loading logo" style="display:block;overflow:visible;">
1616
<style>
1717
.shape {
@@ -65,5 +65,37 @@
6565
</g>
6666
</svg>
6767
</div>
68+
<div id="wasm-unsupported" style="display:none;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:16px;max-width:720px;padding:24px;text-align:center;">
69+
<svg width="64" height="46" viewBox="0 0 40 29" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="zzhack logo" style="display:block;">
70+
<rect x="11.291" width="20" height="20" rx="5" transform="rotate(6.98839 11.291 0)" fill="#FF7979"/>
71+
<circle cx="8" cy="9.14258" r="8" fill="#70A1FF"/>
72+
<path d="M25.5943 8.15645C25.7834 7.35408 26.8075 7.11219 27.3355 7.74517L38.9501 21.6672C39.4233 22.2345 39.1392 23.1014 38.422 23.2786L22.607 27.1853C21.8811 27.3646 21.2224 26.7129 21.3938 25.9851L25.5943 8.15645Z" fill="#FFBE76"/>
73+
</svg>
74+
<div style="display:flex;flex-direction:column;gap:8px;">
75+
<div style="font-size:22px;font-weight:600;">WebAssembly not supported</div>
76+
<div style="font-size:15px;line-height:1.6;color:#cbd5f5;">
77+
This browser can't run the app because WebAssembly is disabled or unavailable.
78+
</div>
79+
</div>
80+
<div style="font-size:14px;line-height:1.6;color:#94a3b8;">
81+
Try updating your browser or switch to a recent version of Chrome, Edge, Firefox, or Safari.
82+
</div>
83+
</div>
84+
<script>
85+
(function () {
86+
var supported = typeof WebAssembly === 'object' && typeof WebAssembly.instantiate === 'function';
87+
if (supported) {
88+
return;
89+
}
90+
var loading = document.getElementById('boot-loading');
91+
if (loading) {
92+
loading.style.display = 'none';
93+
}
94+
var fallback = document.getElementById('wasm-unsupported');
95+
if (fallback) {
96+
fallback.style.display = 'flex';
97+
}
98+
})();
99+
</script>
68100
</body>
69101
</html>

0 commit comments

Comments
 (0)