-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlearn.html
More file actions
718 lines (631 loc) · 38.6 KB
/
Copy pathlearn.html
File metadata and controls
718 lines (631 loc) · 38.6 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
<!DOCTYPE html>
<html lang="uk">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Хімарій — Задачник</title>
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#0d0e1a">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>
@font-face{font-family:Oxanium;font-style:normal;font-weight:400;font-display:swap;src:url('fonts/oxanium-latin-400-normal.woff2') format('woff2')}
@font-face{font-family:Oxanium;font-style:normal;font-weight:700;font-display:swap;src:url('fonts/oxanium-latin-700-normal.woff2') format('woff2')}
@font-face{font-family:Oxanium;font-style:normal;font-weight:900;font-display:swap;src:url('fonts/oxanium-latin-900-normal.woff2') format('woff2')}
@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:swap;src:url('fonts/inter-latin-300-normal.woff2') format('woff2')}
@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url('fonts/inter-latin-400-normal.woff2') format('woff2')}
@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url('fonts/inter-latin-500-normal.woff2') format('woff2')}
@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url('fonts/inter-latin-600-normal.woff2') format('woff2')}
@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:swap;src:url('fonts/inter-cyrillic-300-normal.woff2') format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url('fonts/inter-cyrillic-400-normal.woff2') format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url('fonts/inter-cyrillic-500-normal.woff2') format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url('fonts/inter-cyrillic-600-normal.woff2') format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
*{box-sizing:border-box;margin:0;padding:0}
body{background:#0d0e1a;color:#fff;font-family:Inter,sans-serif;min-height:100vh}
.kr{max-width:1400px;margin:0 auto}
/* ── HERO ── */
.hero{position:relative;padding:24px 40px 20px;display:flex;align-items:center;gap:24px;border-bottom:.5px solid rgba(105,240,174,.15)}
.mol{flex-shrink:0;width:108px;height:108px}.mol svg{width:100%;height:100%}
.drop-anim{animation:3s ease-in-out infinite dropPulse}
@keyframes dropPulse{0%,100%{opacity:.9;transform:scale(1)}50%{opacity:1;transform:scale(1.05)}}
.brand-label{font-family:Oxanium,monospace;font-size:9px;letter-spacing:4px;color:#69F0AE;text-transform:uppercase;margin-bottom:4px;opacity:.8}
.brand-title{font-family:Oxanium,monospace;font-size:34px;font-weight:900;color:#fff;line-height:1;letter-spacing:-1px;margin-bottom:2px}
.brand-title span{color:#69F0AE}
.brand-sub{font-size:11px;color:#c0d0f0;font-weight:300}
.ver{position:absolute;top:10px;right:16px;font-family:Oxanium,monospace;font-size:9px;color:#90a0cc;letter-spacing:2px}
.back-btn{display:inline-flex;align-items:center;gap:7px;padding:7px 16px;background:#111224;border:.5px solid rgba(105,240,174,.2);border-radius:20px;color:#69F0AE;font-size:12px;font-family:Inter,sans-serif;text-decoration:none;transition:.18s;margin-top:8px}
.back-btn:hover{background:#1a1f3a;border-color:#69F0AE;color:#fff}
/* ── ХАБ: секції + типи ── */
.hub{padding:28px 40px}
.hub-meta{font-family:Oxanium,monospace;font-size:10px;color:#5a7a6a;letter-spacing:1px;margin-bottom:20px;text-transform:uppercase}
.hub-meta span{color:#69F0AE}
.section{margin-bottom:16px;border:.5px solid #1e2240;border-radius:14px;overflow:hidden;background:#0c0e1e}
.section-header{padding:16px 20px;display:flex;align-items:center;gap:14px;cursor:pointer;user-select:none;transition:.2s;border-bottom:.5px solid transparent}
.section-header:hover{background:#111428}
.section.open .section-header{border-bottom:.5px solid rgba(105,240,174,.1);background:#0e1228}
.section-icon{font-size:20px;flex-shrink:0}
.section-info{flex:1}
.section-title{font-family:Oxanium,monospace;font-size:14px;font-weight:700;color:#c0d8e0;margin-bottom:2px}
.section-count{font-family:Oxanium,monospace;font-size:9px;color:#4a6a5a;letter-spacing:1px}
.section-count span{color:#69F0AE}
.section-arrow{font-size:14px;color:#69F0AE;opacity:.5;transition:transform .25s}
.section.open .section-arrow{transform:rotate(90deg)}
.section-body{max-height:0;overflow:hidden;transition:max-height .35s cubic-bezier(.4,0,.2,1)}
.section.open .section-body{max-height:2000px}
.section-grid{padding:12px 16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:8px}
.type-card{background:#0e1122;border:.5px solid #1e2240;border-radius:10px;padding:14px 16px;cursor:pointer;transition:.2s;display:flex;align-items:center;gap:12px}
.type-card:hover{border-color:#69F0AE;background:#111a26;transform:translateY(-1px)}
.type-card-num{font-family:Oxanium,monospace;font-size:10px;color:#3a5040;min-width:24px}
.type-card-body{flex:1}
.type-card-title{font-size:13px;font-weight:600;color:#c0d8cc;margin-bottom:2px}
.type-card-count{font-family:Oxanium,monospace;font-size:9px;color:#3a6050;letter-spacing:1px}
.type-card-arrow{color:#69F0AE;font-size:14px;opacity:.5}
/* ── ЕКРАН ТИПУ (список задач) ── */
.type-screen{display:none;padding:28px 40px}
.type-screen.active{display:block}
.type-header{margin-bottom:20px}
.type-header-title{font-family:Oxanium,monospace;font-size:20px;font-weight:700;color:#fff;margin-bottom:4px}
.type-header-sub{font-size:11px;color:#5a7a6a}
.task-list{display:flex;flex-direction:column;gap:8px}
.task-list-item{display:flex;align-items:center;gap:14px;padding:14px 18px;background:#0e1122;border:.5px solid #1e2240;border-radius:10px;cursor:pointer;transition:.2s}
.task-list-item:hover{border-color:#69F0AE;background:#111a26}
.task-list-item.is-example{border-left:3px solid #69F0AE}
.task-list-num{font-family:Oxanium,monospace;font-size:11px;color:#3a5040;min-width:28px}
.task-list-label{font-size:9px;font-family:Oxanium,monospace;letter-spacing:1px;color:#69F0AE;background:rgba(105,240,174,.08);border:.5px solid rgba(105,240,174,.2);border-radius:3px;padding:1px 6px;margin-left:6px}
.task-list-condition{flex:1;font-size:13px;color:#c0d8cc;line-height:1.5}
.task-list-arrow{color:#69F0AE;font-size:14px;opacity:.5}
/* ── ЕКРАН ЗАДАЧІ ── */
.task-screen{display:none;padding:28px 40px}
.task-screen.active{display:block}
.breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:24px;font-size:12px;color:#5a7a6a;flex-wrap:wrap}
.breadcrumb a{color:#69F0AE;text-decoration:none;cursor:pointer}
.breadcrumb a:hover{color:#fff}
.breadcrumb-sep{opacity:.4}
.task-progress{margin-bottom:20px}
.progress-label{font-family:Oxanium,monospace;font-size:9px;color:#5a7a6a;letter-spacing:1px;margin-bottom:6px;text-transform:uppercase}
.progress-bar{height:3px;background:#1e2240;border-radius:2px;overflow:hidden}
.progress-fill{height:100%;background:linear-gradient(90deg,#69F0AE,#4FC3F7);border-radius:2px;transition:width .4s}
.task-header{margin-bottom:20px}
.task-type-badge{display:inline-block;font-family:Oxanium,monospace;font-size:9px;letter-spacing:1.5px;text-transform:uppercase;color:#69F0AE;background:rgba(105,240,174,.08);border:.5px solid rgba(105,240,174,.2);border-radius:4px;padding:2px 10px;margin-bottom:10px}
.task-title{font-family:Oxanium,monospace;font-size:20px;font-weight:700;color:#fff;margin-bottom:4px}
.task-topic-link{font-size:11px;color:#4FC3F7;text-decoration:none;opacity:.7;transition:.15s}
.task-topic-link:hover{opacity:1}
/* ── ПРИКЛАД ── */
.example-block{background:#0a1410;border:.5px solid rgba(105,240,174,.15);border-radius:12px;margin-bottom:20px;overflow:hidden}
.example-header{padding:14px 18px;border-bottom:.5px solid rgba(105,240,174,.1);display:flex;align-items:center;gap:10px;cursor:pointer;user-select:none}
.example-icon{font-size:18px}
.example-label{font-family:Oxanium,monospace;font-size:10px;letter-spacing:2px;color:#69F0AE;text-transform:uppercase;flex:1}
.example-toggle{font-size:12px;color:#69F0AE;transition:transform .25s}
.example-block.open .example-toggle{transform:rotate(90deg)}
.example-body{max-height:0;overflow:hidden;transition:max-height .4s cubic-bezier(.4,0,.2,1)}
.example-block.open .example-body{max-height:3000px}
.example-inner{padding:18px}
.example-condition{background:#0d1a12;border-left:3px solid #69F0AE;border-radius:0 8px 8px 0;padding:12px 16px;margin-bottom:16px;font-size:13px;color:#c0d8cc;line-height:1.6}
.example-intro{font-size:13px;color:#8ab8a0;line-height:1.7;margin-bottom:16px;font-style:italic}
.step{display:flex;gap:12px;margin-bottom:12px}
.step-num{font-family:Oxanium,monospace;font-size:11px;color:#69F0AE;background:rgba(105,240,174,.1);border:.5px solid rgba(105,240,174,.2);border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px}
.step-body{flex:1}
.step-action{font-size:13px;color:#e0f0e8;line-height:1.6;margin-bottom:4px;font-weight:500}
.step-why{font-size:12px;color:#6a9880;line-height:1.6;padding-left:10px;border-left:2px solid rgba(105,240,174,.15)}
.step-result{font-family:Oxanium,monospace;font-size:11px;color:#69F0AE;background:rgba(105,240,174,.06);border-radius:4px;padding:3px 8px;display:inline-block;margin-top:4px}
.example-conclusion{background:#0a1f14;border:.5px solid rgba(105,240,174,.12);border-radius:8px;padding:12px 16px;margin-top:16px;font-size:12px;color:#7aaa88;line-height:1.7}
.example-conclusion::before{content:"💡 ";opacity:.7}
/* ── ЗАДАЧА ── */
.task-block{background:#0e1122;border:.5px solid #1e2240;border-radius:12px;padding:20px}
.task-block-label{font-family:Oxanium,monospace;font-size:9px;letter-spacing:2px;color:#4FC3F7;text-transform:uppercase;margin-bottom:10px}
.task-condition{font-size:14px;color:#e0ecff;line-height:1.65;margin-bottom:20px;padding:14px 16px;background:#080e1a;border-radius:8px;border:.5px solid #1a2240}
.answer-row{display:flex;align-items:center;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.answer-input{background:#080e1a;border:.5px solid #2a3560;border-radius:8px;color:#fff;font-family:Oxanium,monospace;font-size:16px;padding:10px 14px;width:160px;outline:none;transition:.2s}
.answer-input:focus{border-color:#4FC3F7}
.answer-input.correct{border-color:#69F0AE;background:#080f0a}
.answer-input.wrong{border-color:#ff5252;background:#100808}
.answer-unit{font-family:Oxanium,monospace;font-size:12px;color:#5a7a9a}
.btn-check{background:linear-gradient(135deg,rgba(105,240,174,.15),rgba(105,240,174,.08));border:.5px solid #69F0AE;border-radius:8px;padding:10px 24px;color:#69F0AE;font-family:Oxanium,monospace;font-size:12px;cursor:pointer;letter-spacing:1px;transition:.18s}
.btn-check:hover{background:rgba(105,240,174,.2);color:#fff}
.btn-check:disabled{opacity:.4;cursor:not-allowed}
.hints-section{margin-top:4px}
.btn-hint{background:none;border:.5px solid #2a3560;border-radius:8px;padding:8px 16px;color:#5a7a9a;font-size:12px;cursor:pointer;transition:.18s;font-family:Inter,sans-serif;display:flex;align-items:center;gap:6px;margin-bottom:8px}
.btn-hint:hover{border-color:#4FC3F7;color:#4FC3F7}
.hint-card{background:#080d18;border:.5px solid rgba(79,195,247,.15);border-radius:8px;padding:11px 14px;margin-bottom:8px;font-size:12px;color:#8aaccc;line-height:1.7;animation:fadeIn .3s ease}
.hint-card strong{color:#4FC3F7}
@keyframes fadeIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.result-block{display:none;margin-top:16px;border-radius:10px;padding:16px;animation:fadeIn .3s ease}
.result-block.correct{background:rgba(105,240,174,.06);border:.5px solid rgba(105,240,174,.25)}
.result-block.wrong{background:rgba(255,82,82,.05);border:.5px solid rgba(255,82,82,.2)}
.result-icon{font-size:22px;margin-bottom:8px}
.result-title{font-family:Oxanium,monospace;font-size:13px;font-weight:700;margin-bottom:8px}
.result-block.correct .result-title{color:#69F0AE}
.result-block.wrong .result-title{color:#ff7070}
.result-explain{font-size:13px;color:#8ab8a0;line-height:1.75}
.result-explain b{color:#c0d8cc}
.nav-btns{display:flex;gap:10px;margin-top:20px;flex-wrap:wrap}
.btn-next{background:linear-gradient(135deg,rgba(105,240,174,.18),rgba(105,240,174,.08));border:.5px solid #69F0AE;border-radius:8px;padding:10px 28px;color:#69F0AE;font-family:Oxanium,monospace;font-size:12px;cursor:pointer;letter-spacing:1px;transition:.18s}
.btn-next:hover{background:rgba(105,240,174,.25);color:#fff}
.btn-back-hub{background:none;border:.5px solid #2a3560;border-radius:8px;padding:10px 20px;color:#5a7a9a;font-size:12px;cursor:pointer;transition:.18s;font-family:Inter,sans-serif}
.btn-back-hub:hover{border-color:#69F0AE;color:#69F0AE}
.topic-refs{margin-top:16px;display:flex;flex-wrap:wrap;gap:6px}
.topic-ref{font-family:Oxanium,monospace;font-size:9px;color:#4FC3F7;background:rgba(79,195,247,.06);border:.5px solid rgba(79,195,247,.18);border-radius:4px;padding:2px 8px;text-decoration:none;transition:.15s}
.topic-ref:hover{background:rgba(79,195,247,.12);color:#fff}
/* ── FOOTER ── */
.footer{padding:16px 40px;border-top:.5px solid #1e2240;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-top:40px}
.footer-brand{font-family:Oxanium,monospace;font-size:10px;color:#7080b8;letter-spacing:2px}
.footer-back{display:inline-flex;align-items:center;gap:6px;color:#69F0AE;font-size:11px;text-decoration:none;transition:color .15s}
.footer-back:hover{color:#fff}
/* ── RESPONSIVE ── */
@media(max-width:768px){
.hero{padding:12px 14px;gap:14px}.brand-title{font-size:24px}
.hub{padding:16px 12px}
.type-screen{padding:16px 12px}
.task-screen{padding:16px 12px}
.section-grid{grid-template-columns:1fr;padding:10px 12px}
.answer-input{width:130px}
.footer{padding:12px 14px;flex-direction:column;align-items:flex-start}
}
@media(max-width:480px){.brand-title{font-size:20px}.mol{width:80px;height:80px}}
</style>
</head>
<body>
<div class="kr">
<!-- HERO -->
<div class="hero">
<div class="ver">v2.0.0</div>
<div class="mol">
<svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="glow1"><feGaussianBlur stdDeviation="2.5" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge></filter>
<filter id="glow2"><feGaussianBlur stdDeviation="5" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge></filter>
</defs>
<g class="drop-anim">
<rect x="52" y="18" width="10" height="55" rx="2" fill="rgba(105,240,174,0.08)" stroke="#69F0AE" stroke-width="1" opacity="0.8"/>
<polygon points="52,73 62,73 57,88" fill="#69F0AE" opacity="0.7"/>
<rect x="52" y="18" width="10" height="10" rx="2" fill="rgba(255,100,100,0.3)" stroke="#ff7070" stroke-width="0.7"/>
<line x1="38" y1="35" x2="50" y2="35" stroke="#69F0AE" stroke-width="0.6" opacity="0.4"/>
<line x1="38" y1="42" x2="50" y2="42" stroke="#69F0AE" stroke-width="0.6" opacity="0.3"/>
<line x1="38" y1="49" x2="50" y2="49" stroke="#69F0AE" stroke-width="0.6" opacity="0.2"/>
<line x1="64" y1="35" x2="80" y2="35" stroke="#69F0AE" stroke-width="0.6" opacity="0.4"/>
<line x1="64" y1="42" x2="78" y2="42" stroke="#69F0AE" stroke-width="0.6" opacity="0.3"/>
<line x1="64" y1="49" x2="76" y2="49" stroke="#69F0AE" stroke-width="0.6" opacity="0.2"/>
<text x="57" y="105" text-anchor="middle" fill="#69F0AE" font-size="9" font-family="Oxanium,monospace" opacity="0.6">H₂O</text>
<circle cx="30" cy="60" r="7" fill="rgba(105,240,174,0.1)" stroke="#69F0AE" stroke-width="0.8" filter="url(#glow1)"/>
<text x="30" y="64" text-anchor="middle" fill="#69F0AE" font-size="6" font-weight="700" font-family="Oxanium,monospace">Na</text>
<circle cx="88" cy="60" r="6" fill="rgba(79,195,247,0.1)" stroke="#4FC3F7" stroke-width="0.8" filter="url(#glow1)"/>
<text x="88" y="64" text-anchor="middle" fill="#4FC3F7" font-size="6" font-weight="700" font-family="Oxanium,monospace">Cl</text>
<line x1="37" y1="60" x2="50" y2="60" stroke="#69F0AE" stroke-width="0.7" opacity="0.3"/>
<line x1="64" y1="60" x2="81" y2="60" stroke="#4FC3F7" stroke-width="0.7" opacity="0.3"/>
<ellipse cx="57" cy="90" rx="16" ry="4" fill="#69F0AE" opacity="0.04" filter="url(#glow2)">
<animate attributeName="opacity" values="0.02;0.08;0.02" dur="3s" repeatCount="indefinite"/>
</ellipse>
</g>
</svg>
</div>
<div>
<div class="brand-label">Розрахункові задачі</div>
<div class="brand-title">Хім<span>арій</span></div>
<div class="brand-sub">Задачник — від простого до складного, крок за кроком</div>
<a href="index.html" class="back-btn">← Повернутись до Хімарію</a>
</div>
</div>
<!-- ═══ ХАБ — секції з типами ═══ -->
<div class="hub" id="hub-screen">
<div class="hub-meta" id="hub-meta">Завантаження...</div>
<div id="hub-sections"></div>
</div>
<!-- ═══ ЕКРАН ТИПУ — список задач ═══ -->
<div class="type-screen" id="type-screen">
<div class="breadcrumb">
<a onclick="showHub()">📚 Задачник</a>
<span class="breadcrumb-sep">›</span>
<span id="ts-section-name"></span>
<span class="breadcrumb-sep">›</span>
<span id="ts-type-name"></span>
</div>
<div class="type-header">
<div class="type-header-title" id="ts-title"></div>
<div class="type-header-sub" id="ts-sub"></div>
</div>
<div class="task-list" id="ts-list"></div>
</div>
<!-- ═══ ЕКРАН ЗАДАЧІ ═══ -->
<div class="task-screen" id="task-screen">
<div class="breadcrumb">
<a onclick="showHub()">📚 Задачник</a>
<span class="breadcrumb-sep">›</span>
<a id="bc-type" onclick="backToType()"></a>
<span class="breadcrumb-sep">›</span>
<span id="bc-task"></span>
</div>
<div class="task-progress">
<div class="progress-label">Прогрес — <span id="prog-text"></span></div>
<div class="progress-bar"><div class="progress-fill" id="prog-fill"></div></div>
</div>
<div class="task-header">
<div class="task-type-badge" id="t-badge"></div>
<div class="task-title" id="t-title"></div>
<a class="task-topic-link" id="t-topic-link" href="index.html" target="_blank">📖 Відкрити тему в довіднику</a>
</div>
<!-- ПРИКЛАД (показується тільки якщо є) -->
<div class="example-block" id="example-block" style="display:none">
<div class="example-header" onclick="toggleExample()">
<span class="example-icon">📘</span>
<span class="example-label">Розбір прикладу</span>
<span class="example-toggle">▶</span>
</div>
<div class="example-body">
<div class="example-inner">
<div class="example-condition" id="ex-condition"></div>
<div class="example-intro" id="ex-intro"></div>
<div id="ex-steps"></div>
<div class="example-conclusion" id="ex-conclusion"></div>
</div>
</div>
</div>
<!-- ЗАДАЧА -->
<div class="task-block">
<div class="task-block-label">🎯 Твоя задача</div>
<div class="task-condition" id="t-condition"></div>
<div class="answer-row">
<input class="answer-input" type="text" id="answer-input"
placeholder="Відповідь..."
onkeydown="if(event.key==='Enter')checkAnswer()">
<span class="answer-unit" id="answer-unit"></span>
<button class="btn-check" id="btn-check" onclick="checkAnswer()">Перевірити</button>
</div>
<div class="hints-section" id="hints-section"></div>
<div class="result-block" id="result-block">
<div class="result-icon" id="result-icon"></div>
<div class="result-title" id="result-title"></div>
<div class="result-explain" id="result-explain"></div>
</div>
<div class="topic-refs" id="topic-refs"></div>
<div class="nav-btns" id="nav-btns" style="display:none">
<button class="btn-next" onclick="nextTask()">Наступна задача →</button>
<button class="btn-back-hub" onclick="backToType()">← До списку задач</button>
</div>
</div>
</div><!-- .task-screen -->
<div class="footer">
<div class="footer-brand">CHIMARIUM · ЗАДАЧНИК</div>
<a href="index.html" class="footer-back">← Повернутись до Хімарію</a>
</div>
</div><!-- .kr -->
<script>
// ═══════════════════════════════════════════════════════════════
// КОНФІГ — 6 розділів
// ═══════════════════════════════════════════════════════════════
const SECTIONS = [
{
id: 'formula', icon: '🧮', title: 'A. Формули',
types: ['a-mr','a-mass-fraction','a-mol-mass','a-avogadro','a-formula-frac','a-formula-comb','a-unknown-elem']
},
{
id: 'gas', icon: '💨', title: 'B. Гази',
types: ['b-gas-volume','b-gas-density','b-gas-mix']
},
{
id: 'solution', icon: '🧪', title: 'C. Розчини',
types: ['c-mass-fraction','c-molarity','c-density','c-mixing','c-dilution','c-crystallohydrate','c-mixing-rule']
},
{
id: 'reaction', icon: '🔥', title: 'D. Реакції',
types: ['d-stoich','d-excess','d-impurities','d-yield','d-chain','d-plate','d-solution-rxn','d-mixture']
},
{
id: 'physchem', icon: '⚡', title: 'E. Фізхім',
types: ['e-thermo','e-kinetics','e-equilibrium','e-electrolysis','e-ecological']
},
{
id: 'combo', icon: '🧩', title: 'F. Комбіновані',
types: ['f-combo','f-cryptogram']
}
];
const TOPIC_LABELS = {
'1-1-atom':'Будова атому','1-2-periodic':'Періодичний закон',
'1-3-bond':'Хімічний зв\'язок','1-4-states':'Агрегатні стани',
'1-5-gases':'Газові закони','2-1-inorganic-classes':'Класи неорг. сполук',
'2-2-s-elements':'s-елементи','2-3-p-elements':'p-елементи',
'2-4-d-f-elements':'d,f-елементи','3-1-thermodynamics':'Термодинаміка',
'3-2-kinetics':'Кінетика','3-3-equilibrium':'Рівновага',
'3-4-electrochemistry':'Електрохімія','3-5-phase':'Фазові рівноваги',
'4-1-dissolving':'Розчинення','4-2-concentration':'Концентрація',
'4-3-electrolytes':'Електроліти','4-5-colloids':'Колоїди',
'5-1-organic-basics':'Основи орг. хімії','5-2-hydrocarbons':'Вуглеводні',
'5-4-oxygen-compounds':'Оксигенвмісні','5-5-nitrogen-compounds':'Нітрогенвмісні',
'5-6-polymers':'Полімери','6-1-qualitative':'Якісний аналіз'
};
// ═══════════════════════════════════════════════════════════════
// СТАН
// ═══════════════════════════════════════════════════════════════
let ALL_TASKS = [];
let currentType = null;
let currentSectionId = null;
let currentTypeTasks = [];
let currentTaskIndex = 0;
let currentTask = null;
let hintsShown = 0;
let answered = false;
// ═══════════════════════════════════════════════════════════════
// ЗАВАНТАЖЕННЯ
// ═══════════════════════════════════════════════════════════════
async function loadTasks() {
try {
const r = await fetch('data/tasks.json');
ALL_TASKS = await r.json();
} catch(e) {
document.getElementById('hub-meta').textContent = '⚠️ Файл data/tasks.json не знайдено';
return;
}
renderHub();
}
// ═══════════════════════════════════════════════════════════════
// УТИЛІТИ
// ═══════════════════════════════════════════════════════════════
function getTasksByType(typeId) {
return ALL_TASKS.filter(t => t.type === typeId);
}
function getTypeTitle(typeId) {
const t = ALL_TASKS.find(x => x.type === typeId);
return t ? t.title : typeId;
}
// ═══════════════════════════════════════════════════════════════
// ХАБ — секції з типами
// ═══════════════════════════════════════════════════════════════
function renderHub() {
const totalTypes = new Set(ALL_TASKS.map(t => t.type)).size;
document.getElementById('hub-meta').innerHTML =
'<span>' + ALL_TASKS.length + '</span> задач · <span>' + totalTypes + '</span> типів · 6 розділів';
const container = document.getElementById('hub-sections');
let html = '';
SECTIONS.forEach(function(sec, si) {
const typesWithTasks = sec.types.filter(function(t) { return getTasksByType(t).length > 0; });
let totalInSection = 0;
sec.types.forEach(function(t) { totalInSection += getTasksByType(t).length; });
const isEmpty = typesWithTasks.length === 0;
html += '<div class="section' + (si === 0 ? ' open' : '') + '" id="sec-' + sec.id + '">';
html += '<div class="section-header" onclick="toggleSection(\'' + sec.id + '\')">';
html += '<div class="section-icon">' + sec.icon + '</div>';
html += '<div class="section-info">';
html += '<div class="section-title">' + sec.title + '</div>';
html += '<div class="section-count">';
if (isEmpty) {
html += 'Поки порожній — скоро буде';
} else {
html += '<span>' + typesWithTasks.length + '</span> типів · <span>' + totalInSection + '</span> задач';
}
html += '</div></div>';
html += '<div class="section-arrow">▶</div>';
html += '</div>';
html += '<div class="section-body"><div class="section-grid">';
typesWithTasks.forEach(function(typeId, ti) {
const count = getTasksByType(typeId).length;
html += '<div class="type-card" onclick="openType(\'' + typeId + '\',\'' + sec.id + '\')">';
html += '<div class="type-card-num">' + String(ti + 1).padStart(2, '0') + '</div>';
html += '<div class="type-card-body">';
html += '<div class="type-card-title">' + getTypeTitle(typeId) + '</div>';
html += '<div class="type-card-count">' + count + ' задач</div>';
html += '</div>';
html += '<div class="type-card-arrow">›</div>';
html += '</div>';
});
html += '</div></div></div>';
});
container.innerHTML = html;
}
function toggleSection(id) {
document.getElementById('sec-' + id).classList.toggle('open');
}
// ═══════════════════════════════════════════════════════════════
// ЕКРАН ТИПУ — список задач
// ═══════════════════════════════════════════════════════════════
function openType(typeId, sectionId) {
currentType = typeId;
currentSectionId = sectionId;
currentTypeTasks = getTasksByType(typeId);
var sec = null;
for (var i = 0; i < SECTIONS.length; i++) {
if (SECTIONS[i].id === sectionId) { sec = SECTIONS[i]; break; }
}
document.getElementById('hub-screen').style.display = 'none';
document.getElementById('task-screen').classList.remove('active');
document.getElementById('type-screen').classList.add('active');
document.getElementById('ts-section-name').textContent = sec ? sec.title : '';
document.getElementById('ts-type-name').textContent = getTypeTitle(typeId);
document.getElementById('ts-title').textContent = getTypeTitle(typeId);
document.getElementById('ts-sub').textContent = currentTypeTasks.length + ' задач';
var list = document.getElementById('ts-list');
var lhtml = '';
currentTypeTasks.forEach(function(t, i) {
var hasEx = !!t.example;
var cond = t.task ? t.task.condition : (t.example ? t.example.condition : '—');
lhtml += '<div class="task-list-item' + (hasEx ? ' is-example' : '') + '" onclick="startTask(' + i + ')">';
lhtml += '<div class="task-list-num">' + String(i + 1).padStart(2, '0') + '</div>';
lhtml += '<div class="task-list-condition">';
lhtml += cond;
if (hasEx) lhtml += '<span class="task-list-label">з прикладом</span>';
lhtml += '</div>';
lhtml += '<div class="task-list-arrow">›</div>';
lhtml += '</div>';
});
list.innerHTML = lhtml;
window.scrollTo(0, 0);
}
function backToType() {
if (currentType && currentSectionId) {
openType(currentType, currentSectionId);
} else {
showHub();
}
}
// ═══════════════════════════════════════════════════════════════
// ПОКАЗАТИ ХАБ
// ═══════════════════════════════════════════════════════════════
function showHub() {
document.getElementById('hub-screen').style.display = 'block';
document.getElementById('type-screen').classList.remove('active');
document.getElementById('task-screen').classList.remove('active');
window.scrollTo(0, 0);
}
// ═══════════════════════════════════════════════════════════════
// СТАРТ ЗАДАЧІ
// ═══════════════════════════════════════════════════════════════
function startTask(indexInType) {
currentTaskIndex = indexInType;
currentTask = currentTypeTasks[indexInType];
hintsShown = 0;
answered = false;
document.getElementById('type-screen').classList.remove('active');
document.getElementById('task-screen').classList.add('active');
renderTask();
window.scrollTo(0, 0);
}
// ═══════════════════════════════════════════════════════════════
// РЕНДЕР ЗАДАЧІ
// ═══════════════════════════════════════════════════════════════
function renderTask() {
var t = currentTask;
var ex = t.example || null;
var task = t.task;
// Хлібні крихти
document.getElementById('bc-type').textContent = t.title;
document.getElementById('bc-task').textContent = 'Задача ' + (currentTaskIndex + 1);
// Прогрес
var total = currentTypeTasks.length;
document.getElementById('prog-text').textContent = (currentTaskIndex + 1) + ' з ' + total;
document.getElementById('prog-fill').style.width = (((currentTaskIndex + 1) / total) * 100) + '%';
// Заголовок
document.getElementById('t-badge').textContent = t.title;
document.getElementById('t-title').textContent = task.condition;
document.getElementById('t-topic-link').href = 'index.html#topic-' + t.topic;
// Приклад — показати тільки якщо є
var exBlock = document.getElementById('example-block');
if (ex) {
exBlock.style.display = 'block';
exBlock.classList.add('open');
document.getElementById('ex-condition').innerHTML = ex.condition;
document.getElementById('ex-intro').innerHTML = ex.intro;
document.getElementById('ex-conclusion').innerHTML = ex.conclusion;
var shtml = '';
ex.steps.forEach(function(s, i) {
shtml += '<div class="step">';
shtml += '<div class="step-num">' + (i + 1) + '</div>';
shtml += '<div class="step-body">';
shtml += '<div class="step-action">' + s.action + '</div>';
shtml += '<div class="step-why">' + s.why + '</div>';
shtml += '<div class="step-result">' + s.result + '</div>';
shtml += '</div></div>';
});
document.getElementById('ex-steps').innerHTML = shtml;
} else {
exBlock.style.display = 'none';
exBlock.classList.remove('open');
}
// Задача
document.getElementById('t-condition').innerHTML = task.condition;
// Відповідь
var inp = document.getElementById('answer-input');
inp.value = '';
inp.className = 'answer-input';
inp.disabled = false;
document.getElementById('answer-unit').textContent = task.unit || '';
document.getElementById('btn-check').disabled = false;
// Підказки
hintsShown = 0;
renderHints();
// Результат — сховати
var rb = document.getElementById('result-block');
rb.style.display = 'none';
rb.className = 'result-block';
// Навігація — сховати
document.getElementById('nav-btns').style.display = 'none';
// Посилання на теми
var refs = document.getElementById('topic-refs');
var topics = t.topics || [t.topic];
var rhtml = '';
topics.forEach(function(tp) {
rhtml += '<a class="topic-ref" href="index.html#topic-' + tp + '" target="_blank">📖 ' + (TOPIC_LABELS[tp] || tp) + '</a>';
});
refs.innerHTML = rhtml;
}
// ═══════════════════════════════════════════════════════════════
// ПІДКАЗКИ
// ═══════════════════════════════════════════════════════════════
function renderHints() {
var hints = currentTask.task.hints || [];
var sec = document.getElementById('hints-section');
var html = '';
for (var i = 0; i < hintsShown; i++) {
html += '<div class="hint-card"><strong>Підказка ' + (i + 1) + ':</strong> ' + hints[i] + '</div>';
}
if (hintsShown < hints.length && !answered) {
html += '<button class="btn-hint" onclick="showHint()">💡 Підказка ' + (hintsShown + 1) + ' з ' + hints.length + '</button>';
}
sec.innerHTML = html;
}
function showHint() {
if (hintsShown < currentTask.task.hints.length) {
hintsShown++;
renderHints();
}
}
// ═══════════════════════════════════════════════════════════════
// ПЕРЕВІРКА ВІДПОВІДІ
// ═══════════════════════════════════════════════════════════════
function checkAnswer() {
if (answered) return;
var inp = document.getElementById('answer-input');
var raw = inp.value.trim().replace(',', '.');
var userVal = parseFloat(raw);
var task = currentTask.task;
if (typeof task.answer === 'string') {
var correct = raw.toLowerCase().replace(/\s/g, '') ===
task.answer.toLowerCase().replace(/\s/g, '');
showResult(correct, task);
inp.className = 'answer-input ' + (correct ? 'correct' : 'wrong');
} else {
if (isNaN(userVal)) {
inp.style.borderColor = '#ff5252';
inp.placeholder = 'Введи число!';
return;
}
var correct = Math.abs(userVal - task.answer) <= (task.tolerance || 0.01);
showResult(correct, task);
inp.className = 'answer-input ' + (correct ? 'correct' : 'wrong');
}
answered = true;
inp.disabled = true;
document.getElementById('btn-check').disabled = true;
document.getElementById('nav-btns').style.display = 'flex';
renderHints();
}
function showResult(correct, task) {
var rb = document.getElementById('result-block');
rb.style.display = 'block';
rb.className = 'result-block ' + (correct ? 'correct' : 'wrong');
document.getElementById('result-icon').textContent = correct ? '✅' : '❌';
document.getElementById('result-title').textContent = correct
? 'Правильно! Чудова робота!'
: 'Не зовсім. Правильна відповідь: ' + task.answer + (task.unit ? ' ' + task.unit : '');
document.getElementById('result-explain').innerHTML = task.explain;
}
// ═══════════════════════════════════════════════════════════════
// НАСТУПНА ЗАДАЧА
// ═══════════════════════════════════════════════════════════════
function nextTask() {
if (currentTaskIndex < currentTypeTasks.length - 1) {
startTask(currentTaskIndex + 1);
} else {
backToType();
}
}
// ═══════════════════════════════════════════════════════════════
// ПРИКЛАД TOGGLE
// ═══════════════════════════════════════════════════════════════
function toggleExample() {
document.getElementById('example-block').classList.toggle('open');
}
// ═══════════════════════════════════════════════════════════════
// СТАРТ
// ═══════════════════════════════════════════════════════════════
loadTasks();
</script>
</body>
</html>