-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1304 lines (1182 loc) · 66.8 KB
/
index.html
File metadata and controls
1304 lines (1182 loc) · 66.8 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="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AprendeMáquina 🧠 — Descubra o Machine Learning</title>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Syne:wght@700;800&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0C0E1A;
--surface: #131629;
--surface2: #1A1E35;
--border: rgba(255,255,255,0.07);
--cyan: #00E5FF;
--verde: #00E096;
--roxo: #B06EFF;
--rosa: #FF4FA3;
--laranja: #FF7D3B;
--amarelo: #FFD166;
--texto: #E8EAF6;
--muted: #7B82A6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Space Grotesk', sans-serif;
background: var(--bg);
color: var(--texto);
min-height: 100vh;
overflow-x: hidden;
}
/* Animated grid background */
body::before {
content: '';
position: fixed;
inset: 0;
background-image: linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
background-size: 40px 40px;
pointer-events: none;
z-index: 0;
}
body::after {
content: '';
position: fixed;
inset: 0;
background: radial-gradient(ellipse at 15% 30%, rgba(176,110,255,0.12) 0%, transparent 55%),
radial-gradient(ellipse at 85% 70%, rgba(0,229,255,0.1) 0%, transparent 55%);
pointer-events: none;
z-index: 0;
}
.wrap { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 20px; }
/* HEADER */
header { text-align: center; padding: 36px 20px 24px; }
.header-tag {
display: inline-block;
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.15em;
text-transform: uppercase;
color: var(--cyan);
border: 1px solid rgba(0,229,255,0.3);
padding: 5px 14px;
border-radius: 50px;
margin-bottom: 16px;
}
header h1 {
font-family: 'Syne', sans-serif;
font-size: clamp(2rem, 6vw, 3.4rem);
font-weight: 800;
line-height: 1.1;
background: linear-gradient(135deg, var(--cyan) 0%, var(--roxo) 50%, var(--rosa) 100%);
-webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
header p { color: var(--muted); margin-top: 10px; font-size: 1rem; font-weight: 500; }
/* TABS */
.tabs {
display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 24px 0 22px;
}
.tab-btn {
font-family: 'Space Grotesk', sans-serif;
font-size: 0.88rem; font-weight: 700;
padding: 9px 18px; border-radius: 10px;
border: 1px solid var(--border);
background: var(--surface); color: var(--muted);
cursor: pointer; transition: all 0.22s;
}
.tab-btn:hover { color: var(--texto); border-color: rgba(255,255,255,0.15); }
.tab-btn.active { color: var(--bg); border-color: transparent; }
.tab-btn[data-tab="intro"].active { background: var(--cyan); }
.tab-btn[data-tab="crianca"].active { background: var(--verde); }
.tab-btn[data-tab="treinar"].active { background: var(--roxo); }
.tab-btn[data-tab="bias"].active { background: var(--laranja); }
.tab-btn[data-tab="quiz"].active { background: var(--rosa); }
.tab-pane { display: none; animation: fadeUp 0.3s ease; }
.tab-pane.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
/* CARD */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 18px;
padding: 26px;
margin-bottom: 18px;
}
.card-label {
display: inline-flex; align-items: center; gap: 6px;
font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
text-transform: uppercase; margin-bottom: 12px;
padding: 4px 12px; border-radius: 50px;
}
.card h2 { font-family: 'Syne', sans-serif; font-size: 1.5rem; margin-bottom: 10px; }
.card p { color: var(--muted); line-height: 1.75; font-size: 0.95rem; }
.card strong { color: var(--texto); }
.callout {
border-radius: 12px; padding: 16px 18px; margin: 14px 0;
font-size: 0.93rem; font-weight: 600; line-height: 1.65;
}
.callout-cyan { background: rgba(0,229,255,0.07); border: 1px solid rgba(0,229,255,0.2); color: var(--texto); }
.callout-verde { background: rgba(0,224,150,0.07); border: 1px solid rgba(0,224,150,0.2); color: var(--texto); }
.callout-roxo { background: rgba(176,110,255,0.08); border: 1px solid rgba(176,110,255,0.25); color: var(--texto); }
.callout-laranja { background: rgba(255,125,59,0.08); border: 1px solid rgba(255,125,59,0.25); color: var(--texto); }
.pill {
display: inline-block; padding: 3px 11px; border-radius: 50px;
font-size: 0.75rem; font-weight: 700; margin: 2px;
}
/* BTN */
.btn {
font-family: 'Space Grotesk', sans-serif; font-size: 0.92rem; font-weight: 700;
padding: 11px 24px; border-radius: 10px; border: none; cursor: pointer;
transition: all 0.18s; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active { transform: none; }
.btn-cyan { background: var(--cyan); color: var(--bg); }
.btn-verde { background: var(--verde); color: var(--bg); }
.btn-roxo { background: var(--roxo); color: white; }
.btn-rosa { background: var(--rosa); color: white; }
.btn-ghost { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--texto); }
/* =============================================
TAB 1: INTRO — Conceito + Comparação
============================================= */
.compare-grid {
display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px;
}
.compare-box {
background: var(--surface2); border-radius: 14px; padding: 18px;
border: 1px solid var(--border);
}
.compare-box h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.compare-box p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.compare-box .ico { font-size: 2rem; margin-bottom: 10px; }
.tipos-grid {
display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 14px; margin-top: 16px;
}
.tipo-card {
background: var(--surface2); border-radius: 14px; padding: 20px;
border: 1px solid var(--border); transition: transform 0.2s;
}
.tipo-card:hover { transform: translateY(-4px); }
.tipo-card .ico { font-size: 2.2rem; margin-bottom: 10px; }
.tipo-card h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; }
.tipo-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }
.tipo-card .ex { font-size: 0.78rem; margin-top: 8px; color: var(--cyan); font-weight: 600; }
/* =============================================
TAB 2: CRIANÇA — Aprende como Criança
============================================= */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content:''; position:absolute; left:9px; top:0; bottom:0; width:2px; background: linear-gradient(to bottom, var(--cyan), var(--roxo)); border-radius: 2px; }
.tl-item { position: relative; margin-bottom: 24px; }
.tl-dot { position: absolute; left: -24px; top: 6px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid; }
.tl-content { background: var(--surface2); border-radius: 12px; padding: 14px 16px; border: 1px solid var(--border); }
.tl-content h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 5px; }
.tl-content p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
/* FOTO INTERACTIVE */
.foto-game { text-align: center; }
.foto-grid {
display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0;
}
.foto-card {
background: var(--surface2); border: 2px solid var(--border); border-radius: 14px;
padding: 16px 8px; cursor: pointer; transition: all 0.22s; text-align: center;
}
.foto-card:hover { transform: scale(1.05); border-color: rgba(255,255,255,0.2); }
.foto-card.correta { border-color: var(--verde); background: rgba(0,224,150,0.1); }
.foto-card.errada { border-color: var(--rosa); background: rgba(255,79,163,0.1); animation: shake 0.3s; }
.foto-card.vista { opacity: 0.4; pointer-events: none; }
.foto-card .emoji { font-size: 2.4rem; margin-bottom: 6px; }
.foto-card .label { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.foto-pergunta {
background: rgba(0,229,255,0.07); border: 1px solid rgba(0,229,255,0.25);
border-radius: 12px; padding: 14px 18px; margin-bottom: 14px;
font-weight: 700; font-size: 1rem; color: var(--texto);
}
.foto-feedback {
min-height: 44px; padding: 12px 16px; border-radius: 10px;
font-weight: 700; font-size: 0.9rem; transition: all 0.3s; margin-top: 10px;
}
.feedback-ok { background: rgba(0,224,150,0.12); border: 1px solid var(--verde); color: var(--verde); }
.feedback-err { background: rgba(255,79,163,0.1); border: 1px solid var(--rosa); color: var(--rosa); }
.epoch-bar { margin: 14px 0; }
.epoch-bar-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.bar-track { height: 10px; background: rgba(255,255,255,0.07); border-radius: 50px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 50px; transition: width 0.5s ease; background: linear-gradient(90deg, var(--cyan), var(--verde)); }
/* =============================================
TAB 3: TREINAR — Treine seu modelo
============================================= */
.treinar-instruction {
display: flex; align-items: center; gap: 10px;
background: rgba(176,110,255,0.08); border: 1px solid rgba(176,110,255,0.25);
border-radius: 12px; padding: 13px 16px; margin-bottom: 16px;
font-size: 0.88rem; font-weight: 600; color: var(--texto); line-height: 1.5;
}
.treinar-instruction .inst-icon { font-size: 1.6rem; flex-shrink: 0; }
.data-pool {
display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px;
padding: 18px; background: var(--surface2); border-radius: 16px;
border: 1px solid var(--border); min-height: 80px;
}
.data-pool-label {
font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
color: var(--muted); margin-bottom: 10px; display: block;
}
/* Draggable card */
.drag-card {
display: inline-flex; align-items: center; gap: 8px;
padding: 10px 16px; border-radius: 12px; font-size: 0.85rem; font-weight: 700;
cursor: grab; transition: all 0.18s; border: 1px solid rgba(255,255,255,0.12);
background: rgba(255,255,255,0.05); color: var(--texto);
user-select: none; position: relative; touch-action: none;
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.drag-card::before { content: '⠿'; font-size: 1rem; color: var(--muted); flex-shrink: 0; }
.drag-card:hover { transform: translateY(-2px) scale(1.02); border-color: rgba(255,255,255,0.25); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.drag-card:active, .drag-card.dragging {
opacity: 0.35; cursor: grabbing; transform: scale(0.96);
}
.drag-card.placed-pos { background: rgba(0,224,150,0.12); border-color: rgba(0,224,150,0.4); color: var(--verde); cursor: default; }
.drag-card.placed-neg { background: rgba(255,79,163,0.1); border-color: rgba(255,79,163,0.35); color: var(--rosa); cursor: default; }
.drag-card.placed-pos::before, .drag-card.placed-neg::before { content: '✓'; }
.drag-card.wrong-drop { animation: wrongDrop 0.5s ease; border-color: var(--laranja); }
@keyframes wrongDrop {
0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)}
}
/* Ghost element while dragging */
.drag-ghost {
position: fixed; pointer-events: none; z-index: 9999;
padding: 10px 16px; border-radius: 12px; font-size: 0.85rem; font-weight: 700;
background: rgba(176,110,255,0.9); color: white; border: 2px solid var(--roxo);
box-shadow: 0 8px 32px rgba(0,0,0,0.5); opacity: 0.92;
transform: rotate(-2deg) scale(1.05); white-space: nowrap;
max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.training-area {
display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 16px;
}
.train-box {
background: var(--surface2); border-radius: 16px; padding: 18px;
border: 2px dashed rgba(255,255,255,0.1); min-height: 140px;
transition: border-color 0.2s, background 0.2s, transform 0.15s;
position: relative;
}
.train-box.drag-over-pos {
border-color: var(--verde); border-style: solid;
background: rgba(0,224,150,0.07);
transform: scale(1.01);
}
.train-box.drag-over-neg {
border-color: var(--rosa); border-style: solid;
background: rgba(255,79,163,0.06);
transform: scale(1.01);
}
.train-box-header {
display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.train-box-header h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.train-box-hint {
position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
font-size: 0.82rem; color: rgba(255,255,255,0.15); font-weight: 600; pointer-events: none;
flex-direction: column; gap: 6px; transition: opacity 0.2s;
}
.train-box-hint .hint-icon { font-size: 2rem; opacity: 0.3; }
.train-box.has-items .train-box-hint { opacity: 0; }
.train-box .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.model-brain {
text-align: center; padding: 24px; background: var(--surface2);
border-radius: 18px; border: 1px solid var(--border); margin: 16px 0; position: relative; overflow: hidden;
}
.brain-icon { font-size: 4rem; margin-bottom: 10px; display: block; }
.accuracy-meter { margin: 16px 0 8px; }
.accuracy-meter label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.08em; text-transform: uppercase; }
.acc-track { height: 14px; background: rgba(255,255,255,0.07); border-radius: 50px; overflow: hidden; }
.acc-fill { height: 100%; border-radius: 50px; background: linear-gradient(90deg, var(--rosa), var(--amarelo), var(--verde)); transition: width 0.6s ease; }
.acc-value { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; color: var(--cyan); margin-top: 8px; }
.predict-area {
background: var(--surface2); border-radius: 14px; padding: 20px; margin-top: 16px;
}
.predict-input {
display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
}
.predict-input input {
flex: 1; min-width: 180px; background: var(--bg); border: 1px solid rgba(255,255,255,0.12);
border-radius: 10px; padding: 10px 14px; color: var(--texto);
font-family: 'Space Grotesk', sans-serif; font-size: 0.92rem; outline: none;
transition: border-color 0.2s;
}
.predict-input input:focus { border-color: var(--cyan); }
.predict-result {
padding: 14px 16px; border-radius: 10px; font-weight: 700; font-size: 0.95rem;
min-height: 50px; transition: all 0.3s;
}
/* =============================================
TAB 4: VIÉS — Bias e Responsabilidade
============================================= */
.vies-scenario {
background: var(--surface2); border-radius: 14px; padding: 20px; margin-bottom: 14px;
}
.vies-scenario h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.vies-scenario p { font-size: 0.88rem; color: var(--muted); line-height: 1.65; margin-bottom: 12px; }
.vies-options { display: flex; flex-direction: column; gap: 8px; }
.vies-opt {
background: rgba(255,255,255,0.03); border: 1px solid var(--border);
border-radius: 10px; padding: 12px 14px; cursor: pointer;
font-size: 0.88rem; font-weight: 600; color: var(--texto); text-align: left;
font-family: 'Space Grotesk', sans-serif; transition: all 0.2s;
}
.vies-opt:hover:not(:disabled) { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }
.vies-opt.correta { border-color: var(--verde); background: rgba(0,224,150,0.1); color: var(--verde); }
.vies-opt.errada { border-color: var(--rosa); background: rgba(255,79,163,0.08); color: var(--rosa); }
.vies-explicacao { display: none; margin-top: 12px; padding: 14px; border-radius: 10px; font-size: 0.88rem; line-height: 1.65; }
.vies-explicacao.show { display: block; animation: fadeUp 0.3s; }
.nav-scenario { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.scenario-counter { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
/* =============================================
TAB 5: QUIZ
============================================= */
.quiz-prog-bar { height: 5px; background: rgba(255,255,255,0.07); border-radius: 10px; margin-bottom: 20px; }
.quiz-prog-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--roxo), var(--rosa)); transition: width 0.4s; }
.quiz-q { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; line-height: 1.55; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.qopt {
background: var(--surface2); border: 1px solid var(--border);
border-radius: 12px; padding: 13px 16px; cursor: pointer;
font-family: 'Space Grotesk', sans-serif; font-size: 0.9rem; font-weight: 600;
color: var(--texto); text-align: left; transition: all 0.18s;
}
.qopt:hover:not(:disabled) { border-color: rgba(255,255,255,0.2); transform: translateX(4px); }
.qopt.right { border-color: var(--verde); background: rgba(0,224,150,0.1); }
.qopt.wrong { border-color: var(--rosa); background: rgba(255,79,163,0.08); }
.qopt:disabled { cursor: default; }
.quiz-fb { display:none; margin-top:14px; padding:14px 16px; border-radius:12px; font-size:0.88rem; font-weight:600; line-height:1.6; }
.quiz-fb.show { display:block; animation:fadeUp 0.3s; }
.quiz-fb.ok { background:rgba(0,224,150,0.1); border:1px solid var(--verde); color:var(--verde); }
.quiz-fb.no { background:rgba(255,79,163,0.08); border:1px solid var(--rosa); color:var(--rosa); }
.quiz-nav2 { display:flex; justify-content:space-between; align-items:center; margin-top:16px; }
.final-score { text-align:center; padding:30px 10px; }
.score-big { font-family:'Syne',sans-serif; font-size:4rem; font-weight:800; background:linear-gradient(135deg,var(--cyan),var(--roxo)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.score-stars { font-size:2rem; margin:10px 0; }
.score-msg { font-size:1rem; color:var(--muted); margin:8px 0 20px; line-height:1.6; }
footer { text-align:center; padding:30px; color:var(--muted); font-size:0.82rem; border-top:1px solid var(--border); margin-top:20px; }
@media(max-width:560px){
.compare-grid { grid-template-columns:1fr; }
.training-area { grid-template-columns:1fr; }
.foto-grid { grid-template-columns: repeat(2,1fr); }
}
</style>
</head>
<body>
<div class="wrap">
<header>
<div class="header-tag">✦ Módulo 2 · IA na Pedagogia</div>
<h1>🧠 AprendeMáquina</h1>
<p>Entenda Machine Learning de forma intuitiva — sem código, só compreensão</p>
</header>
<div class="tabs">
<button class="tab-btn active" data-tab="intro">🌐 O que é?</button>
<button class="tab-btn" data-tab="crianca">👶 Como aprende</button>
<button class="tab-btn" data-tab="treinar">🤖 Treine um modelo</button>
<button class="tab-btn" data-tab="bias">⚠️ Vieses</button>
<button class="tab-btn" data-tab="quiz">🏆 Desafio</button>
</div>
<!-- ============================================================ TAB 1: INTRO -->
<div class="tab-pane active" id="tab-intro">
<div class="card">
<div class="card-label" style="background:rgba(0,229,255,0.1);color:var(--cyan)">📖 Conceito Central</div>
<h2 style="color:var(--cyan)">O que é Machine Learning?</h2>
<p>No módulo anterior aprendemos que um algoritmo é uma <strong>lista de instruções que nós escrevemos</strong>. O programador diz exatamente o que o computador deve fazer em cada situação.</p>
<p style="margin-top:10px">Machine Learning (Aprendizado de Máquina) é diferente: <strong>o computador aprende a partir de exemplos</strong>, sem que ninguém precise escrever todas as regras. Ele encontra os padrões sozinho!</p>
<div class="callout callout-cyan" style="margin-top:14px">
🧠 Machine Learning = dar muitos exemplos ao computador para que ele descubra as regras por conta própria
</div>
</div>
<div class="card">
<h2 style="color:var(--amarelo)">🆚 Algoritmo tradicional vs. Machine Learning</h2>
<p>Veja a diferença na prática:</p>
<div class="compare-grid">
<div class="compare-box">
<div class="ico">📋</div>
<h3 style="color:var(--cyan)">Algoritmo Tradicional</h3>
<p>O programador escreve cada regra manualmente:<br><br>
<strong style="color:var(--texto)">"SE o e-mail tem a palavra 'promoção' E vem de remetente desconhecido → ENTÃO é spam"</strong><br><br>
Regras fixas. Quem errar a regra, o sistema erra também.</p>
</div>
<div class="compare-box">
<div class="ico">🧠</div>
<h3 style="color:var(--roxo)">Machine Learning</h3>
<p>O sistema analisa <strong>10.000 e-mails spam</strong> e <strong>10.000 e-mails normais</strong>.<br><br>
Ele mesmo descobre quais padrões indicam spam — palavras, hora de envio, frequência — <strong>sem que ninguém explique as regras.</strong></p>
</div>
</div>
<div class="callout callout-verde" style="margin-top:14px">
💡 Pense assim: no algoritmo, você ensina o peixe a pescar explicando cada movimento. No ML, você mostra mil fotos de pesca e o computador aprende sozinho como fazer.
</div>
</div>
<div class="card">
<h2 style="color:var(--verde)">🌍 ML está em todo lugar</h2>
<div class="tipos-grid">
<div class="tipo-card">
<div class="ico">📸</div>
<h3>Reconhecimento de Fotos</h3>
<p>O celular detecta rostos em fotos, separa pessoas de objetos. Foi "treinado" com milhões de imagens.</p>
<div class="ex">→ Google Fotos, Face ID</div>
</div>
<div class="tipo-card">
<div class="ico">🎬</div>
<h3>Recomendação</h3>
<p>Aprende seus gostos ao analisar o que você assiste, curte e para de ver.</p>
<div class="ex">→ Netflix, YouTube, TikTok</div>
</div>
<div class="tipo-card">
<div class="ico">🗣️</div>
<h3>Voz e Tradução</h3>
<p>Entende o que você fala e traduz idiomas. Treinou com bilhões de frases faladas e escritas.</p>
<div class="ex">→ Siri, Google Tradutor</div>
</div>
<div class="tipo-card">
<div class="ico">🏥</div>
<h3>Diagnóstico Médico</h3>
<p>Analisa exames e identifica doenças com precisão. Aprendeu com centenas de milhares de exames.</p>
<div class="ex">→ Detecção de câncer, raio-X</div>
</div>
<div class="tipo-card">
<div class="ico">🏫</div>
<h3>Plataformas de Ensino</h3>
<p>Adapta exercícios ao ritmo de cada aluno. Identifica onde o estudante tem mais dificuldade.</p>
<div class="ex">→ Duolingo, Khan Academy</div>
</div>
<div class="tipo-card">
<div class="ico">✍️</div>
<h3>Assistentes de Escrita</h3>
<p>Sugerem palavras, corrigem textos e até geram parágrafos. Aprenderam com bilhões de textos.</p>
<div class="ex">→ ChatGPT, Gemini, Claude</div>
</div>
</div>
</div>
<div class="card">
<h2 style="color:var(--roxo)">🎓 Os 3 tipos de aprendizado</h2>
<div class="tipos-grid">
<div class="tipo-card" style="border-color:rgba(0,229,255,0.2)">
<div class="ico">👩🏫</div>
<h3 style="color:var(--cyan)">Supervisionado</h3>
<p>Aprende com exemplos <strong>rotulados</strong>. "Esta foto é um gato ✓. Esta foto é um cachorro ✓." A máquina recebe a resposta certa durante o treino.</p>
</div>
<div class="tipo-card" style="border-color:rgba(176,110,255,0.25)">
<div class="ico">🔍</div>
<h3 style="color:var(--roxo)">Não-supervisionado</h3>
<p>Aprende sem rótulos — <strong>agrupa dados parecidos</strong> por conta própria. Como separar alunos em grupos por perfil de aprendizagem.</p>
</div>
<div class="tipo-card" style="border-color:rgba(255,209,102,0.25)">
<div class="ico">🎮</div>
<h3 style="color:var(--amarelo)">Por reforço</h3>
<p>Aprende tentando e errando, recebendo <strong>recompensas</strong> pelos acertos. Como um jogo: faz algo bom → ganha ponto → repete o comportamento.</p>
</div>
</div>
</div>
<div style="text-align:center;margin:10px 0 20px">
<button class="btn btn-cyan" onclick="goTab('crianca')">👉 Ver como a máquina aprende →</button>
</div>
</div>
<!-- ============================================================ TAB 2: COMO APRENDE -->
<div class="tab-pane" id="tab-crianca">
<div class="card">
<div class="card-label" style="background:rgba(0,224,150,0.1);color:var(--verde)">🎮 Jogo 1</div>
<h2 style="color:var(--verde)">👶 A Máquina Aprende como uma Criança</h2>
<p>Uma criança aprende a reconhecer animais vendo muitos exemplos. Uma rede neural faz exatamente isso! Veja como o processo acontece:</p>
</div>
<div class="card">
<h2 style="color:var(--amarelo)" style="margin-bottom:14px">📚 Como funciona o treinamento?</h2>
<div class="timeline">
<div class="tl-item">
<div class="tl-dot" style="background:var(--cyan);border-color:var(--cyan)"></div>
<div class="tl-content">
<h4 style="color:var(--cyan)">1️⃣ Dados de treinamento</h4>
<p>Mostramos milhares de exemplos com as respostas corretas: fotos de gatos com o rótulo "gato", fotos de cachorros com o rótulo "cachorro".</p>
</div>
</div>
<div class="tl-item">
<div class="tl-dot" style="background:var(--roxo);border-color:var(--roxo)"></div>
<div class="tl-content">
<h4 style="color:var(--roxo)">2️⃣ O modelo chuta uma resposta</h4>
<p>O modelo tenta adivinhar. No começo, ele erra bastante — como uma criança que ainda está aprendendo as palavras.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-dot" style="background:var(--laranja);border-color:var(--laranja)"></div>
<div class="tl-content">
<h4 style="color:var(--laranja)">3️⃣ Calcula o erro</h4>
<p>Comparamos a resposta do modelo com a resposta certa. Quanto maior a diferença, maior o erro. Isso chama-se <strong style="color:var(--texto)">"função de perda"</strong>.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-dot" style="background:var(--amarelo);border-color:var(--amarelo)"></div>
<div class="tl-content">
<h4 style="color:var(--amarelo)">4️⃣ Ajusta os pesos</h4>
<p>O modelo ajusta seus parâmetros internos para errar menos na próxima vez. Como corrigir o lápis na mão depois de escrever feio.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-dot" style="background:var(--verde);border-color:var(--verde)"></div>
<div class="tl-content">
<h4 style="color:var(--verde)">5️⃣ Repete milhares de vezes (épocas)</h4>
<p>O ciclo se repete com todos os exemplos — uma <strong style="color:var(--texto)">época</strong> é uma passagem completa pelos dados. Com muitas épocas, o modelo fica cada vez mais preciso.</p>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-label" style="background:rgba(0,224,150,0.1);color:var(--verde)">🎮 Jogar agora</div>
<h2 style="color:var(--verde)">🐾 Você é a Rede Neural!</h2>
<p style="margin-bottom:16px">Simule o aprendizado de uma rede neural: identifique os animais corretamente. A cada acerto seu "modelo" fica mais preciso. Veja a precisão crescer!</p>
<div class="foto-pergunta" id="fotoQ">Clique em "Iniciar treinamento" para começar!</div>
<div class="epoch-bar">
<div class="epoch-bar-label"><span>🎯 Precisão do modelo</span><span id="epochAcc">0%</span></div>
<div class="bar-track"><div class="bar-fill" id="epochFill" style="width:0%"></div></div>
</div>
<div class="epoch-bar">
<div class="epoch-bar-label"><span>📦 Dados treinados</span><span id="epochCount">0 / 12</span></div>
<div class="bar-track"><div class="bar-fill" id="epochCountFill" style="width:0%;background:linear-gradient(90deg,var(--roxo),var(--rosa))"></div></div>
</div>
<div class="foto-grid" id="fotoGrid"></div>
<div class="foto-feedback" id="fotoFb"></div>
<div style="margin-top:16px;display:flex;gap:10px;flex-wrap:wrap">
<button class="btn btn-verde" id="btnFotoStart" onclick="startFotoGame()">▶ Iniciar treinamento</button>
<button class="btn btn-ghost" onclick="resetFotoGame()">🔄 Reiniciar</button>
</div>
</div>
</div>
<!-- ============================================================ TAB 3: TREINAR MODELO -->
<div class="tab-pane" id="tab-treinar">
<div class="card">
<div class="card-label" style="background:rgba(176,110,255,0.1);color:var(--roxo)">🎮 Jogo 2</div>
<h2 style="color:var(--roxo)">🤖 Treine um Detector de Sentimentos</h2>
<p>Uma das tarefas mais comuns de ML é a <strong>análise de sentimentos</strong>: ler um texto e dizer se é positivo ou negativo. É como o modelo que o Google usa para analisar avaliações de produtos.</p>
<p style="margin-top:8px">Abaixo estão avaliações de uma escola fictícia. <strong>Arraste</strong> cada avaliação para a caixa correta — positivo ou negativo. Depois teste o modelo!</p>
</div>
<div class="card">
<div class="treinar-instruction">
<span class="inst-icon">✋</span>
<span>Segure e arraste cada avaliação para a caixa correta abaixo. No celular, pressione e arraste com o dedo!</span>
</div>
<span class="data-pool-label">📦 Avaliações para classificar</span>
<div class="data-pool" id="dataPool"></div>
<div class="training-area">
<div class="train-box" id="boxPositivo">
<div class="train-box-header">
<h4 style="color:var(--verde)">😊 Positivo <span id="countPos">(0)</span></h4>
</div>
<div class="train-box-hint">
<span class="hint-icon">⬆️</span>
<span>Solte avaliações positivas aqui</span>
</div>
<div class="chips" id="chipsPos"></div>
</div>
<div class="train-box" id="boxNegativo">
<div class="train-box-header">
<h4 style="color:var(--rosa)">😞 Negativo <span id="countNeg">(0)</span></h4>
</div>
<div class="train-box-hint">
<span class="hint-icon">⬆️</span>
<span>Solte avaliações negativas aqui</span>
</div>
<div class="chips" id="chipsNeg"></div>
</div>
</div>
<div class="model-brain">
<span class="brain-icon" id="brainIcon">🧠</span>
<div style="font-family:'Syne',sans-serif;font-size:1rem;font-weight:700;color:var(--muted)">MODELO — análise de sentimentos</div>
<div class="accuracy-meter">
<label>Nível de treinamento</label>
<div class="acc-track"><div class="acc-fill" id="accFill" style="width:0%"></div></div>
</div>
<div class="acc-value" id="accValue">0%</div>
<div style="font-size:0.8rem;color:var(--muted);margin-top:4px" id="modelStatus">Adicione pelo menos 3 exemplos de cada tipo para treinar</div>
</div>
<div class="predict-area" id="predictArea" style="display:none">
<h3 style="font-size:1rem;font-weight:700;margin-bottom:14px;color:var(--texto)">🔮 Teste o modelo — escreva uma avaliação:</h3>
<div class="predict-input">
<input type="text" id="predictInput" placeholder="Ex: Os professores são incríveis!" />
<button class="btn btn-roxo" onclick="runPredict()">Analisar</button>
</div>
<div class="predict-result" id="predictResult" style="display:none"></div>
<div style="margin-top:14px">
<p style="font-size:0.82rem;color:var(--muted);margin-bottom:8px;font-weight:600">Ou teste com estas frases prontas:</p>
<div style="display:flex;flex-wrap:wrap;gap:8px" id="testSentences"></div>
</div>
</div>
</div>
<div class="card">
<h2 style="color:var(--amarelo)">💡 Como o modelo "decide"?</h2>
<p>O modelo aprende quais <strong>palavras</strong> aparecem mais em textos positivos e negativos. Se você escrever algo com "incrível", "excelente", "ótimo" → ele aposta em positivo. Se tiver "péssimo", "horrível", "decepcionante" → negativo. Isso é chamado de <strong style="color:var(--texto)">Naive Bayes</strong> — um dos algoritmos de ML mais simples e poderosos!</p>
<div class="callout callout-roxo" style="margin-top:12px">
🏫 <strong>Conexão pedagógica:</strong> Imagine um sistema que analisa as respostas escritas dos alunos e automaticamente identifica quem está frustrado, engajado ou confuso — sem o professor ler cada texto. É assim que plataformas adaptativas funcionam!
</div>
</div>
</div>
<!-- ============================================================ TAB 4: VIESES -->
<div class="tab-pane" id="tab-bias">
<div class="card">
<div class="card-label" style="background:rgba(255,125,59,0.12);color:var(--laranja)">⚠️ Senso Crítico</div>
<h2 style="color:var(--laranja)">O Perigo dos Vieses no Machine Learning</h2>
<p>Machine Learning aprende com dados do mundo real — e o mundo real tem desigualdades. Se os dados de treinamento forem enviesados, o modelo vai <strong>aprender e amplificar esses preconceitos</strong>.</p>
<div class="callout callout-laranja">
⚡ Caso real: em 2018, a Amazon abandonou um sistema de ML para contratar funcionários porque ele <strong>penalizava currículos de mulheres</strong> — porque foi treinado com dados históricos que refletiam uma indústria predominantemente masculina.
</div>
</div>
<div class="card">
<h2 style="color:var(--amarelo)">🎮 Analise os Cenários</h2>
<p style="margin-bottom:16px">Leia cada situação e identifique o problema. Isso é fundamental para quem vai trabalhar com tecnologia na educação!</p>
<div id="viesContainer"></div>
</div>
<div class="card">
<h2 style="color:var(--verde)">🛡️ Como combater os vieses?</h2>
<div class="tipos-grid">
<div class="tipo-card" style="border-color:rgba(0,224,150,0.2)">
<div class="ico">📊</div>
<h3 style="color:var(--verde)">Dados Diversos</h3>
<p>Incluir exemplos de diferentes grupos, gêneros, etnias, regiões geográficas e contextos socioeconômicos no treinamento.</p>
</div>
<div class="tipo-card" style="border-color:rgba(0,229,255,0.2)">
<div class="ico">🔍</div>
<h3 style="color:var(--cyan)">Auditorias Regulares</h3>
<p>Testar o sistema periodicamente com casos conhecidos para detectar discriminações antes que causem dano.</p>
</div>
<div class="tipo-card" style="border-color:rgba(176,110,255,0.25)">
<div class="ico">👥</div>
<h3 style="color:var(--roxo)">Equipes Diversas</h3>
<p>Incluir pessoas de diferentes perfis nas equipes que desenvolvem os sistemas. Perspectivas diversas identificam problemas que grupos homogêneos não percebem.</p>
</div>
<div class="tipo-card" style="border-color:rgba(255,209,102,0.25)">
<div class="ico">🧑🏫</div>
<h3 style="color:var(--amarelo)">Humano no Loop</h3>
<p>Decisões importantes — como avaliar alunos ou contratar professores — devem sempre ter um <strong>humano revisando</strong> as sugestões da IA.</p>
</div>
</div>
</div>
</div>
<!-- ============================================================ TAB 5: QUIZ -->
<div class="tab-pane" id="tab-quiz">
<div class="card">
<div class="card-label" style="background:rgba(255,79,163,0.12);color:var(--rosa)">🏆 Desafio Final</div>
<h2 style="color:var(--rosa)">Teste seus conhecimentos!</h2>
<p>Responda as perguntas para consolidar o que aprendeu sobre Machine Learning.</p>
</div>
<div class="card" id="quizCard">
<div class="quiz-prog-bar"><div class="quiz-prog-fill" id="qFill" style="width:0%"></div></div>
<div id="quizContent"></div>
</div>
</div>
</div><!-- /wrap -->
<footer>🧠 AprendeMáquina · Pedagogia & Inteligência Artificial · Os dados mudam o mundo — entendê-los muda você</footer>
<script>
// ============================================================
// TABS
// ============================================================
document.querySelectorAll('.tab-btn').forEach(b => b.addEventListener('click', () => goTab(b.dataset.tab)));
function goTab(id) {
document.querySelectorAll('.tab-btn').forEach(b => b.classList.toggle('active', b.dataset.tab===id));
document.querySelectorAll('.tab-pane').forEach(p => p.classList.toggle('active', p.id==='tab-'+id));
}
// ============================================================
// TAB 2: FOTO GAME
// ============================================================
const fotoRounds = [
{ question: 'Qual destes é um GATO? 🐱', answer: '🐱', options: [{e:'🐱',l:'Gato'},{e:'🐶',l:'Cachorro'},{e:'🐰',l:'Coelho'},{e:'🐸',l:'Sapo'}] },
{ question: 'Qual destes é um CACHORRO? 🐶', answer: '🐶', options: [{e:'🦊',l:'Raposa'},{e:'🐺',l:'Lobo'},{e:'🐶',l:'Cachorro'},{e:'🐻',l:'Urso'}] },
{ question: 'Qual destes é uma FRUTA? 🍎', answer: '🍎', options: [{e:'🥕',l:'Cenoura'},{e:'🍎',l:'Maçã'},{e:'🌽',l:'Milho'},{e:'🧅',l:'Cebola'}] },
{ question: 'Qual destes é um VEÍCULO? 🚗', answer: '🚗', options: [{e:'🏠',l:'Casa'},{e:'⛵',l:'Barco'},{e:'✈️',l:'Avião'},{e:'🚗',l:'Carro'}], note:'Barco e avião também são veículos! O modelo aprende a diferenciar categorias com mais exemplos.' },
{ question: 'Qual destes é um INSTRUMENTO MUSICAL? 🎸', answer: '🎸', options: [{e:'🎸',l:'Violão'},{e:'🔨',l:'Martelo'},{e:'🧲',l:'Imã'},{e:'💡',l:'Lâmpada'}] },
{ question: 'Qual destes é uma FLOR? 🌸', answer: '🌸', options: [{e:'🌵',l:'Cacto'},{e:'🌿',l:'Planta'},{e:'🍄',l:'Cogumelo'},{e:'🌸',l:'Flor'}] },
{ question: 'Qual destes é um PLANETA? 🪐', answer: '🪐', options: [{e:'⭐',l:'Estrela'},{e:'🌙',l:'Lua'},{e:'☄️',l:'Cometa'},{e:'🪐',l:'Saturno'}] },
{ question: 'Qual destes é um ESPORTE? ⚽', answer: '⚽', options: [{e:'🎮',l:'Videogame'},{e:'🎲',l:'Jogo de tabuleiro'},{e:'⚽',l:'Futebol'},{e:'🎬',l:'Cinema'}] },
{ question: 'Qual destes é uma FERRAMENTA? 🔧', answer: '🔧', options: [{e:'🍴',l:'Garfo'},{e:'✏️',l:'Lápis'},{e:'🔧',l:'Chave inglesa'},{e:'📚',l:'Livro'}] },
{ question: 'Qual destes é um ANIMAL AQUÁTICO? 🐠', answer: '🐠', options: [{e:'🦅',l:'Águia'},{e:'🐠',l:'Peixe'},{e:'🦎',l:'Lagarto'},{e:'🐿️',l:'Esquilo'}] },
{ question: 'Qual destes é uma COMIDA? 🍕', answer: '🍕', options: [{e:'🧴',l:'Sabonete'},{e:'📎',l:'Clipe'},{e:'🍕',l:'Pizza'},{e:'🔑',l:'Chave'}] },
{ question: 'Último dado de treino! Qual é uma EMOÇÃO? 😊', answer: '😊', options: [{e:'🌈',l:'Arco-íris'},{e:'😊',l:'Alegria'},{e:'🌊',l:'Onda'},{e:'🌸',l:'Flor'}] },
];
let fotoIndex = 0, fotoCorrect = 0, fotoActive = false;
function startFotoGame() {
fotoIndex = 0; fotoCorrect = 0; fotoActive = true;
document.getElementById('btnFotoStart').style.display = 'none';
renderFotoRound();
}
function renderFotoRound() {
if (fotoIndex >= fotoRounds.length) {
document.getElementById('fotoQ').textContent = '🎉 Treinamento concluído! Seu modelo alcançou ' + Math.round(fotoCorrect/fotoRounds.length*100) + '% de precisão!';
document.getElementById('fotoGrid').innerHTML = '';
document.getElementById('fotoFb').innerHTML = '';
return;
}
const r = fotoRounds[fotoIndex];
document.getElementById('fotoQ').textContent = 'Dado ' + (fotoIndex+1) + ' de ' + fotoRounds.length + ' — ' + r.question;
const grid = document.getElementById('fotoGrid');
const shuffled = [...r.options].sort(() => Math.random()-0.5);
grid.innerHTML = shuffled.map(o => `
<div class="foto-card" onclick="answerFoto('${o.e}')">
<div class="emoji">${o.e}</div>
<div class="label">${o.l}</div>
</div>
`).join('');
document.getElementById('fotoFb').innerHTML = '';
document.getElementById('fotoFb').className = 'foto-feedback';
}
function answerFoto(emoji) {
if (!fotoActive) return;
const r = fotoRounds[fotoIndex];
const cards = document.querySelectorAll('.foto-card');
const fb = document.getElementById('fotoFb');
cards.forEach(c => { c.classList.add('vista'); if (c.querySelector('.emoji').textContent === r.answer) c.classList.add('correta'); });
let correct = emoji === r.answer;
if (correct) fotoCorrect++;
const acc = Math.round((fotoCorrect / (fotoIndex+1)) * 100);
document.getElementById('epochAcc').textContent = acc + '%';
document.getElementById('epochFill').style.width = acc + '%';
document.getElementById('epochCount').textContent = (fotoIndex+1) + ' / ' + fotoRounds.length;
document.getElementById('epochCountFill').style.width = ((fotoIndex+1)/fotoRounds.length*100) + '%';
if (correct) {
fb.className = 'foto-feedback feedback-ok';
fb.textContent = '✅ Correto! O modelo aprende: ' + r.answer + ' = ' + r.options.find(o=>o.e===r.answer).l + (r.note ? ' — Obs: '+r.note : '');
} else {
fb.className = 'foto-feedback feedback-err';
fb.textContent = '❌ Errado. A resposta certa era ' + r.answer + '. O modelo ajusta seus pesos para acertar da próxima vez!';
}
fotoIndex++;
fotoActive = false;
setTimeout(() => {
fotoActive = true;
if (fotoIndex < fotoRounds.length) renderFotoRound();
else {
document.getElementById('fotoQ').innerHTML = '🎉 Treinamento completo! Precisão final: <strong>' + Math.round(fotoCorrect/fotoRounds.length*100) + '%</strong>. Isso é o que acontece dentro de uma rede neural — só que com milhões de exemplos!';
document.getElementById('fotoGrid').innerHTML = '';
document.getElementById('fotoFb').innerHTML = '';
}
}, 2200);
}
function resetFotoGame() {
fotoIndex = 0; fotoCorrect = 0; fotoActive = false;
document.getElementById('btnFotoStart').style.display = '';
document.getElementById('fotoQ').textContent = 'Clique em "Iniciar treinamento" para começar!';
document.getElementById('fotoGrid').innerHTML = '';
document.getElementById('fotoFb').innerHTML = '';
document.getElementById('epochAcc').textContent = '0%';
document.getElementById('epochFill').style.width = '0%';
document.getElementById('epochCount').textContent = '0 / 12';
document.getElementById('epochCountFill').style.width = '0%';
}
// ============================================================
// TAB 3: TREINAR MODELO
// ============================================================
const avaliacoes = [
{ text: 'Professores dedicados e atenciosos', sentiment: 'pos', words: ['dedicados','atenciosos'] },
{ text: 'Infraestrutura excelente e moderna', sentiment: 'pos', words: ['excelente','moderna'] },
{ text: 'Metodologia inovadora e eficiente', sentiment: 'pos', words: ['inovadora','eficiente'] },
{ text: 'Equipe pedagógica muito competente', sentiment: 'pos', words: ['competente'] },
{ text: 'Ambiente acolhedor e seguro', sentiment: 'pos', words: ['acolhedor','seguro'] },
{ text: 'Comunicação com pais é horrível', sentiment: 'neg', words: ['horrível'] },
{ text: 'Aulas monótonas e desinteressantes', sentiment: 'neg', words: ['monótonas','desinteressantes'] },
{ text: 'Gestão desorganizada e descuidada', sentiment: 'neg', words: ['desorganizada','descuidada'] },
{ text: 'Material didático péssimo e desatualizado', sentiment: 'neg', words: ['péssimo','desatualizado'] },
{ text: 'Falta de suporte aos alunos com dificuldade', sentiment: 'neg', words: ['falta','dificuldade'] },
];
let trainedPos = {}, trainedNeg = {}, posCount = 0, negCount = 0;
const posWords = new Set(['dedicados','atenciosos','excelente','moderna','inovadora','eficiente','competente','acolhedor','seguro','ótimo','incrível','maravilhoso','bom','boa','melhor','fantástico','excelente','especial','perfeito']);
const negWords = new Set(['horrível','monótonas','desinteressantes','desorganizada','descuidada','péssimo','desatualizado','falta','dificuldade','ruim','terrível','péssima','fraco','fraca','decepcionante','lamentável']);
const testPhrases = [
'As professoras são incríveis e atenciosas!',
'A escola é desorganizada e péssima',
'Adorei a metodologia inovadora',
'Gestão terrível, falta comunicação'
];
// ---- Drag & Drop State ----
let dragIdx = null; // index of card being dragged
let ghostEl = null; // floating ghost element
let touchOffX = 0, touchOffY = 0;
function buildDataPool() {
const pool = document.getElementById('dataPool');
pool.innerHTML = avaliacoes.map((a, i) => `
<div class="drag-card" id="chip-${i}" data-idx="${i}"
draggable="true"
ondragstart="onDragStart(event,${i})"
ondragend="onDragEnd(event)">
💬 ${a.text}
</div>
`).join('');
// Attach touch events after render
avaliacoes.forEach((_, i) => {
const el = document.getElementById('chip-' + i);
el.addEventListener('touchstart', onTouchStart, { passive: false });
el.addEventListener('touchmove', onTouchMove, { passive: false });
el.addEventListener('touchend', onTouchEnd, { passive: false });
});
// Drop zones
setupDropZone('boxPositivo', 'pos');
setupDropZone('boxNegativo', 'neg');
// Test phrases
const ts = document.getElementById('testSentences');
ts.innerHTML = testPhrases.map(p => `
<button class="pill" style="background:rgba(176,110,255,0.15);color:var(--roxo);cursor:pointer;font-family:'Space Grotesk',sans-serif;font-size:0.78rem" onclick="quickPredict('${p}')">"${p}"</button>
`).join('');
}
// ---- HTML5 Drag (desktop) ----
function onDragStart(e, idx) {
const el = document.getElementById('chip-' + idx);
if (el.classList.contains('placed-pos') || el.classList.contains('placed-neg')) {
e.preventDefault(); return;
}
dragIdx = idx;
el.classList.add('dragging');
e.dataTransfer.effectAllowed = 'move';
e.dataTransfer.setData('text/plain', idx);
// Invisible drag image
const blank = document.createElement('div');
blank.style.cssText = 'position:fixed;top:-9999px';
document.body.appendChild(blank);
e.dataTransfer.setDragImage(blank, 0, 0);
setTimeout(() => blank.remove(), 0);
}
function onDragEnd(e) {
if (dragIdx !== null) {
const el = document.getElementById('chip-' + dragIdx);
if (el) el.classList.remove('dragging');
}
dragIdx = null;
clearDropHighlights();
}
function setupDropZone(boxId, sentiment) {
const box = document.getElementById(boxId);
box.addEventListener('dragover', e => {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
box.classList.add(sentiment === 'pos' ? 'drag-over-pos' : 'drag-over-neg');
});
box.addEventListener('dragleave', e => {
if (!box.contains(e.relatedTarget)) clearDropHighlights();
});
box.addEventListener('drop', e => {
e.preventDefault();
clearDropHighlights();
const idx = parseInt(e.dataTransfer.getData('text/plain'));
if (!isNaN(idx)) placeCard(idx, sentiment);
dragIdx = null;
});
}
function clearDropHighlights() {
document.getElementById('boxPositivo').classList.remove('drag-over-pos','drag-over-neg');
document.getElementById('boxNegativo').classList.remove('drag-over-pos','drag-over-neg');
}
// ---- Touch Drag (mobile) ----
function onTouchStart(e) {
const el = e.currentTarget;
const idx = parseInt(el.dataset.idx);
if (el.classList.contains('placed-pos') || el.classList.contains('placed-neg')) return;
e.preventDefault();
dragIdx = idx;
const touch = e.touches[0];
const rect = el.getBoundingClientRect();
touchOffX = touch.clientX - rect.left;
touchOffY = touch.clientY - rect.top;
// Create ghost
ghostEl = document.createElement('div');
ghostEl.className = 'drag-ghost';
ghostEl.textContent = '💬 ' + avaliacoes[idx].text;
ghostEl.style.left = (touch.clientX - touchOffX) + 'px';
ghostEl.style.top = (touch.clientY - touchOffY) + 'px';
document.body.appendChild(ghostEl);
el.classList.add('dragging');
}
function onTouchMove(e) {
if (dragIdx === null || !ghostEl) return;
e.preventDefault();
const touch = e.touches[0];
ghostEl.style.left = (touch.clientX - touchOffX) + 'px';
ghostEl.style.top = (touch.clientY - touchOffY) + 'px';
// Highlight drop targets
ghostEl.style.display = 'none';
const under = document.elementFromPoint(touch.clientX, touch.clientY);
ghostEl.style.display = '';
const posBox = document.getElementById('boxPositivo');
const negBox = document.getElementById('boxNegativo');
posBox.classList.remove('drag-over-pos');
negBox.classList.remove('drag-over-neg');
if (under && posBox.contains(under)) posBox.classList.add('drag-over-pos');
if (under && negBox.contains(under)) negBox.classList.add('drag-over-neg');
}
function onTouchEnd(e) {
if (dragIdx === null) return;
e.preventDefault();
const touch = e.changedTouches[0];