-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathinteractive.html
90 lines (88 loc) · 3.27 KB
/
interactive.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
<!doctype html>
<html lang="en">
<head>
<title>Aperiodic monotile</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<script src="monotile.js" defer></script>
<style>
body {
margin: 0;
}
main {
width: 100vw;
height: 100vh;
margin: 0;
padding: 0;
display: grid;
grid-template: auto 1fr / 1fr;
}
svg {
width: 100%;
height: 100%;
}
#controls {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
grid-gap: 1em;
padding: 1em;
}
#controls > div {
display: flex;
align-content: baseline;
grid-gap: 0.5em;
}
footer {
padding: 1em;
}
</style>
</head>
<body>
<main>
<section id="controls">
<div>
<label for="a">a: </label>
<input type="range" list="length-values" min="0" max="4" value="1" step="0.001" id="a">
<output for="a" id="a_output"></output>
</div>
<div>
<label for="b">b: </label>
<input type="range" list="length-values" min="0" max="4" value="1" step="0.001" id="b">
<output for="b" id="b_output"></output>
</div>
<div>
<label for="curve">curve: </label>
<input type="range" list="curve-values" min="0" max="1" value="0" step="0.001" id="curve">
<output for="curve" id="curve_output"></output>
</div>
<div>
<a id="download-svg" download="monotile.svg">Download SVG</a>
<a id="download-png" download="monotile.svg">Download PNG</a>
</div>
<datalist id="length-values">
<option value="0"></option>
<option value="1"></option>
<option value="1.732"></option>
<option value="4"></option>
</datalist>
<datalist id="curve-values">
<option value="0"></option>
<option value="0.5"></option>
<option value="1"></option>
</datalist>
</section>
<svg id="svg" xmlns="http://www.w3.org/2000/svg">
<path id="tile"></p>
</svg>
</main>
<footer>
<p>This tool draws the aperiodic monotile discovered by <a href="https://cs.uwaterloo.ca/~csk/spectre/">Smith, Myers, Kaplan and Goodman-Strauss</a>.</p>
<p>There's a family of related shapes, each made of 14 edges (though two of the edges are parallel and adjacent so look like a single long edge).</p>
<p>Each ledge is one of two lengths, 𝑎 or 𝑏. The angles in the shape don't change.</p>
<p>𝑎 = 1, 𝑏 = √3 is the "hat" tile. 𝑎 = √3, 𝑏=1 is the 'turtle' tile. 𝑎 = 𝑏 = 1 is the "spectre" chiral tile; it can be forced to tile aperiodically by increasing the "curve" parameter.</p>
<p>This tool made by <a href="https://somethingorotherwhatever.com">clp</a>.</p>
<p><a href="https://github.com/christianp/aperiodic-monotile">Tiles in more formats</a>.</p>
</footer>
</body>
</html>