-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
84 lines (80 loc) · 2.81 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- this is mobile related magic -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>domino parlor</title>
<!-- this is probably misguided. I want the dominos to take up the full screen and this does that. -->
<style type="text/css">
/* Disable scrollbar */
html { overflow-y: hidden; }
#domino-div {
height: 94vh;
width: 97vw;
}
</style>
<script type="text/javascript">
// This sets the state based on the URL. Yeah, there is like 40 ways we
// need to plumb this information along. I'm not a web guy and was
// losing steam at this point. Forgive me, I realize it is bad.
function decorate_for_guests() {
const url = new URL(document.location.href);
const params = new URLSearchParams(url.search);
const defaults = {
"palette_add": "3",
"palette_mul": "1",
// (8, 8) looks cool
};
const elements = ["palette_add", "palette_mul"];
elements.forEach(function(id) {
var element = document.getElementById(id);
if (params.get(id) !== null) {
element.value = params.get(id);
} else if (defaults[id] !== undefined) {
element.value = defaults[id];
}
});
}
var kickstart;
(kickstart = function() {
window.onload = decorate_for_guests;
})();
</script>
</head>
<body>
<div id="wrapper">
<div>
<input type="checkbox" id="border" name="border" />
<label for="border">Show Infinite Border</label>
<!--
</div>
<div>
-->
|
<input type="checkbox" id="tile_lines" name="tile_lines" />
<label for="tile_lines">Show Tile Boundaries</label>
<!--
</div>
<div>
-->
|
<label for="palette_add">Color #1</label>
<input type="number" id="palette_add" name="palette_add" style="width: 7ch" />
<label for="palette_mul">Color #2</label>
<input type="number" id="palette_mul" name="palette_mul" style="width: 7ch" />
|
<a id="state_link" href="">Share</a>
</div>
</div>
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="z" data-lib="canvas_experiment" />
<app>
<div id="domino-div">
<canvas id="domino" style="border:1px solid black;" ref={this.canvasRef} width={this.state.canvasWidth} height={this.state.canvasHeight}>Looks like you won't be seeing some cool dominos.</canvas>
<!--
<canvas id="domino" style="border:1px solid black;">Looks like you won't be seeing some cool dominos.</canvas>
-->
</div>
</app>
</body>
</html>