-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1946 lines (1909 loc) · 97 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"
class="scale-content smooth-scroll"
style="--scale-content-desktop: 1600"
>
<head>
<style>
@font-face {
font-family: "voltaire";
font-style: normal;
src: url("https://jens-wittmann.de/voltaire.woff2")
format("woff2");
font-display: swap;
}
</style>
<link rel="stylesheet" href="styleguide/css/style.css" />
<link rel="stylesheet" href="styleguide/css/print.css" media="print" />
<meta charset="utf-8" />
<title>
CurlyFramework for accessibility & sustainability, not only for
MODX.
</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/>
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta
name="description"
content="Framework for accessibility & sustainability, not only for MODX. Based on Tachyons, powered by Alpine.js and flavoured with lessons learned."
/>
<meta property="og:image" content="favicon.svg" />
<style>
.page.lightmode {
background-color: #fff;
--violet-5: #351788;
--violet-10: #eccefa;
--cooking-outline-color: black;
}
.page.darkmode {
background-color: var(--gray-1);
--violet-5: #fff;
--violet-10: var(--gray-3);
--cooking-outline-color: var(--gray-4);
}
@media print {
.page.darkmode {
background-color: #fff;
--violet-5: #351788;
--violet-10: #eccefa;
--cooking-outline-color: black;
}
}
</style>
</head>
<body
x-data="{
showgrid: false,
darkmode: $persist(false),
userThemeModeSet: $persist(false),
init() {
if (this.userThemeModeSet) {
return;
}
let darkmodeQuery = window.matchMedia('(prefers-color-scheme: dark)');
this.darkmode = darkmodeQuery.matches;
darkmodeQuery.addEventListener('change', (e) => {
this.darkmode = e.matches;
});
}
}"
:class="{
'lightmode': !darkmode,
'darkmode': darkmode
}"
class="curlyframework page reset-spacing dg cols-12 g3 f2 violet-5 p4 p6-m"
style="--fontname: 'voltaire', serif"
>
<!-- skiplinks -->
<ul class="skiplinks">
<li><a href="#info">general info</a></li>
<li><a href="#tips">tips</a></li>
<li><a href="#samples">samples</a></li>
<li><a href="#installation">installation</a></li>
<li><a href="#contact">contact</a></li>
</ul>
<div
x-data="{
zoomlevel: 1,
checkZoom() {
this.zoomlevel = window.outerWidth / window.innerWidth;
if (this.zoomlevel < 0.1 || this.zoomlevel >= 2) {
this.zoomlevel = 1;
}
}
}"
x-init="
$nextTick(() => checkZoom());
$watch('zoomlevel', (zoomlevel) => {
document.documentElement.style.setProperty('--zoomlevel', zoomlevel);
})
"
@resize.window="checkZoom()"
></div>
<main class="dc">
<section id="info" class="dc">
<span class="cooking start-1 end-4 end-2-m relative">
<div class="cooking__pot icon">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 275 275"
>
<path
fill="#FFF"
d="M191.461 64.596L153.231 30H115L77.246 65.287H59.998l21.417 19.647"
/>
<path
fill="none"
stroke-width="7.857"
d="M191.461 64.596L153.231 30H115L77.246 65.287H59.998l21.417 19.647"
class="cooking__outline"
/>
<path
fill="#4A4794"
d="M93.766 157.69L77.508 264.96h112.765l-16.63-107.27z"
/>
<defs>
<path
id="a"
d="M93.769 157.69L77.505 264.96H190.27l-16.625-107.27z"
/>
</defs>
<clipPath id="b">
<use xlink:href="#a" overflow="visible" />
</clipPath>
<path
clip-path="url(#b)"
fill="none"
stroke-width="7.857"
d="M120.491 158.431l-9.203 107.27"
class="cooking__outline"
/>
<path
fill="#8D9FCC"
d="M146.031 160.065l8.579 104.898h17.877l17.73-.367-16.337-105.39z"
/>
<defs>
<path
id="c"
d="M93.769 157.69L77.505 264.96H190.27l-16.625-107.27z"
/>
</defs>
<clipPath id="d">
<use xlink:href="#c" overflow="visible" />
</clipPath>
<path
clip-path="url(#d)"
fill="none"
stroke-width="7.857"
d="M146.548 158.431l9.203 107.27"
class="cooking__outline"
/>
<path
fill="none"
stroke-width="7.857"
d="M93.766 157.689h79.877l16.63 107.27H77.508z"
class="cooking__outline"
/>
<path
fill="#4A4794"
d="M93.928 137.253h79.551l16.562-71.968H77.738z"
/>
<defs>
<path
id="e"
d="M77.736 65.285l16.19 71.967h79.557l16.556-71.967z"
/>
</defs>
<clipPath id="f">
<use xlink:href="#e" overflow="visible" />
</clipPath>
<path
clip-path="url(#f)"
fill="none"
stroke-width="7.857"
d="M120.131 172.312l-9.202-107.27"
class="cooking__outline"
/>
<path
fill="#8D9FCC"
d="M155.53 67.416l-6.605 69.836h24.476l1.734-7.192 14.734-64.027z"
/>
<defs>
<path
id="g"
d="M77.736 65.285l16.19 71.967h79.557l16.556-71.967z"
/>
</defs>
<clipPath id="h">
<use xlink:href="#g" overflow="visible" />
</clipPath>
<path
clip-path="url(#h)"
fill="none"
stroke-width="7.857"
d="M146.188 172.312l9.203-107.27"
class="cooking__outline"
/>
<path
fill="none"
stroke-width="7.857"
d="M93.928 137.253h79.551l16.562-71.968H77.738zM101.784 138.09v20.711M164.015 138.09v20.711"
class="cooking__outline"
/>
<g
fill="none"
stroke-width="7.857"
class="cooking__outline"
>
<path
d="M187.644 82.179h11.816v38.838c0 2.53 3.551 5.322 7.925 5.322s7.925-2.792 7.899-5.243c-.021.084-.021-54.939-.021-54.939h-25.11"
/>
<ellipse
cx="134.003"
cy="12.927"
rx="7.925"
ry="5.473"
/>
</g>
<path
fill="none"
stroke-width="7.857"
d="M126.133 14.041l1.98 15.341M141.725 14.041l-1.98 15.341"
class="cooking__outline"
/>
</svg>
</div>
<span class="cooking__steam"></span>
<style>
.cooking__outline {
stroke: var(--cooking-outline-color, black);
}
.cooking__steam {
position: absolute;
top: 0;
left: 15%;
display: block;
width: 10%;
background-color: #bbb;
border-radius: 50%;
filter: blur(5px);
transform: translateY(0) scaleX(1);
opacity: 0;
aspect-ratio: 1/2;
animation: cooking 3s infinite;
}
@keyframes cooking {
0% {
transform: translateY(0) scaleX(1);
opacity: 0;
}
25% {
opacity: 1;
}
50% {
transform: translateY(-1rem) scaleX(2);
}
90% {
opacity: 0;
}
100% {
transform: translateY(-2rem) scaleX(1);
}
}
</style>
</span>
<div class="dc">
<h1
class="start-4 end-last end-6-m f1 f4-m lh-title tr tl-m m0"
>
CurlyFramework
</h1>
<button
@click="darkmode = !darkmode; userThemeModeSet = true"
:aria-pressed="darkmode"
class="btn btn--clean fixed right-0 bottom-0 f4 m3"
>
<span class="clip">
Darkmode
<span x-text="darkmode ? 'off' : 'on'"></span>
</span>
<span x-show="darkmode" class="icon icon-font">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 256 256"
>
<path fill="none" d="M0 0h256v256H0z" />
<path
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="16"
d="M128 40v-8"
/>
<circle
cx="128"
cy="128"
r="56"
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="16"
/>
<path
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="16"
d="m64 64-8-8M64 192l-8 8M192 64l8-8M192 192l8 8M40 128h-8M128 216v8M216 128h8"
/>
</svg>
</span>
<span x-show="!darkmode" class="icon icon-font">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 256 256"
>
<path fill="none" d="M0 0h256v256H0z" />
<path
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="16"
d="M108.11 28.11a96.09 96.09 0 0 0 119.78 119.78A96 96 0 1 1 108.11 28.11Z"
/>
</svg>
</span>
</button>
<p
class="start-1 start-4-m end-last db f3 f5-m lh-title mt3 mb4"
>
Tiny Framework for accessibility and sustainability, not
only for
<a href="https://modx.com" class="bb"> MODX</a>. Based
on
<a
href="https://github.com/jenswittmann/tachyons"
class="bb"
>Tachyons</a
>, powered by
<a href="http://alpinejs.dev" class="bb">Alpine.js</a>
and flavoured with lessons learned over the years.
</p>
</div>
<div class="start-1 end-3">
<a href="#tips" class="f3 nowrap ph3 pv1 ba br-100">
Docs <span aria-hidden="true">⇣</span>
</a>
</div>
<div class="start-6 start-9-m end-11">
<a
href="https://github.com/jenswittmann/CurlyFramework"
rel="noreferrer"
class="f3 nowrap ph3 pv1 ba br-100"
>
Github <span aria-hidden="true">⇢</span>
</a>
</div>
</section>
<section class="dc">
<div id="tips" class="col-full mt6"></div>
<h2 class="start-1 end-10 end-5-m f2 f4-m lh-title m0">
Better accessibility and sustainability in web development?
</h2>
<div class="start-1 start-6-m end-last f1 f2-m">
<p class="m0">
It doesn't have to be a complete overhaul, small steps
can help you get there. I recommend Michelle Barker's
talk "<a
href="https://css-irl.info/video-building-a-greener-web/"
rel="noreferrer"
class="bb"
>Building a greener web</a
>" at "All Day Hey! 2023". Here are some tips:
</p>
<ul style="list-style-type: '⇢ '">
<li>Use WebP and native lazyload (images, embeds).</li>
<li>
Use fewer fonts and try to use variable fonts
(.woff2).
</li>
<li>Load embeds only on user interaction.</li>
<li>Test keyboard navigation.</li>
<li>Test reduced-motion.</li>
<li>
Find a community to test and discuss accessibility
and sustainability with real people.
</li>
</ul>
</div>
</section>
<section class="dc">
<div id="tools" class="col-full mt6"></div>
<h2 class="start-1 start-4-m end-last f5">Tools</h2>
<article aria-label="Sa11y" class="dc">
<div id="tools__sa11y" class="start-1 end-last end-4-m">
<h3 class="sticky top-0 f4 lh-title m0">Sa11y</h3>
</div>
<div
class="start-1 start-4-m end-last flex flex-column justify-center items-center p4 bg-violet-10 br4 aspect-ratio-16x9"
>
<div
x-data="{
sa11y: null,
loadCSS() {
return new Promise((resolve, reject) => {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://cdn.jsdelivr.net/gh/ryersondmp/[email protected]/dist/css/sa11y.min.css';
link.onload = resolve;
link.onerror = reject;
document.head.appendChild(link);
});
},
loadJS() {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/combine/gh/ryersondmp/[email protected]/dist/js/lang/en.umd.js,gh/ryersondmp/[email protected]/dist/js/sa11y.umd.min.js';
script.onload = resolve;
script.onerror = reject;
document.body.appendChild(script);
});
},
initSa11y() {
this.loadCSS()
.then(this.loadJS)
.then(() => {
Sa11y.Lang.addI18n(Sa11yLangEn.strings);
this.sa11y = new Sa11y.Sa11y({
checkRoot: 'body',
});
})
.catch((error) => new Error('Error loading Sa11y:', error));
}
}"
class="w-60-m"
>
<p class="mt3 mb0">
Sa11y.js visually highlights content issues at
the source with a simple tooltip on how to fix
them:
</p>
<button
@click="initSa11y()"
:aria-pressed="sa11y"
:disabled="sa11y"
class="pointer flex items-center g3 p0 mt2 bg-transparent bn"
>
<span
:class="{
'pl5 o-50': sa11y,
'pr5': !sa11y
}"
class="db h2 ba br-100 transition-small"
>
<span
class="db h-100 bg-white ba br-100 aspect-ratio-1x1"
></span>
</span>
<span class="nowrap">show Sa11y.js</span>
</button>
</div>
</div>
</article>
<article aria-label="Checklist" class="dc">
<div class="start-1 end-last end-4-m">
<h3
id="tools__checklist"
class="sticky top-0 f4 lh-title m0"
>
Checklist
</h3>
</div>
<div
class="start-1 start-4-m end-last flex flex-column justify-center items-center p4 pv5-m bg-violet-10 br4 aspect-ratio-16x9"
>
<div
x-data="{
checksdone: $persist([]),
checkitems: [
{
id: 'wireframe',
task: 'Have a coffee with the designer and check the wireframe for any accessibility issues.'
},
{
id: 'design',
task: 'Test the design for common contrast issues, long animations or some complicated navigation structures.'
},
{
id: 'sa11y',
task: 'Use <a href=#tools__sa11y class=bb>Sa11y.js</a> during development. <a href=https://visbug.web.app/ class=bb>VisBug</a> can also be useful for debugging colour ratios and so on.'
},
{
id: 'web.dev',
task: 'Measure your pages with <a href=https://pagespeed.web.dev/analysis/https-curlyframe-work/79r5iuaoc3?form_factor=mobile class=bb>PageSpeed Insights</a>'
},
{
id: 'wave',
task: 'Check accessibility with <a href=https://wave.webaim.org/report#/https://curlyframe.work/ class=bb>WAVE</a>'
},
{
id: 'tabs',
task: 'Use the Tab key to navigate through your site. Do you know where your focus is? Are there any keyboard traps? Are modals escapable with the ESC key?'
},
{
id: 'skiplinks',
task: 'Check your skiplinks and landmarks.'
},
{
id: 'zoom',
task: 'Check that your page is zoomable.'
},
{
id: 'color',
task: 'Check your page without colours using <a href=#tools__sa11y class=bb>Sa11y.js</a> and in <a href=https://chromewebstore.google.com/detail/hoher-kontrast/djcfdncoelnlbldjfhinnjlhdjlikmph?pli=1 class=bb>dark mode</a>.'
},
{
id: 'screenreader',
task: 'Test your page with a screen reader like VoiceOver. Dim your monitor. Is everything accessible and would changes be announced?'
},
{
id: 'print',
task: 'Check that your site has a good and sustainable <button @click=window.print() class=\'btn btn--clean\'><span class=bb>print</span></button> style.'
},
{
id: 'naked',
task: 'View your site in <button @click=\'document.styleSheets.item(1).disabled=!document.styleSheets.item(1).disabled\' class=\'btn btn--clean\'><span class=bb>plain</span></button> HTML without CSS.'
},
{
id: 'sustainability',
task: 'Check sustainability with <a href=https://www.websitecarbon.com/website/curlyframe-work/ class=bb>Website Carbon Calculator</a>.'
},
{
id: 'seo',
task: 'Do a classic SEO <a href=https://freetools.seobility.net/de/seocheck/check?url=https%3A%2F%2Fcurlyframe.work%2F&crawltype=1 class=bb>check</a>.'
},
{
id: 'metatags',
task: 'Check that your <a href=https://metatags.io/?url=https%3A%2F%2Fcurlyframe.work%2F class=bb>meta tags</a> are ready.'
},
{
id: 'page',
task: 'Add a page for accessibility information. Like a contact page, what does not work and helpful <a href=https://toolbox.teilhabe4punkt0.de/tools/overlay-tools-vs-browsereinstellungen class=bb>browser tips</a>/<a href=https://support.google.com/chrome/answer/7040464 class=bb>tools</a>. Maybe there is an option to add .grayscale-100 to the body element to disable colour complety for the site?'
}
]
}"
class="w-90"
>
<p>
Here are some checks for a good website
development workflow.
</p>
<ul class="mv4">
<template x-for="check in checkitems">
<div class="form__item">
<div
x-id="['check']"
class="form__field form__field--checkbox"
>
<input
@change="
if (checksdone.includes(check.id)) {
checksdone.splice(checksdone.indexOf(check.id), 1);
return;
}
checksdone.push(check.id)
"
:id="$id('check')"
:name="$id('check')"
:checked="checksdone.includes(check.id)"
type="checkbox"
value="done"
required
/>
<label
:for="$id('check')"
class="form__label"
>
<span x-html="check.task">
</span>
</label>
</div>
</div>
</template>
</ul>
<p>
Go deeper with the BITV/WCAG 2.2
<a href="https://studio.bitvtest.de/" class="bb"
>Toolbox</a
>
or get in touch with
<a href="#contact" class="bb">me</a>.
</p>
</div>
</div>
</article>
<article aria-label="Image Alt Generator" class="dc">
<div class="start-1 end-last end-4-m">
<h3
id="tools__imagealtgenerator"
class="sticky top-0 f4 lh-title m0"
>
Image Alt Generator
</h3>
</div>
<div
class="start-1 start-4-m end-last flex flex-column justify-center items-center p4 pv5-m bg-violet-10 br4 aspect-ratio-16x9"
>
<div
x-data="{
apiKey: $persist(''),
image: '',
caption: '',
generate() {
if (!this.apiKey) {
alert('Please enter an API key. You can get a free one at platform.openai.com.');
return;
}
this.caption = '';
const file = this.$refs.imageFile.files[0],
reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => {
this.image = reader.result;
this.askAI();
};
},
askAI() {
fetch('https://api.openai.com/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${this.apiKey}`
},
body: JSON.stringify({
model: 'gpt-4o-mini',
messages: [
{
role: 'user',
content: [
{
'type': 'text',
'text': 'Write a very short german image description with max 100 characters for screenreader.'
},
{
'type': 'image_url',
'image_url': {
'url': this.image,
},
}
]
}
]
})
})
.then((response) => response.json())
.then((response) => {
this.caption = response.choices[0].message.content;
});
}
}"
class="w-70-m"
>
<p class="mb2">
Upload an image to get an image description from
ChatGPT. Note that the AI uses a lot of
resources and uses your image for training. So
use it responsibly!
</p>
<div class="mv2">
<button
@click="apiKey = apiKey ? '' : prompt('Enter your OpenAI API Key:')"
class="btn btn--clean f1"
>
<span x-show="!apiKey" class="bb">
Set API Key
</span>
<span x-show="apiKey" class="bb">
remove API Key
</span>
</button>
</div>
<form
x-show="apiKey"
@submit.prevent="generate(); $refs.imagealtgeneratorresult.focus()"
class="form"
>
<div class="form__item p4 ba br3">
<label for="image" class="form__label"
>Image</label
>
<input
x-ref="imageFile"
type="file"
name="image"
id="image"
class="form__field form__field--upload"
/>
</div>
<div class="mv4">
<button
type="submit"
class="pointer db p2 mt4 ml-auto mr-auto bg-transparent ba b--inherit br-100"
>
Generate
</button>
</div>
<figure
x-ref="imagealtgeneratorresult"
x-show="image"
tabindex="0"
class="p4 ba br3"
>
<img
:src="image"
width="10"
height="10"
alt="your uploaded image"
class="overflow-hidden db flex-auto-1-0 w-50 h-inherit br3 aspect-ratio-1x1 img-cover"
/>
<figcaption
x-text="caption == '' ? 'Generating …' : caption"
aria-atomic="true"
aria-live="polite"
role="status"
class="f1 mt3"
></figcaption>
</figure>
</form>
</div>
</div>
</article>
</section>
<section class="dc">
<div id="samples" class="col-full mt6"></div>
<h2 class="start-1 start-4-m end-last f5">Samples</h2>
<article aria-label="Sample Modal" class="dc">
<div class="start-1 end-last end-4-m">
<h3 class="sticky top-0 f4 lh-title m0">Modal</h3>
</div>
<div
class="start-1 start-4-m end-last flex flex-column justify-center items-center p4 bg-violet-10 br4 aspect-ratio-16x9"
>
<div
x-data="{
open: false
}"
class="dc"
>
<button
@click="open = true"
:aria-expanded="open"
aria-controls="popup"
class="btn pointer p0 bg-transparent bn bb"
>
<span class="bb"
>open
<span aria-hidden="true">⇢</span></span
>
</button>
<div
x-cloak
x-transition
x-show="open"
@click="open = false"
class="fixed top-0 left-0 right-0 bottom-0 bg-blur"
></div>
<div
x-cloak
x-transition
x-trap.inert.noscroll="open"
x-show="open"
@keyup.escape.window="open = false"
id="popup"
aria-modal="true"
role="dialog"
class="fixed top-0 right-0 bottom-0 z-max w-80 w-third-m white p3 p5-m bg-violet-1"
>
<p>
The script also takes care of the focus so
that it stays in the modal. Here is a
<a
href="https://jens-wittmann.de"
rel="noreferrer"
>example link</a
>
to the test. You can also close it with the
Escape key.
</p>
<button
@click="open = false"
class="btn pointer p0 bg-transparent bn bb"
>
<span class="bb"
>close
<span aria-hidden="true">×</span></span
>
</button>
</div>
</div>
</div>
</article>
<article aria-label="Sample Modal [popover]" class="dc">
<div class="start-1 end-last end-4-m">
<h3 class="sticky top-0 f4 lh-title m0">
Modal <sup class="f1">[popover]</sup>
</h3>
</div>
<div
class="start-1 start-4-m end-last flex flex-column justify-center items-center p4 bg-violet-10 br4 aspect-ratio-16x9"
>
<div
x-data="{
open: false
}"
class="dc"
>
<button
popovertarget="popup2"
class="btn pointer p0 bg-transparent bn bb"
>
<span class="bb"
>open
<span aria-hidden="true">⇢</span></span
>
</button>
<div
x-trap.inert.noscroll="open"
@toggle="open = $event.newState == 'open'"
id="popup2"
aria-modal="true"
class="w-100 h-100 bg-transparent bn"
popover
>
<button
tabindex="-1"
popovertarget="popup2"
popovertargetaction="hide"
class="fixed top-0 left-0 right-0 bottom-0 bg-transparent bg-blur bn"
></button>
<div
class="fixed top-0 right-0 bottom-0 z-max w-80 w-third-m white p3 p5-m bg-violet-1"
>
<p>
The script also takes care of the focus
so that it stays in the modal. Here is a
<a
href="https://jens-wittmann.de"
rel="noreferrer"
>example link</a
>
to the test. You can also close it with
the Escape key.
</p>
<button
popovertarget="popup2"
popovertargetaction="hide"
class="btn pointer p0 bg-transparent bn bb"
>
<span class="bb"
>close
<span aria-hidden="true"
>×</span
></span
>
</button>
</div>
</div>
</div>
</div>
</article>
<article aria-label="Sample Accordion" class="dc">
<div class="start-1 end-last end-4-m">
<h3 class="sticky top-0 f4 lh-title m0">Accordion</h3>
</div>
<div
class="start-1 start-4-m end-last flex flex-column justify-center items-center p4 bg-violet-10 br4 aspect-ratio-16x9"
>
<template x-for="i in 3">
<div
x-data="{
open: false
}"
x-id="['accordion']"
:class="{
'br4 br--top': i == 1,
'br4 br--bottom': i == 3
}"
class="w-100 w-50-m mb1 ba"
>
<button
@click="open = !open"
:aria-expanded="open"
:aria-controls="$id('accordion')"
class="pointer flex justify-between w-100 p2 bg-transparent bn"
>
<span
>Accordion <span x-text="i"></span
></span>
<span
:class="{
'rotate-180': open
}"
aria-hidden="true"
class="transition-small"
>⇣</span
>
</button>
<p
x-cloak
x-collapse
x-show="open"
:id="$id('accordion')"
class="p2 m0 bt"
>
Simple Answer for the Accordion.
</p>
</div>
</template>
</div>
</article>
<article
aria-label="Sample Accordion <details>"
class="dc"
>
<div class="start-1 end-last end-4-m">
<h3 class="sticky top-0 f4 lh-title m0">
Accordion
<sup class="f1"><details></sup>
</h3>
</div>
<div
class="start-1 start-4-m end-last flex flex-column justify-center items-center p4 bg-violet-10 br4 aspect-ratio-16x9"
>
<template x-for="i in 3">
<details
x-data="{
open: false
}"
@toggle="open = $el.open"
:class="{
'br4 br--top': i == 1,
'br4 br--bottom': i == 3
}"
name="accordions"
class="w-100 w-50-m mb1 ba"
>
<summary
class="pointer flex justify-between w-100 p2 bg-transparent bn"
>
<span
>Accordion <span x-text="i"></span
></span>
<span
:class="{
'rotate-180': open
}"
aria-hidden="true"
class="transition-small"
>⇣</span
>
</summary>
<p x-collapse x-show="open" class="p2 m0 bt">
Simple Answer for the Accordion.
</p>
</details>
</template>
</div>