-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
693 lines (671 loc) · 48.6 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
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
<!DOCTYPE html>
<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">
<link rel="shortcut icon" href="https://shaunroselt.com/assets/img/head-photo.jpg" />
<title>CSS Hexagon Generator</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/default.min.css">
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
<style>
:root {
--hexagon-cursor: default;
--hexagon-width: 210px;
--hexagon-height: 121.24px;
--hexagon-margin-top: 60.62px;
--hexagon-beforeafter-widthheight: 148.49px;
--hexagon-beforeafter-topbottom: -74.2462px;
--hexagon-beforeafter-left: 30.7538px;
--hexagon-border-width: 0px;
--hexagon-border-beforeafter-width: 0px;
--hexagon-color: #2b2f38;
--hexagon-border-color: #f47721;
--hexagon-shadow-color: rgba(81,255,0,1);
--hexagon-shadow-blur: 0px;
--hexagon-span-color: #f47721;
--hexagon-span-text-size: 25px;
--hexagon-span-top: 5.773502691896257px;
--hexagon-span-width: 280px;
--hexagon-span-height: 161.6581px;
--hexagon-hover-width: 210px;
--hexagon-hover-height: 121.24px;
--hexagon-hover-margin-top: 60.62px;
--hexagon-hover-beforeafter-widthheight: 148.49px;
--hexagon-hover-beforeafter-topbottom: -74.2462px;
--hexagon-hover-beforeafter-left: 30.7538px;
--hexagon-hover-border-width: 0px;
--hexagon-hover-border-beforeafter-width: 0px;
--hexagon-hover-color: #2b2f38;
--hexagon-hover-border-color: #f47721;
--hexagon-hover-shadow-color: rgba(81,255,0,1);
--hexagon-hover-shadow-blur: 0px;
--hexagon-hover-span-color: #f47721;
--hexagon-hover-span-text-size: 25px;
--hexagon-hover-span-top: 5.773502691896257px;
--hexagon-hover-span-width: 280px;
--hexagon-hover-span-height: 161.6581px;
--hexagon-hover-span-transition: 0s;
--hexagon-hover-transition: 0s;
}
.inputContainer {
padding: .375rem .75rem;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: .25rem;
}
.inputDisabled {
background-color: #e9ecef;
opacity: 1;
}
</style>
<style id="HexagonCodeCSS">
.hexagon {
cursor: var(--hexagon-cursor);
position: relative;
width: var(--hexagon-width);
height: var(--hexagon-height);
background-color: var(--hexagon-color);
margin: var(--hexagon-margin-top) auto 0 auto;
box-shadow: 0 0 var(--hexagon-shadow-blur) var(--hexagon-shadow-color);
border-left: solid var(--hexagon-border-width) var(--hexagon-border-color);
border-right: solid var(--hexagon-border-width) var(--hexagon-border-color);
display: grid;
transition: var(--hexagon-hover-transition);
}
.hexagon:before, .hexagon:after {
content: "";
position: absolute;
z-index: 1;
width: var(--hexagon-beforeafter-widthheight);
height: var(--hexagon-beforeafter-widthheight);
transform: scaleY(0.5774) rotate(-45deg);
background-color: inherit;
left: var(--hexagon-beforeafter-left);
box-shadow: 0 0 var(--hexagon-shadow-blur) var(--hexagon-shadow-color);
transition: var(--hexagon-hover-transition);
}
.hexagon:before {
top: var(--hexagon-beforeafter-topbottom);
border-top: solid var(--hexagon-border-beforeafter-width) var(--hexagon-border-color);
border-right: solid var(--hexagon-border-beforeafter-width) var(--hexagon-border-color);
}
.hexagon:after {
bottom: var(--hexagon-beforeafter-topbottom);
border-bottom: solid var(--hexagon-border-beforeafter-width) var(--hexagon-border-color);
border-left: solid var(--hexagon-border-beforeafter-width) var(--hexagon-border-color);
}
.hexagon span {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
font-size: var(--hexagon-span-text-size);
color: var(--hexagon-span-color);
top: var(--hexagon-span-top);
left: 0;
width: var(--hexagon-span-width);
height: var(--hexagon-span-height);
z-index: 2;
background: inherit;
transition: var(--hexagon-hover-span-transition);
}
</style>
<style id="HexagonHoverCodeCSS">
.hexagon:hover {
width: var(--hexagon-hover-width);
height: var(--hexagon-hover-height);
background-color: var(--hexagon-hover-color);
margin: var(--hexagon-hover-margin-top) auto 0 auto;
box-shadow: 0 0 var(--hexagon-hover-shadow-blur) var(--hexagon-hover-shadow-color);
border-left: solid var(--hexagon-hover-border-width) var(--hexagon-hover-border-color);
border-right: solid var(--hexagon-hover-border-width) var(--hexagon-hover-border-color);
}
.hexagon:hover:before, .hexagon:hover:after {
width: var(--hexagon-hover-beforeafter-widthheight);
height: var(--hexagon-hover-beforeafter-widthheight);
transform: scaleY(0.5774) rotate(-45deg);
left: var(--hexagon-hover-beforeafter-left);
box-shadow: 0 0 var(--hexagon-hover-shadow-blur) var(--hexagon-hover-shadow-color);
}
.hexagon:hover:before {
top: var(--hexagon-hover-beforeafter-topbottom);
border-top: solid var(--hexagon-hover-border-beforeafter-width) var(--hexagon-hover-border-color);
border-right: solid var(--hexagon-hover-border-beforeafter-width) var(--hexagon-hover-border-color);
}
.hexagon:hover:after {
bottom: var(--hexagon-hover-beforeafter-topbottom);
border-bottom: solid var(--hexagon-hover-border-beforeafter-width) var(--hexagon-hover-border-color);
border-left: solid var(--hexagon-hover-border-beforeafter-width) var(--hexagon-hover-border-color);
}
.hexagon:hover span {
font-size: var(--hexagon-hover-span-text-size);
color: var(--hexagon-hover-span-color);
top: var(--hexagon-hover-span-top);
width: var(--hexagon-hover-span-width);
height: var(--hexagon-hover-span-height);
}
</style>
</head>
<body>
<header class="p-3 mb-3 border-bottom">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="index.html" class="d-flex align-items-center mb-2 mb-lg-0 text-dark text-decoration-none">
<i class="bi bi-code-square"></i>
<span class="ms-2">CSS Hexagon Generator</span>
</a>
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0"></ul>
<form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3">
<iframe class="align-middle" src="https://ghbtns.com/github-btn.html?user=shaunroselt&repo=csshexagon&type=star&count=true&size=large" frameborder="0" scrolling="0" width="150" height="30" title="GitHub"></iframe>
</form>
<div class="dropdown text-end">
<a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" id="dropdownShaunRoselt" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://shaunroselt.com/assets/img/head-photo.jpg" alt="Shaun Roselt" width="34" height="34" class="rounded-circle"> Shaun Roselt
</a>
<ul class="dropdown-menu text-small" aria-labelledby="dropdownShaunRoselt">
<li><a class="dropdown-item" target="_blank" href="https://www.shaunroselt.com/"><i class="bi bi-globe"></i> Personal Website</a></li>
<li><a class="dropdown-item" target="_blank" href="https://www.facebook.com/shaunroselt0"><i class="bi bi-facebook"></i> Facebook</a></li>
<li><a class="dropdown-item" target="_blank" href="https://twitter.com/shaunroselt"><i class="bi bi-twitter"></i> Twitter</a></li>
<li><a class="dropdown-item" target="_blank" href="https://www.instagram.com/shaun.roselt/"><i class="bi bi-instagram"></i> Instagram</a></li>
<li><a class="dropdown-item" target="_blank" href="https://www.youtube.com/ShaunRoselt?sub_confirmation=1"><i class="bi bi-youtube"></i> YouTube</a></li>
<li><a class="dropdown-item" target="_blank" href="https://za.linkedin.com/in/shaunroselt"><i class="bi bi-linkedin"></i> LinkedIn</a></li>
<li><a class="dropdown-item" target="_blank" href="https://steamcommunity.com/id/ShaunRoselt"><i class="bi bi-steam"></i> Steam</a></li>
<li><a class="dropdown-item" target="_blank" href="https://github.com/shaunroselt/"><i class="bi bi-github"></i> GitHub</a></li>
</ul>
</div>
</div>
</header>
<section class="row m-3">
<section class="row mb-3">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="general-tab" data-bs-toggle="tab" data-bs-target="#general" type="button" role="tab" aria-controls="general" aria-selected="true">General</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="hover-tab" data-bs-toggle="tab" data-bs-target="#hover" type="button" role="tab" aria-controls="hover" aria-selected="false">Hover</button>
</li>
</ul>
<div class="tab-content mt-3" id="myTabContent">
<div class="tab-pane fade show active" id="general" role="tabpanel" aria-labelledby="general-tab">
<div class="row">
<div class="col">
<div class="form-floating">
<input type="number" class="form-control" id="hexagonSize" placeholder="Size (px)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="300">
<label for="hexagonSize">Size (px)</label>
</div>
<div class="form-floating">
<select class="form-select" id="hexagonCursor" aria-label="Floating label select" onchange="HexagonSizeChange();">
<option value="alias">alias</option>
<option value="all-scroll">all-scroll</option>
<option value="auto">auto</option>
<option value="cell">cell</option>
<option value="context-menu">context-menu</option>
<option value="col-resize">col-resize</option>
<option value="copy">copy</option>
<option value="crosshair">crosshair</option>
<option value="default" selected>default</option>
<option value="e-resize">e-resize</option>
<option value="ew-resize">ew-resize</option>
<option value="grab">grab</option>
<option value="grabbing">grabbing</option>
<option value="help">help</option>
<option value="move">move</option>
<option value="n-resize">n-resize</option>
<option value="ne-resize">ne-resize</option>
<option value="nesw-resize">nesw-resize</option>
<option value="ns-resize">ns-resize</option>
<option value="nw-resize">nw-resize</option>
<option value="nwse-resize">nwse-resize</option>
<option value="no-drop">no-drop</option>
<option value="not-allowed">not-allowed</option>
<option value="pointer">pointer</option>
<option value="progress">progress</option>
<option value="row-resize">row-resize</option>
<option value="s-resize">s-resize</option>
<option value="se-resize">se-resize</option>
<option value="sw-resize">sw-resize</option>
<option value="text">text</option>
<option value="w-resize">w-resize</option>
<option value="wait">wait</option>
<option value="zoom-in">zoom-in</option>
<option value="zoom-out">zoom-out</option>
</select>
<label for="hexagonCursor">Cursor</label>
</div>
<div class="form-floating inputContainer">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="hexagonVariablesCSS" onchange="HexagonSizeChange();">
<label class="form-check-label" for="hexagonVariablesCSS">Variables</label>
</div>
</div>
</div>
<div class="col">
<div class="form-floating inputContainer">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="hexagonBackgroundChecks" id="hexagonBackgroundCheck1" value="option1" checked>
<label class="form-check-label" for="hexagonBackgroundCheck1">Solid Color</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="hexagonBackgroundChecks" id="hexagonBackgroundCheck2" value="option2" disabled>
<label class="form-check-label" for="hexagonBackgroundCheck2">Image</label>
</div>
</div>
<div class="form-floating">
<input type="color" class="form-control" id="hexagonColor" placeholder="Solid Color" oninput="HexagonSizeChange();" value="#2b2f38">
<label for="hexagonColor">Solid Color</label>
</div>
</div>
<div class="col">
<div class="form-floating">
<input type="number" class="form-control" id="hexagonBorderSize" placeholder="Size (px)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="10">
<label for="hexagonBorderSize">Border Size (px)</label>
</div>
<div class="form-floating">
<input type="color" class="form-control" id="hexagonBorderColor" placeholder="Border Color" oninput="HexagonSizeChange();" value="#f47721">
<label for="hexagonBorderColor">Border Color</label>
</div>
</div>
<div class="col">
<div class="form-floating">
<input type="number" class="form-control" id="hexagonShadowBlur" placeholder="Blur (px)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="50">
<label for="hexagonShadowBlur">Shadow Blur (px)</label>
</div>
<div class="form-floating">
<input type="color" class="form-control" id="hexagonShadowColor" placeholder="Shadow Color" oninput="HexagonSizeChange();" value="#00FFFF">
<label for="hexagonShadowColor">Shadow Color</label>
</div>
<div class="form-floating">
<div class="form-control">
<input class="w-100" type="range" id="hexagonShadowColorAlpha" placeholder="Shadow Alpha" oninput="HexagonSizeChange();" onchange="HexagonSizeChange();" min="0" max="1" step="0.00000001" value="1" style="background: linear-gradient(to right, transparent 0%, black 100%);appearance: none;">
</div>
<label for="hexagonShadowColorAlpha">Shadow Alpha</label>
</div>
</div>
<div class="col">
<div class="form-floating">
<input type="text" class="form-control" id="hexagonText" placeholder="Text" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="I am text!">
<label for="hexagonText">Text</label>
</div>
<div class="form-floating">
<input type="color" class="form-control" id="hexagonTextColor" placeholder="Text Color" oninput="HexagonSizeChange();" value="#f47721">
<label for="hexagonTextColor">Text Color</label>
</div>
<div class="form-floating">
<input type="number" class="form-control" id="hexagonTextSize" placeholder="Text Size (px)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="25">
<label for="hexagonTextSize">Text Size (px)</label>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="hover" role="tabpanel" aria-labelledby="hover-tab">
<div class="row">
<div class="col">
<div class="form-floating inputContainer">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="hexagonHover" onchange="HexagonSizeChange();">
<label class="form-check-label" for="hexagonHover">Hover</label>
</div>
</div>
<div class="form-floating">
<input type="number" class="form-control" id="hexagonHoverSize" placeholder="Size (px)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="300">
<label for="hexagonHoverSize">Size (px)</label>
</div>
<div class="form-floating">
<input type="number" class="form-control" id="hexagonHoverTransition" placeholder="Transition (s)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="0" step="0.1">
<label for="hexagonHoverTransition">Transition (s)</label>
</div>
</div>
<div class="col">
<div class="form-floating inputContainer">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="hexagonHoverBackgroundChecks" id="hexagonHoverBackgroundCheck1" value="option1" checked>
<label class="form-check-label" for="hexagonHoverBackgroundCheck1">Solid Color</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="hexagonHoverBackgroundChecks" id="hexagonHoverBackgroundCheck2" value="option2" disabled>
<label class="form-check-label" for="hexagonHoverBackgroundCheck2">Image</label>
</div>
</div>
<div class="form-floating">
<input type="color" class="form-control" id="hexagonHoverColor" placeholder="Solid Color" oninput="HexagonSizeChange();" value="#2b2f38">
<label for="hexagonHoverColor">Solid Color</label>
</div>
</div>
<div class="col">
<div class="form-floating">
<input type="number" class="form-control" id="hexagonHoverBorderSize" placeholder="Size (px)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="10">
<label for="hexagonHoverBorderSize">Border Size (px)</label>
</div>
<div class="form-floating">
<input type="color" class="form-control" id="hexagonHoverBorderColor" placeholder="Border Color" oninput="HexagonSizeChange();" value="#f47721">
<label for="hexagonHoverBorderColor">Border Color</label>
</div>
</div>
<div class="col">
<div class="form-floating">
<input type="number" class="form-control" id="hexagonHoverShadowBlur" placeholder="Blur (px)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="50">
<label for="hexagonHoverShadowBlur">Shadow Blur (px)</label>
</div>
<div class="form-floating">
<input type="color" class="form-control" id="hexagonHoverShadowColor" placeholder="Shadow Color" oninput="HexagonSizeChange();" value="#00FFFF">
<label for="hexagonHoverShadowColor">Shadow Color</label>
</div>
<div class="form-floating">
<div class="form-control">
<input class="w-100" type="range" id="hexagonHoverShadowColorAlpha" placeholder="Shadow Alpha" oninput="HexagonSizeChange();" onchange="HexagonSizeChange();" min="0" max="1" step="0.00000001" value="1" style="background: linear-gradient(to right, transparent 0%, black 100%);appearance: none;">
</div>
<label for="hexagonHoverShadowColorAlpha">Shadow Alpha</label>
</div>
</div>
<div class="col">
<div class="form-floating">
<input type="color" class="form-control" id="hexagonHoverTextColor" placeholder="Text Color" oninput="HexagonSizeChange();" value="#f47721">
<label for="hexagonHoverTextColor">Text Color</label>
</div>
<div class="form-floating">
<input type="number" class="form-control" id="hexagonHoverTextSize" placeholder="Text Size (px)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="25">
<label for="hexagonHoverTextSize">Text Size (px)</label>
</div>
<div class="form-floating">
<input type="number" class="form-control" id="hexagonHoverTextTransition" placeholder="Transition (s)" onkeyup="HexagonSizeChange();" onchange="HexagonSizeChange();" value="0" step="0.1">
<label for="hexagonHoverTextTransition">Transition (s)</label>
</div>
</div>
</div>
</div>
</div>
</section>
<hr>
<section class="row mb-3" id="layHexagon">
<div class="col">
<div class="hexagon">
<span id="layHexagonText"></span>
</div>
</div>
<div class="col">
<b>HTML:</b>
<pre><code class="language-html" id="layHexagonCodeHTML">...</code></pre>
<b>CSS:</b>
<pre><code class="language-css" id="layHexagonCodeCSS">...</code></pre>
</div>
</section>
</section>
<script>
function HexagonSizeChange(){
function ColorHexToRGB(Hex){
if (Hex[0] == "#") Hex = Hex.slice(1);
if (Hex.length != 6) throw "Only six-digit hex colors are allowed.";
const ArrayHex = Hex.match(/.{1,2}/g);
const ArrayRGB = [
parseInt(ArrayHex[0], 16),
parseInt(ArrayHex[1], 16),
parseInt(ArrayHex[2], 16)
];
return ArrayRGB;
}
const HexagonHover = document.getElementById("hexagonHover").checked;
if (HexagonHover) {
document.getElementById("hover").querySelectorAll(".form-control").forEach((element)=>{ // Enable Hover
if (element.querySelector("input[type='range']") != null) {
element.setAttribute("class","form-control");
element.querySelector("input[type='range']").removeAttribute("disabled");
} else {
element.removeAttribute("disabled");
}
});
}else {
document.getElementById("hover").querySelectorAll(".form-control").forEach((element)=>{ // Disable Hover
if (element.querySelector("input[type='range']") != null) {
element.setAttribute("class","form-control inputDisabled");
element.querySelector("input[type='range']").setAttribute("disabled",true);
} else {
element.setAttribute("disabled",true);
}
});
}
document.getElementById("hexagonHover").removeAttribute("disabled");
document.getElementById("hexagonHoverBackgroundCheck2").setAttribute("disabled",true);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// General
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const HexagonCursor = document.getElementById("hexagonCursor").value;
const HexagonColor = document.getElementById("hexagonColor").value;
let HexagonWidth = document.getElementById("hexagonSize").value;
if (HexagonWidth == "") HexagonWidth = 0;
const HexagonHeight = HexagonWidth / Math.sqrt(3);
const HexagonMarginTop = HexagonHeight/2;
const HexagonBeforeAfterWidthHeight = HexagonWidth / Math.sqrt(2);
const HexagonBeforeAftertopBottom = HexagonBeforeAfterWidthHeight / -2;
let HexagonBorderSize = document.getElementById("hexagonBorderSize").value;
if (HexagonBorderSize == "") HexagonBorderSize = 0;
const HexagonBorderColor = document.getElementById("hexagonBorderColor").value;
const HexagonBeforeAfterLeft = ((HexagonWidth - (HexagonWidth/Math.sqrt(2))) / 2) - HexagonBorderSize;
const HexagonBorderBeforeAfterWidth = HexagonBorderSize * Math.sqrt(2);
let HexagonShadowBlur = document.getElementById("hexagonShadowBlur").value;
if (HexagonShadowBlur == "") HexagonShadowBlur = 0;
const HexagonShadowColor = document.getElementById("hexagonShadowColor").value;
const HexagonShadowColorArrayRGB = ColorHexToRGB(HexagonShadowColor);
const HexagonShadowColorAlpha = document.getElementById("hexagonShadowColorAlpha").value;
const HexagonSpanText = document.getElementById("hexagonText").value;
let HexagonSpanTextSize = document.getElementById("hexagonTextSize").value;
if (HexagonSpanTextSize == "") HexagonSpanTextSize = 0;
const HexagonSpanColor = document.getElementById("hexagonTextColor").value;
const HexagonShadowSpanTop = HexagonBorderSize * Math.tan(30 * Math.PI/180);
const HexagonShadowSpanWidth = HexagonWidth - (HexagonBorderSize * 2);
const HexagonShadowSpanHeight = (HexagonHeight - (HexagonBorderSize * Math.tan(30 * Math.PI/180) * 2)).toFixed(4);
const HexagonVariablesCSS = document.getElementById("hexagonVariablesCSS").checked;
document.documentElement.style.setProperty("--hexagon-cursor", `${HexagonCursor}`);
document.documentElement.style.setProperty("--hexagon-width", `${HexagonWidth}px`);
document.documentElement.style.setProperty("--hexagon-height", `${HexagonHeight}px`);
document.documentElement.style.setProperty("--hexagon-margin-top", `${HexagonMarginTop}px`);
document.documentElement.style.setProperty("--hexagon-beforeafter-widthheight", `${HexagonBeforeAfterWidthHeight}px`);
document.documentElement.style.setProperty("--hexagon-beforeafter-topbottom", `${HexagonBeforeAftertopBottom}px`);
document.documentElement.style.setProperty("--hexagon-beforeafter-left", `${HexagonBeforeAfterLeft}px`);
document.documentElement.style.setProperty("--hexagon-color", `${HexagonColor}`);
document.documentElement.style.setProperty("--hexagon-border-color", `${HexagonBorderColor}`);
document.documentElement.style.setProperty("--hexagon-border-width", `${HexagonBorderSize}px`);
document.documentElement.style.setProperty("--hexagon-border-beforeafter-width", `${HexagonBorderBeforeAfterWidth}px`);
document.documentElement.style.setProperty("--hexagon-shadow-blur", `${HexagonShadowBlur}px`);
document.documentElement.style.setProperty("--hexagon-shadow-color", `rgba(${HexagonShadowColorArrayRGB[0]},${HexagonShadowColorArrayRGB[1]},${HexagonShadowColorArrayRGB[2]},${HexagonShadowColorAlpha})`);
document.getElementById("layHexagonText").innerHTML = HexagonSpanText;
document.documentElement.style.setProperty("--hexagon-span-text-size", `${HexagonSpanTextSize}px`);
document.documentElement.style.setProperty("--hexagon-span-color", `${HexagonSpanColor}`);
document.documentElement.style.setProperty("--hexagon-span-top", `${HexagonShadowSpanTop}px`);
document.documentElement.style.setProperty("--hexagon-span-width", `${HexagonShadowSpanWidth}px`);
document.documentElement.style.setProperty("--hexagon-span-height", `${HexagonShadowSpanHeight}px`);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Hover
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const HexagonHoverColor = document.getElementById("hexagonHoverColor").value;
let HexagonHoverWidth = document.getElementById("hexagonHoverSize").value;
if (HexagonHoverWidth == "") HexagonHoverWidth = 0;
const HexagonHoverHeight = HexagonHoverWidth / Math.sqrt(3);
const HexagonHoverMarginTop = HexagonHoverHeight/2;
const HexagonHoverBeforeAfterWidthHeight = HexagonHoverWidth / Math.sqrt(2);
const HexagonHoverBeforeAftertopBottom = HexagonHoverBeforeAfterWidthHeight / -2;
let HexagonHoverBorderSize = document.getElementById("hexagonHoverBorderSize").value;
if (HexagonHoverBorderSize == "") HexagonHoverBorderSize = 0;
const HexagonHoverBorderColor = document.getElementById("hexagonHoverBorderColor").value;
const HexagonHoverBeforeAfterLeft = ((HexagonHoverWidth - (HexagonHoverWidth/Math.sqrt(2))) / 2) - HexagonHoverBorderSize;
const HexagonHoverBorderBeforeAfterWidth = HexagonHoverBorderSize * Math.sqrt(2);
let HexagonHoverShadowBlur = document.getElementById("hexagonHoverShadowBlur").value;
if (HexagonHoverShadowBlur == "") HexagonHoverShadowBlur = 0;
const HexagonHoverShadowColor = document.getElementById("hexagonHoverShadowColor").value;
const HexagonHoverShadowColorArrayRGB = ColorHexToRGB(HexagonHoverShadowColor);
const HexagonHoverShadowColorAlpha = document.getElementById("hexagonHoverShadowColorAlpha").value;
let HexagonHoverSpanTextSize = document.getElementById("hexagonHoverTextSize").value;
if (HexagonHoverSpanTextSize == "") hexagonHoverSpanTextSize = 0;
const HexagonHoverSpanColor = document.getElementById("hexagonHoverTextColor").value;
const HexagonHoverShadowSpanTop = HexagonHoverBorderSize * Math.tan(30 * Math.PI/180);
const HexagonHoverShadowSpanWidth = HexagonHoverWidth - (HexagonHoverBorderSize * 2);
const HexagonHoverShadowSpanHeight = (HexagonHoverHeight - (HexagonHoverBorderSize * Math.tan(30 * Math.PI/180) * 2)).toFixed(4);
let HexagonHoverTransition = document.getElementById("hexagonHoverTransition").value;
if (HexagonHoverTransition == "") HexagonHoverTransition = 0;
let HexagonHoverSpanTransition = document.getElementById("hexagonHoverTextTransition").value;
if (HexagonHoverSpanTransition == "") HexagonHoverSpanTransition = 0;
if (HexagonHover) {
document.documentElement.style.setProperty("--hexagon-hover-width", `${HexagonHoverWidth}px`);
document.documentElement.style.setProperty("--hexagon-hover-height", `${HexagonHoverHeight}px`);
document.documentElement.style.setProperty("--hexagon-hover-margin-top", `${HexagonHoverMarginTop}px`);
document.documentElement.style.setProperty("--hexagon-hover-beforeafter-widthheight", `${HexagonHoverBeforeAfterWidthHeight}px`);
document.documentElement.style.setProperty("--hexagon-hover-beforeafter-topbottom", `${HexagonHoverBeforeAftertopBottom}px`);
document.documentElement.style.setProperty("--hexagon-hover-beforeafter-left", `${HexagonHoverBeforeAfterLeft}px`);
document.documentElement.style.setProperty("--hexagon-hover-color", `${HexagonHoverColor}`);
document.documentElement.style.setProperty("--hexagon-hover-border-color", `${HexagonHoverBorderColor}`);
document.documentElement.style.setProperty("--hexagon-hover-border-width", `${HexagonHoverBorderSize}px`);
document.documentElement.style.setProperty("--hexagon-hover-border-beforeafter-width", `${HexagonHoverBorderBeforeAfterWidth}px`);
document.documentElement.style.setProperty("--hexagon-hover-shadow-blur", `${HexagonHoverShadowBlur}px`);
document.documentElement.style.setProperty("--hexagon-hover-shadow-color", `rgba(${HexagonHoverShadowColorArrayRGB[0]},${HexagonHoverShadowColorArrayRGB[1]},${HexagonHoverShadowColorArrayRGB[2]},${HexagonHoverShadowColorAlpha})`);
document.documentElement.style.setProperty("--hexagon-hover-span-text-size", `${HexagonHoverSpanTextSize}px`);
document.documentElement.style.setProperty("--hexagon-hover-span-color", `${HexagonHoverSpanColor}`);
document.documentElement.style.setProperty("--hexagon-hover-span-top", `${HexagonHoverShadowSpanTop}px`);
document.documentElement.style.setProperty("--hexagon-hover-span-width", `${HexagonHoverShadowSpanWidth}px`);
document.documentElement.style.setProperty("--hexagon-hover-span-height", `${HexagonHoverShadowSpanHeight}px`);
document.documentElement.style.setProperty("--hexagon-hover-span-transition", `${HexagonHoverSpanTransition}s`);
document.documentElement.style.setProperty("--hexagon-hover-transition", `${HexagonHoverTransition}s`);
} else {
document.documentElement.style.setProperty("--hexagon-hover-width", `${HexagonWidth}px`);
document.documentElement.style.setProperty("--hexagon-hover-height", `${HexagonHeight}px`);
document.documentElement.style.setProperty("--hexagon-hover-margin-top", `${HexagonMarginTop}px`);
document.documentElement.style.setProperty("--hexagon-hover-beforeafter-widthheight", `${HexagonBeforeAfterWidthHeight}px`);
document.documentElement.style.setProperty("--hexagon-hover-beforeafter-topbottom", `${HexagonBeforeAftertopBottom}px`);
document.documentElement.style.setProperty("--hexagon-hover-beforeafter-left", `${HexagonBeforeAfterLeft}px`);
document.documentElement.style.setProperty("--hexagon-hover-color", `${HexagonColor}`);
document.documentElement.style.setProperty("--hexagon-hover-border-color", `${HexagonBorderColor}`);
document.documentElement.style.setProperty("--hexagon-hover-border-width", `${HexagonBorderSize}px`);
document.documentElement.style.setProperty("--hexagon-hover-border-beforeafter-width", `${HexagonBorderBeforeAfterWidth}px`);
document.documentElement.style.setProperty("--hexagon-hover-shadow-blur", `${HexagonShadowBlur}px`);
document.documentElement.style.setProperty("--hexagon-hover-shadow-color", `rgba(${HexagonShadowColorArrayRGB[0]},${HexagonShadowColorArrayRGB[1]},${HexagonShadowColorArrayRGB[2]},${HexagonShadowColorAlpha})`);
document.documentElement.style.setProperty("--hexagon-hover-span-text-size", `${HexagonSpanTextSize}px`);
document.documentElement.style.setProperty("--hexagon-hover-span-color", `${HexagonSpanColor}`);
document.documentElement.style.setProperty("--hexagon-hover-span-top", `${HexagonShadowSpanTop}px`);
document.documentElement.style.setProperty("--hexagon-hover-span-width", `${HexagonShadowSpanWidth}px`);
document.documentElement.style.setProperty("--hexagon-hover-span-height", `${HexagonShadowSpanHeight}px`);
document.documentElement.style.setProperty("--hexagon-hover-span-transition", `0s`);
document.documentElement.style.setProperty("--hexagon-hover-transition", `0s`);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const layHexagonCodeCSS = document.getElementById("layHexagonCodeCSS");
if (HexagonVariablesCSS){
layHexagonCodeCSS.innerHTML =
`:root {
--hexagon-cursor: ${HexagonCursor};
--hexagon-width: ${HexagonWidth}px;
--hexagon-height: ${HexagonHeight}px;
--hexagon-margin-top: ${HexagonMarginTop}px;
--hexagon-beforeafter-widthheight: ${HexagonBeforeAfterWidthHeight}px;
--hexagon-beforeafter-topbottom: ${HexagonBeforeAftertopBottom}px;
--hexagon-beforeafter-left: ${HexagonBeforeAfterLeft}px;
--hexagon-border-width: ${HexagonBorderSize}px;
--hexagon-border-beforeafter-width: ${HexagonBorderBeforeAfterWidth}px;
--hexagon-color: ${HexagonColor};
--hexagon-border-color: ${HexagonBorderColor};
--hexagon-shadow-color: rgba(${HexagonShadowColorArrayRGB[0]},${HexagonShadowColorArrayRGB[1]},${HexagonShadowColorArrayRGB[2]},${HexagonShadowColorAlpha});
--hexagon-shadow-blur: ${HexagonShadowBlur}px;
--hexagon-span-color: ${HexagonSpanColor};
--hexagon-span-text-size: ${HexagonSpanTextSize}px;
--hexagon-span-top: ${HexagonShadowSpanTop}px;
--hexagon-span-width: ${HexagonShadowSpanWidth}px;
--hexagon-span-height: ${HexagonShadowSpanHeight}px;
`;
if (HexagonHover) {
layHexagonCodeCSS.innerHTML = layHexagonCodeCSS.innerHTML +
`
--hexagon-hover-width: ${HexagonHoverWidth}px;
--hexagon-hover-height: ${HexagonHoverHeight}px;
--hexagon-hover-margin-top: ${HexagonHoverMarginTop}px;
--hexagon-hover-beforeafter-widthheight: ${HexagonHoverBeforeAfterWidthHeight}px;
--hexagon-hover-beforeafter-topbottom: ${HexagonHoverBeforeAftertopBottom}px;
--hexagon-hover-beforeafter-left: ${HexagonHoverBeforeAfterLeft}px;
--hexagon-hover-border-width: ${HexagonHoverBorderSize}px;
--hexagon-hover-border-beforeafter-width: ${HexagonHoverBorderBeforeAfterWidth}px;
--hexagon-hover-color: ${HexagonHoverColor};
--hexagon-hover-border-color: ${HexagonHoverBorderColor};
--hexagon-hover-shadow-color: rgba(${HexagonHoverShadowColorArrayRGB[0]},${HexagonHoverShadowColorArrayRGB[1]},${HexagonHoverShadowColorArrayRGB[2]},${HexagonHoverShadowColorAlpha});
--hexagon-hover-shadow-blur: ${HexagonHoverShadowBlur}px;
--hexagon-hover-span-color: ${HexagonHoverSpanColor};
--hexagon-hover-span-text-size: ${HexagonHoverSpanTextSize}px;
--hexagon-hover-span-top: ${HexagonHoverShadowSpanTop}px;
--hexagon-hover-span-width: ${HexagonHoverShadowSpanWidth}px;
--hexagon-hover-span-height: ${HexagonHoverShadowSpanHeight}px;
--hexagon-hover-span-height: ${HexagonHoverShadowSpanHeight}px;
--hexagon-hover-span-transition: ${HexagonHoverSpanTransition}s;
--hexagon-hover-transition: ${HexagonHoverTransition}s;
`;
}
layHexagonCodeCSS.innerHTML = layHexagonCodeCSS.innerHTML + `}
` + document.getElementById("HexagonCodeCSS").innerHTML + document.getElementById("HexagonHoverCodeCSS").innerHTML;
} else {
let HexagonCodeCSS = document.getElementById("HexagonCodeCSS").innerHTML + document.getElementById("HexagonHoverCodeCSS").innerHTML;
if ((HexagonCodeCSS.charAt(0) != ".") || (HexagonCodeCSS.charAt(0) != ":")) HexagonCodeCSS = HexagonCodeCSS.slice(1);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-cursor)",`${HexagonCursor}`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-width)",`${HexagonWidth}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-height)",`${HexagonHeight}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-margin-top)",`${HexagonMarginTop}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-beforeafter-widthheight)",`${HexagonBeforeAfterWidthHeight}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-beforeafter-topbottom)",`${HexagonBeforeAftertopBottom}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-beforeafter-left)",`${HexagonBeforeAfterLeft}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-border-width)",`${HexagonBorderSize}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-border-beforeafter-width)",`${HexagonBorderBeforeAfterWidth}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-color)",`${HexagonColor}`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-border-color)",`${HexagonBorderColor}`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-shadow-color)",`rgba(${HexagonShadowColorArrayRGB[0]},${HexagonShadowColorArrayRGB[1]},${HexagonShadowColorArrayRGB[2]},${HexagonShadowColorAlpha})`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-shadow-blur)",`${HexagonShadowBlur}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-span-color)",`${HexagonSpanColor}`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-span-text-size)",`${HexagonSpanTextSize}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-span-top)",`${HexagonShadowSpanTop}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-span-width)",`${HexagonShadowSpanWidth}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-span-height)",`${HexagonShadowSpanHeight}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-width)",`${HexagonHoverWidth}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-height)",`${HexagonHoverHeight}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-margin-top)",`${HexagonHoverMarginTop}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-beforeafter-widthheight)",`${HexagonHoverBeforeAfterWidthHeight}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-beforeafter-topbottom)",`${HexagonHoverBeforeAftertopBottom}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-beforeafter-left)",`${HexagonHoverBeforeAfterLeft}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-border-width)",`${HexagonHoverBorderSize}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-border-beforeafter-width)",`${HexagonHoverBorderBeforeAfterWidth}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-color)",`${HexagonHoverColor}`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-border-color)",`${HexagonHoverBorderColor}`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-shadow-color)",`rgba(${HexagonHoverShadowColorArrayRGB[0]},${HexagonHoverShadowColorArrayRGB[1]},${HexagonHoverShadowColorArrayRGB[2]},${HexagonHoverShadowColorAlpha})`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-shadow-blur)",`${HexagonHoverShadowBlur}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-span-color)",`${HexagonHoverSpanColor}`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-span-text-size)",`${HexagonHoverSpanTextSize}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-span-top)",`${HexagonHoverShadowSpanTop}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-span-width)",`${HexagonHoverShadowSpanWidth}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-span-height)",`${HexagonHoverShadowSpanHeight}px`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-span-transition)",`${HexagonHoverSpanTransition}s`);
HexagonCodeCSS = HexagonCodeCSS.replaceAll("var(--hexagon-hover-transition)",`${HexagonHoverTransition}s`);
layHexagonCodeCSS.innerHTML = HexagonCodeCSS;
}
let HexagonHTML =
`<div class="hexagon">
<span>${HexagonSpanText}</span>
</div>`;
HexagonHTML = HexagonHTML.replaceAll("<","<");
HexagonHTML = HexagonHTML.replaceAll(">",">");
document.getElementById("layHexagonCodeHTML").innerHTML = HexagonHTML;
hljs.highlightAll();
}
HexagonSizeChange();
</script>
<!-- Default Statcounter code -->
<script type="text/javascript">
var sc_project=13066077;
var sc_invisible=1;
var sc_security="d3f42120";
</script>
<script type="text/javascript" src="https://www.statcounter.com/counter/counter.js" async></script>
<noscript>
<div class="statcounter">
<a title="Web Analytics" href="https://statcounter.com/" target="_blank"><img class="statcounter" src="https://c.statcounter.com/13066077/0/d3f42120/1/" alt="Web Analytics" referrerPolicy="no-referrer-when-downgrade"></a>
</div>
</noscript>
<!-- End of Statcounter Code -->
</body>
</html>