-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwyre.html
285 lines (273 loc) · 12.6 KB
/
wyre.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<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>JSplacement: Wyre</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">Nicogs' JSplacement</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0" id="navbarItems">
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row justify-content-md-center m-4">
<div class="col col-md-auto">
<h1>Nicogs' JSplacement: Wyre</h1>
</div>
</div>
<div class="row justify-content-md-center">
<div class="col">
<div class="canvas-container">
<canvas class="art" id="heightCanvas" width="8192" height="8192"></canvas>
<canvas class="extraCanvas invisible" id="colorCanvas" width="8192" height="8192"></canvas>
<canvas class="extraCanvas invisible" id="normalCanvas" width="8192" height="8192"></canvas>
</div>
<div class="row justify-content-md-center text-center m-4">
<div class="col-md-auto m-1">
<button type="button" id="toolInvert" class="btn btn-outline-primary">Invert</button>
<button type="button" id="toolShowNormal" class="btn btn-outline-primary">Show Normal</button>
<button type="button" id="toolHide" class="btn btn-outline-primary">Hide color/normal</button>
</div>
<div class="col-md-auto m-1">
<button id="heightExport" class="btn btn-outline-primary">Download</button>
<button type="button" id="toolSaveNormal" class="btn btn-outline-primary">Save Normal</button>
<button type="button" id="toolSaveColor" class="btn btn-outline-primary">Save Color</button>
</div>
</div>
</div>
<div class="col-md-7 col-sm-12">
<form id="settings">
<div class="accordion accordion-flush" id="accordionSettings">
<div class="accordion-item">
<h2 class="accordion-header" id="headingMainSettings">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseMainSettings" aria-expanded="false" aria-controls="collapseMainSettings">
Wyre main Settings
</button>
</h2>
<div id="collapseMainSettings" class="accordion-collapse collapse" aria-labelledby="headingMainSettings" data-bs-parent="#accordionSettings">
<div class="accordion-body">
<div class="row row-cols-lg-auto g-2 align-items-center">
<div class="col-12">
<div class="form-floating">
<input type="number" class="form-control" id="canvasLayerCount" value="35" min="2" step="1">
<label for="canvasLayerCount">Layer Count</label>
</div>
</div>
<div class="col-12">
<div class="form-floating">
<input type="number" class="form-control" id="canvasLayerWires" value="3" min="1" step="1">
<label for="canvasLayerWires">Wires per Layer</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!--*********************
* Wire Color Mode *
**********************-->
<div class="accordion-item">
<h2 class="accordion-header" id="headingColorSettings">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseColorSettingss" aria-expanded="fase" aria-controls="collapseColorSettingss">
Wire Color Mode
</button>
</h2>
<div id="collapseColorSettingss" class="accordion-collapse collapse" aria-labelledby="headingColorSettings" data-bs-parent="#accordionSettings">
<div class="accordion-body">
<div class="row row-cols-lg-auto g-2 align-items-center">
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="colorLinear" name="colorMode">
<label class="form-check-label" for="colorLinear">colorLinear</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="colorLinearInverted" name="colorMode">
<label class="form-check-label" for="colorLinearInverted">colorLinearInverted</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="colorCurve" name="colorMode">
<label class="form-check-label" for="colorCurve">colorCurve</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="colorCurveInverted" name="colorMode">
<label class="form-check-label" for="colorCurveInverted">colorCurveInverted</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="colorRandom" name="colorMode">
<label class="form-check-label" for="colorRandom">colorRandom</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!--*********************
* Wire Width Mode *
**********************-->
<div class="accordion-item">
<h2 class="accordion-header" id="headingWidthSettings">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseWidthSettingss" aria-expanded="fase" aria-controls="collapseWidthSettingss">
Wire Width Mode
</button>
</h2>
<div id="collapseWidthSettingss" class="accordion-collapse collapse" aria-labelledby="headingWidthSettings" data-bs-parent="#accordionSettings">
<div class="accordion-body">
<div class="row row-cols-lg-auto g-2 align-items-center">
<div class="col-12 col-lg-6">
<div class="form-floating">
<input type="number" class="form-control" id="wireWidthMax" value="65" min="16" step="1">
<label for="wireWidthMax">wireWidthMax</label>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="form-floating">
<input type="number" class="form-control" id="wireOriginSpreadMax" value="0" min="0" step="1">
<label for="wireOriginSpreadMax">wireOriginSpreadMax</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="widthLinear" name="widthMode">
<label class="form-check-label" for="widthLinear">widthLinear</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="widthLinearInverted" name="widthMode">
<label class="form-check-label" for="widthLinearInverted">widthLinearInverted</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="widthCurve" name="widthMode">
<label class="form-check-label" for="widthCurve">widthCurve</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="widthCurveInverted" name="widthMode">
<label class="form-check-label" for="widthCurveInverted">widthCurveInverted</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="widthRandom" name="widthMode">
<label class="form-check-label" for="widthRandom">widthRandom</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!--*********************
* Step Directions *
**********************-->
<div class="accordion-item">
<h2 class="accordion-header" id="headingStepSettings">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseStepSettingss" aria-expanded="fase" aria-controls="collapseStepSettingss">
Step Directions
</button>
</h2>
<div id="collapseStepSettingss" class="accordion-collapse collapse" aria-labelledby="headingStepSettings" data-bs-parent="#accordionSettings">
<div class="accordion-body">
<div class="row row-cols-lg-auto g-2 align-items-center">
<div class="col-12 col-lg-6">
<div class="form-floating">
<input type="number" class="form-control" id="stepLengthMin" value="128" min="32" step="1">
<label for="stepLengthMin">stepLengthMin</label>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="form-floating">
<input type="number" class="form-control" id="stepLengthMax" value="2048" min="32" step="1">
<label for="stepLengthMax">stepLengthMax</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="stepDirectionAny" name="stepDirection">
<label class="form-check-label" for="stepDirectionAny">stepDirectionAny</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="stepDirectionCardinal" name="stepDirection">
<label class="form-check-label" for="stepDirectionCardinal">stepDirectionCardinal</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="stepDirectionDiagonal" name="stepDirection">
<label class="form-check-label" for="stepDirectionDiagonal">stepDirectionDiagonal</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="radio" role="switch" id="stepDirectionConical" name="stepDirection">
<label class="form-check-label" for="stepDirectionConical">stepDirectionConical</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--*********************
GENERATE LFG!
*********************-->
<div class="col-12">
<div class="input-group m-3">
<button type="submit" id="generateBtn" class="btn btn-outline-primary">Generate</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!--*********************
Colorize
*********************-->
<div class="container">
<div class="row justify-content-md-center m-4">
<div class="col-12">
<div class="container">
<hr/>
<h3>Colorize Art</h3>
<div class="row" id="colorOptions">
</div>
</div>
</div>
</div>
</div>
<script src="./utils.js"></script>
<script src="./js/colorizer.js"></script>
<script src="./js/tools.js"></script>
<script src="./js/export.js"></script>
<script src="./js/wyre/settings.js"></script>
<script src="./js/wyre/wyre.js"></script>
<!-- JavaScript Bundle with Popper -->
</body>
</html>