-
Notifications
You must be signed in to change notification settings - Fork 79
/
index.html
35 lines (32 loc) · 1.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<title>thi.ng/geom test</title>
</head>
<body>
<div>
<select id="chooser">
<option value="">Choose example...</option>
</select>
</div>
<canvas id="main" width="1280" height="720"></canvas>
<script type="text/javascript" src="target/geom.js"></script>
<script>
const chooser = document.getElementById("chooser");
for (let id of Object.keys(thi.ng.geom.examples.gl).sort()) {
const opt = document.createElement("option");
opt.setAttribute("value", id);
opt.appendChild(document.createTextNode(id.replace(/_/g, " ")));
chooser.appendChild(opt);
}
chooser.addEventListener("change", (e) => {
const id = e.target.value;
if (id != "") {
chooser.remove();
thi.ng.geom.examples.gl[id].demo();
}
});
</script>
</body>
</html>