Spaces:
Running
Running
Upload index.html
Browse files- templates/index.html +44 -7
templates/index.html
CHANGED
@@ -9,6 +9,9 @@
|
|
9 |
<!-- Tailwind CSS -->
|
10 |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
|
11 |
|
|
|
|
|
|
|
12 |
<!-- Configuration de MathJax -->
|
13 |
<script>
|
14 |
window.MathJax = {
|
@@ -33,16 +36,20 @@
|
|
33 |
<style>
|
34 |
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=swap');
|
35 |
body { font-family: 'Space Grotesk', sans-serif; }
|
|
|
36 |
.uploadArea {
|
37 |
background: #f3f4f6;
|
38 |
border: 2px dashed #d1d5db;
|
39 |
transition: border-color 0.2s ease;
|
40 |
}
|
41 |
.uploadArea:hover { border-color: #3b82f6; }
|
|
|
42 |
.blue-button { background: #3b82f6; transition: background-color 0.2s ease; }
|
43 |
.blue-button:hover { background: #2563eb; }
|
|
|
44 |
.loader {
|
45 |
-
width: 48px;
|
|
|
46 |
border: 3px solid #3b82f6;
|
47 |
border-bottom-color: transparent;
|
48 |
border-radius: 50%;
|
@@ -50,24 +57,48 @@
|
|
50 |
animation: rotation 1s linear infinite;
|
51 |
}
|
52 |
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
|
|
53 |
.thought-box {
|
54 |
transition: max-height 0.3s ease-out;
|
55 |
max-height: 0;
|
56 |
overflow: hidden;
|
57 |
}
|
58 |
.thought-box.open { max-height: 500px; }
|
|
|
59 |
#thoughtsContent, #answerContent {
|
60 |
max-height: 500px;
|
61 |
overflow-y: auto;
|
62 |
scroll-behavior: smooth;
|
63 |
white-space: pre-wrap;
|
64 |
}
|
|
|
65 |
.preview-image { max-width: 300px; max-height: 300px; object-fit: contain; }
|
|
|
66 |
.timestamp { color: #3b82f6; font-size: 0.9em; margin-left: 8px; }
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
th { background-color: #f3f4f6; font-weight: 600; }
|
70 |
.table-responsive { overflow-x: auto; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
/* Modal plein écran pour les sauvegardes */
|
72 |
#savedModal {
|
73 |
display: none;
|
@@ -140,8 +171,8 @@
|
|
140 |
<div class="border-t pt-6">
|
141 |
<div class="flex justify-between items-center">
|
142 |
<h3 class="text-xl font-bold text-gray-800 mb-4">Solution</h3>
|
143 |
-
<!-- Bouton Sauvegarder
|
144 |
-
<button id="saveButton"
|
145 |
</div>
|
146 |
<div id="answerContent" class="text-gray-700 table-responsive"></div>
|
147 |
</div>
|
@@ -311,7 +342,7 @@
|
|
311 |
}
|
312 |
});
|
313 |
|
314 |
-
// Sauvegarde de la solution
|
315 |
saveButton.addEventListener('click', () => {
|
316 |
const saveName = prompt("Entrez un nom pour la sauvegarde :");
|
317 |
if (!saveName) return;
|
@@ -323,7 +354,13 @@
|
|
323 |
let savedExercises = JSON.parse(localStorage.getItem('savedExercises') || '{}');
|
324 |
savedExercises[saveName] = saveData;
|
325 |
localStorage.setItem('savedExercises', JSON.stringify(savedExercises));
|
326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
});
|
328 |
|
329 |
// Chargement des sauvegardes dans le modal
|
|
|
9 |
<!-- Tailwind CSS -->
|
10 |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
|
11 |
|
12 |
+
<!-- SweetAlert2 -->
|
13 |
+
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
14 |
+
|
15 |
<!-- Configuration de MathJax -->
|
16 |
<script>
|
17 |
window.MathJax = {
|
|
|
36 |
<style>
|
37 |
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=swap');
|
38 |
body { font-family: 'Space Grotesk', sans-serif; }
|
39 |
+
|
40 |
.uploadArea {
|
41 |
background: #f3f4f6;
|
42 |
border: 2px dashed #d1d5db;
|
43 |
transition: border-color 0.2s ease;
|
44 |
}
|
45 |
.uploadArea:hover { border-color: #3b82f6; }
|
46 |
+
|
47 |
.blue-button { background: #3b82f6; transition: background-color 0.2s ease; }
|
48 |
.blue-button:hover { background: #2563eb; }
|
49 |
+
|
50 |
.loader {
|
51 |
+
width: 48px;
|
52 |
+
height: 48px;
|
53 |
border: 3px solid #3b82f6;
|
54 |
border-bottom-color: transparent;
|
55 |
border-radius: 50%;
|
|
|
57 |
animation: rotation 1s linear infinite;
|
58 |
}
|
59 |
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
60 |
+
|
61 |
.thought-box {
|
62 |
transition: max-height 0.3s ease-out;
|
63 |
max-height: 0;
|
64 |
overflow: hidden;
|
65 |
}
|
66 |
.thought-box.open { max-height: 500px; }
|
67 |
+
|
68 |
#thoughtsContent, #answerContent {
|
69 |
max-height: 500px;
|
70 |
overflow-y: auto;
|
71 |
scroll-behavior: smooth;
|
72 |
white-space: pre-wrap;
|
73 |
}
|
74 |
+
|
75 |
.preview-image { max-width: 300px; max-height: 300px; object-fit: contain; }
|
76 |
+
|
77 |
.timestamp { color: #3b82f6; font-size: 0.9em; margin-left: 8px; }
|
78 |
+
|
79 |
+
table {
|
80 |
+
border-collapse: collapse;
|
81 |
+
width: 100%;
|
82 |
+
margin-bottom: 1rem;
|
83 |
+
}
|
84 |
+
th, td {
|
85 |
+
border: 1px solid #d1d5db;
|
86 |
+
padding: 0.5rem;
|
87 |
+
text-align: left;
|
88 |
+
}
|
89 |
th { background-color: #f3f4f6; font-weight: 600; }
|
90 |
.table-responsive { overflow-x: auto; }
|
91 |
+
|
92 |
+
/* Style pour le bouton Sauvegarder afin de le mettre en évidence */
|
93 |
+
#saveButton {
|
94 |
+
background: #3b82f6;
|
95 |
+
color: white;
|
96 |
+
padding: 0.5rem 1rem;
|
97 |
+
border-radius: 0.375rem;
|
98 |
+
transition: background-color 0.2s ease;
|
99 |
+
}
|
100 |
+
#saveButton:hover { background: #2563eb; }
|
101 |
+
|
102 |
/* Modal plein écran pour les sauvegardes */
|
103 |
#savedModal {
|
104 |
display: none;
|
|
|
171 |
<div class="border-t pt-6">
|
172 |
<div class="flex justify-between items-center">
|
173 |
<h3 class="text-xl font-bold text-gray-800 mb-4">Solution</h3>
|
174 |
+
<!-- Bouton Sauvegarder mis en évidence -->
|
175 |
+
<button id="saveButton">Sauvegarder</button>
|
176 |
</div>
|
177 |
<div id="answerContent" class="text-gray-700 table-responsive"></div>
|
178 |
</div>
|
|
|
342 |
}
|
343 |
});
|
344 |
|
345 |
+
// Sauvegarde de la solution avec SweetAlert2
|
346 |
saveButton.addEventListener('click', () => {
|
347 |
const saveName = prompt("Entrez un nom pour la sauvegarde :");
|
348 |
if (!saveName) return;
|
|
|
354 |
let savedExercises = JSON.parse(localStorage.getItem('savedExercises') || '{}');
|
355 |
savedExercises[saveName] = saveData;
|
356 |
localStorage.setItem('savedExercises', JSON.stringify(savedExercises));
|
357 |
+
Swal.fire({
|
358 |
+
icon: 'success',
|
359 |
+
title: 'Sauvegarde réussie',
|
360 |
+
text: 'Votre solution a bien été sauvegardée !',
|
361 |
+
timer: 2000,
|
362 |
+
showConfirmButton: false
|
363 |
+
});
|
364 |
});
|
365 |
|
366 |
// Chargement des sauvegardes dans le modal
|