forked from vZome/zome-tetras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
98 lines (89 loc) · 2.83 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
95
96
97
98
<!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>Zometool Tetrahedra Challenge</title>
<!-- Enable the vzome-viewer custom element -->
<script type="module" src="https://www.vzome.com/modules/vzome-viewer.js"></script>
<!-- populate the table and hook the click events -->
<script type="module" src="./tetra-listing.js"></script>
<script>
function adjustPosition(step) {
const id = document.getElementById("current").getAttribute("data-id");
const target = "tetra-" + (parseInt(id) + step);
const tetra = document.getElementById( target );
if(tetra) {
tetra.click();
}
}
function prevButton() {
adjustPosition(-1);
}
function nextButton() {
adjustPosition(1);
}
</script>
<link href="style.css" rel="stylesheet">
</head>
<body>
<div class="main-grid">
<div class="intro">
<h1>
Zometool Tetrahedra Challenge Solution
</h1>
<p>
Select a row in the table to see the tetrahedron. Rows marked with an asterisk (*)
represent chiral tetrahedra; they have both left-handed and right-handed forms.
</p>
<p>
<a href="https://github.com/vZome/zome-tetras/">Page Source</a>
</p>
</div>
<div class="table">
<table id="partsTable">
<thead>
<tr id="current" data-id="0">
<td class="ident done">vZome</td>
<td class="balls">4</td>
<td class="blu"></td>
<td class="blu"></td>
<td class="blu"></td>
<td class="yel">1</td>
<td class="yel"></td>
<td class="yel"></td>
<td class="red"></td>
<td class="red"></td>
<td class="red"></td>
</tr>
<tr>
<td colspan="11">
<div id="nav">
<button id="nextBtn"onclick='nextButton()'> Next > </button>
<button id="prevBtn" onclick='prevButton()'> < Prev </button>
</div>
</td>
</tr>
<tr>
<th class="ident">Id</th>
<th class="balls">Balls</th>
<th class="blu">B0</th>
<th class="blu">B1</th>
<th class="blu">B2</th>
<th class="yel">Y0</th>
<th class="yel">Y1</th>
<th class="yel">Y2</th>
<th class="red">R0</th>
<th class="red">R1</th>
<th class="red">R2</th>
</tr>
</thead>
</table>
</div>
<div class="viewer">
<vzome-viewer id="viewer" src="vZomeLogo.vZome" />
</div>
</div>
</body>
</html>