-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
112 lines (99 loc) · 3.19 KB
/
index.html
File metadata and controls
112 lines (99 loc) · 3.19 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>IsingForge Engine</title>
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #1a1b20;
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
#main_canvas {
width: 100%;
height: 100%;
outline: none;
display: block;
}
#webgpu_error {
display: none;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100vh;
text-align: center;
padding: 40px;
box-sizing: border-box;
background: #1a1b20;
color: #dcdcdc;
}
#webgpu_error h1 {
color: #ff2a8f;
margin-bottom: 16px;
font-size: 2.2rem;
}
#webgpu_error p {
max-width: 620px;
line-height: 1.6;
margin-bottom: 20px;
}
.flag {
background: #2a2b32;
padding: 6px 12px;
border-radius: 6px;
font-family: monospace;
color: #00f0ff;
display: inline-block;
margin: 6px;
font-size: 1.05rem;
}
</style>
</head>
<body>
<div id="webgpu_error">
<h1>⚠️ WebGPU is not supported or enabled</h1>
<p><strong>IsingForge Engine</strong> requires WebGPU to run high-performance stochastic simulations.</p>
<p style="margin: 25px 0 8px 0;">How to fix it:</p>
<p><strong>Chrome, Edge or Opera:</strong> Start the browser with the following flag:</p>
<div class="flag">--enable-unsafe-webgpu</div>
<p style="margin-top: 30px; font-size: 0.95rem; color: #aaaaaa;">
Recommended: Use the latest <strong>Google Chrome</strong> or <strong>Microsoft Edge</strong>.<br>
Firefox support is experimental and limited on Linux.
</p>
</div>
<canvas id="main_canvas" tabindex="0"></canvas>
<script>
async function checkWebGPU() {
const errorDiv = document.getElementById('webgpu_error');
const canvas = document.getElementById('main_canvas');
if (!('gpu' in navigator)) {
errorDiv.style.display = 'flex';
canvas.style.display = 'none';
return false;
}
try {
const adapter = await navigator.gpu.requestAdapter();
if (!adapter) {
errorDiv.style.display = 'flex';
canvas.style.display = 'none';
return false;
}
return true;
} catch (err) {
console.error("WebGPU adapter request failed:", err);
errorDiv.style.display = 'flex';
canvas.style.display = 'none';
return false;
}
}
window.addEventListener('load', () => {
checkWebGPU();
});
</script>
</body>
</html>