-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.html
811 lines (735 loc) · 30.1 KB
/
configure.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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
<html>
<head>
<title>Chess pieces</title>
<meta http-equiv="Cache-control" content="max-age=0" />
<meta http-equiv="Cache-control" content="no-cache" />
<meta http-equiv="Cache-directive" content="no-cache" />
<meta http-equiv="Pragma-directive" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="dist/jszip.min.js"></script>
<script src="dist/FileSaver.min.js"></script>
<script src="dist/jquery-3.6.1.min.js"></script>
<script src="dist/jquery-ui-1.13.2/jquery-ui.min.js"></script>
<link rel="stylesheet" href="dist/jquery-ui-1.13.2/jquery-ui.min.css">
<script src="dist/spectrum-2.0.8.min.js"></script>
<link rel="stylesheet" href="dist/spectrum-2.0.8.min.css">
<script language="JavaScript" type="text/javascript">
function hide_shadows(els) {
els ||= $('.board embed');
let svgs = $('.board embed').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
svgs.find('#shadow').each((i, p) => {
p.style = 'display:none';
});
svgs.find('path, rect, ellipse').each((i, p) => { p.removeAttribute('transform'); });
}
function update_white_shadows(els, whiteShad) {
els ||= $('.board embed.w');
whiteShad ||= document.getElementById('white-shadow-colorpicker').value;
let wsvgs = els.map(function (index, el) { return el.getSVGDocument(); }).find('svg');
wsvgs.find('#shadow').each((i, p) => {
p.style = 'fill:' + whiteShad;
});
}
function update_black_shadows(els, blackShad) {
els ||= $('.board embed.b');
blackShad ||= document.getElementById('black-shadow-colorpicker').value;
let bsvgs = els.map(function (index, el) { return el.getSVGDocument(); }).find('svg');
bsvgs.find('#shadow').each((i, p) => {
p.style = 'fill:' + blackShad;
});
}
function update_shadow_geometries() {
let slant = Number($('#shadow-slant-slider').slider("option", "value"));
let blur = Number($('#shadow-blur-slider').slider("option", "value"));
let flatten = Number($('#shadow-flatten-slider').slider("option", "value"));
let diag = Number($('#shadow-diag-slider').slider("option", "value"));
let svgSize = 933;
let margin = 80; // default margin in SVG
let figSize = svgSize - 2 * margin;
let slantRatio = Math.tan(slant * Math.PI / 180);
let shadowRelYscale = (100 - flatten) / 100;
let effectiveBlur = blur * 0.5;
let effectiveFigSize = figSize * 0.5;
let xOff = figSize * shadowRelYscale * slantRatio + 2 * effectiveBlur + diag;
let yOff = 2 * effectiveBlur + diag;
let scale = Math.min(svgSize / (figSize + Math.max(xOff, yOff)), figSize / (figSize + diag));
let dy1 = margin - margin * scale; // value to fix top
let dy2 = (svgSize - margin) - (margin + figSize + diag) * scale; // value to fix bottom
let dx1 = margin - margin * scale; // value to fix left
let dx2 = (svgSize - margin) - (margin + figSize + diag + effectiveFigSize * slantRatio) * scale; // value to fix right
let dy = (dy1 + dy2) / 2;
let dx = (dx1 + dx2) / 2;
let shadowYscale = shadowRelYscale * scale;
let els = arguments.length >= 1 ? arguments[0] : $('.board embed');
let svgs = els.map(function (index, el) { return el.getSVGDocument(); }).find('svg');
// set transforms on paths (and shadows)
svgs.find('path, rect, ellipse').each((i, p) => {
if (p.id == 'shadow') {
let bb = p.getBBox();
let test_y = bb.y + bb.height; // impose equality at bb.y + bb.height
let new_x = -slantRatio * test_y;
let new_y = shadowYscale * test_y;
let sdx = dx - new_x + diag; // compare expected x and computed x
let sdy = (dy + scale * test_y) - new_y + diag;
p.setAttribute('transform', 'matrix(' + scale + ', 0, ' + (-slantRatio) + ', ' + shadowYscale + ', ' + sdx + ', ' + sdy + ')');
} else {
p.setAttribute('transform', 'matrix(' + scale + ', 0, 0, ' + scale + ', ' + dx + ', ' + dy + ')');
}
});
svgs.find('#filterBlur feGaussianBlur').each((i, f) => {
f.setAttribute('stdDeviation', blur + ' ' + blur);
});
}
function load_piece(el) {
let col = $(el).hasClass('b') ? 'black' : 'white';
let svg = $(el.getSVGDocument()).find('svg');
let gradient1 = document.getElementById(col + '-1-colorpicker').value;
let gradient2 = document.getElementById(col + '-2-colorpicker').value;
let strokeCol = document.getElementById(col + '-s-colorpicker').value;
let strokeSize = Number(document.getElementById('stroke-spinner').value);
let boundarySize = Number(document.getElementById('boundary-spinner').value);
svg.find('#fillGradient #stop0').css('stop-color', gradient1);
svg.find('#fillGradient #stop1').css('stop-color', gradient2);
svg.find('#fill-color').html('.fill-color {fill: ' + gradient1 + '; }');
svg.find('#stroke-color').html('.stroke-color {stroke: ' + strokeCol + '; }');
svg.find('#stroke-medium').html('.stroke-medium {stroke-width: ' + strokeSize + '; }');
svg.find('#stroke-boundary').html('.stroke-boundary {stroke-width: ' + boundarySize + '; }');
}
function set_black_gradient_1(hex) {
let bsvgs = $('.board embed.b').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
bsvgs.find('#fillGradient #stop0').css('stop-color', hex)
bsvgs.find('#fill-color').html('.fill-color {fill: ' + hex + '; }');
}
function set_black_gradient_2(hex) {
let bsvgs = $('.board embed.b').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
bsvgs.find('#fillGradient #stop1').css('stop-color', hex);
}
function set_black_stroke(hex) {
let bsvgs = $('.board embed.b').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
bsvgs.find('#stroke-color').html('.stroke-color {stroke: ' + hex + '; }');
}
function set_white_gradient_1(hex) {
let wsvgs = $('.board embed.w').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
wsvgs.find('#fillGradient #stop0').css('stop-color', hex)
wsvgs.find('#fill-color').html('.fill-color {fill: ' + hex + '; }');
}
function set_white_gradient_2(hex) {
let wsvgs = $('.board embed.w').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
wsvgs.find('#fillGradient #stop1').css('stop-color', hex);
}
function set_white_stroke(hex) {
let wsvgs = $('.board embed.w').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
wsvgs.find('#stroke-color').html('.stroke-color {stroke: ' + hex + '; }');
}
function set_stroke_size(val) {
let svgs = $('.board embed').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
svgs.find('#stroke-medium').html('.stroke-medium {stroke-width: ' + val + '; }')
}
function set_boundary_size(val) {
let svgs = $('.board embed').map(function (index, el) { return el.getSVGDocument(); }).find('svg');
svgs.find('#stroke-boundary').html('.stroke-boundary {stroke-width: ' + val + '; }')
}
function get_svg(id) {
let svgOrig = $(document.getElementById(id).getSVGDocument()).find('svg')[0];
let svg = svgOrig.cloneNode(true);
if (get_variable('shadow', 'blurred') == 'none') {
$(svg).find('#shadow, #filterBlur').remove();
}
let retv = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' + svg.outerHTML;
return retv;
}
function piece_onload(event) {
load_piece(event.target);
const els = $(event.target);
if (get_variable('shadow', 'blurred') == 'none') {
hide_shadows(els);
} else {
update_shadow_geometries(els);
if (els.hasClass('b')) {
update_black_shadows(els, null);
} else {
update_white_shadows(els, null);
}
}
els.css("visibility", "visible");
}
function install_piece_onload() {
for (let el of $(".board embed")) {
el.addEventListener('load', piece_onload, false);
}
}
// note: make sure each piece shows up
let piece_setup = {
"A1": "wr",
"C1": "wb",
"D1": "wq",
"E1": "wk",
"A2": "wp",
"C2": "wp",
"E2": "wp",
"B3": "bp",
"C3": "wn",
"D4": "bp",
"E4": "bp",
"A5": "br",
"B5": "bn",
"C5": "bb",
"D5": "bq",
"E5": "bk",
};
function get_all_variables() {
let query = window.location.hash.substring(1);
let vars = query.split("&");
let retv = {}
for (let i = 0; i < vars.length; i++) {
let pair = vars[i].split("=", 2);
if (pair.length == 2 && pair[0].length > 0) {
retv[pair[0]] = decodeURIComponent(pair[1]);
}
}
return retv;
}
function update_variables(var_values) {
let path = window.location.pathname;
let all_vars = get_all_variables();
for (let v in var_values) {
all_vars[v] = var_values[v];
}
let first = true;
for (let v in all_vars) {
path += (first ? '#' : '&') + v + "=" + encodeURIComponent(all_vars[v]);
first = false;
}
window.history.replaceState(undefined, "", path);
}
function get_variable(variable, def) {
let query = window.location.hash.substring(1);
let vars = query.split("&");
for (let i = 0; i < vars.length; i++) {
let pair = vars[i].split("=");
if (pair[0] == variable) { return decodeURIComponent(pair[1]); }
}
return def;
}
let color_styles = {
'lichess': ['#efdfb1', '#b68b5d'],
'chesscom': ['#f3f3f4', '#6a9b41'],
'chesstempo': ['#dfdfdf', '#6E84B4'],
'banksia': ['#e6e4e7', '#9a9a9a'],
'nibbler': ['#dadada', '#b4b4b4'],
'arena': ['#ffd89f', '#b86d22'],
'chessbase': ['#e8d8c7', '#c27a53'],
}
function load_board() {
let set = get_variable('board', 'lichess');
let colors = color_styles[set];
if (colors === undefined) {
$('#custom-sq-colorpickers').css('display', '');
colors = [
$("#light-sq-colorpicker").val(),
$("#dark-sq-colorpicker").val(),
]
} else {
$('#custom-sq-colorpickers').css('display', 'none');
}
$('.board .light').css('background-color', colors[0]);
$('.board .dark').css('background-color', colors[1]);
}
function load_all_pieces() {
let set = get_variable('set', 'fantasy');
for (let sq in piece_setup) {
let pc = piece_setup[sq];
let id = "sq" + sq;
let el = document.getElementById(id);
el.className = pc[0];
$(el).css("visibility", "hidden");
el.src = "";
// force reload, needed for some browsers
let par = el.parentNode;
el.remove();
par.appendChild(el);
el.src = set + "/" + pc[1] + ".svg";
}
}
$(() => {
let all_vars = get_all_variables();
let bs_options = $("#board-style-select").find("option");
let bs_all_sets = bs_options.map((i, el) => { return el.value; }).toArray();
let bstyle = all_vars["board"] || "lichess";
if (bs_all_sets.indexOf(bstyle) == -1) {
bstyle = "lichess";
}
let bs_index = bs_all_sets.indexOf(bstyle);
bs_options[bs_index].selected = "selected";
$("#board-style-select").selectmenu({
change: (event, ui) => {
update_variables({ "board": ui.item.value });
load_board();
}
});
$("#light-sq-colorpicker").spectrum({
color: all_vars['lsq'] || "#eeeeee",
showAlpha: false,
move: (col) => { $(".board .light").css("background-color", col.toHexString()); },
hide: (col) => { $(".board .light").css("background-color", col.toHexString()); },
change: (col) => { update_variables({ "lsq": col.toHexString().substring(1) }); },
});
$("#dark-sq-colorpicker").spectrum({
color: all_vars['dsq'] || "#76a5af",
showAlpha: false,
move: (col) => { $(".board .dark").css("background-color", col.toHexString()); },
hide: (col) => { $(".board .dark").css("background-color", col.toHexString()); },
change: (col) => { update_variables({ "dsq": col.toHexString().substring(1) }); },
});
let ps_options = $("#piece-set-select").find("option");
let ps_all_sets = ps_options.map((i, el) => { return el.value; }).toArray();
let pset = all_vars["set"] || "fantasy";
if (ps_all_sets.indexOf(pset) == -1) {
pset = "fantasy";
}
let set_index = ps_all_sets.indexOf(pset);
ps_options[set_index].selected = "selected";
$("#piece-set-select").selectmenu({
change: (event, ui) => {
update_variables({ "set": ui.item.value });
load_all_pieces();
}
});
$("#stroke-spinner").spinner({
min: 0,
max: 100,
change: (event, ui) => {
set_stroke_size(event.target.value);
update_variables({ "stroke": event.target.value });
},
spin: (event, ui) => {
set_stroke_size(ui.value);
update_variables({ "stroke": ui.value })
},
}).val(all_vars['stroke'] || 20);
$("#boundary-spinner").spinner({
min: 0,
max: 100,
change: (event, ui) => {
set_boundary_size(event.target.value);
update_variables({ "boundary": event.target.value });
},
spin: (event, ui) => {
set_boundary_size(ui.value);
update_variables({ "boundary": ui.value });
},
}).val(all_vars['boundary'] || 35);
let edit_black_col1 = (col) => {
set_black_gradient_1(col.toHexString());
update_variables({ "b1": col.toHexString().substring(1) });
};
$("#black-1-colorpicker").spectrum({
color: all_vars['b1'] || "#7f899b",
showAlpha: false,
move: edit_black_col1,
hide: edit_black_col1,
});
let edit_black_col2 = (col) => {
set_black_gradient_2(col.toHexString());
update_variables({ "b2": col.toHexString().substring(1) });
};
$("#black-2-colorpicker").spectrum({
color: all_vars['b2'] || "#1c1c2f",
showAlpha: false,
move: edit_black_col2,
hide: edit_black_col2,
});
let edit_black_stroke = (col) => {
set_black_stroke(col.toHexString());
update_variables({ "bs": col.toHexString().substring(1) });
}
$("#black-s-colorpicker").spectrum({
color: all_vars['bs'] || "black",
showAlpha: false,
move: edit_black_stroke,
hide: edit_black_stroke,
});
let edit_white_col1 = (col) => {
set_white_gradient_1(col.toHexString());
update_variables({ "w1": col.toHexString().substring(1) });
};
$("#white-1-colorpicker").spectrum({
color: all_vars['w1'] || "white",
showAlpha: false,
move: edit_white_col1,
hide: edit_white_col1,
});
let edit_white_col2 = (col) => {
set_white_gradient_2(col.toHexString());
update_variables({ "w2": col.toHexString().substring(1) });
};
$("#white-2-colorpicker").spectrum({
color: all_vars['w2'] || "#bfd3d7",
showAlpha: false,
move: edit_white_col2,
hide: edit_white_col2,
});
let edit_white_stroke = (col) => {
set_white_stroke(col.toHexString());
update_variables({ "ws": col.toHexString().substring(1) });
}
$("#white-s-colorpicker").spectrum({
color: all_vars['ws'] || "black",
showAlpha: false,
move: edit_white_stroke,
hide: edit_white_stroke,
});
$("#download-button").button().click(function () {
let piece_to_square = {};
for (let sq in piece_setup) {
piece_to_square[piece_setup[sq]] = sq;
}
let set = get_variable('set', 'fantasy');
let zip = new JSZip();
let folder = zip.folder(set);
for (let pc in piece_to_square) {
folder.file(pc + ".svg", get_svg('sq' + piece_to_square[pc]));
}
zip.generateAsync({ type: "blob" })
.then((data) => {
saveAs(data, set + '.zip');
});
});
let ss_options = $("#shadow-select").find("option");
let ss_all_sets = ss_options.map((i, el) => { return el.value; }).toArray();
let sstyle = all_vars["shadow"] || "blurred";
if (ss_all_sets.indexOf(sstyle) == -1) {
sstyle = "blurred";
}
let ss_index = ss_all_sets.indexOf(sstyle);
ss_options[ss_index].selected = "selected";
$("#shadow-select").selectmenu({
change: (event, ui) => {
update_variables({ "shadow": ui.item.value });
if (ui.item.value == 'none') {
hide_shadows(null);
$('#shadow-options').css('display', 'none');
} else {
update_white_shadows(null, null);
update_black_shadows(null, null);
update_shadow_geometries();
$('#shadow-options').css('display', '');
}
}
});
$('#shadow-options').css('display', sstyle == 'none' ? 'none' : '');
let edit_black_shadows = (col) => {
update_black_shadows(null, col.toHexString());
update_variables({ "black-shadow": col.toHexString().substring(1) });
};
$("#black-shadow-colorpicker").spectrum({
color: all_vars['black-shadow'] || "#5b5b5b",
showAlpha: false,
move: edit_black_shadows,
hide: edit_black_shadows,
});
let edit_white_shadows = (col) => {
update_white_shadows(null, col.toHexString());
update_variables({ "white-shadow": col.toHexString().substring(1) });
};
$("#white-shadow-colorpicker").spectrum({
color: all_vars['white-shadow'] || "#5b5b5b",
showAlpha: false,
move: edit_white_shadows,
hide: edit_white_shadows,
});
let edit_shadow_slant = (event, ui) => {
update_variables({ "shadow-slant": ui.value });
update_shadow_geometries();
};
$("#shadow-slant-slider").slider({
value: all_vars['shadow-slant'] || 5,
min: 0,
max: 20,
change: edit_shadow_slant,
slide: edit_shadow_slant,
});
let edit_shadow_flatten = (event, ui) => {
update_variables({ "shadow-flatten": ui.value });
update_shadow_geometries();
};
$("#shadow-flatten-slider").slider({
value: all_vars['shadow-flatten'] || 7,
min: 0,
max: 30,
change: edit_shadow_flatten,
slide: edit_shadow_flatten,
});
let edit_shadow_blur = (event, ui) => {
update_variables({ "shadow-blur": ui.value });
update_shadow_geometries();
};
$("#shadow-blur-slider").slider({
value: all_vars['shadow-blur'] || 25,
min: 0,
max: 75,
change: edit_shadow_blur,
slide: edit_shadow_blur,
});
let edit_shadow_diag = (event, ui) => {
update_variables({ "shadow-diag": ui.value });
update_shadow_geometries();
};
$("#shadow-diag-slider").slider({
value: all_vars['shadow-diag'] || 40,
min: 0,
max: 100,
change: edit_shadow_diag,
slide: edit_shadow_diag,
});
$("#accordion").accordion();
let largest = 0;
$("#accordion").children("div").each(function () {
if ($(this).width() > largest) {
largest = $(this).width();
}
});
$("#accordion").children("div").each(function () {
$(this).width(largest);
});
load_board();
install_piece_onload();
load_all_pieces();
})
</script>
<style>
input {
box-shadow: none;
color: inherit;
border: 1px solid #cccccc;
border-radius: 4px;
padding: .5em .8em;
font-size: inherit;
font-family: inherit;
margin-bottom: 10px;
margin-right: 10px;
background-color: white;
}
input.colorpicker {
width: 7em;
}
table.board {
border: none;
margin: 0px;
padding: 0px;
border-collapse: collapse;
}
.board tr td {
width: 0%;
padding: 0px;
white-space: nowrap;
width: 150px;
height: 150px;
}
.board embed {
width: 150px;
height: 150px;
}
.ui-slider {
width: 9em;
margin-top: 0.4em;
margin-bottom: 0.4em;
}
.ui-selectmenu-button.ui-button {
width: 8em;
}
</style>
</head>
<body style="text-align: center">
<h1 style="font-family: Sans; margin-bottom: 0.3em">Chess Pieces</h1>
Visit the <a href="https://github.com/maurimo/chess-art">project page on GitHub</a>.
<table style="margin: 0 auto; margin-top: 0.5em">
<tr>
<td>
<table class="board" style="margin: 0 auto; border: 3px solid black">
<tr>
<td class="light"><embed id='sqA5'></td>
<td class="dark"><embed id='sqB5'></td>
<td class="light"><embed id='sqC5'></td>
<td class="dark"><embed id='sqD5'></td>
<td class="light"><embed id='sqE5'></td>
</tr>
<tr>
<td class="dark"><embed id='sqA4'></td>
<td class="light"><embed id='sqB4'></td>
<td class="dark"><embed id='sqC4'></td>
<td class="light"><embed id='sqD4'></td>
<td class="dark"><embed id='sqE4'></td>
</tr>
<tr>
<td class="light"><embed id='sqA3'></td>
<td class="dark"><embed id='sqB3'></td>
<td class="light"><embed id='sqC3'></td>
<td class="dark"><embed id='sqD3'></td>
<td class="light"><embed id='sqE3'></td>
</tr>
<tr>
<td class="dark"><embed id='sqA2'></td>
<td class="light"><embed id='sqB2'></td>
<td class="dark"><embed id='sqC2'></td>
<td class="light"><embed id='sqD2'></td>
<td class="dark"><embed id='sqE2'></td>
</tr>
<tr>
<td class="light"><embed id='sqA1'></td>
<td class="dark"><embed id='sqB1'></td>
<td class="light"><embed id='sqC1'></td>
<td class="dark"><embed id='sqD1'></td>
<td class="light"><embed id='sqE1'></td>
</tr>
</table>
</td>
<td style="padding-left: 2em">
<p>
<label for="piece-set-select" class="ui-widget ui-state-default"
style="border:none; background: none;">Piece set:</label>
<select id="piece-set-select">
<option value="fantasy">Fantasy</option>
<option value="celtic">Celtic</option>
<option value="spatial">Spatial</option>
<option value="alttest">(test alternatives)</option>
</select>
</p>
<div id="accordion">
<h3>Colors</h3>
<div>
<p style="display: flex; align-items: center">
<label for="black-1-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">Black grad-1: </label>
<input type='text' id='black-1-colorpicker' class="ui-widget colorpicker" />
</p>
<p style="display: flex; align-items: center">
<label for="black-2-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">Black grad-2: </label>
<input type='text' id='black-2-colorpicker' class="ui-widget colorpicker" />
</p>
<p style="display: flex; align-items: center">
<label for="black-s-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">Black stroke: </label>
<input type='text' id='black-s-colorpicker' class="ui-widget colorpicker" />
</p>
<p style="display: flex; align-items: center">
<label for="white-1-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">White grad-1: </label>
<input type='text' id='white-1-colorpicker' class="ui-widget colorpicker" />
</p>
<p style="display: flex; align-items: center">
<label for="white-2-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">White grad-2: </label>
<input type='text' id='white-2-colorpicker' class="ui-widget colorpicker" />
</p>
<p style="display: flex; align-items: center">
<label for="white-s-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">White stroke: </label>
<input type='text' id='white-s-colorpicker' class="ui-widget colorpicker" />
</p>
</div>
<h3>Stroke</h3>
<div>
<p>
<label for="stroke-spinner" class="ui-widget ui-state-default"
style="border:none; background: none;">Inner stroke:</label>
<input id="stroke-spinner" style="width: 3em" />
</p>
<p>
<label for="boundary-spinner" class="ui-widget ui-state-default"
style="border:none; background: none;">Boundary stroke:</label>
<input id="boundary-spinner" style="width: 3em" />
</p>
</div>
<h3>Shadow</h3>
<div>
<p style="margin-bottom: 0px">
<label for="shadow-select" class="ui-widget ui-state-default"
style="border:none; background: none;">Shadow:</label>
<select id="shadow-select">
<option value="none">None</option>
<option value="blurred">Blurred</option>
</select>
</p>
<div style="padding-left: 1em" id="shadow-options">
<p style="display: flex; align-items: center">
<label for="black-shadow-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">Black shadow: </label>
<input type='text' id='black-shadow-colorpicker' class="ui-widget colorpicker" />
</p>
<p style="display: flex; align-items: center">
<label for="white-shadow-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">White shadow: </label>
<input type='text' id='white-shadow-colorpicker' class="ui-widget colorpicker" />
</p>
<p style="display: flex; align-items: center">
<label for="shadow-slant-slider" class="ui-widget ui-state-default"
style="border:none; background: none;">Slant slope: </label>
<span id="shadow-slant-slider"></span>
</p>
<p style="display: flex; align-items: center">
<label for="shadow-flatten-slider" class="ui-widget ui-state-default"
style="border:none; background: none;">Flatten: </label>
<span id="shadow-flatten-slider"></span>
</p>
<p style="display: flex; align-items: center">
<label for="shadow-blur-slider" class="ui-widget ui-state-default"
style="border:none; background: none;">Blur radius: </label>
<span id="shadow-blur-slider"></span>
</p>
<p style="display: flex; align-items: center">
<label for="shadow-diag-slider" class="ui-widget ui-state-default"
style="border:none; background: none;">Diag offset: </label>
<span id="shadow-diag-slider"></span>
</p>
</div>
</div>
<h3>Board</h3>
<div>
<i>Just for experimenting, squares are not part of the theme.</i>
<p style="margin-bottom: 0px">
<label for="board-style-select" class="ui-widget ui-state-default"
style="border:none; background: none;">Squares style:</label>
<select id="board-style-select">
<option value="lichess">Lichess</option>
<option value="chesscom">chess.com</option>
<option value="chesstempo">Chess Tempo</option>
<option value="banksia">Banksia</option>
<option value="nibbler">Nibbler</option>
<option value="arena">Arena</option>
<option value="chessbase">ChessBase</option>
<option value="custom">Custom...</option>
</select>
</p>
<div style="padding-left: 1em" id="custom-sq-colorpickers">
<p style="display: flex; align-items: center">
<label for="light-sq-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">Light squares: </label>
<input type='text' id='light-sq-colorpicker' class="ui-widget colorpicker" />
</p>
<p style="display: flex; align-items: center">
<label for="dark-sq-colorpicker" class="ui-widget ui-state-default"
style="border:none; background: none;">Dark squares: </label>
<input type='text' id='dark-sq-colorpicker' class="ui-widget colorpicker" />
</p>
</div>
</div>
</div>
<p>
<button id="download-button">Download!</button>
</p>
</td>
</tr>
</table>
<p>
<b>Note for Chrome users:</b> disable color management in <a
href="chrome://flags/#force-color-profile">chrome://flags/#force-color-profile</a> setting it to sRGB to get
authentic colors.
</p>
<div display="none" id="hiddenDiv"></div>
</body>
</html>