-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
1791 lines (1672 loc) · 63.9 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
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
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<!-- I wacked this demo page together without much attention for CSS/HTML optimization -->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="Description" content="FlagMeister 250+ SVG Flags in one 32KB Custom Element/Web Component" />
<meta name="Author" content="Danny Engelman" />
<meta name="title" property="og:title" content="FlagMeister.github.io" />
<meta name="image" property="og:image" content="//flagmeister.github.io/linkedin_flagmeister_1200_627.png" />
<meta name="description" property="og:description"
content="FlagMeister 250+ SVG Flags in one 32KB Custom Element/Web Component" />
<meta name="url" property="og:url" content="//flagmeister.github.io" />
<link rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21'><rect width='100%' height='100%' fill='gold'/><text x='1' y='15.5'>Fm</text></svg>"
type="image/svg+xml" />
<title>
FlagMeister - SVG Flags in one Custom Element/Web Component
</title>
<script src="elements.flagmeister.js"></script>
<script src="element.flagmeister-list.js"></script>
<script defer src="https://hexedland.com/meisterbanner.js"></script>
<style id="theme_greenwhite">
body {
font-family: Arial, Helvetica, sans-serif;
visibility: hidden;
color: whitesmoke;
--theme_pre_size: 1.2em;
--textstroke: 1px black;
--defaultmargin: 0.5em;
}
img {
width: 100%;
/* 2024 - moved hardcoded .style.width = 100% to CSS*/
}
p {
margin-left: var(--theme_pre_size);
}
a:link,
a:visited,
a:hover,
a:active {
color: darkblue;
}
a:hover {
background: lightskyblue;
}
.footnote,
.warning,
h1,
h2,
h3 {
text-shadow: 2px 2px 1px black;
--m: 0.2em;
margin-block-start: var(--m);
margin-block-end: var(--m);
}
.warning,
.section_text,
h3 {
text-shadow: 1px 1px 1px black;
}
.section_text {
font-size: 1.2em;
}
h1 a,
h2 a {
text-shadow: 0.3px 0.3px 0 lightgrey;
}
h3 a {
text-shadow: 0 0;
}
.greencloth {
/* background: #047b3d; */
/* saves loading an image, looks better than a solid darkgreen background */
background-image: url("data:image/webp;base64,UklGRpgAAABXRUJQVlA4IIwAAAAwBACdASoeAB4APikSh0KhoQoCAAwBQllYz41AABFV/n8AItOaJepDavAA/vkKUe5BGtPR5aeKP/4hd7G2///gzv/f1X/gzv/BmUX9cJtST/Z9T/XsQq/MQV+1v8m2uukhu3nFYS/A5iTPpyXsMLAwk6xasWWFDPdx7OkWouLHKfqaoozRIW3R5D5MAA==");
background-size: cover;
}
section:not(:first-child) {
/* border-top: 5px solid lightgreen; */
padding: 1em;
scroll-snap-align: start;
}
.docgrid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: auto;
overflow: hidden;
}
.warning {
color: orangered;
}
</style>
<style>
[is*="flag-"] {
position: relative;
display: inline-block;
}
[is*="flag-"]:hover:after {
position: absolute;
left: 0;
top: 0;
content: attr(is);
font-size: 70%;
background: darkgoldenrod;
color: black;
}
section {
max-width: 1280px;
margin: 0 auto;
}
.flaggrid img {
object-fit: cover;
width: 100%;
max-height: 100%;
border: var(--bordersize) solid transparent;
}
.docgrid img {
--flagmeisterdetail: 9999;
max-width: 24%;
}
.flagwidthList img {
width: 45px !important;
border: 1px solid transparent;
}
.textarea_html {
font-size: 1.4em;
font-weight: bold;
color: #333;
width: 100%;
background: lightgoldenrodyellow;
padding: 0.5em 1em 0 1em;
overflow: hidden;
margin: 1em 0;
}
.highlightText {
font-weight: bold;
color: gold;
}
.horizontalFlags_5 {
width: 100%;
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-gap: 1vw;
--flagmeisterdetail: 9999;
margin: 1em 0;
}
#FlagMeisterCreateBanner {
/* do not load details!! */
--flagmeisterdetail: 9999;
--flagmeisterletterheight: 120px;
min-height: var(--flagmeisterletterheight);
}
#FlagMeisterNATOFlags img,
#FlagMeisterICSFlags img {
margin: 0 5px 5px 0;
}
#injectFlagMeisterBanner {
--height: 10vw;
--flagmeisterletterheight: var(--height);
min-height: var(--height);
}
</style>
<style>
section#analyzer {
display: initial;
}
</style>
<style>
.flaggrid {
display: grid;
grid-template-columns: repeat(var(--flagProvidersCount), 1fr);
grid-template-rows: 10fr;
grid-gap: 0.2vw;
/* margin: 5px; */
background: grey;
color: black;
font-family: Arial, Helvetica, sans-serif;
--bordersize: 3px;
}
.flaggrid img {
object-fit: cover;
width: 100%;
max-height: 100%;
border: var(--bordersize) solid transparent;
}
.docgrid img {
--flagmeisterdetail: 9999;
max-width: 24%;
}
.flagwidthList img {
width: 41px;
}
.textarea_html {
font-size: 1.4em;
font-weight: bold;
color: #333;
width: 100%;
background: lightgoldenrodyellow;
padding: 0.5em 1em 0 1em;
overflow: hidden;
margin: 1em 0;
}
.highlightText {
font-weight: bold;
color: gold;
}
.horizontalFlags_5 {
width: 100%;
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-gap: 1vw;
--flagmeisterdetail: 9999;
margin: 1em 0;
}
.clipexamples img {
filter: drop-shadow(8px 8px 4px black);
border: 2px dashed lightcoral;
}
</style>
<style>
#FlagMeisterAnalyzeFlags flagmeister-text {
/* do not load details!! */
--flagmeisterdetail: 9999;
--flagmeisterletterheight: 3vw;
}
</style>
<style>
#FlagTable {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 15px;
}
#FlagTable {
white-space: nowrap;
border-collapse: collapse;
}
#FlagTable td {
border: 1px solid black;
text-align: center;
padding: 0.2em;
}
#FlagTable td a:first-of-type {
/* font-size: 130%; */
}
#FlagTable th {
color: black;
background: grey;
}
</style>
<style>
#FlagMeisterAnalyzeFlags {
margin-bottom: 50vh;
}
#FlagMeisterAnalyzeFlags flagmeister-list {
--flagmeisterdetail: 9999;
--NOflagmeistersource: //raw.githubusercontent.com/kent1D/svg-flags/master/flags/;;
}
#FlagMeisterAnalyzeFlags flagmeister-list img {
max-width: 40px;
}
#LipisColors {
display: none;
}
</style>
<style id="button_DimNoDetail" onload="this.disabled=true">
#FlagMeisterAnalyzeFlagsSelector img:not([src*="dtl:"]) {
opacity: 0.2;
}
button[onclick*="DimNoDetail"] {
background: green;
color: white;
}
</style>
<style id="button_FlagsKB" onload="this.disabled=true">
#FlagMeisterAnalyzeFlagsSelector img:not([flagkb]) {
opacity: 0.2;
border: 2px solid transparent;
}
[flagkb="1000"] {
border: 2px dashed lightcoral;
}
[flagkb="2000"] {
border: 2px dashed red;
}
button[onclick*="FlagsKB"] {
background: orange;
color: black;
}
</style>
<style id="button_NeedWork" onload="this.disabled=true">
#FlagMeisterAnalyzeFlagsSelector [is] {
opacity: 0.2;
}
#FlagMeisterAnalyzeFlagsSelector [is*="-zw"],
#FlagMeisterAnalyzeFlagsSelector [is*="-zm"],
#FlagMeisterAnalyzeFlagsSelector [is*="-wf"],
#FlagMeisterAnalyzeFlagsSelector [is*="-vu"],
#FlagMeisterAnalyzeFlagsSelector [is*="-vi"],
#FlagMeisterAnalyzeFlagsSelector [is*="-vg"],
#FlagMeisterAnalyzeFlagsSelector [is*="-va"],
#FlagMeisterAnalyzeFlagsSelector [is*="-uy"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ug"],
#FlagMeisterAnalyzeFlagsSelector [is*="-tm"],
#FlagMeisterAnalyzeFlagsSelector [is*="-tc"],
#FlagMeisterAnalyzeFlagsSelector [is*="-sz"],
#FlagMeisterAnalyzeFlagsSelector [is*="-sx"],
#FlagMeisterAnalyzeFlagsSelector [is*="-sv"],
#FlagMeisterAnalyzeFlagsSelector [is*="-sm"],
#FlagMeisterAnalyzeFlagsSelector [is*="-sh"],
#FlagMeisterAnalyzeFlagsSelector [is*="-py"],
#FlagMeisterAnalyzeFlagsSelector [is*="-pn"],
#FlagMeisterAnalyzeFlagsSelector [is*="-pf"],
#FlagMeisterAnalyzeFlagsSelector [is*="-pe"],
#FlagMeisterAnalyzeFlagsSelector [is*="-om"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ni"],
#FlagMeisterAnalyzeFlagsSelector [is*="-nf"],
#FlagMeisterAnalyzeFlagsSelector [is*="-mz"],
#FlagMeisterAnalyzeFlagsSelector [is*="-mx"],
#FlagMeisterAnalyzeFlagsSelector [is*="-mt"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ms"],
#FlagMeisterAnalyzeFlagsSelector [is*="-mp"],
#FlagMeisterAnalyzeFlagsSelector [is*="-me"],
#FlagMeisterAnalyzeFlagsSelector [is*="-md"],
#FlagMeisterAnalyzeFlagsSelector [is*="-li"],
#FlagMeisterAnalyzeFlagsSelector [is*="-kz"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ky"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ki"],
#FlagMeisterAnalyzeFlagsSelector [is*="-kh"],
#FlagMeisterAnalyzeFlagsSelector [is*="-je"],
#FlagMeisterAnalyzeFlagsSelector [is*="-iq"],
#FlagMeisterAnalyzeFlagsSelector [is*="-io"],
#FlagMeisterAnalyzeFlagsSelector [is*="-im"],
#FlagMeisterAnalyzeFlagsSelector [is*="-hr"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ht"],
#FlagMeisterAnalyzeFlagsSelector [is*="-fj"],
#FlagMeisterAnalyzeFlagsSelector [is*="-fk"],
#FlagMeisterAnalyzeFlagsSelector [is*="-gd"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ge"],
#FlagMeisterAnalyzeFlagsSelector [is*="-gi"],
#FlagMeisterAnalyzeFlagsSelector [is*="-gq"],
#FlagMeisterAnalyzeFlagsSelector [is*="-gs"],
#FlagMeisterAnalyzeFlagsSelector [is*="-gt"],
#FlagMeisterAnalyzeFlagsSelector [is*="-gu"],
#FlagMeisterAnalyzeFlagsSelector [is*="-es"],
#FlagMeisterAnalyzeFlagsSelector [is*="-er"],
#FlagMeisterAnalyzeFlagsSelector [is*="-eg"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ec"],
#FlagMeisterAnalyzeFlagsSelector [is*="-do"],
#FlagMeisterAnalyzeFlagsSelector [is*="-dm"],
#FlagMeisterAnalyzeFlagsSelector [is*="-cx"],
#FlagMeisterAnalyzeFlagsSelector [is*="-cr"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bn"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bm"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bo"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bt"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bz"],
#FlagMeisterAnalyzeFlagsSelector [is*="-as"],
#FlagMeisterAnalyzeFlagsSelector [is*="-al"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ai"],
#FlagMeisterAnalyzeFlagsSelector [is*="-af"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ad"] {
opacity: 1;
}
</style>
<style id="button_MismatchFlags" onload="this.disabled=true">
#LipisColors {
display: block;
}
#FlagMeisterAnalyzeFlagsSelector [is] {
opacity: 0.2;
}
#FlagMeisterAnalyzeFlagsSelector [is*="-lgbt"],
#FlagMeisterAnalyzeFlagsSelector [is*="-tn"],
#FlagMeisterAnalyzeFlagsSelector [is*="-aq"],
#FlagMeisterAnalyzeFlagsSelector [is*="-as"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bg"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bl"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bq"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bt"],
#FlagMeisterAnalyzeFlagsSelector [is*="-by"],
#FlagMeisterAnalyzeFlagsSelector [is*="-cr"],
#FlagMeisterAnalyzeFlagsSelector [is*="-cu"],
#FlagMeisterAnalyzeFlagsSelector [is*="-dm"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ec"],
#FlagMeisterAnalyzeFlagsSelector [is*="-gp"],
#FlagMeisterAnalyzeFlagsSelector [is*="-gs"],
#FlagMeisterAnalyzeFlagsSelector [is*="-jm"],
#FlagMeisterAnalyzeFlagsSelector [is*="-kz"],
#FlagMeisterAnalyzeFlagsSelector [is*="-md"],
#FlagMeisterAnalyzeFlagsSelector [is*="-pa"],
#FlagMeisterAnalyzeFlagsSelector [is*="-pn"],
#FlagMeisterAnalyzeFlagsSelector [is*="-pe"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ps"],
#FlagMeisterAnalyzeFlagsSelector [is*="-mt"],
#FlagMeisterAnalyzeFlagsSelector [is*="-mr"],
#FlagMeisterAnalyzeFlagsSelector [is*="-mq"],
#FlagMeisterAnalyzeFlagsSelector [is*="-rs"],
#FlagMeisterAnalyzeFlagsSelector [is*="-se"],
#FlagMeisterAnalyzeFlagsSelector [is*="-sa"],
#FlagMeisterAnalyzeFlagsSelector [is*="-yt"],
#FlagMeisterAnalyzeFlagsSelector [is*="-wf"],
#FlagMeisterAnalyzeFlagsSelector [is*="-vi"],
#FlagMeisterAnalyzeFlagsSelector [is*="-va"],
#FlagMeisterAnalyzeFlagsSelector [is*="-bw"],
#FlagMeisterAnalyzeFlagsSelector [is*="-za"],
#FlagMeisterAnalyzeFlagsSelector [is*="-ug"] {
opacity: 1;
}
button[onclick*="MismatchFlags"] {
background: lightcoral;
color: black;
}
</style>
<style>
#FlagDetailAnalyzer {
display: grid;
grid-template-columns: 6fr;
grid-template-rows: 1fr;
/* grid-gap: 0.2vw; */
max-width: 90vw;
}
#FlagAnalyzer {
max-height: 300px;
xheight: 270px;
/* overflow: scroll; */
cursor: pointer;
--flagmeisterdetail: 1;
}
#FlagAnalyzer img:nth-child(1) {
/* prevent any detail loading */
--flagmeisterdetail: 99999;
opacity: 1;
}
#FlagAnalyzer img:nth-child(2) {
/* unset CSS variable so detail from FlagMeister flag definition is used */
--flagmeisterdetail: initial;
opacity: 0.1;
}
#FlagAnalyzer img:nth-child(2)[detail],
#FlagAnalyzer img:nth-child(2)[source] {
opacity: 1;
}
#FlagAnalysis {
max-height: 200px;
}
.flaginfo {
font-size: 0.9em;
color: darkred;
}
.infolabel {
color: black;
}
.flagmeisterCodeSize {
background: lightgreen;
color: black;
}
.provider {
max-width: calc(100vw / var(--flagProvidersCount));
}
.providerDescription {
font-size: 0.7em;
}
#FlagMeisterCodeString {
max-width: 90vw;
overflow-wrap: break-word;
margin-bottom: 5em;
}
</style>
</head>
<body class="greencloth">
<section id="sectionHeader">
<div id="injectFlagMeisterBanner">
<!-- <flagmeister-text iso="ba,bi,us,ax,gb,ke,is,tr,nl,zw,ki" word="FlagMeister">
</flagmeister-text> -->
</div>
<h3>
<span class="highlightText">No</span> <i>static</i> SVG files!
<span class="highlightText">No</span> Image Sprite!
<span class="highlightText">No</span> Frameworks!
<span class="highlightText">No</span> Dependencies! <a
href="https://github.com/flagmeister/flagmeister.github.io">available on GitHub</a>
</h3>
<h1>
All <span class="highlightText">HTML</span> required to display SVG
flags is:
</h1>
<div class="docgrid">
<div>
<label for="codeexample" hidden>Code Example:</label>
<textarea id="codeexample" class="textarea_html" style="width: 380px; height: 209px">
<flag-nl></flag-nl>
<flag-zw></flag-zw> *
<flag-ke></flag-ke>
<flag-kr></flag-kr>
OR
<svg-flag is="es"></svg-flag>
<svg-flag is="aq"></svg-flag>
<svg-flag is="nz"></svg-flag>
<svg-flag is="jollyroger"></svg-flag>
</textarea>
<br><br>
* details automatically loaded from RestCountries API
</div>
<!-- can't lazy load these IMGs? -->
<div id="flags8">
<style>
#flags8 {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
background: grey;
}
#flags8 img {
display: inline-block;
width: 100% !important;
height: 100%;
}
#flags8 [is] {
display: inline-block;
width: 400%;
}
</style>
<flag-nl id="f1"></flag-nl>
<flag-zw id="f2"></flag-zw>
<flag-ke id="f3"></flag-ke>
<flag-kr id="f4"></flag-kr>
<svg-flag id="f5" is="es"></svg-flag>
<svg-flag id="f6" is="aq"></svg-flag>
<svg-flag id="f7" is="nz"></svg-flag>
<svg-flag id="f8" is="jollyroger"></svg-flag>
</div>
</div>
<div>
<h2>
FlagMeister is a single
<span class="highlightText"><span class="flagmeister_size"></span> KB</span>
<sup>gzip</sup>
<span class="highlightText">Custom Element / Web Component</span> file
</h2>
<textarea id="codeexample" class="textarea_html" style="overflow: hidden">
<head>
<script src="elements.flagmeister.min.js"></script>
</head>
</textarea>
<p>
FlagMeister was developed in 2018 using
<b>'Customized Built-In' Elements</b>:
<span class="highlightText"><img is=flag-nl /></span>
<br />
Alas Apple still refuses to implement this part of the Web Components
standard in Safari.
<br />
In 2020 FlagMeister switched to slightly more verbose, but 100%
supported <b>'Autonomous' Elements</b>:
<span class="highlightText"><flag-nl></flag-nl></span>
</p>
</div>
</section>
<section id="firstviewAllFlags">
<style>
#firstviewAllFlags {
/* prevent loading detail */
--flagmeisterdetail: 9999;
}
</style>
<a name="flags"></a>
<flagmeister-list signals="true" class="flagwidthList" delay="1000"></flagmeister-list>
<br />
<br />
<br />
<h2>
If <span class="highlightText">all you want</span> is a
<span class="highlightText">SVG flag</span> you can
<span class="highlightText">stop reading</span> here...
</h2>
<p></p>
<a name="examples"></a>
<h2>Read on if you want FlagMeister to create:</h2>
<div class="horizontalFlags_5">
<flag-nl filter="light" data-not="Not Holland!" draw="attr:alt,80;attr:data-not,80,120"></flag-nl>
<flag-eu filter="light" draw="flag:gb,3,215,160"></flag-eu>
<flag-lgbt clip="heart" box="center" filter="light"></flag-lgbt>
<flag-us filter='light:{"spot":"royalblue","x":160,"y":120}'
draw='text:{"str":"VOTE!","font":"Arial","fill":"gold","size":170,"width":8,"stroke":"black"}'></flag-us>
<flag-gb draw="border:5px,#000" box="270 0 390 480"
clip="outline:m290 457s16 1 16 11c0 0 7-4 8-10 2-7 10 0 10 0l4-8 35 17c2 0 14-25 14-25s47 14 49 13c2 0 1-7 1-7l24 1-3-10 21 15 24-1 12 7 23-10 2 4 7-8 12-1 3-17-19 3-3-10s-13-1-12-2l17-1 5-10-7-2h12l6-4-5-6 8 2s25-23 18-39c-6-16-28-24-39-23-10 1-8 10-8 10s-7-1-9-7c0 0 1-5 9-8 7-3-1-20-5-27-3-6 1-4 4-6 4-1-4-13-8-20s2-7 5-10-6-9-10-12c-4-4-6-20-21-20-14-1-8-48-6-55s-7-1-12-20c-5-20-14-13-19-13-4-1-18 5-20 0-2-6 8-5 12-4 4 0 2-2 4-5s14 10 14-1c-1-10-7-9-7-9l3-4s31-28 31-40 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3 6 8 2 2-4 8 6 5-1 4-8 14-1 1-19-9 2-4-2 9-8v-5l-6-3-1-6 1-9-10-6h-7l-3 3-8-3-4 8-5-1-4-3-9 15-10-1 4 7z">
</flag-gb>
</div>
</section>
<section id="SVGGoodies">
<flagmeister-text iso="ba,gb,kr,ax,gb,us,is,tr,nl,zw,ki" word="SVG_Goodies">
</flagmeister-text>
<h2>Draw SVG on flags</h2>
<p>
The draw attribute/property accepts
<span class="highlightText">any valid SVG string</span> or
<span class="highlightText">FlagMeister commands</span> and adds it on
top of the FlagMeister flag (a 640 x 480 grid)
</p>
<textarea class="textarea_html">
<flag-be draw="<circle cx='320' cy='240' r='180' fill='green'/>"></flag-be>
<flag-fr draw="circle:320,240,180,green ; line:120,gold,0,0,640,480 ; star:red,55,30,5"></flag-fr>
<flag-nl draw="attr:alt,80;attr:data-not,80,120" data-not="Not Holland!"></flag-nl>
<flag-eu draw="flag:gb,3,220,160"></flag-eu>
<flag-us draw='text:{"str":"USA","fill":"gold","size":220,"stroke":"5,black"}'></flag-us>
</textarea>
<br />
<div class="horizontalFlags_5">
<flag-be draw="<circle cx='320' cy='240' r='180' fill='green'/>"></flag-be>
<flag-fr draw="c:320,240,180,green;line:120,gold,0,0,640,480;star:red,55,30,5"></flag-fr>
<flag-nl data-not="Not Holland!" draw="attr:alt,80;attr:data-not,80,120"></flag-nl>
<flag-eu draw="flag:gb,3,220,160"></flag-eu>
<flag-us country="USA"
draw='text:{"str":"USA","font":"Arial","fill":"gold","size":220,"width":5,"stroke":"black"}'></flag-us>
</div>
<h3>FlagMeister commands and parameters (to be documented)</h3>
<style>
.commandCode {
display: table;
clear: both;
background: lightyellow;
color: black;
padding-left: 1em;
padding-right: 1em;
}
</style>
<ul>
<li>
backgroundcolor
<span class="commandCode">bgcolor: or b: [color = #fff]</span>
</li>
<li>
circle
<span class="commandCode">circle: or c: cx , cy , radius , color [, stroke width ,
strokecolor]</span>
</li>
<li>
rect: x , y , width , height , color , [stroke width , strokecolor]
</li>
<li>
line: width , color , x1 , y1 , x2 , y2 , [stroke width , strokecolor]
</li>
<li>flag: iso , [stroke width , strokecolor]</li>
<li>background: color</li>
<li>attr: attribute , fontsize , y OR attr: text-JSON</li>
<li>
text: JSON Object: (showing default values):
<br />
{ str = 'fm' , size = 520 , x = 320 , y = 430 , fill =
false , stroke = '' , s = stroke.split`,` , font = 'Bookman Old Style'
, weight = 'bold' , anchor = 'middle'}
</li>
</ul>
<h3>Notes on drawing</h3>
<ul>
<li>
FlagMeister does no error checking, pay attention to single and double
quote usage
</li>
<li>
<span class="highlightText">SVG strings</span> can only contain
<span class="highlightText">single quotes</span>
</li>
<li>
The FlagMeister text method takes one parameter,
<span class="highlightText">a valid JSON string</span> with
<span class="highlightText">double quotes</span>
</li>
<li>
Be sure to read what you are
<span class="highlightText">NOT allowed</span> to do with the US flag
<a href="//www.huffpost.com/entry/american-flag-disrespect-tru_n_59c7140be4b06ddf45f867a0">by US Federal code
36</a>
</li>
</ul>
</section>
<section id="CSSforflags">
<h2>Apply CSS on IMGs</h2>
<p>
The FlagMeister flag IMG takes
<span class="highlightText">100% of available width</span>, in examples
below the 5 column CSS grid sets the width.
<br />
<br />
FlagMeister generates SVG as Data-URI in IMG tags. All examples use
<span class="highlightText">standard CSS on the IMG tag</span>:
</p>
<textarea class="textarea_html">
img {
filter: drop-shadow(8px 8px 4px black);
border: 2px dashed lightcoral;
}
</textarea>
</section>
<section id="clip">
<h2>Clip flags</h2>
<textarea class="textarea_html">
<flag-gd clip="bigstar"></flag-gd>
<flag-gr clip="heart"></flag-gr>
<flag-zw clip="circle:240,240,240"></flag-zw>
<!-- if you know SVG: -->
<flag-us clip="<path id='outline' fill='none' d=' ..long SVG path in 640x480 grid.. ' />"
draw="<use href='#outline' stroke-width='6' stroke='#000'/>" ></flag-us>
<!-- if you have a path in a 640x480 grid: -->
<flag-nl draw="border:6px,grey"
clip="outline: ..long SVG path in 640x480 grid.. "
box="0 0 400 480"></flag-nl>
</textarea>
<br />
<div class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-1-3-1-1-3v-6l-1-3-4-1h-9l-5-1h-4l-4-5-2-2-1-3-1-2-2-4-1-3-2-4-2-3-1-2-2-3-3-3h-3l-3-2h-3l-2-2v-4l-1-5-1-3-1-5-2-6-2-5-1-3-1-3 2-4v-3-4-4l1-3v-5l-2-5-3-6-4-5-1-5 1-2 1-4v-5-4l1-5 6-6 2-5v-6l1-6 1-4 1-4 1-7a122 122 0 0 1 3-11l2-4 2-3 1-3 1-3 2-4 3-4 1-4 2-3 2-6v-4-4l1-4v-4-5-4-3c1-1 7 4 14 10l4 2 3 1h2-1' />"
draw="<use href='#usa' stroke='#000' stroke-width='6'/>"></flag-us>
<flag-nl draw="border:6,grey" box="0 0 400 480"
clip="outline:m300 0c-7 3-15 0-20 4-1 10 0 4 6 3 7 0 10-6 17-6zm-66 7c-8 4 0 11 4 7 4-4 11 0 17-3 7-1 14-4 3-3-8 1-17-1-24-1zm105 0-18 6c-4 1-10 0-15 3-7 4-10 1-17 1-7-1 6 6-3 1-2 2 2 4 6 7-3 1 0 6-4 1-3-3-1 6-4 0-3-4 3-13-3-8-6-1-10 0-17 1-7 3-7-1-13 4l-21 10c-6 3-6 8-11 10-4 3-7 10-7 13 0 7-6 10-3 14l-3 1 4 10v14c-3 4-7 8 0 11 6 0 10 1 15 4 3-6 7-4 13-3 6 1-7 3-7 8-4 7-3 14-3 21 4 6 8 10 15 8 11-4 7 6 8 6 3 4 4 10 2 14l1-4c0-7-5-11-11-11-7-1-11-6-18-1-4 6-11 6-13 10 0 7-7 7-11 11l-15 10c-7 3-3 10-3 13 7-4 15 0 20 6 4 6 8 7 15 4 6-3 7-10 4-14l14-8c6-3 14-8 17-15 2 4-9 13-13 16-1 3-10 4-11 7-1 3-6 6-6 11-4 3-10 6-15 4-4-3-10-4-11-8-4-4-11 4-14-3-3-4-11 0-10-4-3 1-8-3-6-4-4-3 6 3 6-4 8-4 1-4 3-10-4 0 3-4 1-8-3-4-6-11-6-15 0-7 6-6 10-3 4 1 11-3 11-8 6-1 8-7 3-11-6-3-11 6-14-3-4-3 3-13-3-17-3-4-4-11-10-10-4 1-7 11-14 6-7 0-3-11-7-10-4-6-7 7-6 11l-8 27-4 35c-7 7 4 4-1 7 1-1-3 1-3 7-6 17-14 32-25 46-6 4-3 4-8 10-6 4-7 10-13 13-8-4-8 4-10 8-6 6 11-1 4 6 1 6 3 10 8 11 0 1 8 3 11 7-1 1 6 6 10 7 6 3 10 6 17 6 4 4 10-3 14-3-3 6-10 7-15 7-7-6-10 1-14 6-6-1-10 4-14 1-4-1-15-4-10 1 7 3 7 4-1 4-3-3-13 1-11 3 4 1 6 10 11 10 7-1 6 3 11 6 3 10-4 8-8 8-7-1-7-8-10-11-3-6-11-1-11-6l-15-1c-7-1-4 10-8 3-4-6-4-11-11-11l-14 8c0 6 8 7 8 13 6 6 7 3 11 3 3 0 6-6 6-1 1 4 4 8 8 8 1 4 13 4 14 0 0-4 3-11 8-7 4 3 6 7 11 8 6 3 11-4 14 3l13 4c11 0-3-8 3-11-4-6 7-7 13-8 3 3-3 13 8 8 7 4 4-3 11-6 3-6 4-7 10-4 4 3-1 7 1 11l11 1c7-3 4-8 10-11 1 1 10 8 3 15 7 1 4 14 10 13 10-7 3 10 10 7 7 1 11 0 17-1 4-6 10-4 13 3-3 8 8 6 10 13 3 0 15-3 11 3 1 6 6-4 8 3-6 3 0 8-4 8l-4 8c3 4-1 10-4 14 7-3 0 8-3 8-1 4-8 6-4 11 3 3 7 6 3 11 4 4 8-4 10-1 4 3 7 3 11 0 1 6 7-1 11 3 8-1-6-8 0-8 6 0 0-8 6-8 6 1 0-6 4-8-3-3-11-4-8-10-1-4-8-1-13-1 4-3-6-10 0-11 3-7 6 7 8 0 0-6 7-8 10-11 1-4 11-4 10-7-3-3 3-8-6-1-7 0-3-10-3-13 3-4 7-8 8-14 7 0 6-10 4-13v-15l-10-14c-7-3 4-11-4-11-10 0-1-7-6-10-8-3-6-3-4-8 0-3-7-6-1-8 6 3 8-7 13-3 8 3 7-3 3-7-6-1 10-1 7 3 4 4 8-3 11 4 3-1 11 6 10 1-3-6 0-6 4-3 4 1 8-6 13-6 4 0 10-6 13-3 3 4 10-3 10-8 7-3 0-7-4-10-4-3-13-7-3-10 1-7 7-6 13-8 0-7 8-6 10-11-1-8 14-1 7-10-4-4 0-8 3-14 3-6-3-8-7-13 0-11-3-3-7-1-8-1-8-6-17-4-8-1-4-8-8-14 4-1 11-1 4-7-1-6 1-10 8-10 6-1 11 3 17 1 6 4 8-3 7-10 1-7-1-15 3-21-1-7 7-11 8-17 1-7 4-13 1-20 1-8-4-11 0-18 3 1 1-11-4-11-3 0-11-3-7-8 1-3-10 1-13-4-4 1-7-4-7-10m0 0c-5-13-2-9-14-13m-307 301c1 4 10 3 7 8 1 0 8-4 13-3 6 4 10-3 4-7-4-1-10-1-14 1-7-3 0-4-10 0zm179-255c1-1-1 1 0 0zm11-42c-11 1-20 7-31 7-6 1-7 13-3 8l13-4c4-3 10-6 15-6-3-1 0-3 6-3 1-3 3-1 0-3zm-45 22c-8 3-14 10-21 14-1 6 8-1 11-4-1-4 8-6 13-8zm-22 20c-6 6 0 7-6 8-4 7-8 15-7 24l8-4c4-4 8-7 10-13 1-6 0-13-6-15zm55 22c1 0-1 3 0 0zm-29 92c-5 9 3 7 0 0zm-125 104c0 10 3 3 8 3 4-4 10 6 7 7 3 6 4 10 10 8l13 8c6 1 14-3 13-6 10-3-4 0-7-4-4-1-7-7-11-10l-14-7c-1-7-8-3-18 0zm-18 20c0 7 8 4 11 1 3-3 8 1 10 6 0 4 7 4 11 6 3-1 11-3 8-7-3-4-8-3-11-10-3-3-8-3-14-3-8 0-15 1-15 7zm-20 46-13 4c3 6-3 10 0 13 1 4 4 8 10 8 10 3 1-10 8-7 3-3 6 0 11 0 3 4 8 3 13 6-3 6 1 11 8 6 1 6 3 0 7 1 3-1 7-6 11-4 7-4 13-10 18-17-1-1-7-7-4-1l-3 3h-3c0-1-8-4-10-7 0-4-10-6-8 1-3 0-8 7-13 6-1 0-8-1-7-3-6 0-10-4-15-6-4 0-6-4-11-3z">
</flag-nl>
</div>
</section>
<section id="viewbox">
<h2>Change SVG viewBox = " x y width height "</h2>
<h3>
<span class="highlightText">The flag is still drawn in a 640 by 480 grid !</span>
</h3>
<textarea class="textarea_html">
<flag-gd></flag-gd>
<flag-gd clip="bigstar" box="left"></flag-gd> = 0 0 480 480
<flag-gd clip="bigstar" box="center"></flag-gd> = 80 0 480 480
<flag-gd clip="bigstar" box="right"></flag-gd> = 160 0 480 480
<flag-zw clip="circle:240,240,240" box="-80 100 640 280"></flag-zw>
</textarea>
<br />
<div class="horizontalFlags_5 clipexamples">
<flag-gd></flag-gd>
<flag-gd clip="bigstar" box="left"></flag-gd>
<flag-gd clip="bigstar" box="center"></flag-gd>
<flag-gd clip="bigstar" box="right"></flag-gd>
<flag-zw clip="circle:240,240,240" box="-80 100 640 280"></flag-zw>
</div>
</section>
<section id="filter">
<style>
#sectionFilter .clipexamples img {
border: initial;
}
</style>
<h2>
Apply the FlagMeister <span class="highlightText">light</span> filter
</h2>
<p class="section_text">
This predefined SVG filter creates a
<span class="highlightText">3D lighting effect</span> and an optional
<span class="highlightText">spotlight</span> defaulting to the center of
the flag
</p>
<textarea class="textarea_html">
<flag-us clip="heart"></flag-us>
<flag-us clip="heart" filter="light"></flag-us>
<flag-us></flag-us>
<flag-us filter="light"></flag-us>
<flag-us filter='light:{"spot":"royalblue","x":160,"y":120}'></flag-us>
</textarea>
<div class="horizontalFlags_5 clipexamples">
<flag-gb clip="heart" box="center"></flag-gb>
<flag-gb clip="heart" box="center" filter="light"></flag-gb>
<flag-us></flag-us>
<flag-us filter="light"></flag-us>
<flag-us filter='light:{"spot":"royalblue","x":160,"y":120}'></flag-us>
</div>
<p class="section_text">
The FlagMeister <span class="highlightText">light</span> function takes
optional parameters as a JSON-formatted string in the filter attribute:
</p>
<textarea class="textarea_html">
light: ({
"color1":"#ddd" , "color2":"#333" , "offset":4, "blur":4
, "x":320 , "y":240 , "z":70 , "spot":"transparent" , "focus":15
}) => { ... }
</textarea>
<p class="section_text">
<span class="highlightText">or</span>, after deep-learning SVG filters,
paste any
<span class="highlightText">valid SVG filter definition</span> in the
filter attribute.
</p>
</section>
<section id="CSSproperties">
<h2>CSS custom properties/variables can style multiple flags</h2>
<p class="section_text"></p>
<textarea class="textarea_html">
<style>
.rating {
--flagmeisterclip: heart;
--flagmeisterbox: center;
--flagmeisterfilter: light;
}
.rating [is*="flag"]:not([selected]) {
--flagmeisterfilter: none;
filter: grayscale();
}
</style>
<div class=rating>
<flag-lgbt selected></flag-lgbt>
<flag-lgbt selected></flag-lgbt>
<flag-lgbt selected></flag-lgbt>
<flag-lgbt></flag-lgbt>
<flag-lgbt></flag-lgbt>
</div>
</textarea>
<style>
.rating {
--flagmeisterclip: heart;
--flagmeisterbox: center;
--flagmeisterfilter: light;
--color1: hotpink;
}
.rating [is*="flag"]:not([selected]) {
--flagmeisterfilter: none;
filter: grayscale();
}
</style>
<div id="FlagMeisterRating" class="horizontalFlags_5 clipexamples rating">
<flag-lgbt selected></flag-lgbt>
<flag-lgbt selected></flag-lgbt>
<flag-lgbt selected></flag-lgbt>
<flag-lgbt></flag-lgbt>
<flag-lgbt></flag-lgbt>
</div>
<script>
// in this example the light filter is not applied/reset on mouseover, add a x.load() event to redraw the image
FlagMeisterRating.onmouseover = (evt) => {
let elements = [...FlagMeisterRating.children];
elements.map((x, i) =>
x[
(i > elements.indexOf(evt.path[0].closest('[is*="flag"]'))
? "remove"
: "set") + "Attribute"
]("selected", "true")
);
};
</script>
<p class="section_text">
FlagMeister flags redraw on
<span class="highlightText">attributes changes</span>
(observedAttributes):
<span class="highlightText">draw , clip , box , filter</span>
<br />
<br />
Flags are <span class="highlightText">not updated</span> when CSS
variables change!
<br />
When you hover (onmouseover) the 4th and 5th heart, the
<span class="highlightText">--flagmeisterfilter</span> is
<span class="highlightText">not</span> applied!
<br />
Use the flag.load() method to redraw a flag OR trigger an attribute
change.
</p>
</section>
<section id="CreateBanner">
<div>
<style>
#FlagMeisterCreateBanner {
/* do not load details!! */
--flagmeisterdetail: 9999;
--flagmeisterletterheight: 100px;
min-height: var(--flagmeisterletterheight);
}
</style>
<br />
<div id="FlagMeisterCreateBanner">
<flagmeister-text id="bannertext" iso="ba,bi,kr,ax,gb,us,is,tr,nl,zw,ki" word="FlagMeister">
</flagmeister-text>
</div>
</div>
<h1>
You can now <span class="highlightText">re-create</span> the banner:
</h1>
<ul class="section_text">
<li>
Word: <input name="custombannertext" value="FlagMeister" />
<span style="font-size: 0.8em"><span class="highlightText">yes!</span> this is a live INPUT field
(use a _ underscore for spaces)</span>
</li>
<li>an flag image for every letter</li>
<li>Clipped with a SVG text-character</li>
<li>FlagMeister Light filter</li>
<li>CSS highlighting and drop shadow</li>
</ul>
<h2>
But that is <span class="highlightText">too much work...</span>
<br /><br />
... the FlagMeister <span class="highlightText">added 361 BYTES!</span>
<br /><br />
<span class="highlightText">... Now...</span> you create the banner with
a <span class="highlightText"> Autonomous Custom Element</span>:
</h2>
<textarea class="textarea_html">
<flagmeister-text word="FlagMeister" iso="ba,bi,kr,ax,gb,us,is,tr,nl,zw,ki"></flagmeister-text>
</textarea>
<p class="section_text">
<span class="highlightText"> flagmeister-text </span> creates all child
DOM elements.<br />There is no shadowDOM so you can customize all
elements with
<span class="highlightText">CSS specificity</span>
</p>
</section>
<section id="DetailFlags">
<flagmeister-text iso="ba,gb,kr,ax,gb,us,is,tr,nl,zw,ki" word="Flag_Details">
</flagmeister-text>
<p>