-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (83 loc) · 2.57 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ow my eyes</title>
<style>
body {
background-color: black;
color: white;
margin: 0;
padding: 0;
overflow: hidden;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
canvas {
background-color: black;
margin: 0;
padding: 0;
}
#readme {
text-align: center;
margin: auto;
width: fit-content;
}
a {
color: white;
}
a:visited {
color: #F0F0F0;
}
a:hover {
color: #F0F0F0;
}
.bold {
font-weight: bold;
}
ul {
list-style-type: none;
margin: auto;
width: fit-content;
margin: 0;
padding: 0;
}
</style>
</head>
<body id="wasm">
<div id="readme">
<h1>ow my eyes</h1>
<p> Requires WebGPU to run. <a href="https://github.com/gpuweb/gpuweb/wiki/Implementation-Status"> See supported browsers </a> </p>
<p class="bold">EPILEPSY WARNING! BRIGHT COLORS WARNING! </p>
<button id="start" disabled>Start</button>
<p> May take a bit to load.</p>
<p> Controls </p>
<ul>
<li> Click to fullscreen </li>
<li> Left/Right Arrow Keys to switch color mode </li>
<li> P to enable "Psychedelic Mode" (Will hurt your eyes)</li>
<li> R to reset </li>
</ul>
</div>
<script type="module">
import init from "./pkg/ow_my_lib.js";
let start_button = document.getElementById("start");
if (!navigator.gpu?.wgslLanguageFeatures) {
start_button.innerText = "WebGPU not supported";
//return;
} else {
start_button.removeAttribute("disabled");
start_button.addEventListener("click", async () => {
document.getElementById("readme").remove();
await init();
// by this point, the canvas should exist
const canvas = document.querySelector("canvas");
canvas.addEventListener("click", () => {
canvas.requestFullscreen();
});
});
}
</script>
</body>
</html>