OUAREDAEK commited on
Commit
1cebb0e
·
verified ·
1 Parent(s): 5d88241

Upload templates/index-old6.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. templates/index-old6.html +941 -0
templates/index-old6.html ADDED
@@ -0,0 +1,941 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>PerseverAI - Compagnon Pédagogique</title>
7
+
8
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+
11
+ <style>
12
+ :root {
13
+ --primary: #2563eb;
14
+ --primary-dark: #1d4ed8;
15
+ --secondary: #475569;
16
+ --success: #16a34a;
17
+ --warning: #d97706;
18
+ --danger: #dc2626;
19
+ --info: #0891b2;
20
+ --purple: #7c3aed;
21
+ --gray-50: #f8fafc;
22
+ --gray-100: #f1f5f9;
23
+ --gray-200: #e2e8f0;
24
+ --gray-600: #475569;
25
+ --gray-800: #1e293b;
26
+ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
27
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
28
+ }
29
+
30
+ * { margin: 0; padding: 0; box-sizing: border-box; }
31
+
32
+ body {
33
+ font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
34
+ background: var(--gray-50);
35
+ color: var(--gray-800);
36
+ line-height: 1.5;
37
+ }
38
+
39
+ .container { max-width: 1400px; margin: 0 auto; padding: 24px; }
40
+
41
+ .header {
42
+ background: white;
43
+ border-radius: 12px;
44
+ padding: 24px 32px;
45
+ margin-bottom: 24px;
46
+ box-shadow: var(--shadow-sm);
47
+ border: 1px solid var(--gray-200);
48
+ }
49
+
50
+ .header h1 { font-size: 1.75rem; font-weight: 600; color: var(--gray-800); margin-bottom: 8px; }
51
+ .header p { color: var(--gray-600); font-size: 0.9rem; }
52
+ .badge { display: inline-block; background: var(--gray-100); padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; color: var(--gray-600); margin-top: 12px; }
53
+
54
+ .nav-tabs {
55
+ display: flex;
56
+ background: white;
57
+ border-radius: 12px;
58
+ border: 1px solid var(--gray-200);
59
+ overflow-x: auto;
60
+ margin-bottom: 24px;
61
+ }
62
+
63
+ .nav-tab {
64
+ padding: 14px 20px;
65
+ background: transparent;
66
+ border: none;
67
+ font-size: 0.9rem;
68
+ font-weight: 500;
69
+ color: var(--gray-600);
70
+ cursor: pointer;
71
+ transition: all 0.2s;
72
+ white-space: nowrap;
73
+ border-bottom: 2px solid transparent;
74
+ }
75
+
76
+ .nav-tab:hover { color: var(--primary); background: var(--gray-50); }
77
+ .nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
78
+
79
+ .card {
80
+ background: white;
81
+ border-radius: 12px;
82
+ border: 1px solid var(--gray-200);
83
+ padding: 24px;
84
+ margin-bottom: 24px;
85
+ }
86
+
87
+ .card-header {
88
+ display: flex;
89
+ justify-content: space-between;
90
+ align-items: center;
91
+ margin-bottom: 20px;
92
+ padding-bottom: 16px;
93
+ border-bottom: 1px solid var(--gray-200);
94
+ flex-wrap: wrap;
95
+ gap: 12px;
96
+ }
97
+
98
+ .card-header h3 { font-size: 1.25rem; font-weight: 600; color: var(--gray-800); }
99
+
100
+ .form-group { margin-bottom: 20px; }
101
+ .form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-600); margin-bottom: 8px; }
102
+ .form-control {
103
+ width: 100%;
104
+ padding: 10px 14px;
105
+ border: 1px solid var(--gray-200);
106
+ border-radius: 8px;
107
+ font-size: 0.9rem;
108
+ transition: all 0.2s;
109
+ }
110
+ .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
111
+ .form-row { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
112
+ .form-col { flex: 1; min-width: 200px; }
113
+
114
+ .btn {
115
+ padding: 10px 18px;
116
+ border-radius: 8px;
117
+ font-size: 0.85rem;
118
+ font-weight: 500;
119
+ cursor: pointer;
120
+ transition: all 0.2s;
121
+ border: none;
122
+ }
123
+ .btn-primary { background: var(--primary); color: white; }
124
+ .btn-primary:hover { background: var(--primary-dark); }
125
+ .btn-secondary { background: white; border: 1px solid var(--gray-200); color: var(--gray-600); }
126
+ .btn-secondary:hover { background: var(--gray-50); }
127
+ .btn-large { padding: 12px 24px; font-size: 0.9rem; }
128
+
129
+ /* Planning Stats Cards */
130
+ .planning-stats {
131
+ display: grid;
132
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
133
+ gap: 16px;
134
+ margin-bottom: 28px;
135
+ background: var(--gray-50);
136
+ border-radius: 16px;
137
+ padding: 20px;
138
+ }
139
+ .planning-stat-item {
140
+ text-align: center;
141
+ background: white;
142
+ padding: 16px;
143
+ border-radius: 12px;
144
+ border: 1px solid var(--gray-200);
145
+ }
146
+ .planning-stat-number {
147
+ font-size: 2rem;
148
+ font-weight: 700;
149
+ color: var(--primary);
150
+ }
151
+ .planning-stat-label {
152
+ font-size: 0.75rem;
153
+ color: var(--gray-600);
154
+ margin-top: 4px;
155
+ }
156
+
157
+ /* Planning Table */
158
+ .planning-sessions-table {
159
+ width: 100%;
160
+ border-collapse: collapse;
161
+ margin-top: 20px;
162
+ }
163
+ .planning-sessions-table th {
164
+ text-align: left;
165
+ padding: 14px 12px;
166
+ background: var(--gray-50);
167
+ border-bottom: 2px solid var(--gray-200);
168
+ font-weight: 600;
169
+ font-size: 0.8rem;
170
+ color: var(--gray-600);
171
+ }
172
+ .planning-sessions-table td {
173
+ padding: 16px 12px;
174
+ border-bottom: 1px solid var(--gray-200);
175
+ vertical-align: top;
176
+ }
177
+ .session-type-badge {
178
+ display: inline-block;
179
+ padding: 4px 10px;
180
+ border-radius: 20px;
181
+ font-size: 0.7rem;
182
+ font-weight: 500;
183
+ }
184
+ .type-apprentissage { background: #dbeafe; color: #1e40af; }
185
+ .type-consolidation { background: #dcfce7; color: #166534; }
186
+ .type-maintien { background: #fef3c7; color: #92400e; }
187
+
188
+ .retention-slider {
189
+ width: 100%;
190
+ margin: 15px 0;
191
+ }
192
+ .retention-slider input {
193
+ width: 100%;
194
+ cursor: pointer;
195
+ accent-color: var(--primary);
196
+ }
197
+ .retention-labels {
198
+ display: flex;
199
+ justify-content: space-between;
200
+ font-size: 0.7rem;
201
+ color: var(--gray-600);
202
+ margin-top: 5px;
203
+ }
204
+
205
+ .time-slots-group {
206
+ display: flex;
207
+ flex-wrap: wrap;
208
+ gap: 12px;
209
+ margin-top: 8px;
210
+ }
211
+ .time-slot-checkbox {
212
+ display: flex;
213
+ align-items: center;
214
+ gap: 6px;
215
+ background: var(--gray-50);
216
+ padding: 6px 12px;
217
+ border-radius: 20px;
218
+ border: 1px solid var(--gray-200);
219
+ cursor: pointer;
220
+ }
221
+ .radio-group {
222
+ display: flex;
223
+ gap: 20px;
224
+ margin-top: 8px;
225
+ }
226
+ .radio-option {
227
+ display: flex;
228
+ align-items: center;
229
+ gap: 8px;
230
+ cursor: pointer;
231
+ }
232
+
233
+ .notifications-table {
234
+ width: 100%;
235
+ border-collapse: collapse;
236
+ font-size: 0.85rem;
237
+ }
238
+ .notifications-table th {
239
+ text-align: left;
240
+ padding: 12px 8px;
241
+ background: var(--gray-50);
242
+ border-bottom: 2px solid var(--gray-200);
243
+ font-weight: 600;
244
+ }
245
+ .notifications-table td {
246
+ padding: 12px 8px;
247
+ border-bottom: 1px solid var(--gray-200);
248
+ }
249
+
250
+ .priority-high { color: var(--danger); font-weight: 600; }
251
+ .priority-medium { color: var(--warning); font-weight: 600; }
252
+ .priority-low { color: var(--success); font-weight: 600; }
253
+
254
+ .status-badge {
255
+ display: inline-block;
256
+ padding: 4px 10px;
257
+ border-radius: 20px;
258
+ font-size: 0.7rem;
259
+ font-weight: 500;
260
+ }
261
+ .status-pending { background: #fef3c7; color: #92400e; }
262
+ .status-accepted { background: #dcfce7; color: #166534; }
263
+
264
+ .action-cell {
265
+ display: flex;
266
+ flex-wrap: wrap;
267
+ gap: 6px;
268
+ }
269
+ .action-icon-btn {
270
+ background: transparent;
271
+ border: none;
272
+ cursor: pointer;
273
+ padding: 6px 10px;
274
+ border-radius: 20px;
275
+ font-size: 0.7rem;
276
+ font-weight: 500;
277
+ transition: all 0.2s;
278
+ }
279
+ .action-accept { background: #dcfce7; color: #166534; }
280
+ .action-reject { background: #fee2e2; color: #991b1b; }
281
+ .action-hold { background: #e0f2fe; color: #075985; }
282
+ .action-help { background: #fed7aa; color: #9a3412; }
283
+
284
+ .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
285
+ .stat-card { background: white; border: 1px solid var(--gray-200); border-radius: 8px; padding: 16px; text-align: center; }
286
+ .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
287
+
288
+ .tab-content { display: none; }
289
+ .tab-content.active { display: block; }
290
+
291
+ /* Spaced Repetition Curve */
292
+ .spaced-repetition-container {
293
+ background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
294
+ border-radius: 16px;
295
+ padding: 20px;
296
+ margin-top: 20px;
297
+ }
298
+ .curve-legend {
299
+ display: flex;
300
+ justify-content: center;
301
+ gap: 24px;
302
+ margin-bottom: 16px;
303
+ font-size: 0.75rem;
304
+ }
305
+ .legend-item {
306
+ display: flex;
307
+ align-items: center;
308
+ gap: 8px;
309
+ }
310
+ .legend-color {
311
+ width: 20px;
312
+ height: 3px;
313
+ border-radius: 2px;
314
+ }
315
+ .legend-color.square {
316
+ width: 12px;
317
+ height: 12px;
318
+ border-radius: 50%;
319
+ }
320
+
321
+ @media (max-width: 768px) {
322
+ .container { padding: 16px; }
323
+ .planning-sessions-table { font-size: 0.7rem; }
324
+ .planning-sessions-table td, .planning-sessions-table th { padding: 8px 6px; }
325
+ }
326
+
327
+ .session-detail-line { font-size: 0.75rem; color: var(--gray-600); margin: 4px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
328
+ .export-btn { background: white; border: 1px solid var(--gray-200); padding: 8px 16px; border-radius: 8px; cursor: pointer; }
329
+ .export-btn:hover { background: var(--gray-50); }
330
+
331
+ /* Profile specific styles */
332
+ .profile-progress {
333
+ background: var(--gray-100);
334
+ border-radius: 12px;
335
+ padding: 16px;
336
+ margin-bottom: 24px;
337
+ }
338
+ .progress-bar-container {
339
+ background: var(--gray-200);
340
+ border-radius: 20px;
341
+ height: 10px;
342
+ margin: 12px 0;
343
+ overflow: hidden;
344
+ }
345
+ .progress-bar-fill {
346
+ background: var(--primary);
347
+ width: 0%;
348
+ height: 100%;
349
+ border-radius: 20px;
350
+ transition: width 0.3s ease;
351
+ }
352
+ .big5-rating {
353
+ display: flex;
354
+ gap: 8px;
355
+ margin-top: 8px;
356
+ flex-wrap: wrap;
357
+ }
358
+ .rating-btn {
359
+ width: 40px;
360
+ height: 40px;
361
+ border-radius: 40px;
362
+ border: 1px solid var(--gray-200);
363
+ background: white;
364
+ cursor: pointer;
365
+ font-weight: 600;
366
+ transition: all 0.2s;
367
+ }
368
+ .rating-btn:hover { background: var(--gray-100); }
369
+ .rating-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
370
+ .motivation-rating {
371
+ display: flex;
372
+ gap: 8px;
373
+ margin-top: 8px;
374
+ flex-wrap: wrap;
375
+ }
376
+ .profile-recommendations {
377
+ background: #fefce8;
378
+ border-left: 4px solid var(--warning);
379
+ padding: 16px;
380
+ border-radius: 12px;
381
+ margin-top: 20px;
382
+ }
383
+ .profile-summary-cards {
384
+ display: grid;
385
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
386
+ gap: 16px;
387
+ margin-bottom: 24px;
388
+ }
389
+ .profile-mini-card {
390
+ background: var(--gray-50);
391
+ border-radius: 12px;
392
+ padding: 16px;
393
+ text-align: center;
394
+ }
395
+ .profile-mini-card h4 { font-size: 0.75rem; color: var(--gray-600); margin-bottom: 8px; }
396
+ .profile-mini-card .value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
397
+ .flex-between { display: flex; justify-content: space-between; align-items: center; }
398
+
399
+ /* DASHBOARD PROFESSIONNEL : HEATMAP REDUITE & COURBE SYMÉTRIQUE */
400
+ .heatmap-container {
401
+ background: white;
402
+ border-radius: 16px;
403
+ padding: 18px 20px;
404
+ margin-bottom: 28px;
405
+ border: 1px solid var(--gray-200);
406
+ }
407
+ .heatmap-grid {
408
+ display: grid;
409
+ grid-template-columns: repeat(7, 1fr);
410
+ gap: 5px;
411
+ margin: 16px 0 12px 0;
412
+ }
413
+ .heatmap-day {
414
+ text-align: center;
415
+ font-size: 0.65rem;
416
+ font-weight: 600;
417
+ color: var(--gray-600);
418
+ margin-bottom: 6px;
419
+ }
420
+ .heatmap-cell {
421
+ aspect-ratio: 1 / 1;
422
+ border-radius: 5px;
423
+ transition: all 0.15s ease;
424
+ background-color: #eef2f6;
425
+ cursor: default;
426
+ }
427
+ .heatmap-cell.level-0 { background-color: #f1f5f9; }
428
+ .heatmap-cell.level-1 { background-color: #e2e8f0; }
429
+ .heatmap-cell.level-2 { background-color: #cbd5e1; }
430
+ .heatmap-cell.level-3 { background-color: #94a3b8; }
431
+ .heatmap-cell.level-4 { background-color: #475569; }
432
+
433
+ .legend-heatmap {
434
+ display: flex;
435
+ justify-content: center;
436
+ gap: 20px;
437
+ margin-top: 12px;
438
+ flex-wrap: wrap;
439
+ }
440
+ .legend-heatmap-item {
441
+ display: flex;
442
+ align-items: center;
443
+ gap: 6px;
444
+ font-size: 0.7rem;
445
+ color: var(--gray-600);
446
+ }
447
+ .legend-color-box {
448
+ width: 20px;
449
+ height: 20px;
450
+ border-radius: 4px;
451
+ }
452
+
453
+ /* Courbe symétrique inspirée du heatmap : design élégant */
454
+ .symmetry-curve-card {
455
+ background: white;
456
+ border-radius: 16px;
457
+ padding: 18px 20px;
458
+ margin-bottom: 28px;
459
+ border: 1px solid var(--gray-200);
460
+ }
461
+ .curve-header {
462
+ display: flex;
463
+ justify-content: space-between;
464
+ align-items: baseline;
465
+ flex-wrap: wrap;
466
+ margin-bottom: 16px;
467
+ }
468
+ .curve-header h4 {
469
+ font-weight: 600;
470
+ font-size: 0.9rem;
471
+ color: var(--gray-800);
472
+ }
473
+ .curve-legend-mini {
474
+ display: flex;
475
+ gap: 16px;
476
+ font-size: 0.7rem;
477
+ }
478
+ .symmetry-canvas {
479
+ max-height: 210px;
480
+ width: 100%;
481
+ background: #ffffff;
482
+ border-radius: 12px;
483
+ }
484
+
485
+ /* Indicateurs modernes */
486
+ .indicator-grid {
487
+ display: grid;
488
+ grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
489
+ gap: 20px;
490
+ margin-bottom: 0;
491
+ }
492
+ .indicator-card {
493
+ background: white;
494
+ border-radius: 16px;
495
+ padding: 20px 18px;
496
+ border: 1px solid var(--gray-200);
497
+ transition: box-shadow 0.2s;
498
+ box-shadow: var(--shadow-sm);
499
+ }
500
+ .indicator-card:hover {
501
+ box-shadow: var(--shadow-md);
502
+ }
503
+ .indicator-header {
504
+ display: flex;
505
+ align-items: center;
506
+ gap: 12px;
507
+ margin-bottom: 16px;
508
+ }
509
+ .indicator-icon {
510
+ font-size: 1.6rem;
511
+ color: var(--primary);
512
+ background: #eff6ff;
513
+ width: 44px;
514
+ height: 44px;
515
+ display: flex;
516
+ align-items: center;
517
+ justify-content: center;
518
+ border-radius: 44px;
519
+ }
520
+ .indicator-title {
521
+ font-weight: 600;
522
+ font-size: 0.9rem;
523
+ color: var(--gray-800);
524
+ letter-spacing: -0.2px;
525
+ }
526
+ .indicator-value {
527
+ font-size: 2rem;
528
+ font-weight: 700;
529
+ color: var(--gray-800);
530
+ margin-bottom: 6px;
531
+ line-height: 1.2;
532
+ }
533
+ .indicator-sub {
534
+ font-size: 0.75rem;
535
+ color: var(--gray-600);
536
+ border-top: 1px solid var(--gray-100);
537
+ margin-top: 12px;
538
+ padding-top: 12px;
539
+ }
540
+ .effort-badge-modern {
541
+ display: inline-block;
542
+ background: #f1f5f9;
543
+ padding: 6px 14px;
544
+ border-radius: 40px;
545
+ font-size: 0.8rem;
546
+ font-weight: 500;
547
+ color: #1e293b;
548
+ }
549
+ .persistence-tag {
550
+ background: #dcfce7;
551
+ color: #166534;
552
+ padding: 4px 12px;
553
+ border-radius: 40px;
554
+ font-size: 0.75rem;
555
+ font-weight: 600;
556
+ display: inline-block;
557
+ }
558
+ .dashboard-view-toggle {
559
+ display: flex;
560
+ gap: 12px;
561
+ margin-bottom: 24px;
562
+ }
563
+ .view-btn {
564
+ padding: 8px 18px;
565
+ border-radius: 40px;
566
+ background: white;
567
+ border: 1px solid var(--gray-200);
568
+ cursor: pointer;
569
+ font-weight: 500;
570
+ }
571
+ .view-btn.active {
572
+ background: var(--primary);
573
+ color: white;
574
+ border-color: var(--primary);
575
+ }
576
+ </style>
577
+ </head>
578
+ <body>
579
+ <div class="container">
580
+ <header class="header">
581
+ <h1>PerseverAI</h1>
582
+ <p>Compagnon d'apprentissage autorégulé - Notifications IA & Actions</p>
583
+ <div class="badge">AI · Aid · Perseverance · Tableau des événements</div>
584
+ </header>
585
+
586
+ <nav class="nav-tabs">
587
+ <button class="nav-tab" onclick="showTab('profile')">Profil</button>
588
+ <button class="nav-tab" onclick="showTab('objectif')">Objectif</button>
589
+ <button class="nav-tab" onclick="showTab('planner')">Planning</button>
590
+ <button class="nav-tab" onclick="showTab('dashboard')">Mon Dashboard</button>
591
+ <button class="nav-tab" onclick="showTab('journal')">Mon Journal</button>
592
+ <button class="nav-tab" onclick="showTab('notifications')">Notifications IA</button>
593
+ </nav>
594
+
595
+ <!-- PROFIL -->
596
+ <section id="profile" class="tab-content">
597
+ <div class="card">
598
+ <div class="card-header"><h3>Profil d'Apprentissage Personnalisé</h3><div><button class="btn btn-secondary" onclick="autoFillProfile()">Remplir automatiquement</button><button class="btn btn-secondary" onclick="saveProfileData()">Sauvegarder</button></div></div>
599
+ <div class="profile-progress"><div class="flex-between"><span><strong>Complétion du Profil</strong></span><span id="profileCompletionPercent">40%</span></div><div class="progress-bar-container"><div class="progress-bar-fill" id="profileProgressFill" style="width: 40%;"></div></div><div class="flex-between"><span>Questionnaires complétés: <span id="completedCount">2</span>/5</span><span>Profil personnalisé: <span id="profileLevel">Intermédiaire</span></span></div></div>
600
+ <div class="card" style="margin-bottom:20px;padding:20px;"><h4 style="margin-bottom:16px;">Profil de Personnalité (Big Five Traits)</h4><p style="font-size:0.8rem;color:var(--gray-600);margin-bottom:20px;">Évaluez vos traits de personnalité sur une échelle de 1 à 5</p>
601
+ <div class="form-group"><label class="form-label">Je suis quelqu'un de sociable, extraverti, énergique</label><div class="big5-rating" data-trait="extraversion"><button type="button" class="rating-btn" data-value="1">1</button><button type="button" class="rating-btn" data-value="2">2</button><button type="button" class="rating-btn" data-value="3">3</button><button type="button" class="rating-btn" data-value="4">4</button><button type="button" class="rating-btn" data-value="5">5</button></div></div>
602
+ <div class="form-group"><label class="form-label">Je fais preuve de curiosité intellectuelle, j'aime les nouvelles expériences</label><div class="big5-rating" data-trait="openness"><button type="button" class="rating-btn" data-value="1">1</button><button type="button" class="rating-btn" data-value="2">2</button><button type="button" class="rating-btn" data-value="3">3</button><button type="button" class="rating-btn" data-value="4">4</button><button type="button" class="rating-btn" data-value="5">5</button></div></div>
603
+ <div class="form-group"><label class="form-label">Je suis organisé, fiable, je respecte mes engagements</label><div class="big5-rating" data-trait="conscientiousness"><button type="button" class="rating-btn" data-value="1">1</button><button type="button" class="rating-btn" data-value="2">2</button><button type="button" class="rating-btn" data-value="3">3</button><button type="button" class="rating-btn" data-value="4">4</button><button type="button" class="rating-btn" data-value="5">5</button></div></div>
604
+ <div class="form-group"><label class="form-label">Je suis coopératif, serviable, empathique</label><div class="big5-rating" data-trait="agreeableness"><button type="button" class="rating-btn" data-value="1">1</button><button type="button" class="rating-btn" data-value="2">2</button><button type="button" class="rating-btn" data-value="3">3</button><button type="button" class="rating-btn" data-value="4">4</button><button type="button" class="rating-btn" data-value="5">5</button></div></div>
605
+ <div class="form-group"><label class="form-label">Je ressens facilement de l'anxiété, du stress, de la nervosité</label><div class="big5-rating" data-trait="neuroticism"><button type="button" class="rating-btn" data-value="1">1</button><button type="button" class="rating-btn" data-value="2">2</button><button type="button" class="rating-btn" data-value="3">3</button><button type="button" class="rating-btn" data-value="4">4</button><button type="button" class="rating-btn" data-value="5">5</button></div></div>
606
+ <div style="margin-top:16px;font-size:0.8rem;background:var(--gray-50);padding:12px;border-radius:8px;">Section complétée - Score neuroticisme: <span id="neuroticismScore">4.0</span> (qualité du sommeil importante)</div>
607
+ </div>
608
+ <div class="card" style="margin-bottom:20px;padding:20px;"><h4 style="margin-bottom:16px;">Profil Motivationnel</h4><p style="font-size:0.8rem;margin-bottom:20px;">Pourquoi étudiez-vous ? Sélectionnez vos principales motivations</p>
609
+ <div class="form-group"><label class="form-label">J'étudie parce que j'aime apprendre, je trouve cela intéressant et plaisant</label><div class="motivation-rating" data-motivation="intrinsic"><button type="button" class="rating-btn" data-value="1">1</button><button type="button" class="rating-btn" data-value="2">2</button><button type="button" class="rating-btn" data-value="3">3</button><button type="button" class="rating-btn" data-value="4">4</button><button type="button" class="rating-btn" data-value="5">5</button></div></div>
610
+ <div class="form-group"><label class="form-label">J'étudie pour obtenir de bonnes notes et faire plaisir à mes parents/professeurs</label><div class="motivation-rating" data-motivation="introjected"><button type="button" class="rating-btn" data-value="1">1</button><button type="button" class="rating-btn" data-value="2">2</button><button type="button" class="rating-btn" data-value="3">3</button><button type="button" class="rating-btn" data-value="4">4</button><button type="button" class="rating-btn" data-value="5">5</button></div></div>
611
+ <div style="margin-top:16px;font-size:0.8rem;background:var(--gray-50);padding:12px;border-radius:8px;">Section complétée - Motivation introjectée: <span id="introjectedScore">4.0</span> (pression interne modérée)</div>
612
+ </div>
613
+ <div class="profile-summary-cards"><div class="profile-mini-card"><h4>Big Five Traits</h4><div class="value" id="summaryExtraversion">3.0</div><div>Extraversion</div></div><div class="profile-mini-card"><div class="value" id="summaryOpenness">3.0</div><div>Ouverture</div></div><div class="profile-mini-card"><div class="value" id="summaryConscientiousness">4.0</div><div>Conscience</div></div><div class="profile-mini-card"><h4>Motivation</h4><div class="value" id="summaryIntrinsic">3.0</div><div>Intrinsèque</div></div><div class="profile-mini-card"><div class="value" id="summaryIntrojected">4.0</div><div>Introjectée</div></div></div>
614
+ <div class="profile-recommendations" style="background: transparent; border-left: none;"><h4>Recommandations Personnalisées</h4><div id="recommendationsContainer"><p>Qualité du sommeil: Maintenez 7-8 heures de sommeil de qualité.</p><p>Planification: Renforcez votre organisation avec des rappels.</p></div></div>
615
+ <button class="btn btn-primary btn-large" onclick="finalizeProfile()" style="width:100%;"><i class="fas fa-check-circle"></i> Finaliser et Générer le Profil Personnalisé</button>
616
+ </div>
617
+ </section>
618
+
619
+ <!-- OBJECTIF -->
620
+ <section id="objectif" class="tab-content"><div class="card"><div class="card-header"><h3>Définir mon Objectif d'Apprentissage</h3></div><div class="form-row"><div class="form-col"><label class="form-label">Compétence Cible</label><select id="competence" class="form-control"></select></div><div class="form-col"><label class="form-label">Niveau Actuel</label><select id="level" class="form-control"><option value="0">Débutant</option><option value="1" selected>Intermédiaire</option><option value="2">Avancé</option></select></div></div><div class="form-row"><div class="form-col"><label class="form-label">Date de Début</label><input type="date" id="start" class="form-control" value="2024-01-15"></div><div class="form-col"><label class="form-label">Date de Fin</label><input type="date" id="end" class="form-control" value="2024-12-31"></div></div><div class="form-row"><div class="form-col"><label class="form-label">Durée par Session (minutes)</label><select id="sessionDuration" class="form-control"><option value="20" selected>20 minutes (Optimal)</option><option value="30">30 minutes</option><option value="45">45 minutes</option></select></div><div class="form-col"><label class="form-label">Méthode Productivité</label><div class="radio-group"><label class="radio-option"><input type="radio" name="productivityMethod" value="pomodoro" checked> Pomodoro</label><label class="radio-option"><input type="radio" name="productivityMethod" value="deepwork"> Deep Work</label></div></div></div><div class="form-row"><div class="form-col"><label class="form-label">Type d'Énergie</label><div class="radio-group"><label class="radio-option"><input type="radio" name="energyType" value="morning" checked> Matinale</label><label class="radio-option"><input type="radio" name="energyType" value="evening"> Vespérale</label></div></div><div class="form-col"><label class="form-label">Créneaux Disponibles</label><div class="time-slots-group" id="timeSlotsGroup"><label class="time-slot-checkbox"><input type="checkbox" value="08:00-10:00"> 08:00-10:00</label><label class="time-slot-checkbox"><input type="checkbox" value="10:00-12:00"> 10:00-12:00</label><label class="time-slot-checkbox"><input type="checkbox" value="14:00-16:00"> 14:00-16:00</label></div></div></div><div class="form-group"><label class="form-label">Qualité Estimée de Rétention</label><div class="retention-slider"><input type="range" id="retentionQuality" min="0" max="3" step="1" value="2"><div class="retention-labels"><span>0 - Faible</span><span>1 - Moyenne</span><span>2 - Bonne</span><span>3 - Excellente</span></div></div><div id="retentionValueDisplay">Bon - Consolidation progressive</div></div><button class="btn btn-primary btn-large" onclick="generatePlanner()" style="width:100%;"><i class="fas fa-magic"></i> Générer le Planner Personnalisé</button></div></section>
621
+
622
+ <!-- PLANNING -->
623
+ <section id="planner" class="tab-content"><div class="card"><div class="card-header"><h3><i class="fas fa-calendar-alt"></i> Planner Personnalisé</h3><button class="export-btn" onclick="exportPlanning()"><i class="fas fa-download"></i> Exporter</button></div><div class="planning-stats" id="planningStats"><div class="planning-stat-item"><div class="planning-stat-number" id="statSessions">6</div><div class="planning-stat-label">Sessions Planifiées</div></div><div class="planning-stat-item"><div class="planning-stat-number" id="statTotalDays">270</div><div class="planning-stat-label">Jours Totaux</div></div><div class="planning-stat-item"><div class="planning-stat-number" id="statQuality">3/4</div><div class="planning-stat-label">Niveau de Qualité</div></div><div class="planning-stat-item"><div class="planning-stat-number" id="statDuration">20min</div><div class="planning-stat-label">Durée/Session</div></div></div><div style="overflow-x:auto;"><table class="planning-sessions-table" id="sessionsTable"><thead><tr><th>Date</th><th>Session</th><th>Compétence</th><th>Durée</th><th>Intervalle</th><th>Type</th><th>Stratégie</th><th>Productivité</th><th>Heure Optimale</th></tr></thead><tbody id="sessionsTableBody"></tbody></table></div><div class="spaced-repetition-container"><h4><i class="fas fa-chart-line"></i> Courbe de Répétition Espacée</h4><div class="curve-legend"><div class="legend-item"><div class="legend-color" style="background:#2563eb;"></div><span>Seuil de rétention</span></div><div class="legend-item"><div class="legend-color square" style="background:#ef4444;"></div><span>Sessions</span></div></div><canvas id="spacedRepetitionCurve" width="100%" height="200" style="max-height:200px; width:100%;"></canvas><div id="intervalDatesCurve" style="font-size:0.7rem; text-align:center; margin-top:8px;"></div></div></div></section>
624
+
625
+ <!-- DASHBOARD : HEATMAP REDUITE + COURBE SYMÉTRIQUE INSPIRÉE HEATMAP + INDICATEURS (SANS LA FIGURE DE PROGRESSION) -->
626
+ <section id="dashboard" class="tab-content">
627
+ <div class="card">
628
+ <div class="card-header"><h3><i class="fas fa-chart-simple"></i> Tableau de bord performance & persévérance</h3><div class="dashboard-view-toggle"><button class="view-btn active" data-view="combined" onclick="setDashboardView('combined')">📊 Vue d'ensemble</button></div></div>
629
+
630
+ <!-- Heatmap réduite (grille discrète et sobre) -->
631
+ <div class="heatmap-container">
632
+ <h4 style="margin-bottom:12px; font-weight:500; font-size:0.85rem;"><i class="fas fa-calendar-week"></i> Niveaux d'activité (4 semaines) - Heatmap réduite</h4>
633
+ <div class="heatmap-grid" id="heatmapGrid"></div>
634
+ <div class="legend-heatmap">
635
+ <div class="legend-heatmap-item"><div class="legend-color-box level-0"></div><span>Aucune</span></div>
636
+ <div class="legend-heatmap-item"><div class="legend-color-box level-1"></div><span>Faible</span></div>
637
+ <div class="legend-heatmap-item"><div class="legend-color-box level-2"></div><span>Moyenne</span></div>
638
+ <div class="legend-heatmap-item"><div class="legend-color-box level-3"></div><span>Élevée</span></div>
639
+ <div class="legend-heatmap-item"><div class="legend-color-box level-4"></div><span>Intense</span></div>
640
+ </div>
641
+ </div>
642
+
643
+ <!-- Courbe symétrique par symétrie du heatmap (motif miroir des intensités) -->
644
+ <div class="symmetry-curve-card">
645
+ <div class="curve-header">
646
+ <h4><i class="fas fa-chart-line"></i> Courbe symétrique (miroir du heatmap)</h4>
647
+ <div class="curve-legend-mini"><span style="color:#2563eb;">● Intensité moyenne</span><span style="color:#7c3aed;">● Miroir symétrique</span></div>
648
+ </div>
649
+ <canvas id="symmetryHeatmapCurve" width="100%" height="180" style="max-height:180px; width:100%;" class="symmetry-canvas"></canvas>
650
+ <p style="font-size:0.7rem; color:var(--gray-500); margin-top:12px; text-align:center;"><i class="fas fa-chart-simple"></i> Courbe construite à partir de la moyenne d'intensité par jour (symétrie gauche/droite). Visualisation des pics d'activité.</p>
651
+ </div>
652
+
653
+ <!-- Indicateurs modernes -->
654
+ <div class="indicator-grid">
655
+ <div class="indicator-card"><div class="indicator-header"><div class="indicator-icon"><i class="fas fa-clock"></i></div><div class="indicator-title">Régularité du travail</div></div><div class="indicator-value" id="regularityScore">90%</div><div class="indicator-sub">La constance de l'activité de l'apprenant dans le temps.</div></div>
656
+ <div class="indicator-card"><div class="indicator-header"><div class="indicator-icon"><i class="fas fa-calendar-check"></i></div><div class="indicator-title">Gestion des échéances</div></div><div class="indicator-value" id="deadlineScore">88%</div><div class="indicator-sub">La capacité de l'apprenant à respecter les délais.</div></div>
657
+ <div class="indicator-card"><div class="indicator-header"><div class="indicator-icon"><i class="fas fa-bolt"></i></div><div class="indicator-title">Schéma d'effort</div></div><div><span class="effort-badge-modern" id="effortPattern">Effort concentré (Pic d'activité jeudi/vendredi)</span></div><div class="indicator-sub">La dynamique temporelle de l'effort.</div></div>
658
+ <div class="indicator-card"><div class="indicator-header"><div class="indicator-icon"><i class="fas fa-chart-line"></i></div><div class="indicator-title">Persistance & gestion des efforts</div></div><div><span class="persistence-tag" id="persistenceScore">Très élevée</span></div><div class="indicator-sub">Indice de persévérance globale</div></div>
659
+ </div>
660
+ </div>
661
+ </section>
662
+
663
+ <!-- JOURNAL / NOTIFICATIONS -->
664
+ <section id="journal" class="tab-content"><div class="card"><div class="card-header"><h3>Mon journal d'apprentissage</h3><button class="btn btn-secondary" onclick="saveJournal()">Sauvegarder</button></div><div class="form-group"><label class="form-label">Accompli aujourd'hui</label><textarea id="done" class="form-control" rows="2"></textarea></div><div class="form-group"><label class="form-label">Stratégie utilisée</label><textarea id="metacognition" class="form-control" rows="2"></textarea></div><div id="journalEntriesList"></div></div></section>
665
+ <section id="notifications" class="tab-content"><div class="card"><div class="card-header"><h3><i class="fas fa-bell"></i> Notifications IA - Tableau des événements</h3><button class="btn btn-primary" onclick="generateRandomEvent()"><i class="fas fa-plus"></i> Générer un événement</button></div><div class="stats-grid"><div class="stat-card"><div class="stat-value" id="totalEvents">0</div><div class="stat-label">Total</div></div><div class="stat-card"><div class="stat-value" id="pendingEvents">0</div><div class="stat-label">En attente</div></div><div class="stat-card"><div class="stat-value" id="acceptedEvents">0</div><div class="stat-label">Acceptés</div></div></div><div style="overflow-x:auto;"><table class="notifications-table"><thead><tr><th>Date</th><th>Type</th><th>Titre</th><th>Message</th><th>Priorité</th><th>Statut</th><th>Actions</th></tr></thead><tbody id="notificationsTableBody"></tbody></table></div><div class="chart-container"><canvas id="notificationEfficiencyChart"></canvas></div></div></section>
666
+ </div>
667
+
668
+ <script>
669
+ // ---------- TOUTES LES FONCTIONS ORIGINALES CONSERVÉES, AJOUT DE LA COURBE SYMÉTRIQUE ----------
670
+ const competencesData = [
671
+ { "id": "D-MCONJ", "label": "Marques de la conjugaison", "category": "Discours" },
672
+ { "id": "D-PDV", "label": "Points de vue adoptés", "category": "Discours" },
673
+ { "id": "D-SSENT", "label": "Compréhension des mots", "category": "Discours" },
674
+ { "id": "M-CHOI", "label": "Choix des mots et des expressions", "category": "Maîtrise" },
675
+ { "id": "M-COMP", "label": "Construction des phrases", "category": "Maîtrise" },
676
+ { "id": "M-DEV", "label": "Développement du vocabulaire", "category": "Maîtrise" }
677
+ ];
678
+
679
+ let eventsList = [];
680
+ let currentSessions = [];
681
+ let spacedChart = null;
682
+ let symmetryChart = null;
683
+
684
+ let profileData = {
685
+ extraversion: 3, openness: 3, conscientiousness: 4, agreeableness: 3, neuroticism: 3,
686
+ intrinsic: 3, introjected: 4
687
+ };
688
+
689
+ const eventTemplates = [
690
+ { type: "Rappel d'étude", title: "Session de révision", message: "Votre session est prévue aujourd'hui.", priority: "high" },
691
+ { type: "Conseil IA", title: "Optimisation", message: "Révisez les conjugaisons.", priority: "medium" },
692
+ { type: "Encouragement", title: "Progression", message: "80% des objectifs atteints.", priority: "low" }
693
+ ];
694
+
695
+ function generateHeatmapData() {
696
+ const days = ['Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim'];
697
+ const weeks = 4;
698
+ let matrix = [];
699
+ for(let w = 0; w < weeks; w++) {
700
+ let week = [];
701
+ for(let d = 0; d < 7; d++) {
702
+ let base = (w * 7 + d) % 10;
703
+ let level = 0;
704
+ if(base < 3) level = 1;
705
+ else if(base < 6) level = 2;
706
+ else if(base < 8) level = 3;
707
+ else level = 4;
708
+ if(d === 3 || d === 4) level = Math.min(4, level+1);
709
+ week.push(level);
710
+ }
711
+ matrix.push(week);
712
+ }
713
+ return { days, weeks: matrix };
714
+ }
715
+
716
+ function renderHeatmap() {
717
+ const container = document.getElementById('heatmapGrid');
718
+ if(!container) return;
719
+ const { days, weeks } = generateHeatmapData();
720
+ container.innerHTML = '';
721
+ for(let i = 0; i < days.length; i++) {
722
+ let dayDiv = document.createElement('div');
723
+ dayDiv.className = 'heatmap-day';
724
+ dayDiv.innerText = days[i];
725
+ container.appendChild(dayDiv);
726
+ }
727
+ for(let w = 0; w < weeks.length; w++) {
728
+ for(let d = 0; d < weeks[w].length; d++) {
729
+ let cell = document.createElement('div');
730
+ cell.className = `heatmap-cell level-${weeks[w][d]}`;
731
+ cell.title = `${days[d]} Semaine ${w+1} : Niveau ${weeks[w][d]}`;
732
+ container.appendChild(cell);
733
+ }
734
+ }
735
+ }
736
+
737
+ // Courbe symétrique basée sur la moyenne des intensités du heatmap (par jour de semaine)
738
+ function drawSymmetryCurve() {
739
+ const canvas = document.getElementById('symmetryHeatmapCurve');
740
+ if(!canvas) return;
741
+ const ctx = canvas.getContext('2d');
742
+ const container = canvas.parentElement;
743
+ const width = container.clientWidth - 40;
744
+ const height = 160;
745
+ canvas.width = width;
746
+ canvas.height = height;
747
+ ctx.clearRect(0, 0, width, height);
748
+
749
+ const { days, weeks } = generateHeatmapData();
750
+ // Calculer intensité moyenne par jour (sur 4 semaines)
751
+ let avgIntensity = new Array(7).fill(0);
752
+ for(let w = 0; w < weeks.length; w++) {
753
+ for(let d = 0; d < 7; d++) {
754
+ avgIntensity[d] += weeks[w][d];
755
+ }
756
+ }
757
+ avgIntensity = avgIntensity.map(v => v / weeks.length); // valeur entre 0 et 4
758
+
759
+ // Construire série symétrique : miroir gauche/droite (miroir par rapport au centre)
760
+ let mirrored = [...avgIntensity];
761
+ // Créer une symétrie: inverser l'ordre et lisser avec original pour effet "courbe symétrique"
762
+ let reversed = [...avgIntensity].reverse();
763
+ let combined = [];
764
+ for(let i=0; i<7; i++) combined.push((avgIntensity[i] + reversed[i])/2);
765
+
766
+ const points = combined.map((val, idx) => ({ x: (idx / 6) * width, y: height - (val / 4) * height }));
767
+
768
+ ctx.beginPath();
769
+ ctx.strokeStyle = '#2563eb';
770
+ ctx.lineWidth = 2.5;
771
+ ctx.setLineDash([]);
772
+ for(let i=0;i<points.length;i++) {
773
+ if(i===0) ctx.moveTo(points[i].x, points[i].y);
774
+ else ctx.lineTo(points[i].x, points[i].y);
775
+ }
776
+ ctx.stroke();
777
+
778
+ // Courbe miroir symétrique lissée (complément)
779
+ ctx.beginPath();
780
+ ctx.strokeStyle = '#7c3aed';
781
+ ctx.lineWidth = 2;
782
+ ctx.setLineDash([6, 8]);
783
+ let mirrorPoints = points.map(p => ({ x: width - p.x, y: p.y }));
784
+ for(let i=0;i<mirrorPoints.length;i++) {
785
+ if(i===0) ctx.moveTo(mirrorPoints[i].x, mirrorPoints[i].y);
786
+ else ctx.lineTo(mirrorPoints[i].x, mirrorPoints[i].y);
787
+ }
788
+ ctx.stroke();
789
+ ctx.setLineDash([]);
790
+
791
+ // Ajouter points d'intensité
792
+ for(let i=0;i<points.length;i++) {
793
+ ctx.beginPath();
794
+ ctx.fillStyle = '#2563eb';
795
+ ctx.arc(points[i].x, points[i].y, 4, 0, 2*Math.PI);
796
+ ctx.fill();
797
+ ctx.fillStyle = 'white';
798
+ ctx.beginPath();
799
+ ctx.arc(points[i].x, points[i].y, 2, 0, 2*Math.PI);
800
+ ctx.fill();
801
+ }
802
+ // Légende des jours en abscisse
803
+ ctx.fillStyle = '#475569';
804
+ ctx.font = '9px Inter';
805
+ for(let i=0;i<days.length;i++) {
806
+ let x = (i/6)*width;
807
+ ctx.fillText(days[i], x-8, height-6);
808
+ }
809
+ }
810
+
811
+ function updateIndicators() {
812
+ document.getElementById('regularityScore').innerText = "90%";
813
+ document.getElementById('deadlineScore').innerText = "88%";
814
+ document.getElementById('effortPattern').innerHTML = "Effort concentré (Pic d'activité jeudi/vendredi)";
815
+ document.getElementById('persistenceScore').innerHTML = "Très élevée";
816
+ }
817
+
818
+ function setDashboardView(view) {
819
+ document.querySelectorAll('.view-btn').forEach(btn => btn.classList.remove('active'));
820
+ document.querySelector(`.view-btn[data-view="${view}"]`).classList.add('active');
821
+ if(view === 'combined') {
822
+ renderHeatmap();
823
+ drawSymmetryCurve();
824
+ updateIndicators();
825
+ }
826
+ }
827
+
828
+ function initCompetencesSelect() { const select = document.getElementById('competence'); if(select) select.innerHTML = '<option value="comprendre_mots">Comprendre les mots</option>' + competencesData.map(c => `<option value="${c.id}">${c.label}</option>`).join(''); }
829
+ function setupRatingListeners() {
830
+ document.querySelectorAll('.big5-rating .rating-btn').forEach(btn => btn.addEventListener('click', function() { const container = this.closest('.big5-rating'); const trait = container.dataset.trait; const value = parseInt(this.dataset.value); profileData[trait] = value; updateRatingUI(container, value); updateProfileUI(); saveProfileToStorage(); }));
831
+ document.querySelectorAll('.motivation-rating .rating-btn').forEach(btn => btn.addEventListener('click', function() { const container = this.closest('.motivation-rating'); const motivation = container.dataset.motivation; const value = parseInt(this.dataset.value); profileData[motivation] = value; updateRatingUI(container, value); updateProfileUI(); saveProfileToStorage(); }));
832
+ }
833
+ function updateRatingUI(container, value) { container.querySelectorAll('.rating-btn').forEach(btn => { btn.classList.remove('active'); if(parseInt(btn.dataset.value) === value) btn.classList.add('active'); }); }
834
+ function updateProfileUI() { document.getElementById('summaryExtraversion').innerText = profileData.extraversion; document.getElementById('summaryOpenness').innerText = profileData.openness; document.getElementById('summaryConscientiousness').innerText = profileData.conscientiousness; document.getElementById('summaryIntrinsic').innerText = profileData.intrinsic; document.getElementById('summaryIntrojected').innerText = profileData.introjected; document.getElementById('neuroticismScore').innerText = profileData.neuroticism; document.getElementById('introjectedScore').innerText = profileData.introjected; let completed = Object.values(profileData).filter(v => v).length; const percent = Math.round((completed / 7) * 100); document.getElementById('profileCompletionPercent').innerText = percent + '%'; document.getElementById('profileProgressFill').style.width = percent + '%'; document.getElementById('completedCount').innerText = Math.min(completed, 5); let level = "Débutant"; if(profileData.conscientiousness >= 4 && profileData.intrinsic >= 4) level = "Avancé"; else if(profileData.conscientiousness >= 3) level = "Intermédiaire"; document.getElementById('profileLevel').innerText = level; const recos = []; recos.push("◼ Qualité du sommeil: Maintenez 7-8 heures de sommeil de qualité."); recos.push("◼ Planification: Renforcez votre organisation avec des rappels."); document.getElementById('recommendationsContainer').innerHTML = recos.map(r => `<p>${r}</p>`).join(''); }
835
+ function autoFillProfile() { profileData = { extraversion: 4, openness: 4, conscientiousness: 5, agreeableness: 4, neuroticism: 2, intrinsic: 5, introjected: 3 }; document.querySelectorAll('.big5-rating').forEach(container => { if(profileData[container.dataset.trait]) updateRatingUI(container, profileData[container.dataset.trait]); }); document.querySelectorAll('.motivation-rating').forEach(container => { if(profileData[container.dataset.motivation]) updateRatingUI(container, profileData[container.dataset.motivation]); }); updateProfileUI(); saveProfileToStorage(); showToast("Profil automatiquement rempli !"); }
836
+ function saveProfileData() { saveProfileToStorage(); showToast("Profil sauvegardé !"); }
837
+ function finalizeProfile() { saveProfileToStorage(); showToast("Profil finalisé !"); }
838
+ function saveProfileToStorage() { localStorage.setItem('perseverAI_profile', JSON.stringify(profileData)); }
839
+ function loadProfileFromStorage() { const saved = localStorage.getItem('perseverAI_profile'); if(saved) Object.assign(profileData, JSON.parse(saved)); updateProfileUI(); }
840
+ function retentionRate(days, strength = 0.5) { return Math.exp(-days / (strength * 30)) * 100; }
841
+ function drawSpacedRepetitionCurve(sessions) {
842
+ const canvas = document.getElementById('spacedRepetitionCurve');
843
+ if(!canvas || sessions.length === 0) return;
844
+ const ctx = canvas.getContext('2d');
845
+ const container = canvas.parentElement;
846
+ const width = container.clientWidth - 40;
847
+ const height = 180;
848
+ canvas.width = width; canvas.height = height;
849
+ ctx.clearRect(0, 0, width, height);
850
+ const startDate = sessions[0].date.getTime();
851
+ const endDate = sessions[sessions.length-1].date.getTime();
852
+ const totalDays = (endDate - startDate) / (1000 * 60 * 60 * 24);
853
+ ctx.beginPath(); ctx.strokeStyle = '#2563eb'; ctx.lineWidth = 2.5; ctx.setLineDash([]);
854
+ let firstPoint = true;
855
+ for(let x = 0; x <= width; x++) {
856
+ const dayProgression = (x / width) * totalDays;
857
+ const retention = retentionRate(dayProgression, 0.4);
858
+ const y = height - (retention / 100) * height;
859
+ if(firstPoint) { ctx.moveTo(x, y); firstPoint = false; } else ctx.lineTo(x, y);
860
+ }
861
+ ctx.stroke();
862
+ for(let i = 0; i < sessions.length; i++) {
863
+ const x = ((sessions[i].date.getTime() - startDate) / (endDate - startDate)) * width;
864
+ const dayProgression = ((sessions[i].date.getTime() - startDate) / (1000 * 60 * 60 * 24));
865
+ const retentionAtSession = retentionRate(dayProgression, 0.4);
866
+ const y = height - (retentionAtSession / 100) * height;
867
+ ctx.beginPath(); ctx.fillStyle = '#ef4444'; ctx.arc(x, y, 5, 0, 2*Math.PI); ctx.fill();
868
+ ctx.fillStyle = 'white'; ctx.beginPath(); ctx.arc(x, y, 2, 0, 2*Math.PI); ctx.fill();
869
+ }
870
+ const datesDiv = document.getElementById('intervalDatesCurve');
871
+ if(datesDiv) datesDiv.innerHTML = sessions.map(s => `<span style="margin:0 8px">${s.dateStr}</span>`).join('');
872
+ }
873
+ function generatePlanner() {
874
+ const competence = document.getElementById('competence')?.value || "comprendre_mots";
875
+ const competenceLabel = competencesData.find(c=>c.id===competence)?.label || "Comprendre les mots";
876
+ const startDate = new Date(document.getElementById('start')?.value || "2024-01-15");
877
+ const sessionDur = document.getElementById('sessionDuration')?.value || "20";
878
+ const method = document.querySelector('input[name="productivityMethod"]:checked')?.value || "pomodoro";
879
+ const timeSlot = document.querySelector('#timeSlotsGroup input:checked')?.value || "08:00-10:00";
880
+ const retention = document.getElementById('retentionQuality')?.value || "2";
881
+ const intervals = [1, 7, 16, 35, 70, 140];
882
+ const sessions = [];
883
+ for(let i = 0; i < intervals.length; i++) {
884
+ let currentDate = new Date(startDate);
885
+ if(i > 0) currentDate.setDate(startDate.getDate() + intervals[i-1]);
886
+ else currentDate = new Date(startDate);
887
+ const sessionTypes = ["Apprentissage", "Consolidation", "Consolidation", "Maintien", "Maintien", "Maintien"];
888
+ const strategies = ["Focus intense", "Révision active", "Révision active", "Révision active", "Révision active", "Révision active"];
889
+ sessions.push({ id: i+1, date: new Date(currentDate), dateStr: currentDate.toLocaleDateString('fr-FR'), dayName: currentDate.toLocaleDateString('fr-FR', { weekday: 'long' }), competence: competenceLabel, duration: sessionDur + " minutes", interval: intervals[i] + " jours", type: sessionTypes[i], strategy: strategies[i], productivity: method === 'pomodoro' ? 'Pomodoro' : 'Deep Work', optimalTime: timeSlot });
890
+ }
891
+ currentSessions = sessions;
892
+ renderPlanningTable(sessions);
893
+ updatePlanningStats(sessions, retention, sessionDur);
894
+ drawSpacedRepetitionCurve(sessions);
895
+ showToast("Planning personnalisé généré !"); showTab('planner');
896
+ }
897
+ function generateDefaultPlanning() {
898
+ const startDate = new Date("2024-01-17");
899
+ const intervals = [1, 7, 16, 35, 70, 140];
900
+ const sessions = [];
901
+ for(let i = 0; i < intervals.length; i++) {
902
+ let currentDate = new Date(startDate);
903
+ if(i > 0) currentDate.setDate(startDate.getDate() + (i===1?1: intervals[i-1]));
904
+ else currentDate = new Date(startDate);
905
+ const sessionTypes = ["Apprentissage", "Consolidation", "Consolidation", "Maintien", "Maintien", "Maintien"];
906
+ sessions.push({ id: i+1, date: new Date(currentDate), dateStr: currentDate.toLocaleDateString('fr-FR'), dayName: currentDate.toLocaleDateString('fr-FR', { weekday: 'long' }), competence: "comprendre_mots", duration: "20 minutes", interval: intervals[i] + " jours", type: sessionTypes[i], strategy: "Révision active", productivity: "Pomodoro", optimalTime: "08:00-10:00" });
907
+ }
908
+ currentSessions = sessions;
909
+ renderPlanningTable(sessions);
910
+ updatePlanningStats(sessions, "2", "20");
911
+ drawSpacedRepetitionCurve(sessions);
912
+ }
913
+ function renderPlanningTable(sessions) { const tbody = document.getElementById('sessionsTableBody'); if(!tbody) return; tbody.innerHTML = sessions.map(s => `<tr><td><strong>${s.dateStr}</strong><br><span style="font-size:0.7rem;">${s.dayName}</span></td><td><strong>R${s.id}</strong></td><td>${s.competence}</td><td>${s.duration}</td><td>${s.interval}</td><td><span class="session-type-badge ${s.type === 'Apprentissage' ? 'type-apprentissage' : (s.type === 'Consolidation' ? 'type-consolidation' : 'type-maintien')}">${s.type}</span></td><td>${s.strategy}</td><td>${s.productivity}</td><td>${s.optimalTime}</td></tr>`).join(''); }
914
+ function updatePlanningStats(sessions, quality, duration) { document.getElementById('statSessions').innerText = sessions.length; if(sessions.length > 0) { const lastDate = sessions[sessions.length-1].date; const firstDate = sessions[0].date; const totalDays = Math.ceil((lastDate - firstDate) / (1000 * 60 * 60 * 24)); document.getElementById('statTotalDays').innerText = totalDays; } const qualityMap = {'0':'1/4','1':'2/4','2':'3/4','3':'4/4'}; document.getElementById('statQuality').innerText = qualityMap[quality] || "3/4"; document.getElementById('statDuration').innerText = duration + "min"; }
915
+ function exportPlanning() { let csv = "Date,Session,Compétence,Durée,Intervalle,Type,Stratégie,Productivité,Heure Optimale\n"; currentSessions.forEach(s => { csv += `"${s.dateStr}","R${s.id}","${s.competence}","${s.duration}","${s.interval}","${s.type}","${s.strategy}","${s.productivity}","${s.optimalTime}"\n`; }); const blob = new Blob([csv], {type: 'text/csv'}); const link = document.createElement('a'); link.href = URL.createObjectURL(blob); link.download = 'planning_perseverai.csv'; link.click(); showToast("Planning exporté en CSV"); }
916
+ function generateRandomEvent() { const template = eventTemplates[Math.floor(Math.random() * eventTemplates.length)]; const newEvent = { id: Date.now() + Math.random(), date: new Date().toLocaleString(), type: template.type, title: template.title, message: template.message, priority: template.priority, status: 'pending' }; eventsList.unshift(newEvent); saveEvents(); renderEventsTable(); updateEventStats(); showToast(`Nouvel événement: ${template.title}`); }
917
+ function executeAction(eventId, actionType, actionLabel) { const eventIndex = eventsList.findIndex(e => e.id == eventId); if(eventIndex === -1) return; eventsList[eventIndex].status = actionType === 'ACCEPT' ? 'accepted' : (actionType === 'REJECT' ? 'rejected' : 'hold'); renderEventsTable(); updateEventStats(); saveEvents(); showToast(`${actionLabel}`); }
918
+ function renderEventsTable() { const tbody = document.getElementById('notificationsTableBody'); if(!tbody) return; if(eventsList.length === 0) { tbody.innerHTML = '<tr><td colspan="7" style="text-align:center;">Aucun événement</td></tr>'; return; } tbody.innerHTML = eventsList.map(event => `<tr><td>${event.date}</td><td>${event.type}</td><td><strong>${event.title}</strong></td><td>${event.message}</td><td><span class="priority-${event.priority}">${event.priority}</span></td><td><span class="status-badge ${event.status === 'accepted' ? 'status-accepted' : 'status-pending'}">${event.status === 'accepted' ? 'Accepté' : 'En attente'}</span></td><td class="action-cell"><button class="action-icon-btn action-accept" onclick="executeAction(${event.id}, 'ACCEPT', 'Accepté')">✓ Accepter</button><button class="action-icon-btn action-reject" onclick="executeAction(${event.id}, 'REJECT', 'Rejeté')">✗ Rejeter</button><button class="action-icon-btn action-hold" onclick="executeAction(${event.id}, 'HOLD', 'En attente')">⏸ Attente</button><button class="action-icon-btn action-help" onclick="executeAction(${event.id}, 'HELP', 'Aide demandée')">🆘 Aide</button></td></tr>`).join(''); }
919
+ function updateEventStats() { document.getElementById('totalEvents').innerText = eventsList.length; document.getElementById('pendingEvents').innerText = eventsList.filter(e => e.status === 'pending').length; document.getElementById('acceptedEvents').innerText = eventsList.filter(e => e.status === 'accepted').length; if(efficiencyChart) efficiencyChart.data.datasets[0].data = [eventsList.filter(e=>e.status==='accepted').length, eventsList.filter(e=>e.status==='rejected').length, eventsList.filter(e=>e.status==='pending').length]; efficiencyChart?.update(); }
920
+ let efficiencyChart = null;
921
+ function createChart() { const ctx = document.getElementById('notificationEfficiencyChart')?.getContext('2d'); if(ctx) efficiencyChart = new Chart(ctx, { type: 'bar', data: { labels: ['Acceptés', 'Rejetés', 'En attente'], datasets: [{ label: 'Actions', data: [0,0,0], backgroundColor: ['#16a34a','#dc2626','#d97706'] }] }, options: { responsive: true } }); }
922
+ function saveJournal() { if(document.getElementById('done')?.value) { let journal = JSON.parse(localStorage.getItem('journal') || '[]'); journal.unshift({ date: new Date().toLocaleString(), done: document.getElementById('done').value }); localStorage.setItem('journal', JSON.stringify(journal)); showToast("Journal sauvegardé"); document.getElementById('done').value = ''; } }
923
+ function saveEvents() { localStorage.setItem('eventsList', JSON.stringify(eventsList)); }
924
+ function loadSavedData() { const saved = localStorage.getItem('eventsList'); if(saved) eventsList = JSON.parse(saved); }
925
+ function showTab(tabId) {
926
+ document.querySelectorAll('.tab-content').forEach(t => t.classList.remove('active'));
927
+ document.getElementById(tabId).classList.add('active');
928
+ document.querySelectorAll('.nav-tab').forEach(t => t.classList.remove('active'));
929
+ if(window.event?.target) window.event.target.classList.add('active');
930
+ if(tabId === 'dashboard') { renderHeatmap(); drawSymmetryCurve(); updateIndicators(); }
931
+ if(tabId === 'planner') { if(currentSessions.length === 0) generateDefaultPlanning(); else drawSpacedRepetitionCurve(currentSessions); }
932
+ if(tabId === 'notifications') { renderEventsTable(); updateEventStats(); }
933
+ if(tabId === 'profile') { loadProfileFromStorage(); updateProfileUI(); }
934
+ }
935
+ function showToast(msg) { let div = document.createElement('div'); div.style.cssText = `position:fixed; bottom:20px; right:20px; background:#1e293b; color:white; padding:12px 20px; border-radius:8px; z-index:1000;`; div.innerHTML = msg; document.body.appendChild(div); setTimeout(()=>div.remove(), 2500); }
936
+ document.addEventListener('DOMContentLoaded', () => { initCompetencesSelect(); loadSavedData(); renderEventsTable(); updateEventStats(); createChart(); initProfileModule(); const retentionSlider = document.getElementById('retentionQuality'); if(retentionSlider) retentionSlider.addEventListener('input', function() { const val = parseInt(this.value); const messages = {0:"0 - Faible",1:"1 - Moyenne",2:"2 - Bon - Consolidation progressive",3:"3 - Excellente"}; document.getElementById('retentionValueDisplay').innerText = messages[val]; }); generateDefaultPlanning(); loadProfileFromStorage(); setupRatingListeners(); updateProfileUI(); setDashboardView('combined'); });
937
+ function initProfileModule() { loadProfileFromStorage(); setupRatingListeners(); updateProfileUI(); }
938
+ window.addEventListener('resize', () => { if(document.getElementById('dashboard').classList.contains('active')) drawSymmetryCurve(); if(document.getElementById('planner').classList.contains('active') && currentSessions.length > 0) drawSpacedRepetitionCurve(currentSessions); });
939
+ </script>
940
+ </body>
941
+ </html>