-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·138 lines (131 loc) · 6.48 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="main.js"></script>
<script src="StringChain.js"></script>
<script src="StringBoard.js"></script>
<script src="manualDraw.js"></script>
<script src="UI.js"></script>
<script src="Vec2.js"></script>
<!-- <script src="autoDraw.js"></script> -->
<link rel="stylesheet" href="style.css">
<title>Circle String</title>
</head>
<body>
<div id="dvMain">
<div id="dvUILeftOuter">
<p id="pLeftAlign">Previous Strings</p> <!--shame be upon me, but it was the easiest way to make it pad exactly the same as the other side-->
<div id="dvUILeft">
<p>Click a peg to start and finish a string.<br>
Draw the string around pegs to wrap them.<br>
Draw back in the opposite direction or press [z] to unwrap.<br>
Use [shift] to disable wrapping
</p>
<div id="dvDrawingSettings" class="settings">
<span>
<input id="inpStringColour" name="inpStringColour" type="color">
<label for="inpStringColour">String colour</label>
</span>
<span>
<select id="slDrawMode" name="slDrawMode">
<option>Manual</option>
<option>Pattern</option>
</select>
<label for="slDrawMode">mode</label>
</span>
</div>
<div id="dvPatternSettings">
<p>
Hover peg to preview, click to confirm
</p>
<span>
<label for = "inpPatternInterval">Interval</label>
<input id="inpPatternInterval" class="numberInput" name="inpPatternInterval" type="number" min="1" max="64">
</span>
<span>
<label for="inpPatternCount">Count</label>
<input id="inpPatternCount" class="numberInput" name="inpPatternCount" type="number" min="0" max="64" placeholder="Until repeat">
</span>
<select id="slPatternDirection">
<option>Clockwise</option>
<option>Anticlockwise</option>
</select>
</div>
<hr>
<div id="dvVisualSettings" class="settings">
<span>
<label for="inpCanvasResolution">Board resolution</label>
<input id="inpCanvasResolution" class="numberInput" name="inpCanvasResolution" type="number" min="256" max="4096">
<label>px</label>
</span>
<span>
<label for="inpBoardPegRadius">Peg size</label>
<input id="inpBoardPegRadius" class="numberInput" name="inpBoardPegRadius" type="number" min="1" max="16">
</span>
<button id="btnApplyVisualSettings">Apply</button>
</div>
<hr>
<div id="dvMiscSettings" class="settings">
<span>
<input id="inpNumPegs" class="numberInput" name="inpNumPegs" type="number" min="2" max="512">
<label for="inpNumPegs">Number of pegs (requires clear)</label>
</span>
<span>
<select id="slShiftMode" name="slShiftMode">
<option>Hold</option>
<option>Toggle</option>
</select>
<label for="slShiftMode">shift to enable/disable wrapping</label>
</span>
<span>
<input id="inpAutoEditWrap" name="inpAutoEditWrap" type="checkbox" checked>
<label for="inpAutoEditWrap">Auto-disable wrapping on edit start</label>
</span>
<span>
<input id="inpWarnOnPageLeave" name="inpWarnOnPageLeave" type="checkbox" checked>
<label for="inpWarnOnPageLeave">Warn of potential unsaved changes on page leave</label>
</span>
</div>
<hr>
<div id="dvSaveButtons">
<button id="btnSaveBoard">Save</button>
<button id="btnLoadBoard">Load</button>
<button id="btnRequestReset">Clear</button>
</div>
<p id="pCredits"><a target="_blank" href="https://icons8.com/icon/86374/edit">Edit</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a><br>
<a target="_blank" href="https://icons8.com/icon/14367/waste">Bin</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a></p>
</div>
</div>
<canvas id="cnvMain"></canvas>
<div id="dvUIRight">
<p id="pPrevStringTitle">Previous Strings</p>
<div id="dvStringChainList"></div>
</div>
<div id="dvPopupBackground">
<div id="dvSavePopup" class="popup">
<a id="aSaveAsFile" download="board.json">Save as file</a>
<button id="btnCopyToClipboard">Copy to Clipboard</button>
<button id="btnCloseSavePopup">Close</button>
</div>
<div id="dvLoadPopup" class="popup">
<input id="inpLoadFile" type="file" accept=".txt,.json">
<textarea id="taLoad" rows="10" placeholder="Browse file or paste board data here"></textarea>
<span>
<button id="btnCloseLoadPopup">Cancel</button>
<button id="btnLoad">Load</button>
</span>
</div>
<div id="dvConfirmResetPopup" class="popup">
<p>All unsaved changes will be lost</p>
<br>
<span>
<button id="btnCloseResetPopup">Cancel</button>
<button id="btnResetBoard">Clear</button>
</span>
</div>
</div>
<!-- <canvas id="cnvHidden"></canvas> -->
</div>
</body>
</html>