OUAREDAEK commited on
Commit
c380a39
·
verified ·
1 Parent(s): 9bc2261

Upload templates/index-old1.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. templates/index-old1.html +720 -0
templates/index-old1.html ADDED
@@ -0,0 +1,720 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ .interval-visual {
189
+ width: 100%;
190
+ height: 80px;
191
+ background: var(--gray-100);
192
+ border-radius: 8px;
193
+ position: relative;
194
+ margin-top: 20px;
195
+ }
196
+
197
+ .retention-slider {
198
+ width: 100%;
199
+ margin: 15px 0;
200
+ }
201
+ .retention-slider input {
202
+ width: 100%;
203
+ cursor: pointer;
204
+ accent-color: var(--primary);
205
+ }
206
+ .retention-labels {
207
+ display: flex;
208
+ justify-content: space-between;
209
+ font-size: 0.7rem;
210
+ color: var(--gray-600);
211
+ margin-top: 5px;
212
+ }
213
+
214
+ .time-slots-group {
215
+ display: flex;
216
+ flex-wrap: wrap;
217
+ gap: 12px;
218
+ margin-top: 8px;
219
+ }
220
+ .time-slot-checkbox {
221
+ display: flex;
222
+ align-items: center;
223
+ gap: 6px;
224
+ background: var(--gray-50);
225
+ padding: 6px 12px;
226
+ border-radius: 20px;
227
+ border: 1px solid var(--gray-200);
228
+ cursor: pointer;
229
+ }
230
+ .radio-group {
231
+ display: flex;
232
+ gap: 20px;
233
+ margin-top: 8px;
234
+ }
235
+ .radio-option {
236
+ display: flex;
237
+ align-items: center;
238
+ gap: 8px;
239
+ cursor: pointer;
240
+ }
241
+
242
+ .notifications-table {
243
+ width: 100%;
244
+ border-collapse: collapse;
245
+ font-size: 0.85rem;
246
+ }
247
+ .notifications-table th {
248
+ text-align: left;
249
+ padding: 12px 8px;
250
+ background: var(--gray-50);
251
+ border-bottom: 2px solid var(--gray-200);
252
+ font-weight: 600;
253
+ }
254
+ .notifications-table td {
255
+ padding: 12px 8px;
256
+ border-bottom: 1px solid var(--gray-200);
257
+ }
258
+
259
+ .priority-high { color: var(--danger); font-weight: 600; }
260
+ .priority-medium { color: var(--warning); font-weight: 600; }
261
+ .priority-low { color: var(--success); font-weight: 600; }
262
+
263
+ .status-badge {
264
+ display: inline-block;
265
+ padding: 4px 10px;
266
+ border-radius: 20px;
267
+ font-size: 0.7rem;
268
+ font-weight: 500;
269
+ }
270
+ .status-pending { background: #fef3c7; color: #92400e; }
271
+ .status-accepted { background: #dcfce7; color: #166534; }
272
+
273
+ .action-cell {
274
+ display: flex;
275
+ flex-wrap: wrap;
276
+ gap: 6px;
277
+ }
278
+ .action-icon-btn {
279
+ background: transparent;
280
+ border: none;
281
+ cursor: pointer;
282
+ padding: 6px 10px;
283
+ border-radius: 20px;
284
+ font-size: 0.7rem;
285
+ font-weight: 500;
286
+ transition: all 0.2s;
287
+ }
288
+ .action-accept { background: #dcfce7; color: #166534; }
289
+ .action-reject { background: #fee2e2; color: #991b1b; }
290
+ .action-hold { background: #e0f2fe; color: #075985; }
291
+ .action-help { background: #fed7aa; color: #9a3412; }
292
+
293
+ .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
294
+ .stat-card { background: white; border: 1px solid var(--gray-200); border-radius: 8px; padding: 16px; text-align: center; }
295
+ .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
296
+
297
+ .chart-container { height: 300px; margin-top: 20px; }
298
+ .tab-content { display: none; }
299
+ .tab-content.active { display: block; }
300
+
301
+ @media (max-width: 768px) {
302
+ .container { padding: 16px; }
303
+ .planning-sessions-table { font-size: 0.7rem; }
304
+ .planning-sessions-table td, .planning-sessions-table th { padding: 8px 6px; }
305
+ }
306
+
307
+ .session-detail-line { font-size: 0.75rem; color: var(--gray-600); margin: 4px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
308
+ .session-detail-line i { width: 20px; color: var(--primary); }
309
+
310
+ .export-btn { background: white; border: 1px solid var(--gray-200); padding: 8px 16px; border-radius: 8px; cursor: pointer; }
311
+ .export-btn:hover { background: var(--gray-50); }
312
+ </style>
313
+ </head>
314
+ <body>
315
+ <div class="container">
316
+ <header class="header">
317
+ <h1>PerseverAI</h1>
318
+ <p>Compagnon d'apprentissage autorégulé - Notifications IA & Actions</p>
319
+ <div class="badge">AI · Aid · Perseverance · Tableau des événements</div>
320
+ </header>
321
+
322
+ <nav class="nav-tabs">
323
+ <button class="nav-tab" onclick="showTab('profile')">Profil</button>
324
+ <button class="nav-tab" onclick="showTab('objectif')">Objectif</button>
325
+ <button class="nav-tab" onclick="showTab('planner')">Planning</button>
326
+ <button class="nav-tab" onclick="showTab('dashboard')">Mon Dashboard</button>
327
+ <button class="nav-tab" onclick="showTab('journal')">Mon Journal</button>
328
+ <button class="nav-tab active" onclick="showTab('notifications')">Notifications IA</button>
329
+ </nav>
330
+
331
+ <section id="profile" class="tab-content">
332
+ <div class="card">
333
+ <div class="card-header"><h3>Profil d'apprentissage</h3><button class="btn btn-secondary" onclick="saveProfile()">Sauvegarder</button></div>
334
+ <div class="profile-summary" style="display:grid; grid-template-columns:1fr 1fr; gap:20px;">
335
+ <div><h4>Big Five</h4><div id="big5-summary"></div></div>
336
+ <div><h4>Motivation</h4><div id="motivation-summary"></div></div>
337
+ </div>
338
+ <button class="btn btn-primary" onclick="completeProfile()">Finaliser le profil</button>
339
+ </div>
340
+ </section>
341
+
342
+ <section id="objectif" class="tab-content">
343
+ <div class="card">
344
+ <div class="card-header"><h3>Définir mon Objectif d'Apprentissage</h3></div>
345
+ <div class="form-row">
346
+ <div class="form-col"><label class="form-label">Compétence Cible</label><select id="competence" class="form-control"></select></div>
347
+ <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>
348
+ </div>
349
+ <div class="form-row">
350
+ <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>
351
+ <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>
352
+ </div>
353
+ <div class="form-row">
354
+ <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>
355
+ <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>
356
+ </div>
357
+ <div class="form-row">
358
+ <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>
359
+ <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>
360
+ </div>
361
+ <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 class="retention-value" id="retentionValueDisplay">Bon - Consolidation progressive</div></div>
362
+ <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>
363
+ </div>
364
+ </section>
365
+
366
+ <!-- PLANNING - Version complète avec statistiques et tableau SM-2 -->
367
+ <section id="planner" class="tab-content">
368
+ <div class="card">
369
+ <div class="card-header">
370
+ <h3><i class="fas fa-calendar-alt"></i> Planner Personnalisé</h3>
371
+ <button class="export-btn" onclick="exportPlanning()"><i class="fas fa-download"></i> Exporter</button>
372
+ </div>
373
+
374
+ <!-- Statistiques du planning -->
375
+ <div class="planning-stats" id="planningStats">
376
+ <div class="planning-stat-item"><div class="planning-stat-number" id="statSessions">6</div><div class="planning-stat-label">Sessions Planifiées</div></div>
377
+ <div class="planning-stat-item"><div class="planning-stat-number" id="statTotalDays">270</div><div class="planning-stat-label">Jours Totaux</div></div>
378
+ <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>
379
+ <div class="planning-stat-item"><div class="planning-stat-number" id="statDuration">20min</div><div class="planning-stat-label">Durée/Session</div></div>
380
+ </div>
381
+
382
+ <!-- Tableau des sessions planifiées (modèle SM-2) -->
383
+ <div style="overflow-x: auto;">
384
+ <table class="planning-sessions-table" id="sessionsTable">
385
+ <thead>
386
+ <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>
387
+ </thead>
388
+ <tbody id="sessionsTableBody">
389
+ <!-- Les sessions seront générées dynamiquement -->
390
+ </tbody>
391
+ </table>
392
+ </div>
393
+
394
+ <!-- Visualisation des intervalles SM-2 -->
395
+ <div style="margin-top: 32px;">
396
+ <h4 style="margin-bottom: 16px; font-size: 0.9rem;"><i class="fas fa-chart-line"></i> Visualisation des Intervalles SM-2</h4>
397
+ <div style="background: var(--gray-50); border-radius: 12px; padding: 20px; position: relative;">
398
+ <canvas id="intervalChart" width="100%" height="80" style="max-height: 100px; width: 100%;"></canvas>
399
+ <div style="display: flex; justify-content: space-between; margin-top: 12px; font-size: 0.7rem; color: var(--gray-600);" id="intervalDates"></div>
400
+ </div>
401
+ </div>
402
+ </div>
403
+ </section>
404
+
405
+ <section id="dashboard" class="tab-content">
406
+ <div class="card"><div class="card-header"><h3>Tableau de bord</h3></div><div class="stats-grid" id="dashboardStats"></div><div class="chart-container"><canvas id="progressChart"></canvas></div></div>
407
+ </section>
408
+
409
+ <section id="journal" class="tab-content">
410
+ <div class="card"><div class="card-header"><h3>Mon journal d'apprentissage</h3><button class="btn btn-secondary" onclick="saveJournal()">Sauvegarder</button></div>
411
+ <div class="form-group"><label class="form-label">Accompli aujourd'hui</label><textarea id="done" class="form-control" rows="2"></textarea></div>
412
+ <div class="form-group"><label class="form-label">Stratégie utilisée</label><textarea id="metacognition" class="form-control" rows="2"></textarea></div>
413
+ <div id="journalEntriesList"></div></div>
414
+ </section>
415
+
416
+ <section id="notifications" class="tab-content active">
417
+ <div class="card">
418
+ <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>
419
+ <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>
420
+ <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>
421
+ <div class="chart-container"><canvas id="notificationEfficiencyChart"></canvas></div>
422
+ </div>
423
+ </section>
424
+ </div>
425
+
426
+ <script>
427
+ const competencesData = [
428
+ { "id": "D-MCONJ", "label": "Marques de la conjugaison", "category": "Discours" },
429
+ { "id": "D-PDV", "label": "Points de vue adoptés", "category": "Discours" },
430
+ { "id": "D-SSENT", "label": "Compréhension des mots", "category": "Discours" },
431
+ { "id": "M-CHOI", "label": "Choix des mots et des expressions", "category": "Maîtrise" },
432
+ { "id": "M-COMP", "label": "Construction des phrases", "category": "Maîtrise" },
433
+ { "id": "M-DEV", "label": "Développement du vocabulaire", "category": "Maîtrise" }
434
+ ];
435
+
436
+ let eventsList = [];
437
+ let profile = { bigFive: { extraversion:3, conscientiousness:4, neuroticism:3 } };
438
+ let currentSessions = [];
439
+
440
+ const eventTemplates = [
441
+ { type: "Rappel d'étude", title: "Session de révision", message: "Votre session est prévue aujourd'hui.", priority: "high" },
442
+ { type: "Conseil IA", title: "Optimisation", message: "Révisez les conjugaisons.", priority: "medium" },
443
+ { type: "Encouragement", title: "Progression", message: "80% des objectifs atteints.", priority: "low" }
444
+ ];
445
+
446
+ document.addEventListener('DOMContentLoaded', () => {
447
+ initCompetencesSelect();
448
+ loadSavedData();
449
+ renderEventsTable();
450
+ updateEventStats();
451
+ createChart();
452
+ initProfileSummary();
453
+
454
+ const retentionSlider = document.getElementById('retentionQuality');
455
+ if(retentionSlider) retentionSlider.addEventListener('input', function() {
456
+ const val = parseInt(this.value);
457
+ const messages = {0: "0 - Faible", 1: "1 - Moyenne", 2: "2 - Bon - Consolidation progressive", 3: "3 - Excellente"};
458
+ document.getElementById('retentionValueDisplay').innerText = messages[val];
459
+ });
460
+
461
+ // Générer planning par défaut
462
+ generateDefaultPlanning();
463
+ });
464
+
465
+ function initCompetencesSelect() {
466
+ const select = document.getElementById('competence');
467
+ if(select) select.innerHTML = '<option value="comprendre_mots">Comprendre les mots</option>' + competencesData.map(c => `<option value="${c.id}">${c.label}</option>`).join('');
468
+ }
469
+
470
+ function initProfileSummary() {
471
+ document.getElementById('big5-summary').innerHTML = `<div>Extraversion: ${profile.bigFive.extraversion}</div><div>Conscience: ${profile.bigFive.conscientiousness}</div>`;
472
+ document.getElementById('motivation-summary').innerHTML = `<div>Motivation: 3.5/5</div>`;
473
+ }
474
+
475
+ // Génération du planning selon le modèle SM-2 avec intervalles exponentiels
476
+ function generatePlanner() {
477
+ const competence = document.getElementById('competence')?.value || "comprendre_mots";
478
+ const competenceLabel = competencesData.find(c=>c.id===competence)?.label || "Comprendre les mots";
479
+ const startDate = new Date(document.getElementById('start')?.value || "2024-01-15");
480
+ const sessionDur = document.getElementById('sessionDuration')?.value || "20";
481
+ const method = document.querySelector('input[name="productivityMethod"]:checked')?.value || "pomodoro";
482
+ const energy = document.querySelector('input[name="energyType"]:checked')?.value || "morning";
483
+ const retention = document.getElementById('retentionQuality')?.value || "2";
484
+ const timeSlot = document.querySelector('#timeSlotsGroup input:checked')?.value || "08:00-10:00";
485
+
486
+ // Intervalles SM-2: 1, 7, 16, 35, 70, 140 jours
487
+ const intervals = [1, 7, 16, 35, 70, 140];
488
+ const sessions = [];
489
+ let currentDate = new Date(startDate);
490
+
491
+ for(let i = 0; i < intervals.length; i++) {
492
+ if(i > 0) currentDate = new Date(startDate);
493
+ if(i > 0) currentDate.setDate(startDate.getDate() + intervals[i-1]);
494
+ else currentDate = new Date(startDate);
495
+
496
+ const sessionTypes = ["Apprentissage", "Consolidation", "Consolidation", "Maintien", "Maintien", "Maintien"];
497
+ const strategies = ["Focus intense", "Révision active", "Révision active", "Révision active", "Révision active", "Révision active"];
498
+
499
+ sessions.push({
500
+ id: i+1,
501
+ date: new Date(currentDate),
502
+ dateStr: currentDate.toLocaleDateString('fr-FR'),
503
+ dayName: currentDate.toLocaleDateString('fr-FR', { weekday: 'long' }),
504
+ competence: competenceLabel,
505
+ duration: sessionDur + " minutes",
506
+ interval: intervals[i] + " jours",
507
+ type: sessionTypes[i],
508
+ strategy: strategies[i],
509
+ productivity: method === 'pomodoro' ? 'Pomodoro' : 'Deep Work',
510
+ optimalTime: timeSlot
511
+ });
512
+ }
513
+
514
+ currentSessions = sessions;
515
+ renderPlanningTable(sessions);
516
+ updatePlanningStats(sessions, retention, sessionDur);
517
+ drawIntervalChart(sessions);
518
+ showToast("Planning personnalisé généré avec succès !");
519
+ showTab('planner');
520
+ }
521
+
522
+ function generateDefaultPlanning() {
523
+ const startDate = new Date("2024-01-17");
524
+ const intervals = [1, 7, 16, 35, 70, 140];
525
+ const sessions = [];
526
+ for(let i = 0; i < intervals.length; i++) {
527
+ let currentDate = new Date(startDate);
528
+ if(i > 0) currentDate.setDate(startDate.getDate() + (i===1?1: intervals[i-1]));
529
+ else currentDate = new Date(startDate);
530
+ const sessionTypes = ["Apprentissage", "Consolidation", "Consolidation", "Maintien", "Maintien", "Maintien"];
531
+ const strategies = ["Focus intense", "Révision active", "Révision active", "Révision active", "Révision active", "Révision active"];
532
+ sessions.push({
533
+ id: i+1,
534
+ date: new Date(currentDate),
535
+ dateStr: currentDate.toLocaleDateString('fr-FR'),
536
+ dayName: currentDate.toLocaleDateString('fr-FR', { weekday: 'long' }),
537
+ competence: "comprendre_mots",
538
+ duration: "20 minutes",
539
+ interval: intervals[i] + " jours",
540
+ type: sessionTypes[i],
541
+ strategy: strategies[i],
542
+ productivity: "Pomodoro",
543
+ optimalTime: "08:00-10:00"
544
+ });
545
+ }
546
+ currentSessions = sessions;
547
+ renderPlanningTable(sessions);
548
+ updatePlanningStats(sessions, "2", "20");
549
+ drawIntervalChart(sessions);
550
+ }
551
+
552
+ function renderPlanningTable(sessions) {
553
+ const tbody = document.getElementById('sessionsTableBody');
554
+ if(!tbody) return;
555
+ tbody.innerHTML = sessions.map(s => `
556
+ <tr>
557
+ <td style="white-space:nowrap;"><strong>${s.dateStr}</strong><br><span style="font-size:0.7rem; color:var(--gray-600);">${s.dayName}</span></td>
558
+ <td><strong>R${s.id}</strong></td>
559
+ <td>${s.competence}</td>
560
+ <td>${s.duration}</td>
561
+ <td>${s.interval}</td>
562
+ <td><span class="session-type-badge ${s.type === 'Apprentissage' ? 'type-apprentissage' : (s.type === 'Consolidation' ? 'type-consolidation' : 'type-maintien')}">${s.type}</span></td>
563
+ <td>${s.strategy}</td>
564
+ <td>${s.productivity}</td>
565
+ <td>${s.optimalTime}</td>
566
+ </tr>
567
+ `).join('');
568
+ }
569
+
570
+ function updatePlanningStats(sessions, quality, duration) {
571
+ document.getElementById('statSessions').innerText = sessions.length;
572
+ if(sessions.length > 0) {
573
+ const lastDate = sessions[sessions.length-1].date;
574
+ const firstDate = sessions[0].date;
575
+ const totalDays = Math.ceil((lastDate - firstDate) / (1000 * 60 * 60 * 24));
576
+ document.getElementById('statTotalDays').innerText = totalDays;
577
+ } else {
578
+ document.getElementById('statTotalDays').innerText = "0";
579
+ }
580
+ const qualityMap = {'0':'1/4','1':'2/4','2':'3/4','3':'4/4'};
581
+ document.getElementById('statQuality').innerText = qualityMap[quality] || "3/4";
582
+ document.getElementById('statDuration').innerText = duration + "min";
583
+ }
584
+
585
+ function drawIntervalChart(sessions) {
586
+ const canvas = document.getElementById('intervalChart');
587
+ if(!canvas) return;
588
+ const ctx = canvas.getContext('2d');
589
+ canvas.width = canvas.parentElement.clientWidth - 40;
590
+ canvas.height = 80;
591
+
592
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
593
+ if(sessions.length === 0) return;
594
+
595
+ const startTime = sessions[0].date.getTime();
596
+ const endTime = sessions[sessions.length-1].date.getTime();
597
+ const totalDuration = endTime - startTime;
598
+
599
+ ctx.beginPath();
600
+ ctx.strokeStyle = '#2563eb';
601
+ ctx.lineWidth = 3;
602
+
603
+ for(let i = 0; i < sessions.length; i++) {
604
+ const x = ((sessions[i].date.getTime() - startTime) / totalDuration) * canvas.width;
605
+ ctx.fillStyle = '#2563eb';
606
+ ctx.beginPath();
607
+ ctx.arc(x, canvas.height/2, 6, 0, 2*Math.PI);
608
+ ctx.fill();
609
+ ctx.fillStyle = 'white';
610
+ ctx.beginPath();
611
+ ctx.arc(x, canvas.height/2, 3, 0, 2*Math.PI);
612
+ ctx.fill();
613
+ ctx.fillStyle = '#1e293b';
614
+ ctx.font = '10px Inter';
615
+ ctx.fillText(`R${i+1}`, x-6, canvas.height/2 - 8);
616
+ }
617
+
618
+ // Ligne de connexion
619
+ ctx.beginPath();
620
+ ctx.strokeStyle = '#94a3b8';
621
+ ctx.lineWidth = 1.5;
622
+ ctx.setLineDash([5, 5]);
623
+ for(let i = 0; i < sessions.length; i++) {
624
+ const x = ((sessions[i].date.getTime() - startTime) / totalDuration) * canvas.width;
625
+ if(i === 0) ctx.moveTo(x, canvas.height/2);
626
+ else ctx.lineTo(x, canvas.height/2);
627
+ }
628
+ ctx.stroke();
629
+ ctx.setLineDash([]);
630
+
631
+ // Dates sous le graphique
632
+ const datesDiv = document.getElementById('intervalDates');
633
+ if(datesDiv) {
634
+ datesDiv.innerHTML = sessions.map(s => `<span>${s.dateStr}</span>`).join('');
635
+ }
636
+ }
637
+
638
+ function exportPlanning() {
639
+ let csv = "Date,Session,Compétence,Durée,Intervalle,Type,Stratégie,Productivité,Heure Optimale\n";
640
+ currentSessions.forEach(s => {
641
+ csv += `"${s.dateStr}","R${s.id}","${s.competence}","${s.duration}","${s.interval}","${s.type}","${s.strategy}","${s.productivity}","${s.optimalTime}"\n`;
642
+ });
643
+ const blob = new Blob([csv], {type: 'text/csv'});
644
+ const link = document.createElement('a');
645
+ link.href = URL.createObjectURL(blob);
646
+ link.download = 'planning_perseverai.csv';
647
+ link.click();
648
+ showToast("Planning exporté en CSV");
649
+ }
650
+
651
+ // ========== FONCTIONS NOTIFICATIONS ==========
652
+ function generateRandomEvent() {
653
+ const template = eventTemplates[Math.floor(Math.random() * eventTemplates.length)];
654
+ 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' };
655
+ eventsList.unshift(newEvent);
656
+ saveEvents();
657
+ renderEventsTable();
658
+ updateEventStats();
659
+ showToast(`Nouvel événement: ${template.title}`);
660
+ }
661
+
662
+ function executeAction(eventId, actionType, actionLabel) {
663
+ const eventIndex = eventsList.findIndex(e => e.id == eventId);
664
+ if(eventIndex === -1) return;
665
+ eventsList[eventIndex].status = actionType === 'ACCEPT' ? 'accepted' : (actionType === 'REJECT' ? 'rejected' : 'hold');
666
+ renderEventsTable();
667
+ updateEventStats();
668
+ saveEvents();
669
+ showToast(`${actionLabel}`);
670
+ }
671
+
672
+ function renderEventsTable() {
673
+ const tbody = document.getElementById('notificationsTableBody');
674
+ if(!tbody) return;
675
+ if(eventsList.length === 0) { tbody.innerHTML = '<tr><td colspan="7" style="text-align:center;">Aucun événement</td></tr>'; return; }
676
+ tbody.innerHTML = eventsList.map(event => `<tr>
677
+ <td>${event.date}</td><td>${event.type}</td><td><strong>${event.title}</strong></td><td>${event.message}</td>
678
+ <td><span class="priority-${event.priority}">${event.priority}</span></td>
679
+ <td><span class="status-badge ${event.status === 'accepted' ? 'status-accepted' : 'status-pending'}">${event.status === 'accepted' ? 'Accepté' : 'En attente'}</span></td>
680
+ <td class="action-cell"><button class="action-icon-btn action-accept" onclick="executeAction(${event.id}, 'ACCEPT', 'Accepté')">✓ Accepter</button>
681
+ <button class="action-icon-btn action-reject" onclick="executeAction(${event.id}, 'REJECT', 'Rejeté')">✗ Rejeter</button>
682
+ <button class="action-icon-btn action-hold" onclick="executeAction(${event.id}, 'HOLD', 'En attente')">⏸ Attente</button>
683
+ <button class="action-icon-btn action-help" onclick="executeAction(${event.id}, 'HELP', 'Aide demandée')">🆘 Aide</button></td>
684
+ </tr>`).join('');
685
+ }
686
+
687
+ function updateEventStats() {
688
+ document.getElementById('totalEvents').innerText = eventsList.length;
689
+ document.getElementById('pendingEvents').innerText = eventsList.filter(e => e.status === 'pending').length;
690
+ document.getElementById('acceptedEvents').innerText = eventsList.filter(e => e.status === 'accepted').length;
691
+ }
692
+
693
+ let efficiencyChart = null;
694
+ function createChart() {
695
+ const ctx = document.getElementById('notificationEfficiencyChart')?.getContext('2d');
696
+ 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 } });
697
+ }
698
+
699
+ 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 = ''; } }
700
+ function saveProfile() { localStorage.setItem('profile', JSON.stringify(profile)); showToast("Profil sauvegardé"); }
701
+ function completeProfile() { saveProfile(); showToast("Profil finalisé"); }
702
+ function saveEvents() { localStorage.setItem('eventsList', JSON.stringify(eventsList)); }
703
+ function loadSavedData() { const saved = localStorage.getItem('eventsList'); if(saved) eventsList = JSON.parse(saved); }
704
+
705
+ function showTab(tabId) {
706
+ document.querySelectorAll('.tab-content').forEach(t => t.classList.remove('active'));
707
+ document.getElementById(tabId).classList.add('active');
708
+ document.querySelectorAll('.nav-tab').forEach(t => t.classList.remove('active'));
709
+ if(window.event?.target) window.event.target.classList.add('active');
710
+ if(tabId === 'dashboard') { const ctx = document.getElementById('progressChart')?.getContext('2d'); if(ctx && !window.dashChart) window.dashChart = new Chart(ctx, { type:'line', data:{ labels:['Sem1','Sem2','Sem3','Sem4'], datasets:[{ label:'Progression', data:[30,45,60,75], borderColor:'#2563eb' }] } }); }
711
+ if(tabId === 'planner' && currentSessions.length === 0) generateDefaultPlanning();
712
+ if(tabId === 'notifications') { renderEventsTable(); updateEventStats(); 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(); }
713
+ }
714
+
715
+ 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); }
716
+
717
+ document.getElementById('dashboardStats') && (document.getElementById('dashboardStats').innerHTML = `<div class="stat-card"><div class="stat-value">12</div><div class="stat-label">Sessions</div></div><div class="stat-card"><div class="stat-value">85%</div><div class="stat-label">Complétion</div></div>`);
718
+ </script>
719
+ </body>
720
+ </html>