-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
674 lines (674 loc) · 24.3 KB
/
demo.html
File metadata and controls
674 lines (674 loc) · 24.3 KB
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
<html>
<head>
<meta charset="utf-8">
<title>flounder.style.js demo</title>
<meta name="theme-color" content="rgb(1,4,9)">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,viewport-fit=contain">
<style>
body
{
margin: 0px;
padding: 0px;
background-color: rgb(230,237,243);
}
div
{
content-visibility: auto;
}
button
{
background-color: transparent;
border-style: none;
border-width: 0px;
cursor: pointer;
}
#screen-header
{
margin: 0px;
padding: 0px;
color: rgb(230,237,243);
background-color: rgb(1,4,9, 0.8);
position: fixed;
width: 100%;
z-index: 900;
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
transition: margin-top 500ms;
}
#screen-header a
{
color: rgb(230, 237, 243);
}
#screen-header .segment
{
position: relative;
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
padding: 0.75rem 1.00rem;
overflow-x: hidden;
transform: skewX(150deg);
text-decoration: none !important;
min-width: 2.25rem;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
font-weight: 400;
font-size: 1.0rem;
line-height: 100%;
}
#screen-header .segment:first-child
{
padding-left: 1.75rem;
margin-left: -0.75rem;
}
#screen-header .segment + .segment
{
margin-left: 0rem;
border-left-style: solid;
border-left-width: 1px;
border-left-color: rgb(230,237,243) !important;
}
#screen-header .segment > *
{
transform: skewX(-150deg);
}
@media (hover: hover)
{
#screen-header a.segment:hover
{
background-color: rgb(70,80,90);
}
}
#screen-body
{
position: fixed;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
z-index: 10;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#screen-body button
{
background-color: rgba(1,4, 9, 0.6);
border-radius: 1.5rem;
padding: 1.5rem;
transition: opacity 1000ms;
}
#screen-body button svg
{
width: 8rem;
height: 8rem;
color: rgba(230, 237, 243, 0.7);
fill: rgba(230, 237, 243, 0.7);
}
@media (hover: hover)
{
#screen-body button:hover
{
background-color: rgba(1,4, 9, 0.8);
}
#screen-body button:hover svg
{
color: rgba(230, 237, 243, 0.9);
fill: rgba(230, 237, 243, 0.9);
}
}
#screen-body .option-panel
{
margin-top: 1rem;
color: rgb(230, 237, 243);
background-color: rgba(1,4, 9, 0.6);
border-radius: 0.5rem;
padding: 0.5rem;
padding-right: 1.0rem;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
cursor: pointer;
transition: opacity 1000ms;
}
#screen-body #fps
{
position: absolute;
top: 1rem;
right: 1rem;
color: rgb(230, 237, 243);
background-color: rgba(1,4, 9, 0.6);
border-radius: 0.5rem;
padding: 0.5rem 1.0rem;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
cursor: pointer;
transition: opacity 1000ms;
font-family: Courier;
text-align: right;
white-space: pre;
}
#screen-body #fps:empty
{
display: none;
}
#screen-body .option-panel input
{
margin: 0.5rem;
padding: 0px;
}
#screen-footer
{
position: fixed;
/* top: 0px; */
right: 0px;
bottom: 0px;
left: 0px;
z-index: 100;
margin: 0px;
color: rgb(230,237,243);
background-color: rgba(1,4,9,0.6);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
font-size: 1.0rem;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
transition: margin-bottom 500ms;
}
#screen-footer:not(.show-arguments):not(.show-style)
{
display: none;
}
#screen-footer.show-style #arguments
{
display: none;
}
#screen-footer.show-arguments #style
{
display: none;
}
#screen-footer #arguments,
#screen-footer #style
{
padding: 0rem;
line-height: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 720px;
}
#screen-footer button
{
background-color: rgba(1,4, 9, 0.3);
border-radius: 0.25rem;
padding: 0.25rem;
margin: 0.25rem;
}
#screen-footer button svg
{
width: 1.5rem;
height: 1.5rem;
color: rgb(230, 237, 243);
fill: rgb(230, 237, 243);
}
@media (hover: hover)
{
#screen-footer button:hover
{
background-color: rgba(1,4, 9, 0.9);
}
}
#screen-footer #copied
{
position: absolute;
bottom: 3rem;
color: rgb(230,237,243);
background-color: rgba(1,4,9,0.7);
border-radius: 0.25rem;
padding: 0.25rem;
transition: opacity 500ms;
}
#screen-footer:not(.copied) #copied
{
opacity: 0;
}
body.immersive #screen-header
{
margin-top: -2.5rem;
}
body.immersive:not(.mousemove) #screen-body
{
cursor: none;
}
body.immersive.mousemove #screen-body
{
cursor: pointer;
}
body.immersive:not(.mousemove) #screen-body button
{
opacity: 0;
cursor: none;
}
body.immersive #screen-body button svg:first-child
{
display: none;
}
body:not(.immersive) #screen-body button svg:last-child
{
display: none;
}
body.immersive #screen-body .option-panel
{
opacity: 0;
pointer-events: none;
}
body:not(.immersive) #screen-body #fps
{
display: none;
}
body.immersive #screen-footer
{
margin-bottom: -2.5rem;
}
</style>
</head>
<body>
<h1 id="screen-header"><a class="segment" href="https://github.com/"><span>GitHub</span></a><a class="segment" href="https://github.com/wraith13"><span>wraith13</span></a><a class="segment" href="https://github.com/wraith13/flounder.style.js"><span>flounder.style.js</span></a><div class="segment"><span>demo</span></div></h1>
<div id="screen-body">
<button id="play-button">
<svg width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-20.52,-0.152764)">
<path d="M277.128,192.306L277.129,192C277.294,169.198 295.857,150.737 318.698,150.737C326.626,150.737 334.038,152.961 340.345,156.819L893.467,476.149L893.46,476.161C906.034,483.312 914.523,496.833 914.523,512.321C914.523,529.423 904.173,544.126 889.4,550.504L340.335,867.492C339.741,867.855 339.138,868.203 338.526,868.537L336.016,869.985L335.929,869.834C330.678,872.232 324.842,873.568 318.697,873.568C295.755,873.568 277.128,854.942 277.128,832L277.128,192.306Z"/>
</g>
</svg>
<svg width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1.17021,0,0,1.125,-75.5745,-64)">
<path d="M444,291.176L444,732.824C444,752.238 428.847,768 410.183,768L289.817,768C271.153,768 256,752.238 256,732.824L256,291.176C256,271.762 271.153,256 289.817,256L410.183,256C428.847,256 444,271.762 444,291.176ZM748.218,291.176L748.218,732.824C748.218,752.238 733.065,768 714.401,768L594.035,768C575.371,768 560.218,752.238 560.218,732.824L560.218,291.176C560.218,271.762 575.371,256 594.035,256L714.401,256C733.065,256 748.218,271.762 748.218,291.176Z"/>
</g>
</svg>
</button>
<label class="option-panel" for="with-fullscreen"><input id="with-fullscreen" type="checkbox">FullScreen</label>
<label class="option-panel" for="show-fps"><input id="show-fps" type="checkbox">Show FPS</label>
<div id="fps"></div>
</div>
<div id="screen-footer">
<button id="toggle-button">
<svg width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(2.78261,0,0,2.78261,-317.217,-317.217)">
<path d="M390,298.106C390,298.071 390,298.035 390,298C390,247.224 348.776,206 298,206C266.006,206 237.804,222.367 221.318,247.178L195.945,205.148C221.193,177.416 257.579,160 298,160C374.164,160 436,221.836 436,298C436,298.035 436,298.071 436,298.106L459,298.106L413,374.373L367,298.106L390,298.106ZM160,298.106L137,298.106L183,221.733L229,298.106L206,298.106C206.058,348.834 247.259,390 298,390C329.972,390 358.157,373.655 374.648,348.873L400.017,390.895C374.77,418.601 338.401,436 298,436C221.871,436 160.058,374.222 160,298.106Z"/>
</g>
</svg>
</button>
<div id="arguments"></div>
<div id="style"></div>
<button id="copy-button">
<svg width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1.0084,0,0,1.0084,-283.765,246.924)">
<path d="M924,445.333L924,535.773C924,573.428 893.428,604 855.773,604L516.227,604C478.572,604 448,573.428 448,535.773L448,196.227C448,158.572 478.572,128 516.227,128L606.667,128L606.667,191.467L536,191.467C522.46,191.467 511.467,202.46 511.467,216L511.467,516.014C511.467,529.554 522.46,540.547 536,540.547L836,540.547C849.54,540.547 860.533,529.554 860.533,516.014L860.533,445.333L924,445.333ZM1130.27,-10.039L1130.27,329.506C1130.27,367.162 1099.69,397.733 1062.04,397.733L722.494,397.733C684.838,397.733 654.267,367.162 654.267,329.506L654.267,-10.039C654.267,-47.695 684.838,-78.267 722.494,-78.267L1062.04,-78.267C1099.69,-78.267 1130.27,-47.695 1130.27,-10.039ZM1066.8,9.733C1066.8,-3.807 1055.81,-14.8 1042.27,-14.8L742.267,-14.8C728.726,-14.8 717.733,-3.807 717.733,9.733L717.733,309.747C717.733,323.287 728.726,334.28 742.267,334.28L1042.27,334.28C1055.81,334.28 1066.8,323.287 1066.8,309.747L1066.8,9.733Z"/>
</g>
</svg>
</button>
<div id="copied">Copied!</div>
</div>
<script src="https://wraith13.github.io/evil-commonjs/index.js"></script>
<script>
window.module.sequentialLoad
([
{ path:"https://wraith13.github.io/evil-timer.js/index.js", mapping:["evil-timer.js"] },
{ path:"https://wraith13.github.io/phi-colors/library/source/index.js", mapping:["phi-colors"] },
//{ path:"https://wraith13.github.io/flounder.style.js/index.js", mapping:["flounder.style.js"] },
{ path:"./index.js", mapping:["flounder.style.js"] },
]).then
(
map =>
{
const { FlounderStyle } = require("flounder.style.js");
const { phiColors } = require("phi-colors");
const rate = (min, max, r) => min + ((max -min) *r);
const valueToString = (value) => undefined === value ? "undefined": JSON.stringify(value);
const stringify = (value) =>
{
if (null !== value && undefined !== value)
{
if (Array.isArray(value))
{
return "[ " +value.map(i => stringify(i)).join(", ") +" ]";
}
if ("object" === typeof value)
{
var result = [];
Object.keys(value).forEach
(
key =>
{
var v = value[key];
if (undefined !== v)
{
result.push(`${key}:${stringify(v)}`);
}
}
)
return "{ " +result.join(", ") +" }";
}
}
if ("number" === typeof value)
{
return value.toLocaleString("en-US", { maximumFractionDigits: 4, });
}
return valueToString(value);
};
const makeRandomInteger = (size) => Math.floor(Math.random() *size);
const randomSelect = (list) => list[makeRandomInteger(list.length)];
const makeRandomSpotArguments = (type, foregroundColor, backgroundColor, intervalSize) =>
({
type,
layoutAngle: randomSelect([ "regular", "alternative", ]),
foregroundColor,
backgroundColor,
intervalSize,
depth: 0.0,
maxPatternSize: randomSelect([ undefined, intervalSize /4, ]),
reverseRate: randomSelect([ undefined, 0.0, ]),
});
const makeRandomTrispotArguments = (foregroundColor, backgroundColor, intervalSize) =>
makeRandomSpotArguments("trispot", foregroundColor, backgroundColor, intervalSize);
const makeRandomTetraspotArguments = (foregroundColor, backgroundColor, intervalSize) =>
makeRandomSpotArguments("tetraspot", foregroundColor, backgroundColor, intervalSize);
const makeRandomLineArguments = (type, foregroundColor, backgroundColor, intervalSize) =>
({
type,
layoutAngle: Math.random(),
foregroundColor,
backgroundColor,
intervalSize,
depth: 0.0,
maxPatternSize: randomSelect([ undefined, intervalSize /(2 +makeRandomInteger(9)), ]),
reverseRate: randomSelect([ undefined, 0.0, ]),
anglePerDepth: randomSelect([ undefined, "auto", "-auto", 1,0, -1.0, ]),
});
const makeRandomStripeArguments = (foregroundColor, backgroundColor, intervalSize) =>
makeRandomLineArguments("stripe", foregroundColor, backgroundColor, intervalSize);
const makeRandomDilineArguments = (foregroundColor, backgroundColor, intervalSize) =>
makeRandomLineArguments("diline", foregroundColor, backgroundColor, intervalSize);
const makeRandomTrilineArguments = (foregroundColor, backgroundColor, intervalSize) =>
makeRandomLineArguments("triline", foregroundColor, backgroundColor, intervalSize);
const makeRandomArguments = (foregroundColor, backgroundColor) => randomSelect
([
makeRandomTrispotArguments,
makeRandomTetraspotArguments,
makeRandomStripeArguments,
makeRandomDilineArguments,
makeRandomTrilineArguments,
])
(foregroundColor, backgroundColor, 16 +makeRandomInteger(256));
const screenBody = document.getElementById("screen-body");
const screenFooter = document.getElementById("screen-footer");
const withFullscreen = document.getElementById("with-fullscreen");
const showFPS = document.getElementById("show-fps");
const fullscreenEnabled = document.fullscreenEnabled || document.webkitFullscreenEnabled;
if ( ! fullscreenEnabled)
{
withFullscreen.parentElement.style.setProperty("display", "none");
}
let startAt = 0;
let offsetAt = -1;
let color = { r: Math.random(), g: Math.random(), b: Math.random() };
const nextColor = ({ r, g, b}) =>
{
const hsl = phiColors.rgbToHsl({ r, g, b, });
hsl.h += rate(phiColors.HslHMin, phiColors.HslHMax, 1 /phiColors.phi)
return phiColors.clipRgb(phiColors.hslToRgb(hsl));
};
const makeColor = ({ r, g, b, }) => phiColors.rgbForStyle({ r, g, b, });
screenBody.style.setProperty("background-color", makeColor(color));
let arguments;
let offsetCoefficient;
let direction;
let rotate;
const span = 5000;
const fpsCalcUnit = 5;
let frameTimings = [];
let fpsHistory = [];
const resetFps = () =>
{
frameTimings = [];
fpsHistory = [];
};
const makeFpsText = (fps) =>
`${fps.toLocaleString("en-US", { useGrouping: false, maximumFractionDigits: 2, minimumFractionDigits: 2, })} fps`;
const getFpsText = (now) =>
{
let result = "";
if (fpsCalcUnit <= frameTimings.length)
{
const first = frameTimings.shift();
const fps = (fpsCalcUnit *1000.0) /(now -first);
const current =
{
fps,
now,
text: makeFpsText(fps),
};
const expiredAt = now -1000;
while(0 < fpsHistory.length && fpsHistory[0].now < expiredAt)
{
fpsHistory.shift();
}
fpsHistory.push(current);
let currentMaxFps = current;
let currentMinFps = current;
fpsHistory.forEach
(
i =>
{
if (currentMaxFps.fps < i.fps)
{
currentMaxFps = i;
}
if (i.fps < currentMinFps.fps)
{
currentMinFps = i;
}
}
);
result = currentMaxFps.text +" (max)\n" + current.text + " (now)\n" +currentMinFps.text +" (min)";
}
frameTimings.push(now);
return result;
};
const animation = (now) =>
{
if (document.body.classList.contains("immersive"))
{
if (undefined === arguments || startAt +span <= now)
{
startAt = now;
const backgroundColor = makeColor(color);
color = nextColor(color);
const foregroundColor = makeColor(color);
arguments = makeRandomArguments(foregroundColor, backgroundColor);
offsetCoefficient = undefined;
direction = undefined;
console.log(stringify(arguments));
}
else
{
arguments.depth = (now -startAt) /span;
}
if (0 == (arguments.anglePerDepth ?? 0) && undefined === arguments.maxPatternSize)
{
if (undefined === offsetCoefficient || undefined === direction)
{
offsetCoefficient = FlounderStyle.calculateOffsetCoefficient(arguments);
direction = randomSelect(offsetCoefficient.directions);
rotate = 1 +makeRandomInteger(4);
}
const step = (rotate *arguments.depth) %1.0;
arguments.offsetX = offsetCoefficient.intervalSize * direction.x *step;
arguments.offsetY = offsetCoefficient.intervalSize * direction.y *step;
}
FlounderStyle.setStyle(screenBody, arguments);
if (showFPS.checked)
{
document.getElementById("fps").innerText = getFpsText(now);
}
window.requestAnimationFrame(animation);
}
else
{
if (undefined !== arguments)
{
if (navigator.clipboard)
{
document.getElementById("arguments").innerText = stringify(arguments);
document.getElementById("style").innerText = FlounderStyle.styleToString(arguments);
if ( ! screenFooter.classList.contains("show-arguments") && ! screenFooter.classList.contains("show-style"))
{
screenFooter.classList.toggle("show-arguments", true);
}
}
offsetAt = now -startAt;
document.getElementById("fps").innerText = "";
}
}
};
const pause = () =>
{
document.body.classList.toggle("immersive", false);
if (document.fullscreenElement || document.webkitFullscreenElement)
{
if (document.exitFullscreen)
{
document.exitFullscreen();
}
else
if (document.webkitCancelFullScreen)
{
document.webkitCancelFullScreen();
}
}
};
class ToggleClassForWhileTimer
{
constructor()
{
this.timer = undefined;
}
start(element, token, span)
{
if (undefined !== this.timer)
{
clearTimeout(this.timer);
}
element.classList.toggle(token, true);
this.timer = setTimeout
(
() =>
{
this.timer = undefined;
element.classList.toggle(token, false);
},
span
);
}
}
screenBody.addEventListener
(
"click",
event =>
{
event.stopPropagation();
if (event.target === event.currentTarget)
{
pause();
}
}
);
const mousemoveTimer = new ToggleClassForWhileTimer();
screenBody.addEventListener
(
"mousemove",
() => mousemoveTimer.start(document.body, "mousemove", 1000)
)
document.getElementById("play-button").addEventListener
(
"click",
event =>
{
if ( ! document.body.classList.contains("immersive"))
{
event.stopPropagation();
document.body.classList.toggle("immersive", true);
document.body.classList.toggle("mousemove", false);
if (fullscreenEnabled && withFullscreen.checked)
{
if (document.body.requestFullscreen)
{
document.body.requestFullscreen();
}
else
if (document.body.webkitRequestFullscreen)
{
document.body.webkitRequestFullscreen();
}
}
window.requestAnimationFrame
(
now =>
{
if (undefined !== arguments)
{
startAt = now -offsetAt;
}
resetFps();
animation(now);
}
);
}
else
{
pause();
}
}
);
document.getElementById("toggle-button").addEventListener
(
"click",
event =>
{
event.stopPropagation();
const isShowArgument = ! screenFooter.classList.contains("show-arguments");
screenFooter.classList.toggle("show-arguments", isShowArgument);
screenFooter.classList.toggle("show-style", ! isShowArgument);
}
);
const copiedTimer = new ToggleClassForWhileTimer();
document.getElementById("copy-button").addEventListener
(
"click",
event =>
{
event.stopPropagation();
const text = screenFooter.classList.contains("show-arguments") ?
document.getElementById("arguments").innerText:
document.getElementById("style").innerText;
navigator.clipboard.writeText(text).then
(
() => copiedTimer.start(screenFooter, "copied", 1000),
() => { },
);
;
}
);
}
);
</script>
</body>
</html>