summaryrefslogtreecommitdiff
path: root/web/static/index.html
blob: e195e0b5c0e7901fadb60098c1ededb5eb8aa218 (plain) (blame)
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
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>dartboat™</title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no">
		<link rel="stylesheet" type="text/css" href="style.css">
		<script src="dartboat.js"></script>
		<script src="dartboat_wasm.js"></script>
	</head>
	<body>
		<div id="main">
			<div id="titlebar">
				<div>dartboat™</div>
				<div class="input first"><span>delay</span><input id="delay" data-opt="delay" maxlength="4" value=""></div>
				<div class="input"><span>stdev</span><input id="stdev" data-opt="stdev" maxlength="4" value=""></div>
				<div class="button" id="flip-controls-button">&rarr;</div>
				<div class="button" data-modal="help-modal">?</div>
			</div>
			<div id="info">
				<div id="oi">oi!</div>
				<div id="p1-info">
					<div id="p1-info-inner">
						<div id="p1-name"></div>
						<div id="p1-rem"></div>
						<div id="p1-sugg"></div>
						<div id="p1-avg"></div>
					</div>
				</div>
				<div id="p2-info">
					<div id="p2-info-inner">
						<div id="p2-name"></div>
						<div id="p2-rem"></div>
						<div id="p2-sugg"></div>
						<div id="p2-avg"></div>
					</div>
				</div>
			</div>
			<div id="controls">
				<div id="prompt">
					<div id="prompt-msg-l"></div>
					<div id="prompt-input"></div>
					<div id="prompt-msg-r"></div>
				</div>
				<div id="keypad-default" class="keypad">
					<div data-command="append:1" class="key num">1</div>
					<div data-command="append:2" class="key num">2</div>
					<div data-command="append:3" class="key num">3</div>
					<div data-command="append:4" class="key num">4</div>
					<div data-command="append:5" class="key num">5</div>
					<div data-command="append:6" class="key num">6</div>
					<div data-command="append:7" class="key num">7</div>
					<div data-command="append:8" class="key num">8</div>
					<div data-command="append:9" class="key num">9</div>
					<div data-command="clear" class="key">CLEAR</div>
					<div data-command="append:0" class="key num">0</div>
					<div data-command="submit" class="key" id="key-submit">OK</div>
					<div data-command="undo" class="key" id="key-undo">UNDO</div>
					<div data-command="rem" class="key" id="key-rem">REMAINING</div>
				</div>
				<div id="keypad-select_mode" class="keypad">
					<div data-command="append:1;submit" class="key"><span class="keyboard-val">[1]</span> Play against bot</div>
					<div data-command="append:2;submit" class="key"><span class="keyboard-val">[2]</span> One-player scoreboard</div>
					<div data-command="append:3;submit" class="key"><span class="keyboard-val">[3]</span> Two-player scoreboard</div>
				</div>
				<div id="keypad-dartboard" class="keypad">
					<div id="dartboard-container">
						<svg id="dartboard" viewBox="0 0 451 451">
							<g class="base" transform="translate(225.5 225.5) scale(1 -1)"></g>
							<g class="overlay" transform="translate(225.5 225.5) scale(1 -1)"></g>
						</svg>
					</div>
				</div>
			</div>
			<div id="visits"></div>
		</div>
		<div id="help-modal" class="modal">
			<div class="modal-content">
				<h2>dartboat</h2>
				<p>dartboat uses an internal representation of a specification dartboard. Darts are thrown following a normal distribution, with the resultant coordinates used to calculate the segments in which they land. The idea is that this provides a more realistic opponent than picking points at random.</p>
				<h2>Settings</h2>
				<p><em>stdev</em> — the standard deviation of the bot's throws in millimetres. A value of 24 translates to a three-dart average of roughly 35. A value of 13 would be a 65 average, and a value of 8 a 95 average.</p>
				<p><em>delay</em> — milliseconds it takes the bot to throw each dart.</p>
				<h2>Interface</h2>
				<p>To avoid destructive actions being a misclick away, certain actions require two presses—one to activate the button and another to trigger it.</p>
				<p>The controls are designed to be keyboard-friendly. The keys should be fairly intuitive for the most part.</p>
				<h2>Info</h2>
				<p>dartboat is <a href="https://retarded.software/dartboat.git/" target="_blank">free and open-source software</a>. It is written in C and compiled to WebAssembly for the web target. JavaScript is used to handle the interactive elements.</p>
			</div>
		</div>
	</body>
</html>