OUAREDAEK commited on
Commit
4c5de41
·
verified ·
1 Parent(s): 95f052e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +560 -2
index.html CHANGED
@@ -168,6 +168,265 @@
168
  gap: 10px;
169
  }
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  /* Form Elements */
172
  .form-group {
173
  margin-bottom: 1.5rem;
@@ -721,6 +980,18 @@
721
  .flashcard-stats-summary {
722
  grid-template-columns: 1fr;
723
  }
 
 
 
 
 
 
 
 
 
 
 
 
724
  }
725
  </style>
726
  </head>
@@ -729,8 +1000,8 @@
729
  <!-- Header -->
730
  <header class="header">
731
  <h1><i class="fas fa-graduation-cap"></i> Compagnon Pédagogique</h1>
732
- <p>SCompétences ciblées, niveau maîtrisé, délai respecté avec persistance et gestion de l’effort.</p>
733
- <div class="badge">PerseverAId (AI + Aid + Perseverance)</div>
734
  </header>
735
 
736
  <!-- Navigation -->
@@ -1119,6 +1390,145 @@
1119
 
1120
  <div id="statsContainer" class="stats-grid"></div>
1121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1122
  <div class="visualization-container">
1123
  <h4><i class="fas fa-chart-area"></i> Progression de la Rétention</h4>
1124
  <div class="chart-container">
@@ -1195,6 +1605,10 @@
1195
  due: 0
1196
  };
1197
 
 
 
 
 
1198
  // Initialisation
1199
  document.addEventListener('DOMContentLoaded', function() {
1200
  loadCompetences();
@@ -1204,6 +1618,7 @@
1204
  initializeHabitsProductivity();
1205
  loadFlashcards();
1206
  updateFlashcardStats();
 
1207
  });
1208
 
1209
  // Navigation
@@ -1241,6 +1656,7 @@
1241
  // Actions spécifiques par onglet
1242
  if (tabId === 'stats') {
1243
  refreshStats();
 
1244
  } else if (tabId === 'learn') {
1245
  updateComparisonChart();
1246
  } else if (tabId === 'flashcards') {
@@ -1612,6 +2028,148 @@
1612
  });
1613
  }
1614
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1615
  // ============================================
1616
  // FLASHCARD APPLICATION
1617
  // ============================================
 
168
  gap: 10px;
169
  }
170
 
171
+ /* Heatmap d'activité */
172
+ .heatmap-container {
173
+ margin-top: 2rem;
174
+ }
175
+
176
+ .heatmap-header {
177
+ display: flex;
178
+ justify-content: space-between;
179
+ align-items: center;
180
+ margin-bottom: 1.5rem;
181
+ }
182
+
183
+ .heatmap-title {
184
+ font-size: 1.3rem;
185
+ color: var(--dark-color);
186
+ display: flex;
187
+ align-items: center;
188
+ gap: 10px;
189
+ }
190
+
191
+ .heatmap-controls {
192
+ display: flex;
193
+ gap: 10px;
194
+ }
195
+
196
+ .heatmap-period {
197
+ padding: 8px 15px;
198
+ border: 2px solid #e2e8f0;
199
+ border-radius: 8px;
200
+ background: #f8fafc;
201
+ cursor: pointer;
202
+ transition: all 0.3s;
203
+ }
204
+
205
+ .heatmap-period:hover {
206
+ border-color: var(--primary-color);
207
+ }
208
+
209
+ .heatmap-period.active {
210
+ background: var(--primary-color);
211
+ color: white;
212
+ border-color: var(--primary-color);
213
+ }
214
+
215
+ .heatmap-grid {
216
+ display: grid;
217
+ grid-template-columns: auto repeat(7, 1fr);
218
+ gap: 8px;
219
+ margin-top: 1rem;
220
+ }
221
+
222
+ .heatmap-day-label {
223
+ text-align: right;
224
+ padding: 10px;
225
+ font-weight: 600;
226
+ color: var(--dark-color);
227
+ }
228
+
229
+ .heatmap-cell {
230
+ aspect-ratio: 1;
231
+ border-radius: 4px;
232
+ display: flex;
233
+ align-items: center;
234
+ justify-content: center;
235
+ font-size: 0.8rem;
236
+ font-weight: bold;
237
+ cursor: pointer;
238
+ transition: transform 0.2s;
239
+ }
240
+
241
+ .heatmap-cell:hover {
242
+ transform: scale(1.1);
243
+ z-index: 10;
244
+ }
245
+
246
+ .heatmap-intensity-0 { background: #f1f5f9; color: var(--gray-color); }
247
+ .heatmap-intensity-1 { background: #dbeafe; color: var(--dark-color); }
248
+ .heatmap-intensity-2 { background: #93c5fd; color: white; }
249
+ .heatmap-intensity-3 { background: #3b82f6; color: white; }
250
+ .heatmap-intensity-4 { background: #1d4ed8; color: white; }
251
+
252
+ .heatmap-week-label {
253
+ text-align: center;
254
+ padding: 5px;
255
+ font-size: 0.9rem;
256
+ color: var(--gray-color);
257
+ }
258
+
259
+ .heatmap-legend {
260
+ display: flex;
261
+ justify-content: center;
262
+ align-items: center;
263
+ gap: 15px;
264
+ margin-top: 1.5rem;
265
+ padding-top: 1.5rem;
266
+ border-top: 2px solid #f1f5f9;
267
+ }
268
+
269
+ .legend-item {
270
+ display: flex;
271
+ align-items: center;
272
+ gap: 5px;
273
+ }
274
+
275
+ .legend-color {
276
+ width: 20px;
277
+ height: 20px;
278
+ border-radius: 4px;
279
+ }
280
+
281
+ /* Indicateurs de gestion du temps */
282
+ .time-management-stats {
283
+ display: grid;
284
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
285
+ gap: 20px;
286
+ margin-top: 2rem;
287
+ }
288
+
289
+ .time-stat-card {
290
+ background: white;
291
+ border-radius: 12px;
292
+ padding: 1.5rem;
293
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
294
+ border-top: 4px solid var(--secondary-color);
295
+ }
296
+
297
+ .time-stat-header {
298
+ display: flex;
299
+ align-items: center;
300
+ gap: 10px;
301
+ margin-bottom: 1rem;
302
+ }
303
+
304
+ .time-stat-icon {
305
+ width: 40px;
306
+ height: 40px;
307
+ border-radius: 10px;
308
+ display: flex;
309
+ align-items: center;
310
+ justify-content: center;
311
+ font-size: 1.2rem;
312
+ color: white;
313
+ }
314
+
315
+ .time-stat-value {
316
+ font-size: 2.5rem;
317
+ font-weight: bold;
318
+ color: var(--secondary-color);
319
+ margin: 10px 0;
320
+ }
321
+
322
+ .time-stat-description {
323
+ color: var(--gray-color);
324
+ font-size: 0.9rem;
325
+ margin-top: 5px;
326
+ }
327
+
328
+ .progress-circle {
329
+ width: 100px;
330
+ height: 100px;
331
+ position: relative;
332
+ margin: 0 auto;
333
+ }
334
+
335
+ .progress-circle svg {
336
+ width: 100%;
337
+ height: 100%;
338
+ }
339
+
340
+ .progress-text {
341
+ position: absolute;
342
+ top: 50%;
343
+ left: 50%;
344
+ transform: translate(-50%, -50%);
345
+ font-size: 1.5rem;
346
+ font-weight: bold;
347
+ color: var(--secondary-color);
348
+ }
349
+
350
+ /* Effort Pattern */
351
+ .effort-pattern {
352
+ background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
353
+ border-radius: 12px;
354
+ padding: 1.5rem;
355
+ margin-top: 2rem;
356
+ }
357
+
358
+ .pattern-badge {
359
+ display: inline-block;
360
+ padding: 8px 15px;
361
+ background: linear-gradient(135deg, #f59e0b, #d97706);
362
+ color: white;
363
+ border-radius: 20px;
364
+ font-weight: bold;
365
+ margin-bottom: 1rem;
366
+ }
367
+
368
+ .pattern-details {
369
+ display: grid;
370
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
371
+ gap: 15px;
372
+ margin-top: 1rem;
373
+ }
374
+
375
+ .pattern-item {
376
+ background: white;
377
+ padding: 1rem;
378
+ border-radius: 8px;
379
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
380
+ }
381
+
382
+ .pattern-label {
383
+ font-size: 0.9rem;
384
+ color: var(--gray-color);
385
+ margin-bottom: 5px;
386
+ }
387
+
388
+ .pattern-value {
389
+ font-size: 1.1rem;
390
+ font-weight: bold;
391
+ color: var(--dark-color);
392
+ }
393
+
394
+ /* Persistance */
395
+ .persistence-section {
396
+ background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
397
+ border-radius: 12px;
398
+ padding: 1.5rem;
399
+ margin-top: 2rem;
400
+ border-left: 5px solid #f59e0b;
401
+ }
402
+
403
+ .persistence-header {
404
+ display: flex;
405
+ align-items: center;
406
+ gap: 10px;
407
+ margin-bottom: 1rem;
408
+ }
409
+
410
+ .persistence-level {
411
+ font-size: 1.5rem;
412
+ font-weight: bold;
413
+ color: #d97706;
414
+ }
415
+
416
+ .persistence-details {
417
+ margin-top: 1rem;
418
+ }
419
+
420
+ .persistence-item {
421
+ display: flex;
422
+ align-items: center;
423
+ gap: 10px;
424
+ margin-bottom: 10px;
425
+ padding: 8px;
426
+ background: rgba(255, 255, 255, 0.5);
427
+ border-radius: 8px;
428
+ }
429
+
430
  /* Form Elements */
431
  .form-group {
432
  margin-bottom: 1.5rem;
 
980
  .flashcard-stats-summary {
981
  grid-template-columns: 1fr;
982
  }
983
+
984
+ .heatmap-grid {
985
+ gap: 4px;
986
+ }
987
+
988
+ .heatmap-cell {
989
+ font-size: 0.7rem;
990
+ }
991
+
992
+ .time-management-stats {
993
+ grid-template-columns: 1fr;
994
+ }
995
  }
996
  </style>
997
  </head>
 
1000
  <!-- Header -->
1001
  <header class="header">
1002
  <h1><i class="fas fa-graduation-cap"></i> Compagnon Pédagogique</h1>
1003
+ <p>Soutien à l'Apprentissage Autorégulé Durable par une Planification d'Étude Personnalisée et une Adaptation Générative de Contenu</p>
1004
+ <div class="badge">Version Professionnelle 2.0 | SM-2 Niveau Avancé</div>
1005
  </header>
1006
 
1007
  <!-- Navigation -->
 
1390
 
1391
  <div id="statsContainer" class="stats-grid"></div>
1392
 
1393
+ <!-- Heatmap d'activité -->
1394
+ <div class="heatmap-container">
1395
+ <div class="heatmap-header">
1396
+ <div class="heatmap-title">
1397
+ <i class="fas fa-fire"></i> Heatmap d'activité
1398
+ </div>
1399
+ <div class="heatmap-controls">
1400
+ <button class="heatmap-period active" onclick="changeHeatmapPeriod('month')">Mois</button>
1401
+ <button class="heatmap-period" onclick="changeHeatmapPeriod('quarter')">Trimestre</button>
1402
+ <button class="heatmap-period" onclick="changeHeatmapPeriod('year')">Année</button>
1403
+ </div>
1404
+ </div>
1405
+
1406
+ <div id="heatmapContent">
1407
+ <!-- La heatmap sera générée ici par JavaScript -->
1408
+ </div>
1409
+
1410
+ <div class="heatmap-legend">
1411
+ <div class="legend-item">
1412
+ <div class="legend-color heatmap-intensity-0"></div>
1413
+ <span>0 min</span>
1414
+ </div>
1415
+ <div class="legend-item">
1416
+ <div class="legend-color heatmap-intensity-1"></div>
1417
+ <span>15 min</span>
1418
+ </div>
1419
+ <div class="legend-item">
1420
+ <div class="legend-color heatmap-intensity-2"></div>
1421
+ <span>30 min</span>
1422
+ </div>
1423
+ <div class="legend-item">
1424
+ <div class="legend-color heatmap-intensity-3"></div>
1425
+ <span>45 min</span>
1426
+ </div>
1427
+ <div class="legend-item">
1428
+ <div class="legend-color heatmap-intensity-4"></div>
1429
+ <span>60+ min</span>
1430
+ </div>
1431
+ </div>
1432
+ </div>
1433
+
1434
+ <!-- Indicateurs de gestion du temps -->
1435
+ <div class="time-management-stats">
1436
+ <div class="time-stat-card">
1437
+ <div class="time-stat-header">
1438
+ <div class="time-stat-icon" style="background: linear-gradient(135deg, #10b981, #059669);">
1439
+ <i class="fas fa-calendar-check"></i>
1440
+ </div>
1441
+ <div>
1442
+ <h4>Régularité du travail</h4>
1443
+ <div class="time-stat-description">Constance de l'activité dans le temps</div>
1444
+ </div>
1445
+ </div>
1446
+ <div class="progress-circle">
1447
+ <svg viewBox="0 0 100 100">
1448
+ <circle cx="50" cy="50" r="45" fill="none" stroke="#e2e8f0" stroke-width="8"/>
1449
+ <circle cx="50" cy="50" r="45" fill="none" stroke="#10b981" stroke-width="8"
1450
+ stroke-linecap="round" stroke-dasharray="283" stroke-dashoffset="28.3"/>
1451
+ </svg>
1452
+ <div class="progress-text">90%</div>
1453
+ </div>
1454
+ </div>
1455
+
1456
+ <div class="time-stat-card">
1457
+ <div class="time-stat-header">
1458
+ <div class="time-stat-icon" style="background: linear-gradient(135deg, #3b82f6, #1d4ed8);">
1459
+ <i class="fas fa-clock"></i>
1460
+ </div>
1461
+ <div>
1462
+ <h4>Gestion des échéances</h4>
1463
+ <div class="time-stat-description">Capacité à respecter les délais</div>
1464
+ </div>
1465
+ </div>
1466
+ <div class="progress-circle">
1467
+ <svg viewBox="0 0 100 100">
1468
+ <circle cx="50" cy="50" r="45" fill="none" stroke="#e2e8f0" stroke-width="8"/>
1469
+ <circle cx="50" cy="50" r="45" fill="none" stroke="#3b82f6" stroke-width="8"
1470
+ stroke-linecap="round" stroke-dasharray="283" stroke-dashoffset="53.77"/>
1471
+ </svg>
1472
+ <div class="progress-text">81%</div>
1473
+ </div>
1474
+ </div>
1475
+ </div>
1476
+
1477
+ <!-- Schéma d'effort -->
1478
+ <div class="effort-pattern">
1479
+ <div class="pattern-badge">🕖 Schéma d'effort</div>
1480
+ <h4>Effort concentré (Pic d'activité jeudi/vendredi)</h4>
1481
+ <div class="time-stat-description">La dynamique temporelle de l'effort</div>
1482
+
1483
+ <div class="pattern-details">
1484
+ <div class="pattern-item">
1485
+ <div class="pattern-label">Jour de pic</div>
1486
+ <div class="pattern-value">Jeudi</div>
1487
+ </div>
1488
+ <div class="pattern-item">
1489
+ <div class="pattern-label">Heure optimale</div>
1490
+ <div class="pattern-value">14h-16h</div>
1491
+ </div>
1492
+ <div class="pattern-item">
1493
+ <div class="pattern-label">Durée moyenne</div>
1494
+ <div class="pattern-value">42 min</div>
1495
+ </div>
1496
+ <div class="pattern-item">
1497
+ <div class="pattern-label">Fréquence</div>
1498
+ <div class="pattern-value">5j/semaine</div>
1499
+ </div>
1500
+ </div>
1501
+ </div>
1502
+
1503
+ <!-- Persistance et gestion des efforts -->
1504
+ <div class="persistence-section">
1505
+ <div class="persistence-header">
1506
+ <div class="time-stat-icon" style="background: linear-gradient(135deg, #f59e0b, #d97706);">
1507
+ <i class="fas fa-mountain"></i>
1508
+ </div>
1509
+ <div>
1510
+ <h4>Persistance et gestion des efforts</h4>
1511
+ <div class="persistence-level">Très élevée</div>
1512
+ </div>
1513
+ </div>
1514
+ <div class="time-stat-description">Efforts constants, persévère même face aux difficultés</div>
1515
+
1516
+ <div class="persistence-details">
1517
+ <div class="persistence-item">
1518
+ <i class="fas fa-check-circle" style="color: #10b981;"></i>
1519
+ <span>87% des sessions complétées sans interruption</span>
1520
+ </div>
1521
+ <div class="persistence-item">
1522
+ <i class="fas fa-check-circle" style="color: #10b981;"></i>
1523
+ <span>Maintien de la concentration pendant 92% du temps</span>
1524
+ </div>
1525
+ <div class="persistence-item">
1526
+ <i class="fas fa-check-circle" style="color: #10b981;"></i>
1527
+ <span>Récupération rapide après les difficultés</span>
1528
+ </div>
1529
+ </div>
1530
+ </div>
1531
+
1532
  <div class="visualization-container">
1533
  <h4><i class="fas fa-chart-area"></i> Progression de la Rétention</h4>
1534
  <div class="chart-container">
 
1605
  due: 0
1606
  };
1607
 
1608
+ // Variables pour la heatmap
1609
+ let heatmapData = [];
1610
+ let currentHeatmapPeriod = 'month';
1611
+
1612
  // Initialisation
1613
  document.addEventListener('DOMContentLoaded', function() {
1614
  loadCompetences();
 
1618
  initializeHabitsProductivity();
1619
  loadFlashcards();
1620
  updateFlashcardStats();
1621
+ generateHeatmap();
1622
  });
1623
 
1624
  // Navigation
 
1656
  // Actions spécifiques par onglet
1657
  if (tabId === 'stats') {
1658
  refreshStats();
1659
+ generateHeatmap();
1660
  } else if (tabId === 'learn') {
1661
  updateComparisonChart();
1662
  } else if (tabId === 'flashcards') {
 
2028
  });
2029
  }
2030
 
2031
+ // ============================================
2032
+ // HEATMAP D'ACTIVITÉ
2033
+ // ============================================
2034
+
2035
+ // Générer la heatmap
2036
+ function generateHeatmap() {
2037
+ const container = document.getElementById('heatmapContent');
2038
+
2039
+ // Générer des données de démonstration
2040
+ heatmapData = generateDemoHeatmapData(currentHeatmapPeriod);
2041
+
2042
+ // Créer la structure de la heatmap
2043
+ let html = '<div class="heatmap-grid">';
2044
+
2045
+ // Ajouter les étiquettes des jours
2046
+ const days = ['Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim'];
2047
+ html += '<div class="heatmap-day-label"></div>';
2048
+ days.forEach(day => {
2049
+ html += `<div class="heatmap-day-label">${day}</div>`;
2050
+ });
2051
+
2052
+ // Ajouter les cellules de la heatmap
2053
+ heatmapData.forEach((week, weekIndex) => {
2054
+ html += `<div class="heatmap-week-label">S${weekIndex + 1}</div>`;
2055
+
2056
+ days.forEach((day, dayIndex) => {
2057
+ const activity = week[dayIndex];
2058
+ if (activity !== null) {
2059
+ const intensity = getIntensityLevel(activity);
2060
+ const tooltip = `Jour: ${day}, Semaine ${weekIndex + 1}\nActivité: ${activity} minutes`;
2061
+ html += `
2062
+ <div class="heatmap-cell heatmap-intensity-${intensity}"
2063
+ title="${tooltip}"
2064
+ onclick="showDayDetails(${weekIndex}, ${dayIndex}, ${activity})">
2065
+ ${activity}
2066
+ </div>
2067
+ `;
2068
+ } else {
2069
+ html += '<div class="heatmap-cell" style="visibility: hidden;"></div>';
2070
+ }
2071
+ });
2072
+ });
2073
+
2074
+ html += '</div>';
2075
+ container.innerHTML = html;
2076
+ }
2077
+
2078
+ // Générer des données de démonstration pour la heatmap
2079
+ function generateDemoHeatmapData(period) {
2080
+ const data = [];
2081
+ let weeks = 4; // Par défaut pour le mois
2082
+
2083
+ if (period === 'quarter') weeks = 13;
2084
+ if (period === 'year') weeks = 52;
2085
+
2086
+ // Pattern d'activité typique (plus d'activité jeudi/vendredi)
2087
+ for (let week = 0; week < weeks; week++) {
2088
+ const weekData = [];
2089
+ for (let day = 0; day < 7; day++) {
2090
+ // Générer une activité aléatoire avec un pattern spécifique
2091
+ let activity = 0;
2092
+
2093
+ // Plus d'activité jeudi (jour 3) et vendredi (jour 4)
2094
+ if (day === 3 || day === 4) {
2095
+ // Jeudi/vendredi: haute activité (30-75 min)
2096
+ activity = Math.floor(Math.random() * 45) + 30;
2097
+ } else if (day === 0 || day === 6) {
2098
+ // Week-end: activité moyenne (15-45 min)
2099
+ activity = Math.floor(Math.random() * 30) + 15;
2100
+ } else {
2101
+ // Autres jours: activité basse (0-30 min)
2102
+ activity = Math.floor(Math.random() * 30);
2103
+ }
2104
+
2105
+ // Ajouter une variabilité hebdomadaire
2106
+ if (week % 4 === 0) {
2107
+ // Semaines fortes
2108
+ activity = Math.min(activity * 1.3, 90);
2109
+ } else if (week % 4 === 2) {
2110
+ // Semaines faibles
2111
+ activity = Math.max(activity * 0.7, 10);
2112
+ }
2113
+
2114
+ // Arrondir à l'entier le plus proche
2115
+ activity = Math.round(activity);
2116
+
2117
+ weekData.push(activity);
2118
+ }
2119
+ data.push(weekData);
2120
+ }
2121
+
2122
+ return data;
2123
+ }
2124
+
2125
+ // Obtenir le niveau d'intensité basé sur le temps d'activité
2126
+ function getIntensityLevel(activity) {
2127
+ if (activity === 0) return 0;
2128
+ if (activity <= 15) return 1;
2129
+ if (activity <= 30) return 2;
2130
+ if (activity <= 45) return 3;
2131
+ return 4;
2132
+ }
2133
+
2134
+ // Changer la période de la heatmap
2135
+ function changeHeatmapPeriod(period) {
2136
+ currentHeatmapPeriod = period;
2137
+
2138
+ // Mettre à jour les boutons
2139
+ document.querySelectorAll('.heatmap-period').forEach(btn => {
2140
+ btn.classList.remove('active');
2141
+ if (btn.textContent.toLowerCase().includes(period)) {
2142
+ btn.classList.add('active');
2143
+ }
2144
+ });
2145
+
2146
+ // Regénérer la heatmap
2147
+ generateHeatmap();
2148
+ }
2149
+
2150
+ // Afficher les détails d'un jour spécifique
2151
+ function showDayDetails(weekIndex, dayIndex, activity) {
2152
+ const days = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'];
2153
+ const dayName = days[dayIndex];
2154
+
2155
+ let evaluation = '';
2156
+ if (activity >= 60) {
2157
+ evaluation = '🌋 Activité intense';
2158
+ } else if (activity >= 45) {
2159
+ evaluation = '🔥 Très productive';
2160
+ } else if (activity >= 30) {
2161
+ evaluation = '💪 Productive';
2162
+ } else if (activity >= 15) {
2163
+ evaluation = '🌱 Régulière';
2164
+ } else if (activity > 0) {
2165
+ evaluation = '🌼 Légère';
2166
+ } else {
2167
+ evaluation = '⏸️ Repos';
2168
+ }
2169
+
2170
+ alert(`📅 ${dayName}, Semaine ${weekIndex + 1}\n⏱️ Temps d'étude: ${activity} minutes\n📊 Évaluation: ${evaluation}`);
2171
+ }
2172
+
2173
  // ============================================
2174
  // FLASHCARD APPLICATION
2175
  // ============================================