-
Notifications
You must be signed in to change notification settings - Fork 4
/
dotGrid.html
242 lines (225 loc) · 10.7 KB
/
dotGrid.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
<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: dotGrid</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/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/bootstrap-icons@1.10.2/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: dotGrid</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">
dotGrid 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="canvasScale" value="20" min="10" step="1">
<label for="canvasScale">Scale</label>
</div>
</div>
<div class="col-12">
<div class="form-floating">
<input type="number" class="form-control" id="canvasBrightnessMin" placeholder="0" min="0"value="0">
<label for="canvasBrightnessMin">Minimum Brightness</label>
</div>
</div>
<div class="col-12">
<div class="form-floating">
<input type="number" class="form-control" id="canvasDrawingChance" value="2.5" min="0.1" step="0.1">
<label for="canvasDrawingChance">Drawing Chance</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!--*********************
* Shapes Settings *
**********************-->
<div class="accordion-item">
<h2 class="accordion-header" id="headingShapesSettings">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseShapesSettingss" aria-expanded="fase" aria-controls="collapseShapesSettingss">
Shapes Settings
</button>
</h2>
<div id="collapseShapesSettingss" class="accordion-collapse collapse" aria-labelledby="headingShapesSettings" 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="checkbox" role="switch" id="shapeBoxFilled">
<label class="form-check-label" for="shapeBoxFilled">shapeBoxFilled</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="shapeBoxOutlined">
<label class="form-check-label" for="shapeBoxOutlined">shapeBoxOutlined</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="shapeCircleFilled">
<label class="form-check-label" for="shapeCircleFilled">shapeCircleFilled</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="shapeCircleOutlined">
<label class="form-check-label" for="shapeCircleOutlined">shapeCircleOutlined</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="shapeDiamondFilled">
<label class="form-check-label" for="shapeDiamondFilled">shapeDiamondFilled</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="shapeDiamondOutlined">
<label class="form-check-label" for="shapeDiamondOutlined">shapeDiamondOutlined</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!--*********************
* Pattern Settings *
**********************-->
<div class="accordion-item">
<h2 class="accordion-header" id="headingPatternsSettings">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapsePatternsSettingss" aria-expanded="fase" aria-controls="collapsePatternsSettingss">
Pattern Settings
</button>
</h2>
<div id="collapsePatternsSettingss" class="accordion-collapse collapse" aria-labelledby="headingPatternsSettings" 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="patternMaxLength" value="5" min="2" step="1">
<label for="patternMaxLength">Pattern Max Length</label>
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="patternLineX">
<label class="form-check-label" for="patternLineX">patternLineX</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="patternLineY">
<label class="form-check-label" for="patternLineY">patternLineY</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="patternAdditionXY">
<label class="form-check-label" for="patternAdditionXY">patternAdditionXY</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="patternAdditionYX">
<label class="form-check-label" for="patternAdditionYX">patternAdditionYX</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="patternSubtractionXY">
<label class="form-check-label" for="patternSubtractionXY">patternSubtractionXY</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="patternSubtractionYX">
<label class="form-check-label" for="patternSubtractionYX">patternSubtractionYX</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="patternGridXY">
<label class="form-check-label" for="patternGridXY">patternGridXY</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--*********************
GENERATE LFG!
*********************-->
<div class="col-12">
<div class="input-group m-3">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="breakCode">
<label class="form-check-label" for="breakCode">Break Code</label>
</div>
</div>
</div>
<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/dotgrid/settings.js"></script>
<script src="./js/dotgrid/dotgrid.js"></script>
<!-- JavaScript Bundle with Popper -->
</body>
</html>