-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
353 lines (348 loc) · 40.1 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
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>rePaint | A quick way to draw simple pictures online.</title>
<link rel="icon" href="favicon.svg"/>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300..700" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/tippy.js@6/animations/shift-toward.css"/>
</head>
<body onmouseup="mouseUp()">
<div id="TittleBar">
<div class="TittleBarButton"></div>
<h1 id="Status">rePaint</h1>
<div class="TittleBarButton" onclick="openPreferencesPopup()">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path fill="#fdfdfd" d="M17.5,8.28c-5.09,0-9.22,4.13-9.22,9.22c0,5.09,4.13,9.22,9.22,9.22s9.22-4.13,9.22-9.22C26.72,12.41,22.59,8.28,17.5,8.28z M17.5,21.63c-2.27,0-4.13-1.85-4.13-4.13s1.85-4.13,4.13-4.13s4.13,1.85,4.13,4.13S19.77,21.63,17.5,21.63z"/>
<path fill="#fdfdfd" d="M16.09,5.06h2.82c0.54,0,0.98,0.44,0.98,0.98v3c0,0.54-0.44,0.98-0.98,0.98h-2.82c-0.54,0-0.98-0.44-0.98-0.98v-3C15.11,5.5,15.55,5.06,16.09,5.06z"/>
<path fill="#fdfdfd" d="M7.71,9.7L9.7,7.71c0.38-0.38,1.01-0.38,1.39,0l2.12,2.12c0.38,0.38,0.38,1.01,0,1.39l-1.99,1.99c-0.38,0.38-1.01,0.38-1.39,0l-2.12-2.12C7.32,10.71,7.32,10.08,7.71,9.7z"/>
<path fill="#fdfdfd" d="M5.06,18.91v-2.82c0-0.54,0.44-0.98,0.98-0.98h3c0.54,0,0.98,0.44,0.98,0.98v2.82c0,0.54-0.44,0.98-0.98,0.98h-3C5.5,19.89,5.06,19.45,5.06,18.91z"/>
<path fill="#fdfdfd" d="M9.7,27.29L7.71,25.3c-0.38-0.38-0.38-1.01,0-1.39l2.12-2.12c0.38-0.38,1.01-0.38,1.39,0l1.99,1.99c0.38,0.38,0.38,1.01,0,1.39l-2.12,2.12C10.71,27.68,10.08,27.68,9.7,27.29z"/>
<path fill="#fdfdfd" d="M18.91,29.94h-2.82c-0.54,0-0.98-0.44-0.98-0.98v-3c0-0.54,0.44-0.98,0.98-0.98h2.82c0.54,0,0.98,0.44,0.98,0.98v3C19.89,29.5,19.45,29.94,18.91,29.94z"/>
<path fill="#fdfdfd" d="M27.29,25.3l-1.99,1.99c-0.38,0.38-1.01,0.38-1.39,0l-2.12-2.12c-0.38-0.38-0.38-1.01,0-1.39l1.99-1.99c0.38-0.38,1.01-0.38,1.39,0l2.12,2.12C27.68,24.29,27.68,24.92,27.29,25.3z"/>
<path fill="#fdfdfd" d="M29.94,16.09v2.82c0,0.54-0.44,0.98-0.98,0.98h-3c-0.54,0-0.98-0.44-0.98-0.98v-2.82c0-0.54,0.44-0.98,0.98-0.98h3C29.5,15.11,29.94,15.55,29.94,16.09z"/>
<path fill="#fdfdfd" d="M25.3,7.71l1.99,1.99c0.38,0.38,0.38,1.01,0,1.39l-2.12,2.12c-0.38,0.38-1.01,0.38-1.39,0l-1.99-1.99c-0.38-0.38-0.38-1.01,0-1.39l2.12-2.12C24.29,7.32,24.92,7.32,25.3,7.71z"/>
</svg>
</div>
</div>
<div id="WindowContent">
<div id="SideBar">
<div id="ToolsBox">
<div id="ToolSelectionBox">
<div class="ToolButton" id="PBrButton" onclick="selectTool(this)" data-tippy-content="<strong>Paint Brush tool (B)</strong><br>Draws custom brush strokes" data-tippy-placement="right"> <!-- PaintBrushButton -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="PBrSvgElement" fill="#9A949B" d="M12.89,20.53l3.91,2.55c0.76,0.5,1.79,0.21,2.18-0.62L26.45,6.7c0.32-0.68,0.09-1.49-0.54-1.91l0,0c-0.63-0.41-1.47-0.29-1.96,0.28L12.57,18.29C11.97,18.98,12.12,20.03,12.89,20.53z"/>
<path class="PBrSvgElement" fill="#9A949B" d="M11.81,24.99c0,0,2.51-3.54,2.26-3.65c-0.96-0.46-3.5-1.15-4.94,3.24c0,0-0.95,2.61-0.04,6.07c0,0,1.7-3.05,4.51-3.36c0,0,5.26-2.28,1.28-5.43C14.74,21.76,11.95,25.09,11.81,24.99z"/>
</svg>
</div>
<div class="ToolButton" id="EraButton" onclick="selectTool(this)" data-tippy-content="<strong>Eraser tool (E)</strong><br>Deletes drawn pixels" data-tippy-placement="right"> <!-- EraserButton -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35; margin: 2px;" xml:space="preserve">
<path class="EraSvgElement" fill="#9A949B" d="M15.6,33.9c-0.5,0-1-0.4-1-1c0-0.6,0.4-1,1-1l17.1-0.1c0,0,0,0,0,0c0.5,0,1,0.4,1,1c0,0.6-0.4,1-1,1L15.6,33.9C15.6,33.9,15.6,33.9,15.6,33.9z"/>
<path class="EraSvgElement" fill="#9A949B" d="M15.6,33.8c-0.4,0-0.7-0.1-1-0.3l-10-6.1c-0.9-0.6-1.2-1.8-0.7-2.7L17.8,2.1C18,1.7,18.5,1.3,19,1.2c0.5-0.1,1.1,0,1.5,0.2l0,0l10,6.1c0.4,0.3,0.8,0.7,0.9,1.2c0.1,0.5,0,1-0.2,1.5L17.2,32.9C16.9,33.5,16.2,33.8,15.6,33.8zM19.4,3.2L5.6,25.7l10,6.1L29.4,9.3L19.4,3.2z"/>
<path class="EraSvgElement" fill="#9A949B" d="M11.7,13.9l6.8-11.2c0.8-1.4,1.6-0.1,2.9,0.7l8,5.2c0.6,0.4,0.7,1.1,0.4,1.6l-6.6,10.8"/>
</svg>
</div>
<div class="ToolButton" id="SToButton" onclick="selectTool(this)" data-tippy-content="<strong>Shape tool (H)</strong><br>Draws one of the selected shapes" data-tippy-placement="right">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="SToSvgElement" fill="#9A949B" d="M17.01,20.29H3.18V8.45h13.83V20.29z M5.18,18.29h9.83v-7.84H5.18V18.29z"/>
<path class="SToSvgElement" fill="#9A949B" d="M31.09,28.37H12.1l9.49-12.76L31.09,28.37z M16.08,26.37h11.02l-5.51-7.41L16.08,26.37z"/>
<path class="SToSvgElement" fill="#9A949B" d="M26.95,16.47c-2.56,0-4.64-2.08-4.64-4.64c0-2.56,2.08-4.64,4.64-4.64s4.64,2.08,4.64,4.64C31.58,14.39,29.5,16.47,26.95,16.47z M26.95,9.2c-1.45,0-2.64,1.18-2.64,2.64s1.18,2.64,2.64,2.64s2.64-1.18,2.64-2.64S28.4,9.2,26.95,9.2z"/>
<polygon class="SToSvgElement" fill="#9A949B" points="21.6,18 15.1,27.4 28.1,27.4 "/>
</svg>
</div>
<div class="ToolButton" id="TexButton" onclick="selectTool(this)" data-tippy-content="<strong>Text tool (T)</strong><br>Renders text to the canvas" data-tippy-placement="right">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="TexSvgElement" fill="#9A949B" d="M17.2,7.9c-0.1,0.6-0.1,1.3-0.1,1.9c0,0.6,0,1.1,0,1.4c0,0.4,0,0.8,0,1.1c0,0.4,0,0.7,0.1,0.9h-0.6c-0.1-1.2-0.3-2.1-0.5-2.8c-0.2-0.7-0.6-1.2-1.1-1.5s-1.3-0.5-2.4-0.5h-1.4v14.4c0,0.7,0.1,1.2,0.2,1.5c0.1,0.3,0.4,0.6,0.7,0.7s0.9,0.2,1.6,0.2v0.5c-0.4,0-1-0.1-1.7-0.1c-0.7,0-1.4,0-2,0c-0.8,0-1.5,0-2.1,0c-0.7,0-1.2,0-1.6,0.1v-0.5c0.7,0,1.2-0.1,1.6-0.2s0.6-0.3,0.7-0.7c0.1-0.3,0.2-0.8,0.2-1.5V8.5H7.5c-1,0-1.8,0.2-2.3,0.5c-0.5,0.3-0.9,0.8-1.1,1.5c-0.2,0.7-0.4,1.6-0.5,2.8H3c0-0.3,0.1-0.6,0.1-0.9c0-0.4,0-0.7,0-1.1c0-0.3,0-0.8,0-1.4C3,9.2,3,8.5,2.9,7.9c0.7,0,1.5,0,2.3,0.1c0.8,0,1.7,0,2.5,0s1.6,0,2.3,0c0.7,0,1.5,0,2.3,0c0.8,0,1.7,0,2.5,0C15.7,7.9,16.5,7.9,17.2,7.9z"/>
<path class="TexSvgElement" fill="#9A949B" d="M23.7,12.4c1.5,0,2.6,0.5,3.5,1.4c0.8,0.9,1.3,2.3,1.3,4.2h-8.9l0-0.5H26c0-0.8,0-1.6-0.2-2.3c-0.2-0.7-0.4-1.3-0.8-1.7c-0.4-0.4-0.8-0.6-1.4-0.6c-0.8,0-1.5,0.4-2.1,1.2c-0.6,0.8-1,2-1.1,3.7l0.1,0.1c0,0.3-0.1,0.5-0.1,0.8c0,0.3,0,0.6,0,0.9c0,1.1,0.2,2.1,0.6,3c0.4,0.8,0.9,1.5,1.5,1.9s1.2,0.6,1.9,0.6c0.5,0,1-0.1,1.4-0.2s0.9-0.4,1.3-0.8c0.4-0.4,0.7-0.9,1-1.5l0.5,0.2c-0.2,0.6-0.5,1.1-0.9,1.6c-0.4,0.5-1,0.9-1.6,1.3c-0.6,0.3-1.4,0.5-2.2,0.5c-1.2,0-2.3-0.3-3.1-0.8c-0.9-0.6-1.5-1.3-2-2.3c-0.5-1-0.7-2.1-0.7-3.4c0-1.5,0.2-2.8,0.7-3.8c0.5-1.1,1.1-1.9,2-2.5C21.6,12.7,22.6,12.4,23.7,12.4z"/>
<rect class="TexSvgElement" fill="#9A949B" x="30.4" y="6.6" class="st0" width="1.2" height="21.8"/>
</svg>
</div>
<div class="ToolButton" id="SelButton" onclick="selectTool(this)" data-tippy-content="<strong>Selection tool (S)</strong><br>Selects the area for further actions" data-tippy-placement="right">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="SelSvgElement" fill="#9A949B" d="M27.71,28.12h-4.06v-2h4.04L27.71,28.12z M21.62,28.12h-4.06v-2h4.06V28.12z M15.53,28.12h-4.06v-2h4.06V28.12zM9.44,28.12H7.31c-0.9,0-1.76-0.33-2.42-0.93l1.34-1.49c0.3,0.27,0.68,0.42,1.09,0.42h2.14V28.12z M30.24,27.08l-1.41-1.42c0.31-0.31,0.48-0.72,0.48-1.16v-1.98h2v1.98C31.32,25.48,30.93,26.39,30.24,27.08z M3.69,24.73c0-0.08-0.01-0.15-0.01-0.23v-3.89h2l0,4L3.69,24.73z M31.32,20.49h-2v-4.06h2V20.49z M5.68,18.58h-2v-4.06h2V18.58z M31.32,14.4h-2v-3.9l1.99-0.21c0,0.08,0.01,0.15,0.01,0.23V14.4z M5.68,12.49h-2v-2c0-0.97,0.38-1.88,1.06-2.56l1.41,1.42c-0.31,0.31-0.48,0.71-0.48,1.15V12.49zM28.79,9.3c-0.3-0.27-0.69-0.42-1.09-0.42h-2.12v-2h2.12c0.9,0,1.77,0.33,2.44,0.94L28.79,9.3z M23.54,8.88h-4.06v-2h4.06V8.88zM17.45,8.88h-4.06v-2h4.06V8.88z M11.37,8.88H7.31l-0.03-2h4.09V8.88z"/>
</svg>
</div>
<div class="ToolButton" id="CPiButton" onclick="selectTool(this)" data-tippy-content="<strong>Color picker (I)</strong><br>Copies a pixel color and sets it as the stroke color" data-tippy-placement="right">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="CPiSvgElement" fill="#9A949B" d="M13.26,26.33c-0.06,0-0.12,0-0.18-0.01c-0.52-0.04-1.08-0.24-1.58-0.57c-1.25-0.82-1.75-2.1-1.17-3l8.08-12.39c0.29-0.44,0.88-0.57,1.32-0.28c0.44,0.29,0.57,0.88,0.28,1.32l-7.98,12.23c0.07,0.12,0.23,0.32,0.52,0.51c0.29,0.19,0.54,0.26,0.68,0.27l7.98-12.23c0.29-0.44,0.88-0.57,1.32-0.28c0.44,0.29,0.57,0.88,0.28,1.32l-8.08,12.39C14.41,26.08,13.89,26.33,13.26,26.33z"/>
<path class="CPiSvgElement" fill="#9A949B" d="M9.13,31.25c-0.04,0-0.08,0-0.11,0c-0.3-0.02-0.61-0.13-0.89-0.32c-0.77-0.5-1.04-1.35-0.63-1.98l3.18-4.87l2.69,1.76l-3.18,4.87C9.96,31.05,9.57,31.25,9.13,31.25z"/>
<path class="CPiSvgElement" fill="#9A949B" d="M19.54,6.47l0.02-0.03c0.29-0.44,0.87-0.56,1.31-0.28l5.15,3.36c0.44,0.29,0.56,0.87,0.28,1.31l-0.02,0.03c-0.29,0.44-0.87,0.56-1.31,0.28l-5.15-3.36C19.37,7.5,19.25,6.91,19.54,6.47z"/>
<path class="CPiSvgElement" fill="#9A949B" d="M21.56,6.25l1.43-2.2c0.29-0.44,0.87-0.56,1.31-0.28l2.51,1.64c0.44,0.29,0.56,0.87,0.28,1.31l-1.43,2.2c-0.29,0.44-0.87,0.56-1.31,0.28l-2.51-1.64C21.4,7.28,21.27,6.69,21.56,6.25z"/>
</svg>
</div>
</div>
<div id="ToolPreferencesBox">
<fieldset id="ToolPreferencesFieldset">
</fieldset>
</div>
</div>
<div id="ActionBox">
<button class="ActionButton" id="UndoButton" data-tippy-content="<strong>Undo (Z)</strong><br>Restores the previous state of the canvas">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="UndoSvgElement" fill="#9A949B" d="M15.18,32.22c-0.54,0-0.99-0.43-1-0.98c-0.01-0.55,0.42-1.01,0.98-1.02c5.83-0.13,10.58-4.99,10.58-10.83c0-5.92-4.64-10.68-10.55-10.83c-0.55-0.01-0.99-0.47-0.97-1.02c0.01-0.55,0.45-1.02,1.02-0.97c7.01,0.18,12.5,5.81,12.5,12.83c0,6.92-5.62,12.67-12.53,12.83C15.19,32.22,15.19,32.22,15.18,32.22z"/>
<path class="UndoSvgElement" fill="#9A949B" d="M15.21,8.56H8.27c-0.55,0-1-0.45-1-1s0.45-1,1-1h6.94c0.55,0,1,0.45,1,1S15.76,8.56,15.21,8.56z"/>
<path class="UndoSvgElement" fill="#9A949B" d="M12.08,12.34c-0.26,0-0.51-0.1-0.71-0.29L7.59,8.27c-0.39-0.39-0.39-1.02,0-1.41s1.02-0.39,1.41,0l3.78,3.78c0.39,0.39,0.39,1.02,0,1.41C12.59,12.25,12.33,12.34,12.08,12.34z"/>
<path class="UndoSvgElement" fill="#9A949B" d="M8.27,8.56c-0.26,0-0.51-0.1-0.71-0.29c-0.39-0.39-0.39-1.02,0-1.41l3.78-3.78c0.39-0.39,1.02-0.39,1.41,0s0.39,1.02,0,1.41L8.97,8.27C8.78,8.46,8.52,8.56,8.27,8.56z"/>
</svg>
</button>
<button class="ActionButton" id="RedoButton" data-tippy-content="<strong>Redo (Y)</strong><br>Restores the state of the canvas before undo">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="RedoSvgElement" fill="#9A949B" d="M19.82,32.22c0.54,0,0.99-0.43,1-0.98c0.01-0.55-0.42-1.01-0.98-1.02c-5.83-0.13-10.58-4.99-10.58-10.83c0-5.92,4.64-10.68,10.55-10.83c0.55-0.01,0.99-0.47,0.97-1.02c-0.01-0.55-0.45-1.02-1.02-0.97c-7.01,0.18-12.5,5.81-12.5,12.83c0,6.92,5.62,12.67,12.53,12.83C19.81,32.22,19.81,32.22,19.82,32.22z"/>
<path class="RedoSvgElement" fill="#9A949B" d="M19.79,8.56h6.94c0.55,0,1-0.45,1-1s-0.45-1-1-1h-6.94c-0.55,0-1,0.45-1,1S19.24,8.56,19.79,8.56z"/>
<path class="RedoSvgElement" fill="#9A949B" d="M22.92,12.34c0.26,0,0.51-0.1,0.71-0.29l3.78-3.78c0.39-0.39,0.39-1.02,0-1.41s-1.02-0.39-1.41,0l-3.78,3.78c-0.39,0.39-0.39,1.02,0,1.41C22.41,12.25,22.67,12.34,22.92,12.34z"/>
<path class="RedoSvgElement" fill="#9A949B" d="M26.73,8.56c0.26,0,0.51-0.1,0.71-0.29c0.39-0.39,0.39-1.02,0-1.41l-3.78-3.78c-0.39-0.39-1.02-0.39-1.41,0s-0.39,1.02,0,1.41l3.78,3.78C26.22,8.46,26.48,8.56,26.73,8.56z"/>
</svg>
</button>
<button class="ActionButton" id="CopyButton" data-tippy-content="<strong>Copy (C)</strong><br>Copies selected area to the clipboard">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="CopySvgElement" fill="#9A949B" d="M12.44,23.99H7.02c-0.94,0-1.7-0.76-1.7-1.7V4.44c0-0.96,0.78-1.73,1.73-1.73h8.52l5.79,5.7v1.41h-2V9.24L14.76,4.7H7.32v17.28h5.11V23.99z"/>
<polyline class="CopySvgElement" fill="#9A949B" points="15.17,3.7 15.17,8.84 20.37,8.82 "/>
<polygon class="CopySvgElement" fill="#9A949B" points="14.17,9.85 14.17,3.7 16.17,3.7 16.17,7.84 20.36,7.82 20.37,9.82 "/>
<path class="CopySvgElement" fill="#9A949B" d="M27.61,32.3H15.7c-1.14,0-2.07-0.93-2.07-2.07V13.08c0-1.14,0.93-2.07,2.07-2.07h7.34c0.55,0,1.06,0.21,1.45,0.6l4.57,4.5c0.39,0.39,0.62,0.92,0.62,1.47v12.65C29.68,31.37,28.75,32.3,27.61,32.3z M15.7,13.01l-0.07,0.07v17.15l11.97,0.07l0.07-12.72l-4.59-4.55L15.7,13.01z"/>
<polyline class="CopySvgElement" fill="#9A949B" points="23.48,11.81 23.48,17.15 28.68,17.15 "/>
<polygon class="CopySvgElement" fill="#9A949B" points="28.68,18.16 22.48,18.16 22.48,11.81 24.48,11.81 24.48,16.15 28.68,16.15 "/>
</svg>
</button>
<button class="ActionButton" id="PasteButton" onclick="Fragment.paste()" data-tippy-content="<strong>Paste (V)</strong><br>Pastes the image from the clipboard to the canvas">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="PasteSvgElement" fill="#682375" d="M28.27,32.34H17.48c-1.03,0-1.87-0.84-1.87-1.87V14.93c0-1.03,0.84-1.87,1.87-1.87h6.65c0.5,0,0.96,0.19,1.32,0.54l4.14,4.08c0.36,0.35,0.56,0.84,0.56,1.34v11.46C30.14,31.5,29.3,32.34,28.27,32.34z M17.48,14.87l-0.06,0.06v15.54l10.85,0.06l0.06-11.52l-4.16-4.12L17.48,14.87z"/>
<polyline class="PasteSvgElement" fill="#682375" points="24.52,13.78 24.52,18.62 29.23,18.62 "/>
<polygon class="PasteSvgElement" fill="#682375" points="29.23,19.53 23.62,19.53 23.62,13.78 25.43,13.78 25.43,17.72 29.23,17.72 "/>
<path class="PasteSvgElement" fill="#682375" d="M13.5,29.43h-6.4c-1.38,0-2.5-1.12-2.5-2.5V7.39c0-1.38,1.12-2.5,2.5-2.5h1.71c1.38,0,2.5,1.12,2.5,2.5v1.24c0,0.28,0.23,0.5,0.5,0.5h5.76c0.28,0,0.5-0.23,0.5-0.5l0-1.25c0-1.38,1.13-2.5,2.5-2.5h1.5c1.38,0,2.5,1.12,2.5,2.5v3.56h-2V7.39c0-0.28-0.23-0.5-0.5-0.5h-1.5c-0.28,0-0.5,0.23-0.5,0.5l0,1.25c0,1.38-1.13,2.5-2.5,2.5h-5.76c-1.38,0-2.5-1.12-2.5-2.5V7.39c0-0.28-0.23-0.5-0.5-0.5H7.11c-0.28,0-0.5,0.23-0.5,0.5v19.54c0,0.28,0.23,0.5,0.5,0.5h6.4V29.43z"/>
<path class="PasteSvgElement" fill="#682375" d="M18.22,6.73c-0.05-0.09-1.25-2.23-3.62-2.23c-2.32,0-3.33,2.09-3.37,2.18L9.42,5.84c0.06-0.14,1.55-3.35,5.19-3.35c3.59,0,5.31,3.16,5.38,3.29L18.22,6.73z"/>
</svg>
</button>
<button class="ActionButton" id="CutButton" data-tippy-content="<strong>Cut (X)</strong><br>Copies selected area to the clipboard and clears it">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="CutSvgElement" fill="#9A949B" d="M7.57,26.77c-0.21,0-0.43-0.02-0.64-0.06c-0.96-0.17-1.8-0.71-2.36-1.51s-0.78-1.77-0.61-2.73c0.17-0.96,0.7-1.8,1.51-2.36l2.99-2.09c1.65-1.16,3.94-0.75,5.1,0.9c0.56,0.8,0.78,1.77,0.61,2.74c-0.17,0.96-0.7,1.8-1.51,2.36l-2.99,2.09C9.04,26.54,8.31,26.77,7.57,26.77z M10.55,19.36c-0.33,0-0.66,0.1-0.95,0.3l-2.99,2.09C6.25,22.01,6,22.39,5.93,22.82s0.02,0.88,0.27,1.24c0.25,0.36,0.63,0.61,1.07,0.68c0.44,0.08,0.88-0.02,1.24-0.28l2.99-2.09c0.36-0.25,0.6-0.63,0.68-1.07s-0.02-0.88-0.27-1.24C11.59,19.6,11.07,19.36,10.55,19.36z"/>
<path class="CutSvgElement" fill="#9A949B" d="M10.53,17.34c-0.73,0-1.46-0.21-2.09-0.66l-2.99-2.09c-0.8-0.56-1.33-1.4-1.5-2.36c-0.17-0.96,0.05-1.93,0.61-2.73c1.16-1.65,3.44-2.06,5.1-0.9l2.99,2.09c1.65,1.16,2.06,3.44,0.9,5.1C12.82,16.79,11.69,17.34,10.53,17.34z M9.59,15.04c0.36,0.25,0.8,0.35,1.24,0.27c0.44-0.08,0.82-0.32,1.07-0.68c0.52-0.75,0.34-1.79-0.41-2.31L8.5,10.23C8.14,9.97,7.7,9.88,7.26,9.95c-0.44,0.08-0.82,0.32-1.07,0.68c-0.25,0.36-0.35,0.8-0.28,1.24c0.08,0.44,0.32,0.82,0.68,1.07L9.59,15.04z"/>
<path class="CutSvgElement" fill="#9A949B" d="M29.25,28.53c-0.35,0-0.7-0.1-1-0.32L12.75,17.37c-0.79-0.55-0.98-1.65-0.43-2.44c0.55-0.79,1.65-0.98,2.44-0.43l15.49,10.85c0.79,0.55,0.98,1.65,0.43,2.44C30.34,28.27,29.8,28.53,29.25,28.53z"/>
<path class="CutSvgElement" fill="#9A949B" d="M13.49,20.71c-0.55,0-1.09-0.26-1.44-0.75c-0.55-0.79-0.36-1.88,0.43-2.44L28.25,6.49c0.79-0.56,1.88-0.36,2.44,0.43c0.55,0.79,0.36,1.88-0.43,2.44L14.49,20.4C14.18,20.61,13.83,20.71,13.49,20.71z"/>
</svg>
</button>
</div>
<div id="ColorsBox">
<div id="SelectedColorBox" data-tippy-content="<strong>Stroke color palette (C)</strong><br>Opens a color palette that contains all possible colors">
<input type="color" id="SelectedColor" onchange="setWithColorPicker()">
<input type="text" id="SelectedColorHex" style="width: 60px; margin-bottom: 5px; font-size: 10pt;" value="#000000" onchange="setColorWithHex()"><br>
<button id="CopyHexButton" onclick="copyHex()">Copy</button>
</div>
<div id="ColorLibraryBox">
<table id="ColorLibraryTable">
<tr>
<td class="SavedColorBox" id="DefaultColor1-1" hex-data="#ff0000" style="background-color: red;" onclick="setColorFromLibrary(this)" data-tippy-content="Red (Shift + 1)"></td>
<td class="SavedColorBox" id="DefaultColor1-2" hex-data="#ffa500" style="background-color: orange;" onclick="setColorFromLibrary(this)" data-tippy-content="Orange (Shift + 2)"></td>
<td class="SavedColorBox" id="DefaultColor1-3" hex-data="#ffff00" style="background-color: yellow;" onclick="setColorFromLibrary(this)" data-tippy-content="Yellow (Shift + 3)"></td>
<td class="SavedColorBox" id="DefaultColor1-4" hex-data="#008000" style="background-color: green;" onclick="setColorFromLibrary(this)" data-tippy-content="Green (Shift + 4)"></td>
<td class="SavedColorBox" id="DefaultColor1-5" hex-data="#87ceeb" style="background-color: skyblue;" onclick="setColorFromLibrary(this)" data-tippy-content="Skyblue (Shift + 5)"></td>
<td class="SavedColorBox" id="DefaultColor1-6" hex-data="#0000ff" style="background-color: blue;" onclick="setColorFromLibrary(this)" data-tippy-content="Blue (Shift + 6)"></td>
<td class="SavedColorBox" id="DefaultColor1-7" hex-data="#800080" style="background-color: purple;" onclick="setColorFromLibrary(this)" data-tippy-content="Purple (Shift + 7)"></td>
</tr>
<tr>
<td class="SavedColorBox" id="DefaultColor2-1" hex-data="#dc143c" style="background-color: crimson;" onclick="setColorFromLibrary(this)" data-tippy-content="Crimson (Ctrl + Shift + 1)"></td>
<td class="SavedColorBox" id="DefaultColor2-2" hex-data="#a52a2a" style="background-color: brown;" onclick="setColorFromLibrary(this)" data-tippy-content="Brown (Ctrl + Shift + 2)"></td>
<td class="SavedColorBox" id="DefaultColor2-3" hex-data="#d2691e" style="background-color: chocolate;" onclick="setColorFromLibrary(this)" data-tippy-content="Chocolate (Ctrl + Shift + 3)"></td>
<td class="SavedColorBox" id="DefaultColor2-4" hex-data="#9acd32" style="background-color: yellowgreen;" onclick="setColorFromLibrary(this)" data-tippy-content="Yellowgreen (Ctrl + Shift + 4)"></td>
<td class="SavedColorBox" id="DefaultColor2-5" hex-data="#add8e6" style="background-color: lightblue;" onclick="setColorFromLibrary(this)" data-tippy-content="Lightskyblue (Ctrl + Shift + 5)"></td>
<td class="SavedColorBox" id="DefaultColor2-6" hex-data="#ee82ee" style="background-color: violet;" onclick="setColorFromLibrary(this)" data-tippy-content="Violet (Ctrl + Shift + 6)"></td>
<td class="SavedColorBox" id="DefaultColor2-7" hex-data="#8a2be2" style="background-color: blueviolet;" onclick="setColorFromLibrary(this)" data-tippy-content="Blueviolet (Ctrl + Shift + 7)"></td>
</tr>
<tr>
<td class="SavedColorBox" id="UserColor1-1" style="background-color: #000000;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Alt + 1)"></td>
<td class="SavedColorBox" id="UserColor1-2" style="background-color: #808080;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Alt + 2)"></td>
<td class="SavedColorBox" id="UserColor1-3" style="background-color: #a9a9a9;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Alt + 3)"></td>
<td class="SavedColorBox" id="UserColor1-4" style="background-color: #d3d3d3;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Alt + 4)"></td>
<td class="SavedColorBox" id="UserColor1-5" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Alt + 5)"></td>
<td class="SavedColorBox" id="UserColor1-6" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Alt + 6)"></td>
<td class="SavedColorBox" id="UserColor1-7" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Alt + 7)"></td>
</tr>
<tr>
<td class="SavedColorBox" id="UserColor2-1" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Shift + Alt + 1)"></td>
<td class="SavedColorBox" id="UserColor2-2" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Shift + Alt + 2)"></td>
<td class="SavedColorBox" id="UserColor2-3" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Shift + Alt + 3)"></td>
<td class="SavedColorBox" id="UserColor2-4" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Shift + Alt + 4)"></td>
<td class="SavedColorBox" id="UserColor2-5" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Shift + Alt + 5)"></td>
<td class="SavedColorBox" id="UserColor2-6" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Shift + Alt + 6)"></td>
<td class="SavedColorBox" id="UserColor2-7" style="background-color: #ffffff;" onclick="setColorFromLibrary(this)" oncontextmenu="saveUserColor(this)" data-tippy-content="User's color (Shift + Alt + 7)"></td>
</tr>
</table>
<p id="UserColorHint">Hint: Right-click on any color of 2 bottom rows to save your color</p>
</div>
</div>
<div id="FileInteractionBox">
<fieldset id="FileInteractionFieldset">
<legend id="FileActionsLegend">File actions</legend>
<button class="FileButton" id="NewFileButton" onclick="openCreateFilePopup()" data-tippy-content="<strong>New File (Alt + N)</strong><br>Creates the new canvas. Erases the contents of the previous canvas">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path fill="#682375" d="M21.7,32H8.8c-1.1,0-2-0.9-2-2V5.2c0-1.1,0.9-2,2-2h11.7l7.8,7.7v14.5h-2V11.7l-6.6-6.5H8.8l0,24.8l12.9,0V32z"/>
<polyline fill="#682375" points="20.1,4.2 20.1,11.4 27.3,11.3 "/>
<polygon fill="#682375" points="19.1,12.4 19.1,4.2 21.1,4.2 21.1,10.4 27.3,10.3 27.3,12.3 "/>
<rect fill="#682375" x="23.7" y="30" width="7.2" height="2"/>
<rect fill="#682375" x="26.3" y="27.4" width="2" height="7.2"/>
</svg>
</button>
<input class="FileButton" id="FileOpenDialogCaller" type="file" onchange="openFile('open', this)" accept="image/png, image/jpeg" style="display: none;">
<button class="FileButton" id="OpenFileButton" onclick="document.getElementById('FileOpenDialogCaller').click()" data-tippy-content="<strong>Open File (Alt + O)</strong><br>Sets the selected image as the canvas">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path fill="#682375" d="M23.81,23.48H5.39c-1.43,0-2.59-1.16-2.59-2.59V7.23c0-0.69,0.27-1.35,0.76-1.84C4.05,4.9,4.7,4.64,5.39,4.64c0,0,0,0,0.01,0l18.42,0.04c1.43,0,2.59,1.17,2.59,2.59v13.62C26.41,22.32,25.24,23.48,23.81,23.48z M5.39,6.64c-0.16,0-0.31,0.06-0.42,0.17C4.86,6.92,4.8,7.07,4.8,7.23v13.66c0,0.33,0.27,0.59,0.59,0.59h18.42c0.33,0,0.59-0.27,0.59-0.59V7.27c0-0.33-0.27-0.59-0.59-0.59L5.39,6.64C5.39,6.64,5.39,6.64,5.39,6.64z"/>
<circle fill="#682375" cx="9.09" cy="10.31" r="1.53"/>
<path fill="#682375" d="M9.09,12.83c-1.39,0-2.52-1.13-2.52-2.52c0-1.39,1.13-2.53,2.52-2.53s2.52,1.13,2.52,2.53C11.61,11.7,10.48,12.83,9.09,12.83z M9.09,9.78c-0.29,0-0.52,0.24-0.52,0.53s0.24,0.52,0.52,0.52s0.52-0.24,0.52-0.52S9.38,9.78,9.09,9.78z"/>
<polyline fill="#682375" points="6.07,20.48 6.07,18.03 9.93,14.17 11.93,16.17 18.06,10.04 22.98,14.96 22.98,20.48 6.07,20.48 "/>
<rect fill="#682375" x="19.9" y="25.5" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -11.3423 25.9545)" width="11.5" height="2.4"/>
<rect fill="#682375" x="30.4" y="19.9" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -5.8419 28.2325)" width="1.6" height="2.4"/>
<polygon fill="#682375" points="19.7,30.9 21.4,32.7 19.7,32.7 "/>
</svg>
</button>
<input class="FileButton" id="FileInsertDialogCaller" type="file" onchange="openFile('insert', this)" accept="image/png, image/jpeg" style="display: none;">
<button class="FileButton" id="InsertFileButton" onclick="document.getElementById('FileInsertDialogCaller').click()" data-tippy-content="<strong>Insert File (Alt + I)</strong><br>Inserts the image to the already existing canvas">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path fill="#682375" d="M23.81,23.48H5.39c-1.43,0-2.59-1.16-2.59-2.59V7.23c0-0.69,0.27-1.35,0.76-1.84C4.05,4.9,4.7,4.64,5.39,4.64c0,0,0,0,0.01,0l18.42,0.04c1.43,0,2.59,1.17,2.59,2.59v13.62C26.41,22.32,25.24,23.48,23.81,23.48z M5.39,6.64c-0.16,0-0.31,0.06-0.42,0.17C4.86,6.92,4.8,7.07,4.8,7.23v13.66c0,0.33,0.27,0.59,0.59,0.59h18.42c0.33,0,0.59-0.27,0.59-0.59V7.27c0-0.33-0.27-0.59-0.59-0.59L5.39,6.64C5.39,6.64,5.39,6.64,5.39,6.64z"/>
<circle fill="#682375" cx="9.09" cy="10.31" r="1.53"/>
<path fill="#682375" d="M9.09,12.83c-1.39,0-2.52-1.13-2.52-2.52c0-1.39,1.13-2.53,2.52-2.53s2.52,1.13,2.52,2.53C11.61,11.7,10.48,12.83,9.09,12.83z M9.09,9.78c-0.29,0-0.52,0.24-0.52,0.53s0.24,0.52,0.52,0.52s0.52-0.24,0.52-0.52S9.38,9.78,9.09,9.78z"/>
<polyline fill="#682375" points="6.07,20.48 6.07,18.03 9.93,14.17 11.93,16.17 18.06,10.04 22.98,14.96 22.98,20.48 6.07,20.48 "/>
<path fill="#682375" d="M29.44,32.15h-2v-6.03l-1.74,1.74l-1.41-1.41L27.74,23c0.29-0.29,0.72-0.37,1.09-0.22c0.37,0.15,0.62,0.52,0.62,0.92V32.15z"/>
<rect x="29.18" y="22.99" transform="matrix(0.707 -0.7072 0.7072 0.707 -9.1465 28.7928)" fill="#682375" width="2" height="4.9"/>
</svg>
</button>
<button class="FileButton" id="SaveAsButton" onclick="saveFile()" data-tippy-content="<strong>Save File (Alt + S)</strong><br>Downloads the canvas contents to the local storage">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path fill="#682375" d="M24.25,26.1H6.28c-1.31,0-2.37-1.06-2.37-2.37V5.69c0-1.3,1.06-2.37,2.36-2.37l16.28-0.06l3.95,3.95v16.62C26.51,25.08,25.49,26.1,24.25,26.1z M21.73,5.27L6.28,5.32c-0.2,0-0.37,0.17-0.37,0.37v18.03c0,0.2,0.17,0.37,0.37,0.37h17.97c0.14,0,0.26-0.12,0.26-0.26V8.04L21.73,5.27z"/>
<polygon fill="#682375" points="21.21,12.8 9.34,12.8 9.34,4.26 11.34,4.26 11.34,10.8 19.21,10.8 19.21,4.27 21.21,4.27 "/>
<polygon fill="#682375" points="23.07,25.1 21.07,25.1 21.07,17.84 9.39,17.84 9.39,25.1 7.39,25.1 7.39,15.84 23.07,15.84 "/>
<path fill="#682375" d="M28.59,32.31c-0.26,0-0.52-0.1-0.71-0.29l-3.67-3.67l1.41-1.41l1.96,1.96v-6.92h2v9.33c0,0.4-0.24,0.77-0.62,0.92C28.85,32.29,28.72,32.31,28.59,32.31z"/>
<rect fill="#682375" x="27.83" y="28.48" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -11.935 30.1492)" width="5.18" height="2"/>
</svg>
</button>
</fieldset>
</div>
<input type="text" id="CursorLocationInput" readonly>
</div>
<div id="CanvasBox" >
<div id="CanvasContainer">
<canvas id="Canvas" height="0px" width="0px" onmouseenter="continueStroke()" onmouseleave="pauseStroke()" onmousemove="getCursorLocation(event)" onmousedown="mouseDown()"></canvas>
<canvas id="PreviewCanvas" height="0px" width="0px"></canvas>
</div>
</div>
</div>
<div id="BackgroundDim">
<div id="FileCreationPopup" class="PopupWindow" style="width: 420px; height: 270px;">
<h2>New File</h2>
<div class="PopupOptions">
<div id="SizeInputs" class="PopupContentGroup">
<div class="InputBox">
<label>Canvas Width</label><br>
<input type="number" id="WidthInput" min="8" value="800">
</div>
<div class="InputBox">
<label>Canvas Height</label><br>
<input type="number" id="HeightInput" min="8" value="600">
</div>
</div>
<div id="Other" class="PopupContentGroup">
<div class="InputBox">
<label>Measure units</label><br>
<select id="UnitSelection">
<option value="">pixels</option>
</select>
</div>
<button onclick="swapValues()">🔀</button><br><br>
<div class="InputBox">
<label>Transparent canvas:</label>
<input type="checkbox" id="TransparentCanvasCheckbox" checked onclick="showCanvasBackgroundBox(this)">
</div>
<div class="InputBox" id="CanvasBackgroundColorInputBox" style="display: none;">
<label>Canvas background:</label><br>
<input type="color" id="CanvasBackgroundInput">
</div>
</div>
</div>
<button class="FinishPopupButton" onclick="createCanvas()">Create</button><br>
<button class="CancelButton" onclick="closePopup()">Cancel</button>
</div>
<div id="ShadowPropertiesPopup" class="PopupWindow" style="width: 500px; height: 500px;">
<h2>Shadow properties</h2>
<div class="PopupOptions">
<div class="PopupContentGroup">
<canvas id="ShadowPreviewCanvas" width="250" height="200"></canvas>
</div>
<div id="SizeInputs" class="PopupContentGroup">
<div class="InputBox">
<label>Enable shadow</label>
<input type="checkbox" id="EnableShadowCheckbox">
</div>
<div class="InputBox">
<label>Shadow offset by X</label><br>
<input type="number" id="OffsetXInput" value="5" min="-999" max="999">
</div>
<div class="InputBox">
<label>Shadow offset by Y</label><br>
<input type="number" id="OffsetYInput" value="5" min="-999" max="999">
</div>
<div class="InputBox">
<label>Shadow Blur</label><br>
<input type="number" id="ShadowBlurInput" min="0" max="100" value="5">
</div>
<div class="InputBox">
<label>Shadow opacity</label><br>
<input type="number" id="ShadowOpacityInput"min="1" max="100" value="100">
</div>
<div class="InputBox">
<label>Shadow color</label><br>
<input type="color" id="ShadowColorInput" value="#000000">
</div>
</div>
</div>
<button class="FinishPopupButton" id="ApplyShadowButton">Apply</button><br>
<button class="CancelButton" onclick="closePopup()">Cancel</button>
</div>
<div id="PreferencesPopup" class="PopupWindow" style="width: 350px; height: 550px;">
<h2>Preferences</h2>
<div class="PopupOptions">
<div id="SizeInputs" class="PopupContentGroup">
<div class="InputBox">
<label>Arrow increment distance (pixels)</label><br>
<input id="ArrowIncrementDistanceInput" type="number" min="0.1" max="999" value="1" step="0.1">
</div>
<div class="InputBox">
<label>Thickness of resize areas of a selection field</label><br>
<input id="AreaBorderThicknessInput" type="number" min="5" max="50" value="12">
</div>
<div class="InputBox">
<label>Action history limit</label><br>
<input id="ActionHistoryLimitInput" type="number" min="5" max="250" value="25">
<p style="margin-top: 0px;">It is not recommended to set a limit of more than 50 actions</p>
</div>
<br>
<div class="InputBox">
<Button onclick="openChangelogPopup()">Changelog</Button>
</div>
<div class="InputBox">
<input type="text" readonly value="1.1">
<br><a href="https://github.com/Makzzzimus/rePaint" target="_blank">Github</a>
</div>
</div>
</div>
<br>
<button class="FinishPopupButton" id="ApplyPreferencesButton" onclick="applyPreferences()">Apply</button><br>
<button class="CancelButton" onclick="closePopup(true)">Cancel</button><br>
<button class="CancelButton" onclick="resetUserPreferences()">Reset to default</button>
</div>
<!-- increase changelog's width -->
<div id="ChangelogPopup" class="PopupWindow" style="width: 600px; height: 500px;">
<h2>Changelog</h2>
<div class="PopupOptions">
<textarea id="ChangelogTextarea" readonly></textarea>
</div>
<br>
<button class="CancelButton" onclick="closePopup()">Close</button>
</div>
</div>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script src="script.js"></script>
</body>
</html>