-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1112 lines (953 loc) · 40.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="fr">
<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" />
<title>Ateliernum</title>
<!-- start of favicon and its fallbacks -->
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/assets/favicons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/assets/favicons/favicon-16x16.png"
/>
<link rel="manifest" href="/assets/favicons/site.webmanifest" />
<link
rel="mask-icon"
href="/assets/favicons/safari-pinned-tab.svg"
color="#5bbad5"
/>
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<!-- end of favicon and its fallbacks -->
<link rel="stylesheet" href="sizes.css" />
<link rel="stylesheet" href="global.css" />
<link rel="stylesheet" href="theming.css" />
<style id="css-composables">
.fake {
background-color: #1a1a1a;
border-radius: var(--size-13);
}
.fake-title {
height: var(--size-6);
margin-bottom: var(--size-3);
width: 50%;
max-width: calc(var(--reading-length) * 0.5);
}
.fake-text {
height: var(--size-4);
margin: var(--size-5) 0;
max-width: 70%;
max-width: calc(var(--reading-length) * 0.7);
}
</style>
<style id="elements-styling">
nav {
z-index: 200;
}
#search-bar {
grid-area: search;
position: sticky;
top: 0;
background-color: var(--background-color);
padding: var(--size-5);
display: flex;
align-items: center;
width: 100%;
}
#search-field {
width: var(--size-12);
padding: var(--size-4) var(--size-2);
border-radius: var(--size-4);
color: var(--text-color);
display: flex;
align-items: center;
}
#search-field > svg {
height: var(--size-5);
width: var(--size-5);
margin: 0 var(--size-3);
}
#search-field input {
flex: 1;
}
main {
display: flex;
flex-direction: column;
justify-self: center;
min-height: 100vh; /*prevents it from being 0px high when no content is loaded*/
padding-bottom: var(--size-10);
}
main > * {
margin: var(--size-7) 0;
}
aside {
display: flex;
justify-content: end;
align-items: start;
padding: var(--size-7);
grid-area: aside;
}
#aside-content {
position: sticky;
top: var(--size-10);
padding: var(--size-7) 0;
display: flex;
flex-direction: column;
border-radius: var(--size-4);
}
#aside-content[open]::backdrop {
background: rgba(255, 0, 0, 0.25);
/* TODO use this to do the screen fade like the youtube side menu on expand */
/* https://developer.mozilla.org/en-US/docs/Web/CSS/::backdrop */
}
#aside-content > *:not(:last-child),
footer > *:not(:last-child) {
margin-bottom: var(--size-4);
}
#language-filters,
#category-filters {
margin: 0 var(--size-6);
}
.legal-disclaimer {
text-align: center;
}
.legal-disclaimer:hover {
color: var(--color-highlight);
text-decoration: underline;
}
#main-end {
/* needs to be bigger than search in order to trigger the intersection observer on firefox android */
height: var(--size-10);
}
.socials {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
}
.socials > * {
height: var(--size-5);
width: var(--size-5);
}
.socials > *:hover {
color: var(--color-highlight);
}
article {
display: flex;
height: 30vmin;
min-height: var(--size-11);
border-radius: var(--size-4) 0 0 var(--size-4);
}
article h2 {
margin-top: 0;
}
article .authors {
font-weight: 700;
margin-top: 0;
}
.resource-type {
width: var(--size-2);
height: 100%;
background-color: #25bffd;
}
input[type="checkbox"][data-language] {
accent-color: #25bffd;
}
.resource-type[data-type="course"],
#category-filters input[type="checkbox"][data-type="course"] {
background-color: #ff1460;
accent-color: #ff1460;
}
.resource-type[data-type="resource"],
#category-filters input[type="checkbox"][data-type="resource"] {
background-color: #06fdaf;
accent-color: #06fdaf;
}
.resource-type[data-type="template"],
#category-filters input[type="checkbox"][data-type="template"] {
background-color: #fce44b;
accent-color: #fce44b;
}
.resource-type[data-type="project"],
#category-filters input[type="checkbox"][data-type="project"] {
background-color: #ae23db;
accent-color: #ae23db;
}
.resource-type.inactive {
background-color: transparent;
}
article > .loader-content {
width: 30vw;
}
article > .article-content,
article > .loader-content {
flex: 1;
padding: 0 var(--size-5);
}
article > a.article-hero,
article > .loader-hero {
height: 100%;
aspect-ratio: 1/1;
/* background-color: #1a1a1a; */
background-color: #1a1a1a;
}
article > a.article-hero > img {
height: 100%;
width: 100%;
object-fit: cover;
}
#mobile-menu {
position: fixed;
right: 0;
top: 0;
height: 100vh;
display: flex;
flex-direction: row-reverse;
z-index: 300;
}
#mobile-menu-content {
width: 33vw;
min-width: 200px;
height: 100vh;
display: flex;
flex-direction: column;
}
#mobile-filters > * {
margin-bottom: var(--size-5);
}
#menu-opener {
position: fixed;
bottom: var(--size-6);
right: var(--size-6);
z-index: 300;
}
#mobile-filters li {
height: var(--size-8);
display: flex;
align-items: center;
margin-bottom: var(--size-1);
}
#mobile-filters li:hover {
background-color: var(--background-color);
}
#mobile-filters li > *:nth-child(2) {
flex: 1;
padding: var(--size-2);
}
/* layouts */
/* phone portrait */
/*additive*/
@media screen and (min-width: 0px) {
}
/* xs phones only */
@media screen and (min-width: 0px) and (max-width: 430px) {
#search-bar > span.flex-spacer:nth-child(1) {
display: none;
}
}
/*exclusive*/
@media screen and (min-width: 0px) and (max-width: 768px) {
body {
display: grid;
/* prettier-ignore */
grid: "aside " auto
"main " auto
"search " auto
/ auto ;
}
#search-bar {
position: fixed;
top: unset;
bottom: 0;
}
aside {
display: none;
}
header {
display: none;
}
#mobile-menu-content > header {
display: block;
padding-inline: 0; /* TODO better separation between desktop/mobile stuff*/
text-align: center;
}
aside > #aside-content {
flex-direction: row;
justify-content: space-between;
width: 100%;
}
article {
position: relative;
}
article > a.article-hero {
position: absolute;
top: 0;
left: 0;
}
article > .article-content > * {
position: relative;
z-index: 100;
}
article > .article-content > :not(a) {
pointer-events: none;
}
article img {
filter: brightness(0.5);
}
article > a.article-hero {
transform: translate(var(--size-2), 0);
}
}
/* phone landscape */
@media screen and (min-width: 640px) {
}
/* tablet portrait */
@media (min-width: 768px) {
body {
display: grid;
/* prettier-ignore */
grid: "header header" auto
"search search" auto
"aside main" auto
/ max-content 1fr;
}
#mobile-menu,
#menu-opener {
display: none;
}
}
/* tablet landscape */
@media (min-width: 1024px) {
}
/* computer */
@media (min-width: 1280px) {
body {
display: grid;
/* prettier-ignore */
grid: "header header header" auto
"search search search" auto
"aside main gutter" auto
/minmax(max-content, 1fr) minmax(var(--reading-length),auto) 1fr;
}
article > .article-content {
max-width: var(--reading-length);
}
}
/* a11y stuff */
@media (prefers-reduced-motion) {
body {
scroll-behavior: unset;
}
}
</style>
<script>
// this script tag is for anything to execute before rendering the page
// like sending a request for the updated database (but not waiting for it to arrive)
let db = {};
let dbLoaded = false;
const futureDB = new Promise(async (resolve, reject) => {
// fetch("/db/db.json")
const githubResponse = await fetch(
"https://raw.githubusercontent.com/AtelierNum/AtelierNum.github.ioDB/main/db.json"
);
const pagesResponse = await fetch(
"https://ateliernum-templates.pages.dev/state.json"
);
const coursesAndResAndProjects = await githubResponse.json();
const templates = Object.values(await pagesResponse.json());
templates.forEach((t) => (t.type = "template"));
db = coursesAndResAndProjects.concat(templates);
dbLoaded = true;
resolve(db);
});
</script>
</head>
<body>
<header class="paper2">
<a href="/">
<img src="/assets/images/logo_ateliernum.png" alt="" />
<h1>Ateliernum</h1>
</a>
<!-- <nav>
<ul>
<li><a href="/">Accueil</a></li>
<li><a href="/quests.html">Missions</a></li>
</ul>
</nav> -->
</header>
<nav id="search-bar">
<span class="flex-spacer"></span>
<div id="search-field" class="paper2">
<!-- prettier-ignore -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-0.25 -0.25 14.5 14.5" height="48" width="48" stroke-width="1.5"><g><circle cx="5.92" cy="5.92" r="5.42" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></circle><line x1="13.5" y1="13.5" x2="9.75" y2="9.75" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line></g></svg>
<input
id="search-input"
type="search"
placeholder="Your beautiful search query..."
/>
</div>
<span class="flex-spacer"></span>
</nav>
<aside>
<div id="aside-content" class="paper2">
<ul id="language-filters">
<li>
<input type="checkbox" data-language="en" checked />🇬🇧 English
</li>
<li><input type="checkbox" data-language="fr" checked />🇫🇷 French</li>
</ul>
<ul id="category-filters">
<li><input type="checkbox" data-type="course" checked />Courses</li>
<li><input type="checkbox" data-type="resource" />Resources</li>
<li>
<input type="checkbox" data-type="template" checked />Templates
</li>
<li><input type="checkbox" data-type="project" />Projects</li>
</ul>
<footer id="desktop-footer">
<!-- prettier-ignore -->
<ul class="socials">
<li><a href="https://discord.gg/tF6qz8v"><svg class="icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" height="48" width="48"><path fill="currentColor" fill-rule="evenodd" d="M9 3.5C7.17446 3.5 5.79321 3.80807 4.27964 4.55118C4.19318 4.59363 4.12081 4.66015 4.07125 4.74275C3.03206 6.47474 1 11.2959 1 17C1 17.1299 1.05053 17.2546 1.1409 17.3479C2.0917 18.3293 2.95713 19.0512 3.88473 19.5607C4.81779 20.0732 5.79045 20.3581 6.9403 20.4964C7.13603 20.52 7.32732 20.4263 7.42875 20.2572L7.93986 19.4054C7.19582 19.1454 6.43693 18.7996 5.96967 18.3323C5.67678 18.0394 5.67678 17.5646 5.96967 17.2717C6.26256 16.9788 6.73744 16.9788 7.03033 17.2717C7.28511 17.5265 7.88376 17.8166 8.72916 18.0879L8.73018 18.0882L8.73036 18.0879C9.42886 18.271 10.646 18.5 12 18.5C13.354 18.5 14.5711 18.271 15.2696 18.0879L15.2698 18.0882C15.2702 18.0881 15.2705 18.088 15.2708 18.0879C16.1162 17.8166 16.7149 17.5265 16.9697 17.2717C17.2626 16.9788 17.7374 16.9788 18.0303 17.2717C18.3232 17.5646 18.3232 18.0394 18.0303 18.3323C17.5631 18.7996 16.8042 19.1454 16.0601 19.4054L16.5713 20.2572C16.6727 20.4263 16.864 20.52 17.0597 20.4964C18.2096 20.3581 19.1822 20.0732 20.1153 19.5607C21.0429 19.0512 21.9083 18.3293 22.8591 17.3479C22.9495 17.2546 23 17.1299 23 17C23 11.2959 20.9679 6.47474 19.9287 4.74275C19.8792 4.66015 19.8068 4.59363 19.7204 4.55118C18.2068 3.80807 16.8255 3.5 15 3.5C14.7848 3.5 14.5937 3.63772 14.5257 3.84189L14.1895 4.85038C14.1071 4.82376 14.0161 4.79607 13.9172 4.76844C13.4386 4.63474 12.7672 4.5 12 4.5C11.2328 4.5 10.5614 4.63474 10.0828 4.76844C9.98392 4.79607 9.89287 4.82376 9.81051 4.85038L9.47434 3.84189C9.40628 3.63772 9.21522 3.5 9 3.5ZM10 12.75C10 13.7165 9.32843 14.5 8.5 14.5C7.67157 14.5 7 13.7165 7 12.75C7 11.7835 7.67157 11 8.5 11C9.32843 11 10 11.7835 10 12.75ZM15.5 14.5C16.3284 14.5 17 13.7165 17 12.75C17 11.7835 16.3284 11 15.5 11C14.6716 11 14 11.7835 14 12.75C14 13.7165 14.6716 14.5 15.5 14.5Z" clip-rule="evenodd"></path></svg></a></li>
<li><a href="https://www.instagram.com/ateliernum/"><svg class="icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" height="48" width="48"><path fill="currentColor" fill-rule="evenodd" d="M7.5 0.75C3.77208 0.75 0.75 3.77208 0.75 7.5V16.5C0.75 20.2279 3.77208 23.25 7.5 23.25H16.5C20.2279 23.25 23.25 20.2279 23.25 16.5V7.5C23.25 3.77208 20.2279 0.75 16.5 0.75H7.5ZM2.25 7.5C2.25 4.6005 4.60051 2.25 7.5 2.25H16.5C19.3995 2.25 21.75 4.60051 21.75 7.5V16.5C21.75 19.3995 19.3995 21.75 16.5 21.75H7.5C4.6005 21.75 2.25 19.3995 2.25 16.5V7.5ZM19.5 6.25C19.5 6.94036 18.9404 7.5 18.25 7.5C17.5596 7.5 17 6.94036 17 6.25C17 5.55964 17.5596 5 18.25 5C18.9404 5 19.5 5.55964 19.5 6.25ZM12 7.75C9.65279 7.75 7.75 9.65279 7.75 12C7.75 14.3472 9.65279 16.25 12 16.25C14.3472 16.25 16.25 14.3472 16.25 12C16.25 9.65279 14.3472 7.75 12 7.75ZM6.25 12C6.25 8.82436 8.82436 6.25 12 6.25C15.1756 6.25 17.75 8.82436 17.75 12C17.75 15.1756 15.1756 17.75 12 17.75C8.82436 17.75 6.25 15.1756 6.25 12Z" clip-rule="evenodd"></path></svg></a></li>
<li><a href="https://github.com/AtelierNum"><svg class="icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" height="48" width="48"><path fill="currentColor" d="M11.9962 1.28371C9.38562 1.28124 6.85951 2.2085 4.87051 3.8993C2.8815 5.59011 1.55961 7.93395 1.1417 10.5108C0.723797 13.0877 1.23719 15.7292 2.58989 17.9619C3.94259 20.1947 6.04618 21.8728 8.5237 22.6955C9.07204 22.791 9.2459 22.4691 9.2459 22.1787C9.2459 21.9159 9.25163 21.188 9.2459 20.2681C6.18899 20.9311 5.55754 18.8208 5.55754 18.8208C5.356 18.1569 4.92364 17.587 4.3386 17.214C3.34128 16.532 4.41311 16.5453 4.41311 16.5453C4.76132 16.5931 5.09399 16.7199 5.38572 16.9159C5.67744 17.1119 5.9205 17.3721 6.09632 17.6764C6.24505 17.9474 6.44604 18.1862 6.68766 18.3791C6.92928 18.5719 7.20674 18.7149 7.50399 18.7999C7.80123 18.8848 8.11237 18.9099 8.4194 18.8739C8.72642 18.8378 9.02325 18.7412 9.29271 18.5896C9.34339 18.0343 9.59069 17.5153 9.99006 17.1262C7.55122 16.8472 4.98628 15.9053 4.98628 11.6944C4.9708 10.6028 5.37617 9.5471 6.11829 8.74639C5.78201 7.79922 5.82029 6.75935 6.22529 5.83946C6.22529 5.83946 7.14905 5.54428 9.2459 6.9667C11.0468 6.47251 12.9475 6.47251 14.7483 6.9667C16.85 5.54523 17.7661 5.83946 17.7661 5.83946C18.1712 6.75922 18.2102 7.7989 17.875 8.74639C18.6173 9.54761 19.0221 10.6042 19.0051 11.6963C19.0051 15.9187 16.4363 16.8463 13.9889 17.1166C14.2518 17.3807 14.4549 17.6982 14.5846 18.0476C14.7143 18.397 14.7675 18.7701 14.7407 19.1418V22.1834C14.7407 22.4767 14.9184 22.8015 15.4763 22.6955C17.9544 21.8726 20.0584 20.1939 21.4111 17.9603C22.7637 15.7268 23.2766 13.0844 22.8577 10.5071C22.4388 7.92966 21.1155 5.58576 19.1251 3.89557C17.1347 2.20538 14.6074 1.27942 11.9962 1.28371V1.28371Z"></path></svg></a></li>
</ul>
<div class="legal-disclaimer">
<a href="/mentions.html">Mentions légales</a>
</div>
</footer>
</div>
</aside>
<main>
<article class="loader">
<div class="loader-hero"></div>
<div class="loader-content">
<div class="fake fake-title"></div>
<div class="fake fake-text"></div>
<div class="fake fake-text"></div>
<div class="fake fake-text"></div>
</div>
</article>
<article class="loader">
<div class="loader-hero"></div>
<div class="loader-content">
<div class="fake fake-title"></div>
<div class="fake fake-text"></div>
<div class="fake fake-text"></div>
<div class="fake fake-text"></div>
</div>
</article>
<article class="loader">
<div class="loader-hero"></div>
<div class="loader-content">
<div class="fake fake-title"></div>
<div class="fake fake-text"></div>
<div class="fake fake-text"></div>
<div class="fake fake-text"></div>
</div>
</article>
</main>
<span id="desktop-gutter"></span>
<span id="main-end"></span>
<div id="mobile-menu" data-open="false">
<div id="mobile-menu-content" class="paper2">
<header>
<!-- <img src="/assets/images/logo_ateliernum.png" alt="" /> -->
<h1>Ateliernum</h1>
</header>
<div id="mobile-filters">
<ul id="mobile-language-filters">
<li>
<div class="resource-type" data-language="en"></div>
<div>🇬🇧 English</div>
</li>
<li>
<div class="resource-type" data-language="fr"></div>
<div>🇫🇷 French</div>
</li>
</ul>
<ul id="mobile-category-filters">
<li>
<div class="resource-type inactive" data-type="course"></div>
<div>Courses</div>
</li>
<li>
<div class="resource-type" data-type="resource"></div>
<div>Resources</div>
</li>
<li>
<div class="resource-type" data-type="template"></div>
<div>Templates</div>
</li>
<li>
<div class="resource-type" data-type="project"></div>
<div>Projects</div>
</li>
</ul>
</div>
<footer>
<!-- prettier-ignore -->
<ul class="socials">
<li><a href="https://discord.gg/tF6qz8v"><svg style="width: var(--size-5);" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" height="48" width="48"><path fill="currentColor" fill-rule="evenodd" d="M9 3.5C7.17446 3.5 5.79321 3.80807 4.27964 4.55118C4.19318 4.59363 4.12081 4.66015 4.07125 4.74275C3.03206 6.47474 1 11.2959 1 17C1 17.1299 1.05053 17.2546 1.1409 17.3479C2.0917 18.3293 2.95713 19.0512 3.88473 19.5607C4.81779 20.0732 5.79045 20.3581 6.9403 20.4964C7.13603 20.52 7.32732 20.4263 7.42875 20.2572L7.93986 19.4054C7.19582 19.1454 6.43693 18.7996 5.96967 18.3323C5.67678 18.0394 5.67678 17.5646 5.96967 17.2717C6.26256 16.9788 6.73744 16.9788 7.03033 17.2717C7.28511 17.5265 7.88376 17.8166 8.72916 18.0879L8.73018 18.0882L8.73036 18.0879C9.42886 18.271 10.646 18.5 12 18.5C13.354 18.5 14.5711 18.271 15.2696 18.0879L15.2698 18.0882C15.2702 18.0881 15.2705 18.088 15.2708 18.0879C16.1162 17.8166 16.7149 17.5265 16.9697 17.2717C17.2626 16.9788 17.7374 16.9788 18.0303 17.2717C18.3232 17.5646 18.3232 18.0394 18.0303 18.3323C17.5631 18.7996 16.8042 19.1454 16.0601 19.4054L16.5713 20.2572C16.6727 20.4263 16.864 20.52 17.0597 20.4964C18.2096 20.3581 19.1822 20.0732 20.1153 19.5607C21.0429 19.0512 21.9083 18.3293 22.8591 17.3479C22.9495 17.2546 23 17.1299 23 17C23 11.2959 20.9679 6.47474 19.9287 4.74275C19.8792 4.66015 19.8068 4.59363 19.7204 4.55118C18.2068 3.80807 16.8255 3.5 15 3.5C14.7848 3.5 14.5937 3.63772 14.5257 3.84189L14.1895 4.85038C14.1071 4.82376 14.0161 4.79607 13.9172 4.76844C13.4386 4.63474 12.7672 4.5 12 4.5C11.2328 4.5 10.5614 4.63474 10.0828 4.76844C9.98392 4.79607 9.89287 4.82376 9.81051 4.85038L9.47434 3.84189C9.40628 3.63772 9.21522 3.5 9 3.5ZM10 12.75C10 13.7165 9.32843 14.5 8.5 14.5C7.67157 14.5 7 13.7165 7 12.75C7 11.7835 7.67157 11 8.5 11C9.32843 11 10 11.7835 10 12.75ZM15.5 14.5C16.3284 14.5 17 13.7165 17 12.75C17 11.7835 16.3284 11 15.5 11C14.6716 11 14 11.7835 14 12.75C14 13.7165 14.6716 14.5 15.5 14.5Z" clip-rule="evenodd"></path></svg></a></li>
<li><a href="https://www.instagram.com/ateliernum/"><svg style="width: var(--size-5);" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" height="48" width="48"><path fill="currentColor" fill-rule="evenodd" d="M7.5 0.75C3.77208 0.75 0.75 3.77208 0.75 7.5V16.5C0.75 20.2279 3.77208 23.25 7.5 23.25H16.5C20.2279 23.25 23.25 20.2279 23.25 16.5V7.5C23.25 3.77208 20.2279 0.75 16.5 0.75H7.5ZM2.25 7.5C2.25 4.6005 4.60051 2.25 7.5 2.25H16.5C19.3995 2.25 21.75 4.60051 21.75 7.5V16.5C21.75 19.3995 19.3995 21.75 16.5 21.75H7.5C4.6005 21.75 2.25 19.3995 2.25 16.5V7.5ZM19.5 6.25C19.5 6.94036 18.9404 7.5 18.25 7.5C17.5596 7.5 17 6.94036 17 6.25C17 5.55964 17.5596 5 18.25 5C18.9404 5 19.5 5.55964 19.5 6.25ZM12 7.75C9.65279 7.75 7.75 9.65279 7.75 12C7.75 14.3472 9.65279 16.25 12 16.25C14.3472 16.25 16.25 14.3472 16.25 12C16.25 9.65279 14.3472 7.75 12 7.75ZM6.25 12C6.25 8.82436 8.82436 6.25 12 6.25C15.1756 6.25 17.75 8.82436 17.75 12C17.75 15.1756 15.1756 17.75 12 17.75C8.82436 17.75 6.25 15.1756 6.25 12Z" clip-rule="evenodd"></path></svg></a></li>
<li><a href="https://github.com/AtelierNum"><svg style="width: var(--size-5);" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" height="48" width="48"><path fill="currentColor" d="M11.9962 1.28371C9.38562 1.28124 6.85951 2.2085 4.87051 3.8993C2.8815 5.59011 1.55961 7.93395 1.1417 10.5108C0.723797 13.0877 1.23719 15.7292 2.58989 17.9619C3.94259 20.1947 6.04618 21.8728 8.5237 22.6955C9.07204 22.791 9.2459 22.4691 9.2459 22.1787C9.2459 21.9159 9.25163 21.188 9.2459 20.2681C6.18899 20.9311 5.55754 18.8208 5.55754 18.8208C5.356 18.1569 4.92364 17.587 4.3386 17.214C3.34128 16.532 4.41311 16.5453 4.41311 16.5453C4.76132 16.5931 5.09399 16.7199 5.38572 16.9159C5.67744 17.1119 5.9205 17.3721 6.09632 17.6764C6.24505 17.9474 6.44604 18.1862 6.68766 18.3791C6.92928 18.5719 7.20674 18.7149 7.50399 18.7999C7.80123 18.8848 8.11237 18.9099 8.4194 18.8739C8.72642 18.8378 9.02325 18.7412 9.29271 18.5896C9.34339 18.0343 9.59069 17.5153 9.99006 17.1262C7.55122 16.8472 4.98628 15.9053 4.98628 11.6944C4.9708 10.6028 5.37617 9.5471 6.11829 8.74639C5.78201 7.79922 5.82029 6.75935 6.22529 5.83946C6.22529 5.83946 7.14905 5.54428 9.2459 6.9667C11.0468 6.47251 12.9475 6.47251 14.7483 6.9667C16.85 5.54523 17.7661 5.83946 17.7661 5.83946C18.1712 6.75922 18.2102 7.7989 17.875 8.74639C18.6173 9.54761 19.0221 10.6042 19.0051 11.6963C19.0051 15.9187 16.4363 16.8463 13.9889 17.1166C14.2518 17.3807 14.4549 17.6982 14.5846 18.0476C14.7143 18.397 14.7675 18.7701 14.7407 19.1418V22.1834C14.7407 22.4767 14.9184 22.8015 15.4763 22.6955C17.9544 21.8726 20.0584 20.1939 21.4111 17.9603C22.7637 15.7268 23.2766 13.0844 22.8577 10.5071C22.4388 7.92966 21.1155 5.58576 19.1251 3.89557C17.1347 2.20538 14.6074 1.27942 11.9962 1.28371V1.28371Z"></path></svg></a></li>
</ul>
<div class="legal-disclaimer">
<a href="/mentions.html">Mentions légales</a>
</div>
</footer>
</div>
</div>
<div id="menu-opener">
<!-- prettier-ignore -->
<svg style="height:var(--size-5);" xmlns="http://www.w3.org/2000/svg" viewBox="-0.25 -0.25 14.5 14.5" height="48" width="48" stroke-width="1.5"><g><line x1="13.5" y1="2" x2="0.5" y2="2" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><line x1="13.5" y1="7" x2="0.5" y2="7" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><line x1="13.5" y1="12" x2="0.5" y2="12" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line></g></svg>
</div>
<template id="main-article-template">
<article>
<div class="resource-type"></div>
<a href="" target="_blank" class="article-hero">
<img src="" alt="" onerror="this.remove()" />
</a>
<div class="article-content">
<a href="" target="_blank"><h2>title</h2></a>
<p class="authors">authors</p>
<p class="description">description</p>
</div>
</article>
</template>
<script type="module">
import { create, search, insert, remove } from "@orama/orama";
const LOADING_INCREMENT = 3;
let inViewDocuments = {
cursor: 0,
documents: [],
getAmount: (amount) => {
if (
inViewDocuments.cursor + amount >=
inViewDocuments.documents.length
) {
const finalSlice = inViewDocuments.documents.slice(
inViewDocuments.cursor
);
inViewDocuments.cursor = inViewDocuments.documents.length;
return finalSlice;
} else {
const newSlice = inViewDocuments.documents.slice(
inViewDocuments.cursor,
inViewDocuments.cursor + amount
);
inViewDocuments.cursor += amount;
return newSlice;
}
},
set: (documents) => {
inViewDocuments.cursor = 0;
inViewDocuments.documents = documents;
const clearAllChildren = (domElement) => domElement.replaceChildren();
clearAllChildren(document.querySelector("main"));
inViewDocuments
.getAmount(LOADING_INCREMENT)
.forEach((d) => addArticle(d));
},
};
// why are some fields commented?
// to show the exist, but we will never search on these
// it's just a way to not index them : https://docs.lyrasearch.io/usage/insert-data
// top-level await still not commonly supported :/
let oramaDB;
create({
schema: {
id: "string",
title: "string",
description: "string",
// image:"string"
type: "string",
authors: "string",
//destination: "string"
tags: "string", // it should probably be an array of strings, but lyra only supports strings right now so let's concat
},
}).then((createdDB) => (oramaDB = createdDB));
let filtersState = localStorage.getItem("filtersState");
if (filtersState) {
filtersState = JSON.parse(filtersState);
} else {
filtersState = {
languages: {
en: true,
fr: true,
},
categories: {
course: true,
resource: true,
template: true,
project: false,
},
};
saveFilters();
}
function saveFilters() {
localStorage.setItem("filtersState", JSON.stringify(filtersState));
}
function getSelectedLanguages() {
let activeLangs = [];
Object.entries(filtersState.languages).forEach(([k, v]) => {
if (v) activeLangs.push(k);
});
return activeLangs;
}
function setLanguageFilter(language, value) {
filtersState.languages[language] = value;
saveFilters();
refreshFilterUI();
}
function setCategoryFilter(category, value) {
filtersState.categories[category] = value;
saveFilters();
refreshFilterUI();
}
function refreshFilterUI() {
const desktopCategoryFilters = document.querySelectorAll(
'#category-filters input[type="checkbox"]'
);
desktopCategoryFilters.forEach((el) => {
el.checked = filtersState.categories[el.dataset.type];
});
const desktopLanguageFilters = document.querySelectorAll(
'#language-filters input[type="checkbox"]'
);
desktopLanguageFilters.forEach((el) => {
el.checked = filtersState.languages[el.dataset.language];
});
const mobileCategoryFilters = document.querySelectorAll(
"#mobile-category-filters > li"
);
mobileCategoryFilters.forEach((el) => {
const highlight = el.querySelector(".resource-type");
if (filtersState.categories[highlight.dataset.type]) {
highlight.classList.remove("inactive");
} else {
highlight.classList.add("inactive");
}
});
const mobileLanguageFilters = document.querySelectorAll(
"#mobile-language-filters > li"
);
mobileLanguageFilters.forEach((el) => {
const highlight = el.querySelector(".resource-type");
if (filtersState.languages[highlight.dataset.language]) {
highlight.classList.remove("inactive");
} else {
highlight.classList.add("inactive");
}
});
}
const desktopCategoryFilters = document.querySelectorAll(
'#category-filters input[type="checkbox"]'
);
desktopCategoryFilters.forEach((el) => {
el.addEventListener("change", (ev) => {
setCategoryFilter(ev.target.dataset.type, ev.target.checked);
searchAll();
});
});
const desktopLanguageFilters = document.querySelectorAll(
'#language-filters input[type="checkbox"]'
);
desktopLanguageFilters.forEach((el) => {
el.addEventListener("change", (ev) => {
setLanguageFilter(ev.target.dataset.language, ev.target.checked);
searchAll();
});
});
const mobileCategoryFilters = document.querySelectorAll(
"#mobile-category-filters > li"
);
mobileCategoryFilters.forEach((el) => {
const highlight = el.querySelector(".resource-type");
el.addEventListener("click", () => {
setCategoryFilter(
highlight.dataset.type,
!filtersState.categories[highlight.dataset.type]
);
searchAll();
});
});
const mobileLanguageFilters = document.querySelectorAll(
"#mobile-language-filters > li"
);
mobileLanguageFilters.forEach((el) => {
const highlight = el.querySelector(".resource-type");
el.addEventListener("click", () => {
setLanguageFilter(
highlight.dataset.language,
!filtersState.languages[highlight.dataset.language]
);
searchAll();
});
});
const searchInput = document.querySelector("#search-input");
searchInput.addEventListener("input", (ev) => {
searchAll(ev.srcElement.value);
});
searchInput.addEventListener("keyup", (ev) => {
const prefersReducedMotion =
window.matchMedia(`(prefers-reduced-motion: reduce)`) === true ||
window.matchMedia(`(prefers-reduced-motion: reduce)`).matches ===
true;
if (ev.key === "Enter" || ev.keyCode === 13) {
window.scrollTo({
top: 0,
left: 0,
behavior: prefersReducedMotion ? "auto" : "smooth",
});
}
});
let isDraggingOnMobileMenuHandle = false;
let touchTracking = {
prevPageX: 0,
prevPageY: 0,
};
const mobileMenu = document.querySelector("#mobile-menu");
const mobileMenuContent = document.querySelector("#mobile-menu-content");
const getContentWidth = () =>
parseFloat(window.getComputedStyle(mobileMenuContent).width);
let contentWidth = getContentWidth();
window.addEventListener("resize", () => {
contentWidth = getContentWidth();
});
//TODO make it reactive? on property change, instead of having to thingk about calling this
function refreshMobileMenuUI() {
if (mobileMenu.dataset.open == "false") {
mobileMenu.style.transform = `translateX(calc(${contentWidth}px - var(--size-2)))`;
} else {
mobileMenu.style.transform = `translateX(0)`;
}
}
document.querySelector("#menu-opener").addEventListener("click", (ev) => {
if (mobileMenu.dataset.open == "false") {
mobileMenu.dataset.open = "true";
} else {
mobileMenu.dataset.open = "false";
}
refreshMobileMenuUI();
});
document.body.addEventListener("mousedown", (ev) => {
isDraggingOnMobileMenuHandle = true;
});
document.body.addEventListener("touchstart", (ev) => {
touchTracking.prevPageX = ev.touches[0].pageX;
touchTracking.prevPageY = ev.touches[0].pageY;
isDraggingOnMobileMenuHandle = true;
});
const stopMenuDragging = () => {
isDraggingOnMobileMenuHandle = false;
const contentWidth = parseFloat(
window.getComputedStyle(mobileMenuContent).width
);
if (parseInt(getTranslateValues(mobileMenu).x) > contentWidth * 0.5) {
mobileMenu.dataset.open = "false";
} else {
mobileMenu.dataset.open = "true";
}
refreshMobileMenuUI();
};
const updateMenuDragging = (e) => {
const isMouse = Boolean(e.movementX);
if (!isMouse && e.touches) {
e.movementX = e.touches[0].pageX - touchTracking.prevPageX;
e.movementY = e.touches[0].pageY - touchTracking.prevPageY;
touchTracking.prevPageX = e.touches[0].pageX;
touchTracking.prevPageY = e.touches[0].pageY;
}
const insideOvershootFactor = 1.04;
const contentWidth = parseFloat(
window.getComputedStyle(mobileMenuContent).width
);
if (isDraggingOnMobileMenuHandle) {
const currentX = parseInt(getTranslateValues(mobileMenu).x);
const newX = currentX + e.movementX;
if (newX * insideOvershootFactor < contentWidth && newX > 0) {
mobileMenu.style.transform = `translateX(${newX}px)`;
}
}
};
//https://zellwk.com/blog/css-translate-values-in-javascript/
function getTranslateValues(element) {
const style = window.getComputedStyle(element);
const matrix =
style["transform"] || style.webkitTransform || style.mozTransform;
// No transform property. Simply return 0 values.
if (matrix === "none" || typeof matrix === "undefined") {
return {
x: 0,
y: 0,
z: 0,
};
}
// Can either be 2d or 3d transform
const matrixType = matrix.includes("3d") ? "3d" : "2d";
const matrixValues = matrix.match(/matrix.*\((.+)\)/)[1].split(", ");
// 2d matrices have 6 values
// Last 2 values are X and Y.
// 2d matrices does not have Z value.
if (matrixType === "2d") {
return {
x: matrixValues[4],
y: matrixValues[5],
z: 0,
};
}
// 3d matrices have 16 values
// The 13th, 14th, and 15th values are X, Y, and Z
if (matrixType === "3d") {
return {
x: matrixValues[12],
y: matrixValues[13],
z: matrixValues[14],
};
}
}
function removeLoaders() {
document
.querySelectorAll("main > article.loader")
.forEach((el) => el.remove());
}
function doc2Node(article) {
const articleTemplate = document.querySelector(
"#main-article-template"
);
const getFirstChildOfTemplate = (templateNode) =>
templateNode.content.children[0];
const newArticle =
getFirstChildOfTemplate(articleTemplate).cloneNode(true);
// customize the new article
newArticle.id = article.id;
newArticle.dataset.language = article.language;
newArticle.querySelector("h2").innerText = article.title;
newArticle.querySelector(".description").innerText =
article.description;
newArticle.querySelector(".authors").innerText = article.authors || "";
newArticle.querySelector("img").src = article.thumbnail;
newArticle.querySelector(".resource-type").dataset.type = article.type;
newArticle.querySelectorAll("a").forEach((a) => (a.href = article.url));
return newArticle;
}
function addArticle(article) {
document.querySelector("main").append(doc2Node(article));
}
async function searchAll() {
if (!dbLoaded) {
return;
}
const searchInput = document.querySelector("#search-input").value;
console.log(`searching for ${searchInput}`);
if (searchInput.trim().length == 0) {
loadEverythingInView();
return;
}
const searchTerms = searchInput.split(" ");
console.log(filtersState);
const searchResults = await Promise.all(