-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrench.html
More file actions
1455 lines (1395 loc) · 71.7 KB
/
Copy pathfrench.html
File metadata and controls
1455 lines (1395 loc) · 71.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
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">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<title>StudyNet — French</title>
<link rel="manifest" href="manifest.json"/>
<link rel="icon" type="image/png" sizes="192x192" href="icons/icon-192.png"/>
<link rel="apple-touch-icon" href="icons/apple-touch-icon.png"/>
<meta name="theme-color" content="#000000"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<style>
:root{
--bg:#fff;--fg:#000;--muted:#666;--border:#e0e0e0;
--hover:#f5f5f5;--radius:8px;
--font:"Inter",system-ui,sans-serif;
--sb:210px;
}
@media(prefers-color-scheme:dark){
:root{--bg:#000;--fg:#fff;--muted:#888;--border:#222;--hover:#111;}
}
html.theme-light{--bg:#fff;--fg:#000;--muted:#666;--border:#e0e0e0;--hover:#f5f5f5;}
html.theme-dark {--bg:#000;--fg:#fff;--muted:#888;--border:#222;--hover:#111;}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
body{
font-family:var(--font);background:var(--bg);color:var(--fg);
min-height:100vh;transition:background .2s,color .2s;
display:flex;
}
a{color:inherit;text-decoration:none;}
button{font:inherit;cursor:pointer;}
.page{padding:2rem 3rem max(5rem,env(safe-area-inset-bottom));}
.sidebar{
width:var(--sb);flex-shrink:0;
border-right:1px solid var(--border);
position:sticky;top:0;height:100vh;
overflow-y:auto;
display:flex;flex-direction:column;
padding:1.5rem 1.1rem 1.25rem;
}
.sb-back{
display:flex;align-items:center;gap:.4rem;
font-size:.8rem;color:var(--muted);
padding:.3rem .5rem .9rem;
border-bottom:1px solid var(--border);
margin-bottom:.6rem;
}
.sb-back:hover{color:var(--fg);}
.sb-brand{
font-size:.95rem;font-weight:700;letter-spacing:-.02em;
padding:.5rem .5rem .3rem;
display:flex;align-items:center;gap:.5rem;
}
.sb-brand span{opacity:.4;font-weight:400;font-size:.82rem;}
.sb-section{
font-size:.62rem;font-weight:700;text-transform:uppercase;
letter-spacing:.1em;color:var(--muted);
padding:.75rem .5rem .25rem;
}
.sb-mode-btn{
display:flex;align-items:center;gap:.55rem;
padding:.45rem .65rem;border-radius:var(--radius);
font-size:.83rem;background:none;border:none;
color:var(--muted);text-align:left;width:100%;
cursor:pointer;
transition:background .15s,color .15s;
white-space:nowrap;
}
.sb-mode-btn:hover,.sb-mode-btn.active{background:var(--fg);color:var(--bg);}
.sb-spacer{flex:1;}
.sb-score{font-size:.75rem;color:var(--muted);padding:.5rem .65rem;}
.sb-btn{
display:flex;align-items:center;gap:.55rem;
width:100%;padding:.45rem .65rem;
border-radius:var(--radius);font-size:.83rem;
background:none;border:none;color:var(--muted);
text-align:left;cursor:pointer;
transition:background .15s,color .15s;
}
.sb-btn:hover{background:var(--hover);color:var(--fg);}
.sb-btn.active{background:var(--fg);color:var(--bg);}
.main{flex:1;min-width:0;display:flex;flex-direction:column;overflow-x:hidden;}
.mob-header{display:none;}
.modes{display:none!important;}
.hero{padding:2.5rem 0 1.5rem;}
.hero h1{font-size:clamp(1.6rem,4vw,2.4rem);font-weight:800;letter-spacing:-.03em;display:flex;align-items:center;gap:.65rem;}
.hero p{margin-top:.5rem;color:var(--muted);font-size:.9rem;}
.hero-stats{display:flex;gap:.5rem;margin-top:1rem;flex-wrap:wrap;}
.h-chip{padding:.28rem .75rem;border:1px solid var(--border);border-radius:99px;font-size:.75rem;color:var(--muted);}
.h-chip b{color:var(--fg);}
.topic-mob-chip{margin:.75rem 0 -.25rem;}
.topic-mob-pill{
display:inline-flex;align-items:center;gap:.3rem;
padding:.22rem .65rem;border:1px solid var(--border);
border-radius:99px;font-size:.75rem;cursor:pointer;
background:none;color:var(--fg);transition:background .15s;
}
.topic-mob-pill:hover{background:var(--hover);}
.panel{display:none;margin-top:2rem;}
.panel.active{display:block;animation:panelSlideIn .22s ease both;}
.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.1rem;}
.panel-head h2{font-size:.95rem;font-weight:700;}
.topic-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(162px,1fr));gap:.85rem;}
.topic-card{
background:var(--bg);color:var(--fg);
border:1px solid var(--border);border-radius:var(--radius);
padding:1.1rem 1rem;text-align:left;cursor:pointer;
transition:background .15s,border-color .15s;
display:flex;flex-direction:column;gap:.35rem;width:100%;
}
.topic-card:hover{background:var(--hover);border-color:var(--fg);}
.topic-card.topic-all{border-color:var(--fg);}
.topic-card.topic-active{background:var(--fg);color:var(--bg);}
.topic-card.topic-active .tc-desc,.topic-card.topic-active .tc-dot{opacity:.6;color:inherit;border-color:currentColor;}
.tc-icon{font-size:1.35rem;}
.tc-label{font-size:.9rem;font-weight:700;}
.tc-desc{font-size:.73rem;color:var(--muted);}
.tc-dots{display:flex;flex-wrap:wrap;gap:.25rem;margin-top:.2rem;}
.tc-dot{font-size:.63rem;padding:.12rem .38rem;border:1px solid var(--border);border-radius:99px;color:var(--muted);}
.no-content{
padding:1.75rem 1rem;text-align:center;
color:var(--muted);font-size:.83rem;
border:1px dashed var(--border);border-radius:var(--radius);
margin-bottom:1rem;
}
.fc-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;flex-wrap:wrap;gap:.5rem;}
.fc-counter{font-size:.8rem;color:var(--muted);}
.fc-set-btns{display:flex;gap:.4rem;flex-wrap:wrap;}
.fc-set-btn{padding:.25rem .65rem;border:1px solid var(--border);border-radius:99px;font-size:.72rem;background:none;color:var(--muted);cursor:pointer;min-height:30px;}
.fc-set-btn.active{background:var(--fg);color:var(--bg);border-color:var(--fg);}
.fc-scene{perspective:1000px;height:200px;margin-bottom:1rem;cursor:pointer;}
.fc-card{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .45s ease;}
.fc-card.flipped{transform:rotateY(180deg);}
.fc-face{
position:absolute;inset:0;
backface-visibility:hidden;-webkit-backface-visibility:hidden;
border:1px solid var(--border);border-radius:var(--radius);
display:flex;align-items:center;justify-content:center;
flex-direction:column;gap:.5rem;padding:1.5rem;text-align:center;
}
.fc-back{transform:rotateY(180deg);background:var(--hover);}
.fc-word{font-size:1.5rem;font-weight:700;letter-spacing:-.02em;}
.fc-sub{font-size:.8rem;color:var(--muted);}
.fc-hint{font-size:.72rem;color:var(--muted);margin-top:.25rem;}
.fc-prog-bar{height:2px;background:var(--border);border-radius:99px;margin-bottom:1rem;}
.fc-prog-fill{height:100%;background:var(--fg);border-radius:99px;transition:width .3s;}
.fc-controls{display:flex;gap:.5rem;justify-content:center;flex-wrap:wrap;}
.fc-ctrl{padding:.55rem 1.4rem;border:1px solid var(--border);border-radius:var(--radius);background:none;color:var(--fg);font-size:.82rem;font-weight:600;min-height:40px;}
.fc-ctrl:hover{background:var(--hover);}
.fc-ctrl.primary{background:var(--fg);color:var(--bg);border-color:var(--fg);}
.fc-ctrl.primary:hover{opacity:.8;}
.mcq-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;flex-wrap:wrap;gap:.5rem;}
.mcq-set-sel{display:flex;gap:.4rem;flex-wrap:wrap;}
.mcq-set-btn{padding:.25rem .65rem;border:1px solid var(--border);border-radius:99px;font-size:.72rem;background:none;color:var(--muted);cursor:pointer;min-height:30px;}
.mcq-set-btn.active{background:var(--fg);color:var(--bg);border-color:var(--fg);}
.mcq-card{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;}
.mcq-top{padding:.85rem 1.1rem;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;}
.mcq-title{font-size:.82rem;font-weight:700;}
.mcq-prog-txt{font-size:.75rem;color:var(--muted);}
.mcq-prog-bar{height:2px;background:var(--border);}
.mcq-prog-fill{height:100%;background:var(--fg);transition:width .3s;}
.mcq-body{padding:1.3rem 1.1rem;}
.mcq-q{font-size:.95rem;font-weight:600;margin-bottom:1rem;line-height:1.5;}
.mcq-opts{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;}
.mcq-opt{padding:.65rem .9rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);color:var(--fg);font-size:.82rem;text-align:left;transition:border-color .2s,background .2s;min-height:44px;}
.mcq-opt:hover:not(:disabled){background:var(--hover);}
.mcq-opt.correct{background:var(--fg);color:var(--bg);border-color:var(--fg);animation:pop .25s ease;}
.mcq-opt.wrong{opacity:.3;text-decoration:line-through;}
.mcq-opt:disabled{cursor:default;}
.mcq-footer{padding:.85rem 1.1rem;border-top:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;}
.mcq-fb{font-size:.8rem;color:var(--muted);}
.mcq-next{padding:.45rem 1rem;border:1px solid var(--fg);border-radius:var(--radius);background:var(--fg);color:var(--bg);font-size:.78rem;font-weight:600;display:none;min-height:36px;}
.mcq-result{padding:2rem 1.1rem;text-align:center;}
.mcq-result h2{font-size:1.5rem;font-weight:800;}
.mcq-result p{color:var(--muted);margin:.5rem 0 1.2rem;font-size:.85rem;}
.match-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;flex-wrap:wrap;gap:.4rem;}
.match-score{font-size:.8rem;color:var(--muted);}
.match-set-btns{display:flex;gap:.4rem;flex-wrap:wrap;margin-bottom:1rem;}
.match-set-btn{padding:.25rem .65rem;border:1px solid var(--border);border-radius:99px;font-size:.72rem;background:none;color:var(--muted);cursor:pointer;min-height:30px;}
.match-set-btn.active{background:var(--fg);color:var(--bg);border-color:var(--fg);}
.match-grid{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;}
.match-col{display:flex;flex-direction:column;gap:.5rem;}
.match-col h3{font-size:.72rem;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.06em;margin-bottom:.2rem;}
.match-tile{padding:.65rem .9rem;border:1px solid var(--border);border-radius:var(--radius);font-size:.83rem;cursor:pointer;transition:background .15s,border-color .15s;background:var(--bg);color:var(--fg);text-align:center;min-height:44px;display:flex;align-items:center;justify-content:center;}
.match-tile:hover:not(.matched):not(.disabled){background:var(--hover);}
.match-tile.selected{border-color:var(--fg);background:var(--hover);}
.match-tile.matched{opacity:.25;pointer-events:none;text-decoration:line-through;}
.match-tile.wrong{animation:shake .3s ease;}
.match-complete{text-align:center;padding:1.5rem;border:1px solid var(--border);border-radius:var(--radius);}
.match-complete h3{font-size:1.1rem;font-weight:700;}
.match-complete p{color:var(--muted);font-size:.83rem;margin:.4rem 0 1rem;}
.prac-sets{display:flex;gap:.4rem;flex-wrap:wrap;margin-bottom:1rem;}
.prac-set-btn{padding:.28rem .7rem;border:1px solid var(--border);border-radius:99px;font-size:.75rem;background:none;color:var(--muted);cursor:pointer;min-height:32px;}
.prac-set-btn.active{background:var(--fg);color:var(--bg);border-color:var(--fg);}
.prac-intro{font-size:.8rem;color:var(--muted);margin-bottom:.9rem;}
.q-list{display:flex;flex-direction:column;gap:1px;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;}
.q-item{display:flex;align-items:flex-start;gap:.7rem;padding:.75rem .95rem;background:var(--bg);border-bottom:1px solid var(--border);}
.q-item:last-child{border-bottom:none;}
.q-num{flex-shrink:0;font-size:.72rem;color:var(--muted);padding-top:.18rem;min-width:1.3rem;}
.q-body{flex:1;}
.q-sent{font-size:.86rem;line-height:1.9;display:flex;align-items:center;flex-wrap:wrap;gap:.2rem;}
.q-hint-txt{font-size:.76rem;color:var(--muted);font-style:italic;}
.tbl-ex{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;overflow-x:auto;}
.tbl-ex table{width:100%;border-collapse:collapse;font-size:.83rem;min-width:320px;}
.tbl-ex th,.tbl-ex td{padding:.5rem .8rem;border:1px solid var(--border);}
.tbl-ex th{background:var(--hover);font-size:.77rem;font-weight:600;}
.q-inp{border:none;border-bottom:1px solid var(--fg);background:transparent;color:var(--fg);font:inherit;font-size:.85rem;width:100px;padding:.05rem .2rem;outline:none;min-height:28px;}
.q-inp:focus{border-bottom-width:2px;}
.q-inp.ok{border-bottom-color:var(--fg);opacity:.6;}
.q-inp.err{animation:shake .3s ease;}
.q-inp:disabled{opacity:.55;cursor:default;}
.q-fb{font-size:.7rem;margin-top:.15rem;color:var(--muted);}
.ref-toggle{font-size:.75rem;color:var(--muted);background:none;border:none;cursor:pointer;text-decoration:underline;text-decoration-style:dotted;padding:0 0 .5rem;}
.ref-toggle:hover{color:var(--fg);}
.ref-box{margin:.6rem 0 .9rem;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;}
.ref-box table{width:100%;border-collapse:collapse;font-size:.78rem;}
.ref-box th,.ref-box td{padding:.4rem .65rem;border:1px solid var(--border);}
.ref-box th{font-weight:600;background:var(--hover);}
.rule-box{background:var(--hover);border:1px solid var(--border);border-radius:var(--radius);padding:.85rem 1rem;font-size:.82rem;line-height:1.7;margin-bottom:1rem;}
.rule-box strong{font-weight:700;}
.rule-box code{font-family:monospace;background:var(--border);padding:.1rem .3rem;border-radius:3px;font-size:.8rem;}
.reset-btn{padding:.25rem .65rem;border:1px solid var(--border);border-radius:99px;font-size:.72rem;background:none;color:var(--muted);cursor:pointer;}
.reset-btn:hover{background:var(--hover);color:var(--fg);}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:.5rem 1.1rem;border:1px solid var(--fg);border-radius:var(--radius);background:var(--fg);color:var(--bg);font-size:.8rem;font-weight:600;cursor:pointer;min-height:40px;}
.btn:hover{opacity:.75;}
.btn-ghost{background:none;color:var(--fg);}
.btn-ghost:hover{background:var(--hover);opacity:1;}
footer{margin-top:4rem;padding-top:1.4rem;border-top:1px solid var(--border);font-size:.75rem;color:var(--muted);display:flex;justify-content:space-between;flex-wrap:wrap;gap:.5rem;}
@keyframes pop{0%{transform:scale(.97)}60%{transform:scale(1.04)}100%{transform:scale(1)}}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
@keyframes panelSlideIn{from{opacity:0;transform:translateX(var(--slide-dir,40px));}to{opacity:1;transform:translateX(0);}}
.icon{width:1em;height:1em;display:inline-block;vertical-align:-.125em;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;}
[data-step="step-1"] .sb-active-ctx,[data-step="step-1"] .sb-topic-list{display:none!important;}
[data-step="step-2"] .sb-active-ctx,[data-step="step-3"] .sb-active-ctx{display:block!important;}
[data-step="step-2"] .sb-topic-list{display:none!important;}
[data-step="step-3"] .sb-topic-list{display:block!important;}
[data-step="step-1"] .sb-modes,[data-step="step-2"] .sb-modes{display:none!important;}
[data-step="step-3"] .sb-modes{display:flex!important;flex-direction:column;gap:3px;}
.sb-active-ctx{margin-bottom:.25rem;}
.sb-back-link{display:flex;align-items:center;gap:.35em;width:100%;padding:.3rem .5rem;border:none;background:none;color:var(--muted);font:inherit;font-size:.8rem;cursor:pointer;border-radius:var(--radius);text-align:left;transition:background .15s;}
.sb-back-link:hover{background:var(--hover);color:var(--fg);}
.sb-active-topic{font-size:.88rem;font-weight:600;padding:.15rem .5rem .35rem;}
.sb-topic-list{border-top:1px solid var(--border);padding-top:.5rem;margin-top:.25rem;}
.sb-tlist-btn{display:block;width:100%;padding:.3rem .5rem;border:none;background:none;color:var(--fg);font:inherit;font-size:.8rem;border-radius:var(--radius);cursor:pointer;text-align:left;transition:background .15s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sb-tlist-btn:hover{background:var(--hover);}
.sb-tlist-btn.active{font-weight:600;}
.act-head{display:flex;align-items:center;gap:1rem;margin-bottom:1.5rem;flex-wrap:wrap;}
.act-back-btn{display:flex;align-items:center;gap:.35em;flex-shrink:0;padding:.4rem .75rem;border:1px solid var(--border);background:none;color:var(--fg);font:inherit;font-size:.82rem;border-radius:var(--radius);cursor:pointer;white-space:nowrap;transition:background .15s;}
.act-back-btn:hover{background:var(--hover);}
.act-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:1rem;}
.act-tile{display:flex;flex-direction:column;align-items:center;gap:.7rem;padding:2rem 1rem 1.5rem;border-radius:var(--radius);border:1.5px solid var(--border);background:var(--bg);cursor:pointer;transition:background .15s,border-color .15s;font:inherit;color:var(--fg);text-align:center;width:100%;}
.act-tile:hover:not(.act-tile--off){background:var(--hover);border-color:var(--fg);}
.act-tile--off{opacity:.38;cursor:default;}
.at-icon{display:flex;align-items:center;justify-content:center;}
.at-name{font-weight:600;font-size:.98rem;}
.at-count{font-size:.8rem;color:var(--muted);}
.mob-pill-strip{display:none;gap:.5rem;padding:.5rem 1rem;border-bottom:1px solid var(--border);}
.mob-pill{display:flex;align-items:center;gap:.3em;padding:.35rem .75rem;border:1px solid var(--border);background:var(--bg);color:var(--fg);font:inherit;font-size:.8rem;border-radius:20px;cursor:pointer;transition:background .15s;}
.mob-pill:hover{background:var(--hover);}
.streak-section{margin-top:2rem;padding:.9rem 1.1rem;border:1px solid var(--border);border-radius:var(--radius);}
.streak-row{display:flex;align-items:center;gap:.65rem;margin-bottom:.75rem;}
.streak-icon{line-height:1;}
.streak-info{flex:1;}
.streak-count{font-size:1.25rem;font-weight:700;line-height:1.2;color:var(--fg);}
.streak-sub{font-size:.72rem;color:var(--muted);margin-top:.1rem;}
.streak-bar-wrap{height:6px;background:var(--border);border-radius:99px;overflow:hidden;margin-bottom:.4rem;}
.streak-bar-fill{height:100%;background:#f97316;border-radius:99px;transition:width .4s ease;}
.streak-bar-label{font-size:.72rem;color:var(--muted);}
@media(max-width:700px){
body{display:block;}
.sidebar{display:none;}
.mob-header{display:flex;align-items:center;justify-content:space-between;padding:1.2rem 1.25rem;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--bg);z-index:10;}
.mob-logo{font-size:.95rem;font-weight:700;letter-spacing:-.02em;}
.mob-logo span{opacity:.35;font-weight:400;}
.mob-btns{display:flex;gap:.3rem;}
.mob-btn{background:none;border:1px solid var(--border);border-radius:var(--radius);padding:.28rem .5rem;font-size:.88rem;color:var(--fg);cursor:pointer;}
.page{padding:1.25rem 1.25rem max(5rem,env(safe-area-inset-bottom));}
[data-step="step-3"] .mob-pill-strip{display:flex;}
[data-step="step-3"] .modes{display:none!important;}
}
@media(max-width:540px){
.mcq-opts{grid-template-columns:1fr;}
.match-grid{grid-template-columns:1fr 1fr;}
.fc-word{font-size:1.2rem;}
.tbl-ex table{font-size:.76rem;}
.tbl-ex th,.tbl-ex td{padding:.4rem .5rem;}
}
@media(max-width:380px){
.match-grid{grid-template-columns:1fr;}
}
</style>
</head>
<body data-step="step-1">
<svg id="svg-sprite" aria-hidden="true" style="display:none" xmlns="http://www.w3.org/2000/svg">
<symbol id="icon-home" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></symbol>
<symbol id="icon-books" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2z"/><path d="M22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7z"/></symbol>
<symbol id="icon-cards" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></symbol>
<symbol id="icon-quiz" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></symbol>
<symbol id="icon-match" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 3 21 3 21 8"/><line x1="4" y1="20" x2="21" y2="3"/><polyline points="21 16 21 21 16 21"/><line x1="15" y1="15" x2="21" y2="21"/></symbol>
<symbol id="icon-pencil" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></symbol>
<symbol id="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></symbol>
<symbol id="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></symbol>
<symbol id="icon-pin" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></symbol>
<symbol id="icon-chat" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></symbol>
<symbol id="icon-school" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></symbol>
<symbol id="icon-user" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></symbol>
<symbol id="icon-users" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></symbol>
<symbol id="icon-cloud" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 10h-1.26A8 8 0 109 20h9a5 5 0 000-10z"/></symbol>
<symbol id="icon-calendar" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></symbol>
<symbol id="icon-text" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" y1="20" x2="15" y2="20"/><line x1="12" y1="4" x2="12" y2="20"/></symbol>
</svg>
<aside class="sidebar">
<a href="index.html" class="sb-back">
<svg class="icon" aria-hidden="true"><use href="#icon-home"/></svg>
StudyNet
</a>
<div class="sb-brand">
<svg viewBox="0 0 3 2" width="21" height="14" aria-hidden="true" style="border-radius:2px;flex-shrink:0"><rect width="1" height="2" fill="#002395"/><rect x="1" width="1" height="2" fill="#fff"/><rect x="2" width="1" height="2" fill="#ED2939"/></svg>
Français <span>/ French</span>
</div>
<div class="sb-active-ctx" id="sb-active-ctx">
<button class="sb-back-link" onclick="setMode('topic')">← Topics</button>
<div class="sb-active-topic" id="sb-topic-name"></div>
</div>
<div class="sb-modes" id="sb-modes"></div>
<div class="sb-topic-list" id="sb-topic-list">
<div class="sb-section">Switch topic</div>
<div id="sb-tlist"></div>
</div>
<div class="sb-spacer"></div>
<div class="sb-score" id="sb-score">Score: 0 / 0</div>
<button class="sb-btn" id="theme-btn">
<svg class="icon" aria-hidden="true"><use class="theme-icon-use" href="#icon-moon"/></svg>
Theme
</button>
<a href="index.html" class="sb-btn">
<svg class="icon" aria-hidden="true"><use href="#icon-user"/></svg>
Profile
</a>
</aside>
<div class="main">
<header class="mob-header">
<div class="mob-logo">
<svg viewBox="0 0 3 2" width="18" height="12" aria-hidden="true" style="border-radius:2px;vertical-align:middle;margin-right:.35rem"><rect width="1" height="2" fill="#002395"/><rect x="1" width="1" height="2" fill="#fff"/><rect x="2" width="1" height="2" fill="#ED2939"/></svg>Français <span>/ French</span>
</div>
<div class="mob-btns">
<button class="mob-btn" id="theme-mob" aria-label="Toggle theme">
<svg class="icon" aria-hidden="true"><use class="theme-icon-use" href="#icon-moon"/></svg>
</button>
</div>
</header>
<div class="mob-pill-strip" id="mob-pill-strip">
<button class="mob-pill" id="mob-topic-pill" onclick="setMode('topic')">
<span id="mob-topic-pill-text">Topics</span> ▾
</button>
<button class="mob-pill" id="mob-mode-pill" onclick="setMode('activities')">
<span id="mob-mode-pill-text">Activities</span> ▾
</button>
</div>
<div class="page">
<section class="hero">
<h1>
<svg viewBox="0 0 3 2" width="36" height="24" aria-hidden="true" style="border-radius:3px;flex-shrink:0"><rect width="1" height="2" fill="#002395"/><rect x="1" width="1" height="2" fill="#fff"/><rect x="2" width="1" height="2" fill="#ED2939"/></svg>
Français
</h1>
<p>Allons-y 1 · Modules 1–6 · revision activities</p>
<div class="hero-stats">
<div class="h-chip">Score: <b id="hs-score">0 / 0</b></div>
<div class="h-chip">Practice: <b>54 items</b></div>
</div>
<div class="topic-mob-chip">
<button class="topic-mob-pill" onclick="setMode('topic')">
<svg class="icon" aria-hidden="true"><use href="#icon-pin"/></svg>
<span id="topic-mob-label">All Topics</span> ▾
</button>
</div>
</section>
<div class="modes"></div>
<!-- TOPIC SELECT -->
<div class="panel active" id="panel-topic">
<div class="panel-head"><h2>Choose a Topic</h2></div>
<div class="topic-grid" id="topic-grid"></div>
<div class="streak-section">
<div class="streak-row">
<span class="streak-icon"><svg viewBox="0 0 24 24" width="22" height="22" fill="#f97316" aria-hidden="true"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg></span>
<div class="streak-info">
<div class="streak-count" id="streak-count">—</div>
<div class="streak-sub" id="streak-sub">study streak · resets if you miss a day</div>
</div>
</div>
<div class="streak-bar-wrap"><div class="streak-bar-fill" id="streak-bar-fill" style="width:0%"></div></div>
<div class="streak-bar-label" id="streak-bar-label">0 / 10 days to next star</div>
</div>
</div>
<!-- ACTIVITY PICKER -->
<div class="panel" id="panel-activities">
<div class="act-head">
<button class="act-back-btn" onclick="setMode('topic')">← Topics</button>
<div>
<h2 id="act-title" style="font-size:1.1rem;font-weight:700;"></h2>
<p id="act-desc" style="font-size:.85rem;color:var(--muted);margin-top:.25rem;"></p>
</div>
</div>
<div class="act-grid" id="act-grid"></div>
</div>
<!-- FLASHCARDS -->
<div class="panel" id="panel-flashcards">
<div class="fc-header">
<div class="fc-set-btns" id="fc-sets"></div>
<span class="fc-counter" id="fc-counter">1 / 0</span>
</div>
<div class="fc-prog-bar"><div class="fc-prog-fill" id="fc-prog-fill"></div></div>
<div class="fc-scene" id="fc-scene" onclick="flipCard()">
<div class="fc-card" id="fc-card">
<div class="fc-face fc-front">
<div class="fc-word" id="fc-front-word"></div>
<div class="fc-sub" id="fc-front-sub"></div>
<div class="fc-hint">Tap to reveal</div>
</div>
<div class="fc-face fc-back">
<div class="fc-word" id="fc-back-word"></div>
<div class="fc-sub" id="fc-back-sub"></div>
</div>
</div>
</div>
<div class="fc-controls">
<button class="fc-ctrl" onclick="fcMove(-1)">← Prev</button>
<button class="fc-ctrl" onclick="flipCard()">Flip</button>
<button class="fc-ctrl primary" onclick="fcMove(1)">Next →</button>
</div>
</div>
<!-- QUIZ -->
<div class="panel" id="panel-quiz">
<div class="mcq-header">
<div class="mcq-set-sel" id="mcq-sets"></div>
</div>
<div class="mcq-card">
<div class="mcq-top">
<span class="mcq-title" id="mcq-title">Topic</span>
<span class="mcq-prog-txt" id="mcq-prog-txt">1 / 0</span>
</div>
<div class="mcq-prog-bar"><div class="mcq-prog-fill" id="mcq-prog-fill" style="width:0%"></div></div>
<div class="mcq-body" id="mcq-body">
<div class="mcq-q" id="mcq-q"></div>
<div class="mcq-opts" id="mcq-opts"></div>
</div>
<div class="mcq-footer">
<span class="mcq-fb" id="mcq-fb"></span>
<button class="mcq-next" id="mcq-next">Next →</button>
</div>
</div>
</div>
<!-- MATCH -->
<div class="panel" id="panel-match">
<div class="match-set-btns" id="match-sets"></div>
<div class="match-header">
<span style="font-size:.82rem;color:var(--muted)">Click one from each column to pair them.</span>
<span class="match-score" id="match-score">0 / 0 matched</span>
</div>
<div id="match-area"></div>
</div>
<!-- PRACTICE -->
<div class="panel" id="panel-practice">
<div class="prac-sets" id="prac-sets"></div>
<div id="prac-content"></div>
</div>
<footer>
<a href="index.html" style="color:var(--muted);">← Back to StudyNet</a>
<span>Progress saved in your browser.</span>
</footer>
</div>
</div>
<script>
// THEME
const html = document.documentElement;
const savedTheme = localStorage.getItem('sn_theme');
if (savedTheme) html.classList.add('theme-' + savedTheme);
function updateThemeIcons() {
const isDark = html.classList.contains('theme-dark') ||
(!html.classList.contains('theme-light') && matchMedia('(prefers-color-scheme:dark)').matches);
document.querySelectorAll('.theme-icon-use').forEach(el =>
el.setAttribute('href', isDark ? '#icon-sun' : '#icon-moon'));
}
function toggleTheme() {
const dark = html.classList.contains('theme-dark') ||
(!html.classList.contains('theme-light') && matchMedia('(prefers-color-scheme:dark)').matches);
html.classList.remove('theme-light','theme-dark');
const next = dark ? 'light' : 'dark';
html.classList.add('theme-' + next);
localStorage.setItem('sn_theme', next);
updateThemeIcons();
}
document.getElementById('theme-btn').addEventListener('click', toggleTheme);
document.getElementById('theme-mob').addEventListener('click', toggleTheme);
updateThemeIcons();
// MODE SWITCHING
let currentMode = 'topic';
function setMode(id) {
currentMode = id;
const stepNum = {'step-1':1,'step-2':2,'step-3':3};
const step = id === 'topic' ? 'step-1' : id === 'activities' ? 'step-2' : 'step-3';
const fwd = stepNum[step] >= stepNum[document.body.dataset.step || 'step-1'];
document.body.style.setProperty('--slide-dir', fwd ? '40px' : '-40px');
document.querySelectorAll('.panel').forEach(p => p.classList.remove('active'));
document.querySelectorAll('[data-mode]').forEach(b => b.classList.toggle('active', b.dataset.mode === id));
document.getElementById('panel-' + id).classList.add('active');
document.body.dataset.step = step;
if (id === 'topic') buildTopicPanel();
if (id !== 'topic' && id !== 'activities' && currentTopic) {
const tp = document.getElementById('mob-topic-pill-text');
const mp = document.getElementById('mob-mode-pill-text');
if (tp) tp.textContent = currentTopic.label;
if (mp) mp.textContent = id.charAt(0).toUpperCase() + id.slice(1);
}
}
// STORAGE
const STORE = 'sn_french_v1';
function loadS() { try { return JSON.parse(localStorage.getItem(STORE)) || {}; } catch(e) { return {}; } }
function saveS(s) { localStorage.setItem(STORE, JSON.stringify(s)); }
let S = loadS();
if (!S.inputs) S.inputs = {};
// NORMALISATION — handles French accents
function norm(s) {
return s.toLowerCase()
.replace(/[àâ]/g,'a')
.replace(/[éèêë]/g,'e')
.replace(/[îï]/g,'i')
.replace(/[ôœ]/g,'o')
.replace(/[ùû]/g,'u')
.replace(/ç/g,'c')
.replace(/['‘’]/g,"'")
.replace(/[^a-z0-9\s'\/-]/g,'')
.replace(/\s+/g,' ')
.trim();
}
function chk(inp, ans) { return ans.some(a => norm(a) === norm(inp)); }
// ═══════════════════════════════════════
// DATA
// ═══════════════════════════════════════
const fcDecks = {
'Salutations': [
{front:'Bonjour', back:'Hello'},
{front:'Bonsoir', back:'Good evening'},
{front:'Bonne nuit', back:'Good night'},
{front:'Au revoir', back:'Goodbye'},
{front:'Ça va ?', back:'How are you? (informal)'},
{front:'Je vais bien', back:'I am fine'},
{front:'Ça va bien', back:'I am well'},
{front:'Ça va mal', back:'Things are not going well'},
{front:'Merci', back:'Thank you'},
{front:'De rien', back:"You're welcome"},
{front:'À demain', back:'See you tomorrow'},
{front:'Comment allez-vous ?', back:'How are you? (formal)'},
],
'Les Matières': [
{front:'Le français', back:'French'},
{front:'Les maths', back:'Maths'},
{front:"L'anglais", back:'English'},
{front:"L'histoire", back:'History'},
{front:'La géographie', back:'Geography'},
{front:'La biologie', back:'Biology'},
{front:'La musique', back:'Music'},
{front:'La physique', back:'Physics'},
{front:'La chimie', back:'Chemistry'},
{front:"L'éducation physique", back:'PE / Sports'},
{front:'Le dessin', back:'Art'},
{front:'La religion', back:'Religion'},
],
'La Famille': [
{front:'Le père', back:'Father'},
{front:'La mère', back:'Mother'},
{front:'Le frère', back:'Brother'},
{front:'La sœur', back:'Sister'},
{front:'Le grand-père', back:'Grandfather'},
{front:'La grand-mère', back:'Grandmother'},
{front:"L'oncle", back:'Uncle'},
{front:'La tante', back:'Aunt'},
{front:'Le fils', back:'Son'},
{front:'La fille', back:'Daughter'},
{front:'Le mari', back:'Husband'},
{front:'La femme', back:'Wife'},
],
'Le Temps': [
{front:'Il fait beau', back:'The weather is nice'},
{front:'Il fait mauvais', back:'The weather is bad'},
{front:'Il fait chaud', back:'It is hot'},
{front:'Il fait froid', back:'It is cold'},
{front:'Il pleut', back:'It is raining'},
{front:'Il neige', back:'It is snowing'},
{front:'Il gèle', back:'It freezes / It is freezing'},
{front:'Il y a du vent', back:"It's windy"},
{front:'Il y a du soleil', back:'There is sunshine'},
{front:'Il y a des nuages', back:'There are clouds'},
{front:'Il y a du brouillard',back:'There is fog'},
],
};
const quizData = {
etre: {
label: 'Être (To Be)',
questions: [
{q:'Je ___ (I am)', ans:['suis']},
{q:'Tu ___ (you are, informal)', ans:['es']},
{q:'Il ___ (he is)', ans:['est']},
{q:'Elle ___ (she is)', ans:['est']},
{q:'On ___ (one is)', ans:['est']},
{q:'Nous ___ (we are)', ans:['sommes']},
{q:'Vous ___ (you are, formal/pl)', ans:['êtes','etes']},
{q:'Ils ___ (they are, masc.)', ans:['sont']},
{q:'Elles ___ (they are, fem.)', ans:['sont']},
]
},
avoir: {
label: 'Avoir (To Have)',
questions: [
{q:"J'___ (I have)", ans:['ai']},
{q:'Tu ___ (you have)', ans:['as']},
{q:'Il ___ (he has)', ans:['a']},
{q:'Elle ___ (she has)', ans:['a']},
{q:'On ___ (one has)', ans:['a']},
{q:'Nous ___ (we have)', ans:['avons']},
{q:'Vous ___ (you have)', ans:['avez']},
{q:'Ils ___ (they have, masc.)', ans:['ont']},
{q:'Elles ___ (they have, fem.)', ans:['ont']},
]
},
jours: {
label: 'Jours & Mois',
questions: [
{q:'Monday in French?', ans:['Lundi','lundi']},
{q:'Tuesday in French?', ans:['Mardi','mardi']},
{q:'Wednesday in French?', ans:['Mercredi','mercredi']},
{q:'Thursday in French?', ans:['Jeudi','jeudi']},
{q:'Friday in French?', ans:['Vendredi','vendredi']},
{q:'Saturday in French?', ans:['Samedi','samedi']},
{q:'Sunday in French?', ans:['Dimanche','dimanche']},
{q:'January in French?', ans:['Janvier','janvier']},
{q:'February in French?', ans:['Février','fevrier','Fevrier']},
{q:'March in French?', ans:['Mars','mars']},
{q:'April in French?', ans:['Avril','avril']},
{q:'June in French?', ans:['Juin','juin']},
{q:'September in French?', ans:['Septembre','septembre']},
{q:'December in French?', ans:['Décembre','decembre','Decembre']},
]
},
vocab: {
label: 'Vocabulaire',
questions: [
{q:'Un chat = ?', ans:['a cat','cat']},
{q:'Un chien = ?', ans:['a dog','dog']},
{q:'Un lapin = ?', ans:['a rabbit','rabbit']},
{q:'Un cheval = ?', ans:['a horse','horse']},
{q:'Un poisson rouge = ?', ans:['a goldfish','goldfish']},
{q:'Le salon = ?', ans:['living room','the living room']},
{q:'La cuisine = ?', ans:['kitchen','the kitchen']},
{q:'La chambre = ?', ans:['bedroom','the bedroom']},
{q:'La salle de bains = ?', ans:['bathroom','the bathroom']},
{q:'Le jardin = ?', ans:['garden','the garden']},
{q:'Il fait beau = ?', ans:['the weather is nice','it is nice']},
{q:'Il pleut = ?', ans:['it is raining','it rains']},
]
},
opinions: {
label: 'Opinions',
questions: [
{q:'"I like" in French?', ans:["j'aime","j'aime"]},
{q:'"I love" in French?', ans:["j'adore","j'adore"]},
{q:'"I hate" in French?', ans:['je déteste','je deteste']},
{q:'"I don\'t like" in French?', ans:["je n'aime pas","je n'aime pas"]},
{q:'"Easy" in French?', ans:['facile']},
{q:'"Hard / Difficult" in French?', ans:['difficile']},
{q:'"Interesting" in French?', ans:['intéressant','interessant']},
{q:'"Boring" in French?', ans:['barbant']},
{q:'"Friendly" in French?', ans:['sympa']},
{q:'"Funny" in French?', ans:['drôle','drole']},
{q:'"Because" in French?', ans:['parce que']},
{q:'"Useful" in French?', ans:['utile']},
]
},
};
const matchSetsData = [
{ label: 'Les Jours', colL: 'Français', colR: 'English', pairs: [
{left:'Lundi', right:'Monday'},
{left:'Mardi', right:'Tuesday'},
{left:'Mercredi', right:'Wednesday'},
{left:'Jeudi', right:'Thursday'},
{left:'Vendredi', right:'Friday'},
{left:'Samedi', right:'Saturday'},
{left:'Dimanche', right:'Sunday'},
]},
{ label: 'Mois 1–6', colL: 'Français', colR: 'English', pairs: [
{left:'Janvier', right:'January'},
{left:'Février', right:'February'},
{left:'Mars', right:'March'},
{left:'Avril', right:'April'},
{left:'Mai', right:'May'},
{left:'Juin', right:'June'},
]},
{ label: 'Mois 7–12', colL: 'Français', colR: 'English', pairs: [
{left:'Juillet', right:'July'},
{left:'Août', right:'August'},
{left:'Septembre',right:'September'},
{left:'Octobre', right:'October'},
{left:'Novembre', right:'November'},
{left:'Décembre', right:'December'},
]},
{ label: 'Les Animaux', colL: 'Français', colR: 'English', pairs: [
{left:'Un chat', right:'cat'},
{left:'Un chien', right:'dog'},
{left:'Un lapin', right:'rabbit'},
{left:'Un cheval', right:'horse'},
{left:'Un hamster', right:'hamster'},
{left:'Un poisson rouge', right:'goldfish'},
{left:'Une tortue', right:'turtle'},
{left:'Une souris', right:'mouse'},
]},
];
const pracData = {
etre: {
label: 'Être – conjugation',
type: 'conj',
intro: 'Type the correct form of être (to be).',
verb: 'être',
total: 6,
items: [
{pronoun:'je', hint:'I am', ans:['suis']},
{pronoun:'tu', hint:'you are (informal)',ans:['es']},
{pronoun:'il / elle / on', hint:'he/she/one is', ans:['est']},
{pronoun:'nous', hint:'we are', ans:['sommes']},
{pronoun:'vous', hint:'you are (formal)', ans:['êtes','etes']},
{pronoun:'ils / elles', hint:'they are', ans:['sont']},
]
},
avoir: {
label: 'Avoir – conjugation',
type: 'conj',
intro: 'Type the correct form of avoir (to have).',
verb: 'avoir',
total: 6,
items: [
{pronoun:"j'", hint:'I have', ans:['ai']},
{pronoun:'tu', hint:'you have', ans:['as']},
{pronoun:'il / elle / on', hint:'he/she/one has', ans:['a']},
{pronoun:'nous', hint:'we have', ans:['avons']},
{pronoun:'vous', hint:'you have (formal)', ans:['avez']},
{pronoun:'ils / elles', hint:'they have', ans:['ont']},
]
},
aimer: {
label: 'Aimer – conjugation',
type: 'conj',
intro: 'Type the correct form of aimer (to like).',
verb: 'aimer',
total: 6,
items: [
{pronoun:"j'", hint:'I like', ans:['aime']},
{pronoun:'tu', hint:'you like', ans:['aimes']},
{pronoun:'il / elle / on', hint:'he/she likes', ans:['aime']},
{pronoun:'nous', hint:'we like', ans:['aimons']},
{pronoun:'vous', hint:'you like (pl)', ans:['aimez']},
{pronoun:'ils / elles', hint:'they like', ans:['aiment']},
]
},
possessif: {
label: 'Adjectifs possessifs',
type: 'possessif',
intro: 'Fill in the possessive adjectives.',
total: 18,
items: [
{pronoun:'my', masc:['mon'], fem:['ma'], plur:['mes']},
{pronoun:'your (informal)', masc:['ton'], fem:['ta'], plur:['tes']},
{pronoun:'his / her', masc:['son'], fem:['sa'], plur:['ses']},
{pronoun:'our', masc:['notre'], fem:['notre'], plur:['nos']},
{pronoun:'your (formal/pl)',masc:['votre'], fem:['votre'], plur:['vos']},
{pronoun:'their', masc:['leur'], fem:['leur'], plur:['leurs']},
]
},
endings: {
label: 'Terminaisons des verbes',
type: 'endings',
intro: 'Fill in the regular verb endings.',
total: 18,
items: [
{pronoun:"je / j'", er:['e'], ir:['is'], re:['s']},
{pronoun:'tu', er:['es'], ir:['is'], re:['s']},
{pronoun:'il / elle / on', er:['e'], ir:['it'], re:['-']},
{pronoun:'nous', er:['ons'], ir:['issons'], re:['ons']},
{pronoun:'vous', er:['ez'], ir:['issez'], re:['ez']},
{pronoun:'ils / elles', er:['ent'], ir:['issent'], re:['ent']},
]
},
};
const topicDefs = [
{ id:'all', label:'All Topics', iconId:'books', desc:'Practise everything',
fc:['Salutations','Les Matières','La Famille','Le Temps'],
quiz:['etre','avoir','jours','vocab','opinions'], matchIdx:[0,1,2,3],
prac:['etre','avoir','aimer','possessif','endings'] },
{ id:'salutations',label:'Salutations', iconId:'chat', desc:'Greetings & common phrases',
fc:['Salutations'], quiz:[], matchIdx:[], prac:[] },
{ id:'matieres', label:'Les Matières', iconId:'school', desc:'School subjects',
fc:['Les Matières'], quiz:[], matchIdx:[], prac:[] },
{ id:'famille', label:'La Famille', iconId:'users', desc:'Family members',
fc:['La Famille'], quiz:[], matchIdx:[], prac:[] },
{ id:'temps', label:'Le Temps', iconId:'cloud', desc:'Weather expressions',
fc:['Le Temps'], quiz:[], matchIdx:[], prac:[] },
{ id:'verbes', label:'Les Verbes', iconId:'pencil', desc:'Verb conjugation',
fc:[], quiz:['etre','avoir'], matchIdx:[],
prac:['etre','avoir','aimer','possessif','endings'] },
{ id:'calendrier', label:'Calendrier', iconId:'calendar', desc:'Days & months',
fc:[], quiz:['jours'], matchIdx:[0,1,2], prac:[] },
{ id:'vocabulaire',label:'Vocabulaire', iconId:'text', desc:'Animals & possessives',
fc:[], quiz:['vocab','opinions'], matchIdx:[3], prac:[] },
];
let currentTopic = topicDefs[0];
// ═══════════════════════════════════════
// FLASHCARDS
// ═══════════════════════════════════════
let fcDeck = [], fcIdx = 0;
const fcCard = document.getElementById('fc-card');
Object.keys(fcDecks).forEach((key, i) => {
const btn = document.createElement('button');
btn.className = 'fc-set-btn' + (i === 0 ? ' active' : '');
btn.textContent = key;
btn.dataset.fcKey = key;
btn.addEventListener('click', () => {
document.querySelectorAll('.fc-set-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
loadFcDeck(key);
});
document.getElementById('fc-sets').appendChild(btn);
});
function loadFcDeck(key) {
fcDeck = [...fcDecks[key]]; fcIdx = 0;
fcCard.classList.remove('flipped');
renderFc();
}
function renderFc() {
const c = fcDeck[fcIdx];
document.getElementById('fc-front-word').textContent = c.front;
document.getElementById('fc-front-sub').textContent = c.frontSub || '';
document.getElementById('fc-back-word').textContent = c.back;
document.getElementById('fc-back-sub').textContent = c.sub || c.backSub || '';
document.getElementById('fc-counter').textContent = `${fcIdx + 1} / ${fcDeck.length}`;
document.getElementById('fc-prog-fill').style.width = `${((fcIdx + 1) / fcDeck.length) * 100}%`;
fcCard.classList.remove('flipped');
}
function flipCard() { fcCard.classList.toggle('flipped'); }
function fcMove(dir) { fcIdx = (fcIdx + dir + fcDeck.length) % fcDeck.length; renderFc(); }
if (Object.keys(fcDecks).length) loadFcDeck(Object.keys(fcDecks)[0]);
// ═══════════════════════════════════════
// QUIZ
// ═══════════════════════════════════════
const mcqSetKeys = Object.keys(quizData);
let mcqCurrent = mcqSetKeys[0], mcqIdx = 0, mcqScore = 0, mcqAnswered = false;
mcqSetKeys.forEach((key, i) => {
const btn = document.createElement('button');
btn.className = 'mcq-set-btn' + (i === 0 ? ' active' : '');
btn.textContent = quizData[key].label;
btn.dataset.quizKey = key;
btn.addEventListener('click', () => {
document.querySelectorAll('.mcq-set-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
loadMcq(key);
});
document.getElementById('mcq-sets').appendChild(btn);
});
function buildMcqOpts(correctAns, allAns) {
const seen = new Set([norm(correctAns[0])]);
const wrong = [];
allAns.forEach(a => {
if (!seen.has(norm(a[0]))) { seen.add(norm(a[0])); wrong.push(a[0]); }
});
const picked = wrong.sort(() => Math.random() - .5).slice(0, 3);
const opts = [correctAns[0], ...picked].sort(() => Math.random() - .5);
const ansIdx = opts.findIndex(o => norm(o) === norm(correctAns[0]));
return { opts, ansIdx };
}
function loadMcq(key) {
mcqCurrent = key; mcqIdx = 0; mcqScore = 0; mcqAnswered = false;
document.getElementById('mcq-title').textContent = quizData[key].label;
renderMcq();
}
function renderMcq() {
const ex = quizData[mcqCurrent];
const q = ex.questions[mcqIdx];
mcqAnswered = false;
document.getElementById('mcq-fb').textContent = '';
document.getElementById('mcq-next').style.display = 'none';
document.getElementById('mcq-prog-txt').textContent = `${mcqIdx + 1} / ${ex.questions.length}`;
document.getElementById('mcq-prog-fill').style.width = `${((mcqIdx + 1) / ex.questions.length) * 100}%`;
document.getElementById('mcq-q').textContent = q.q;
const allAns = ex.questions.map(qq => qq.ans);
const { opts, ansIdx } = buildMcqOpts(q.ans, allAns);
const optsEl = document.getElementById('mcq-opts');
optsEl.innerHTML = '';
opts.forEach((opt, i) => {
const btn = document.createElement('button');
btn.className = 'mcq-opt'; btn.textContent = opt;
btn.addEventListener('click', () => answerMcq(i, ansIdx, opts[ansIdx]));
optsEl.appendChild(btn);
});
}
function answerMcq(chosen, correct, correctText) {
if (mcqAnswered) return;
mcqAnswered = true;
const btns = document.getElementById('mcq-opts').querySelectorAll('.mcq-opt');
btns.forEach(b => b.disabled = true);
if (chosen === correct) {
btns[chosen].classList.add('correct'); mcqScore++;
document.getElementById('mcq-fb').textContent = 'Correct!';
} else {
btns[chosen].classList.add('wrong');
btns[correct].classList.add('correct');
document.getElementById('mcq-fb').textContent = 'Answer: ' + correctText;
}
const nxt = document.getElementById('mcq-next');
nxt.style.display = 'inline-flex';
nxt.textContent = mcqIdx < quizData[mcqCurrent].questions.length - 1 ? 'Next →' : 'See results';
}
document.getElementById('mcq-next').addEventListener('click', () => {
const ex = quizData[mcqCurrent];
mcqIdx++;
if (mcqIdx < ex.questions.length) { renderMcq(); return; }
const pct = Math.round(mcqScore / ex.questions.length * 100);
document.getElementById('mcq-body').innerHTML = `<div class="mcq-result">
<h2>${mcqScore} / ${ex.questions.length}</h2>
<p>${pct === 100 ? 'Parfait !' : pct >= 70 ? 'Bien fait !' : 'Continue à pratiquer !'}</p>
<div style="display:flex;gap:.5rem;justify-content:center;">
<button class="btn btn-ghost" onclick="loadMcq('${mcqCurrent}')">Retry</button>
</div>
</div>`;
document.getElementById('mcq-next').style.display = 'none';
document.getElementById('mcq-fb').textContent = '';
});
if (mcqSetKeys.length) loadMcq(mcqSetKeys[0]);
// ═══════════════════════════════════════
// MATCHING GAME
// ═══════════════════════════════════════
let matchPairs = [], matchSelected = null, matchMatched = 0;
matchSetsData.forEach((s, i) => {
const btn = document.createElement('button');
btn.className = 'match-set-btn' + (i === 0 ? ' active' : '');
btn.textContent = s.label;
btn.dataset.matchIdx = String(i);
btn.addEventListener('click', () => {
document.querySelectorAll('.match-set-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
loadMatch(s);
});
document.getElementById('match-sets').appendChild(btn);
});
function loadMatch(setDef) {
matchSelected = null; matchMatched = 0;
matchPairs = setDef.pairs.map(p => ({ ...p, matched: false }));
const shuffledRight = [...matchPairs].sort(() => Math.random() - .5);
document.getElementById('match-score').textContent = `0 / ${matchPairs.length} matched`;
const area = document.getElementById('match-area');
area.innerHTML = '';
const grid = document.createElement('div'); grid.className = 'match-grid';
const leftCol = document.createElement('div'); leftCol.className = 'match-col';
const rightCol = document.createElement('div'); rightCol.className = 'match-col';