Spaces:
Running
Running
Update templates/histoire.html
Browse files- templates/histoire.html +403 -405
templates/histoire.html
CHANGED
@@ -1,427 +1,425 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="fr">
|
3 |
<head>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
<style>
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
</head>
|
105 |
-
<body
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
</div>
|
118 |
-
</div>
|
119 |
-
</div>
|
120 |
</nav>
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
</div>
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
<textarea name="sujet-histoire" id="sujet-histoire" rows="3"
|
145 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
146 |
-
placeholder="Entrez le sujet de votre dissertation..."></textarea>
|
147 |
-
</div>
|
148 |
-
|
149 |
-
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
150 |
-
<div class="space-y-2">
|
151 |
-
<label for="pointt1-histoire" class="text-sm font-medium text-gray-700 block">
|
152 |
-
<i class="fas fa-list-ol mr-2"></i>Premier point
|
153 |
-
</label>
|
154 |
-
<input type="text" name="pointt1-histoire" id="pointt1-histoire"
|
155 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
156 |
-
placeholder="Premier point...">
|
157 |
-
</div>
|
158 |
-
|
159 |
-
<div class="space-y-2">
|
160 |
-
<label for="point2-histoire" class="text-sm font-medium text-gray-700 block">
|
161 |
-
<i class="fas fa-list-ol mr-2"></i>Deuxième point
|
162 |
-
</label>
|
163 |
-
<input type="text" name="point2-histoire" id="point2-histoire"
|
164 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
165 |
-
placeholder="Deuxième point...">
|
166 |
-
</div>
|
167 |
-
|
168 |
-
<div class="space-y-2">
|
169 |
-
<label for="point3-histoire" class="text-sm font-medium text-gray-700 block">
|
170 |
-
<i class="fas fa-list-ol mr-2"></i>Troisième point
|
171 |
-
</label>
|
172 |
-
<input type="text" name="point3-histoire" id="point3-histoire"
|
173 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
174 |
-
placeholder="Troisième point...">
|
175 |
-
</div>
|
176 |
-
</div>
|
177 |
-
|
178 |
-
<button type="submit" class="w-full bg-blue-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-blue-700 transition-colors duration-200 flex items-center justify-center space-x-2">
|
179 |
-
<i class="fas fa-magic mr-2"></i>
|
180 |
-
<span>Générer la dissertation</span>
|
181 |
-
</button>
|
182 |
-
</form>
|
183 |
-
<div id="histoire-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden"></div>
|
184 |
</div>
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
<div class="flex items-center mb-6">
|
191 |
-
<i class="fas fa-scroll text-green-600 text-2xl mr-3"></i>
|
192 |
-
<h2 class="text-2xl font-bold text-gray-800">Histoire - Type 2 (Images)</h2>
|
193 |
-
</div>
|
194 |
-
<form id="histoire-type2-form" class="space-y-6" enctype="multipart/form-data">
|
195 |
-
<div class="space-y-2">
|
196 |
-
<label for="sujet-histoire-type2" class="text-sm font-medium text-gray-700 block">
|
197 |
-
<i class="fas fa-pen-fancy mr-2"></i>Sujet
|
198 |
-
</label>
|
199 |
-
<textarea name="sujet-histoire-type2" id="sujet-histoire-type2" rows="3"
|
200 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
201 |
-
placeholder="Entrez le sujet..."></textarea>
|
202 |
-
</div>
|
203 |
-
<div class="space-y-2">
|
204 |
-
<label for="images-histoire-type2" class="text-sm font-medium text-gray-700 block">
|
205 |
-
<i class="fas fa-images mr-2"></i>Images (Multiple)
|
206 |
-
</label>
|
207 |
-
<input type="file" name="images-histoire-type2" id="images-histoire-type2" multiple
|
208 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50">
|
209 |
-
<div id="image-preview-histoire-type2" class="flex flex-wrap"></div>
|
210 |
-
</div>
|
211 |
-
<button type="submit" class="w-full bg-green-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-green-700 transition-colors duration-200 flex items-center justify-center">
|
212 |
-
<i class="fas fa-magic mr-2"></i>
|
213 |
-
<span>Générer l'analyse</span>
|
214 |
-
</button>
|
215 |
-
</form>
|
216 |
-
<div id="histoire-type2-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden"></div>
|
217 |
</div>
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
<div class="flex items-center mb-6">
|
224 |
-
<i class="fas fa-globe-europe text-purple-600 text-2xl mr-3"></i>
|
225 |
-
<h2 class="text-2xl font-bold text-gray-800">Dissertation de Géographie - Type 1 & 3</h2>
|
226 |
-
</div>
|
227 |
-
<form id="geographie-form" class="space-y-6">
|
228 |
-
<div class="space-y-2">
|
229 |
-
<label for="sujet-geographie" class="text-sm font-medium text-gray-700 block">
|
230 |
-
<i class="fas fa-pen-fancy mr-2"></i>Sujet de la dissertation
|
231 |
-
</label>
|
232 |
-
<textarea name="sujet-geographie" id="sujet-geographie" rows="3"
|
233 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
234 |
-
placeholder="Entrez le sujet de votre dissertation..."></textarea>
|
235 |
-
</div>
|
236 |
-
|
237 |
-
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
238 |
-
<div class="space-y-2">
|
239 |
-
<label for="point1-geographie" class="text-sm font-medium text-gray-700 block">
|
240 |
-
<i class="fas fa-list-ol mr-2"></i>Premier point
|
241 |
-
</label>
|
242 |
-
<input type="text" name="point1-geographie" id="point1-geographie"
|
243 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
244 |
-
placeholder="Premier argument...">
|
245 |
-
</div>
|
246 |
-
|
247 |
-
<div class="space-y-2">
|
248 |
-
<label for="point2-geographie" class="text-sm font-medium text-gray-700 block">
|
249 |
-
<i class="fas fa-list-ol mr-2"></i>Deuxième point
|
250 |
-
</label>
|
251 |
-
<input type="text" name="point2-geographie" id="point2-geographie"
|
252 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
253 |
-
placeholder="Deuxième argument...">
|
254 |
-
</div>
|
255 |
-
|
256 |
-
<div class="space-y-2">
|
257 |
-
<label for="point3-geographie" class="text-sm font-medium text-gray-700 block">
|
258 |
-
<i class="fas fa-list-ol mr-2"></i>Troisième point
|
259 |
-
</label>
|
260 |
-
<input type="text" name="point3-geographie" id="point3-geographie"
|
261 |
-
class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
262 |
-
placeholder="Troisième argument...">
|
263 |
-
</div>
|
264 |
-
</div>
|
265 |
-
|
266 |
-
<button type="submit" class="w-full bg-purple-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-purple-700 transition-colors duration-200 flex items-center justify-center space-x-2">
|
267 |
-
<i class="fas fa-magic mr-2"></i>
|
268 |
-
<span>Générer la dissertation</span>
|
269 |
-
</button>
|
270 |
-
</form>
|
271 |
-
<div id="geographie-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden"></div>
|
272 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
</div>
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
</div>
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
</div>
|
313 |
-
</footer>
|
314 |
-
|
315 |
-
<!-- Scripts -->
|
316 |
-
<script>
|
317 |
window.addEventListener('load', function() {
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
output.classList.remove('hidden');
|
335 |
output.innerHTML = `
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
</div>
|
340 |
`;
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
form.addEventListener('submit', async (e) => {
|
348 |
-
e.preventDefault();
|
349 |
-
showLoading(outputId);
|
350 |
-
|
351 |
-
try {
|
352 |
-
const formData = new FormData(form);
|
353 |
-
const response = await fetch(endpoint, {
|
354 |
-
method: 'POST',
|
355 |
-
body: formData
|
356 |
-
});
|
357 |
-
|
358 |
-
if (!response.ok) {
|
359 |
-
throw new Error(`HTTP error! status: ${response.status}`);
|
360 |
-
}
|
361 |
-
|
362 |
-
const result = await response.json();
|
363 |
-
output.classList.remove('hidden');
|
364 |
-
output.innerHTML = `
|
365 |
-
<div class="markdown-output prose max-w-none">
|
366 |
-
${marked.parse(result.output)}
|
367 |
-
</div>
|
368 |
-
`;
|
369 |
-
|
370 |
-
// Ajuster les tableaux pour le mobile
|
371 |
-
const tables = output.getElementsByTagName('table');
|
372 |
-
Array.from(tables).forEach(table => {
|
373 |
-
table.parentNode.style.overflow = 'auto';
|
374 |
-
table.style.minWidth = '100%';
|
375 |
-
});
|
376 |
-
} catch (error) {
|
377 |
-
output.classList.remove('hidden');
|
378 |
-
output.innerHTML = `
|
379 |
-
<div class="bg-red-50 border-l-4 border-red-500 p-4">
|
380 |
-
<div class="flex items-center">
|
381 |
-
<div class="flex-shrink-0">
|
382 |
-
<i class="fas fa-exclamation-circle text-red-500"></i>
|
383 |
-
</div>
|
384 |
-
<div class="ml-3">
|
385 |
-
<p class="text-red-700">Une erreur est survenue: ${error.message}</p>
|
386 |
-
</div>
|
387 |
-
</div>
|
388 |
-
</div>
|
389 |
-
`;
|
390 |
-
}
|
391 |
-
});
|
392 |
-
}
|
393 |
-
|
394 |
-
// Initialisation des formulaires et des prévisualisations d'images
|
395 |
-
submitForm('histoire-form', 'histoire-output', '/api/histoire');
|
396 |
-
submitForm('histoire-type2-form', 'histoire-type2-output', '/api/histoire-type2');
|
397 |
-
submitForm('geographie-form', 'geographie-output', '/api/geographie');
|
398 |
-
submitForm('geographie-type2-form', 'geographie-type2-output', '/api/geographie-type2');
|
399 |
-
|
400 |
-
// Configuration de la prévisualisation des images
|
401 |
-
function handleImagePreviews(inputId, previewContainerId) {
|
402 |
-
const input = document.getElementById(inputId);
|
403 |
-
const previewContainer = document.getElementById(previewContainerId);
|
404 |
-
|
405 |
-
input.addEventListener('change', function() {
|
406 |
-
previewContainer.innerHTML = '';
|
407 |
-
Array.from(this.files).forEach(file => {
|
408 |
-
if (file.type.startsWith('image/')) {
|
409 |
-
const reader = new FileReader();
|
410 |
-
reader.onload = (e) => {
|
411 |
-
const img = document.createElement('img');
|
412 |
-
img.src = e.target.result;
|
413 |
-
img.classList.add('image-preview');
|
414 |
-
previewContainer.appendChild(img);
|
415 |
-
};
|
416 |
-
reader.readAsDataURL(file);
|
417 |
-
}
|
418 |
-
});
|
419 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
}
|
421 |
-
|
422 |
-
|
423 |
-
|
|
|
424 |
});
|
425 |
-
</script>
|
426 |
</body>
|
427 |
-
</html>
|
|
|
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>Histoire et Géographie - Assistant Académique</title>
|
7 |
+
|
8 |
+
<!-- Feuilles de style et polices -->
|
9 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/aos.css" rel="stylesheet">
|
10 |
+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
11 |
+
|
12 |
+
<!-- Scripts et Tailwind -->
|
13 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
14 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.2/marked.min.js"></script>
|
15 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js"></script>
|
16 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aos.js"></script>
|
17 |
+
|
18 |
<style>
|
19 |
+
/* Police et réglages de base */
|
20 |
+
body {
|
21 |
+
font-family: 'Poppins', sans-serif;
|
22 |
+
background-color: #f1f5f9;
|
23 |
+
scroll-behavior: smooth;
|
24 |
+
}
|
25 |
+
/* Couleur et dégradé de la navigation et du footer */
|
26 |
+
.gradient-bg {
|
27 |
+
background: linear-gradient(120deg, #1a365d 0%, #2563eb 100%);
|
28 |
+
}
|
29 |
+
/* Cartes et transitions */
|
30 |
+
.card {
|
31 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
32 |
+
}
|
33 |
+
.card:hover {
|
34 |
+
transform: translateY(-5px);
|
35 |
+
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
|
36 |
+
}
|
37 |
+
/* Animation du spinner */
|
38 |
+
.spinner {
|
39 |
+
animation: spin 1s linear infinite;
|
40 |
+
}
|
41 |
+
@keyframes spin {
|
42 |
+
0% { transform: rotate(0deg); }
|
43 |
+
100% { transform: rotate(360deg); }
|
44 |
+
}
|
45 |
+
/* Inputs et textarea avec effet focus */
|
46 |
+
.form-input {
|
47 |
+
transition: all 0.3s ease;
|
48 |
+
}
|
49 |
+
.form-input:focus {
|
50 |
+
transform: scale(1.01);
|
51 |
+
border-color: #2563eb;
|
52 |
+
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
|
53 |
+
}
|
54 |
+
/* Prévisualisation d'images */
|
55 |
+
.image-preview {
|
56 |
+
max-width: 200px;
|
57 |
+
max-height: 200px;
|
58 |
+
margin: 10px;
|
59 |
+
border: 1px solid #ccc;
|
60 |
+
border-radius: 0.375rem;
|
61 |
+
}
|
62 |
+
/* Style Markdown optimisé */
|
63 |
+
.markdown-output {
|
64 |
+
width: 100%;
|
65 |
+
overflow-wrap: break-word;
|
66 |
+
word-wrap: break-word;
|
67 |
+
hyphens: auto;
|
68 |
+
}
|
69 |
+
.markdown-output p {
|
70 |
+
margin: 1em 0;
|
71 |
+
line-height: 1.6;
|
72 |
+
font-size: 16px;
|
73 |
+
}
|
74 |
+
.markdown-output h1, .markdown-output h2,
|
75 |
+
.markdown-output h3, .markdown-output h4 {
|
76 |
+
margin: 1.5em 0 0.5em;
|
77 |
+
line-height: 1.3;
|
78 |
+
}
|
79 |
+
.markdown-output ul, .markdown-output ol {
|
80 |
+
padding-left: 1.5em;
|
81 |
+
margin: 1em 0;
|
82 |
+
}
|
83 |
+
.markdown-output li {
|
84 |
+
margin: 0.5em 0;
|
85 |
+
line-height: 1.4;
|
86 |
+
}
|
87 |
+
@media (max-width: 768px) {
|
88 |
+
.markdown-output { font-size: 15px; }
|
89 |
+
.markdown-output p { margin: 0.8em 0; }
|
90 |
+
.markdown-output ul, .markdown-output ol { padding-left: 1.2em; }
|
91 |
+
.markdown-output h1 { font-size: 1.8em; }
|
92 |
+
.markdown-output h2 { font-size: 1.5em; }
|
93 |
+
.markdown-output h3 { font-size: 1.3em; }
|
94 |
+
.markdown-output h4 { font-size: 1.1em; }
|
95 |
+
.markdown-output pre {
|
96 |
+
padding: 1em;
|
97 |
+
overflow-x: auto;
|
98 |
+
white-space: pre-wrap;
|
99 |
+
word-wrap: break-word;
|
100 |
+
}
|
101 |
+
.markdown-output code { word-break: break-word; }
|
102 |
+
}
|
103 |
+
/* Bouton Retour en haut */
|
104 |
+
#back-to-top {
|
105 |
+
position: fixed;
|
106 |
+
bottom: 30px;
|
107 |
+
right: 30px;
|
108 |
+
background-color: #2563eb;
|
109 |
+
color: #fff;
|
110 |
+
border-radius: 50%;
|
111 |
+
padding: 0.75rem;
|
112 |
+
cursor: pointer;
|
113 |
+
opacity: 0;
|
114 |
+
visibility: hidden;
|
115 |
+
transition: opacity 0.3s ease, visibility 0.3s ease;
|
116 |
+
z-index: 50;
|
117 |
+
}
|
118 |
+
#back-to-top.show {
|
119 |
+
opacity: 1;
|
120 |
+
visibility: visible;
|
121 |
+
}
|
122 |
+
</style>
|
123 |
</head>
|
124 |
+
<body>
|
125 |
+
<!-- En-tête sémantique -->
|
126 |
+
<header class="gradient-bg shadow-lg" role="banner">
|
127 |
+
<nav class="container mx-auto px-6 py-4 flex items-center justify-between" aria-label="Navigation principale">
|
128 |
+
<div class="flex items-center">
|
129 |
+
<i class="fas fa-book-open text-white text-2xl mr-3"></i>
|
130 |
+
<h1 class="text-white text-2xl font-bold">Mariam</h1>
|
131 |
+
</div>
|
132 |
+
<div class="flex items-center text-white text-sm">
|
133 |
+
<i class="fas fa-graduation-cap mr-2"></i>
|
134 |
+
Histoire et Géographie
|
135 |
+
</div>
|
|
|
|
|
|
|
136 |
</nav>
|
137 |
+
</header>
|
138 |
+
|
139 |
+
<!-- Contenu principal -->
|
140 |
+
<main role="main" class="container mx-auto p-6">
|
141 |
+
<!-- Section d'introduction -->
|
142 |
+
<section class="text-center mb-12" data-aos="fade-up">
|
143 |
+
<h2 class="text-3xl font-bold text-gray-800 mb-4">Assistant de Rédaction</h2>
|
144 |
+
<p class="text-gray-600 max-w-2xl mx-auto">
|
145 |
+
Générez des dissertations structurées et détaillées pour vos devoirs d'histoire et de géographie.
|
146 |
+
</p>
|
147 |
+
</section>
|
148 |
+
|
149 |
+
<!-- Bloc Dissertation d'Histoire Type 1 & 3 -->
|
150 |
+
<section class="mb-8" data-aos="fade-up">
|
151 |
+
<div class="bg-white rounded-xl shadow-xl p-8 card">
|
152 |
+
<div class="flex items-center mb-6">
|
153 |
+
<i class="fas fa-landmark text-blue-600 text-2xl mr-3"></i>
|
154 |
+
<h2 class="text-2xl font-bold text-gray-800">Dissertation d'Histoire - Type 1 & 3</h2>
|
155 |
</div>
|
156 |
+
<form id="histoire-form" class="space-y-6" aria-label="Formulaire dissertation histoire">
|
157 |
+
<div class="space-y-2">
|
158 |
+
<label for="sujet-histoire" class="text-sm font-medium text-gray-700">
|
159 |
+
<i class="fas fa-pen-fancy mr-2"></i>Sujet de la dissertation
|
160 |
+
</label>
|
161 |
+
<textarea name="sujet-histoire" id="sujet-histoire" rows="3" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Entrez le sujet de votre dissertation..."></textarea>
|
162 |
+
</div>
|
163 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
164 |
+
<div class="space-y-2">
|
165 |
+
<label for="pointt1-histoire" class="text-sm font-medium text-gray-700">
|
166 |
+
<i class="fas fa-list-ol mr-2"></i>Premier point
|
167 |
+
</label>
|
168 |
+
<input type="text" name="pointt1-histoire" id="pointt1-histoire" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Premier point...">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
</div>
|
170 |
+
<div class="space-y-2">
|
171 |
+
<label for="point2-histoire" class="text-sm font-medium text-gray-700">
|
172 |
+
<i class="fas fa-list-ol mr-2"></i>Deuxième point
|
173 |
+
</label>
|
174 |
+
<input type="text" name="point2-histoire" id="point2-histoire" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Deuxième point...">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
</div>
|
176 |
+
<div class="space-y-2">
|
177 |
+
<label for="point3-histoire" class="text-sm font-medium text-gray-700">
|
178 |
+
<i class="fas fa-list-ol mr-2"></i>Troisième point
|
179 |
+
</label>
|
180 |
+
<input type="text" name="point3-histoire" id="point3-histoire" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Troisième point...">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
</div>
|
182 |
+
</div>
|
183 |
+
<button type="submit" class="w-full bg-blue-600 text-white px-6 py-3 rounded-lg font-medium flex items-center justify-center hover:bg-blue-700 transition-colors duration-200">
|
184 |
+
<i class="fas fa-magic mr-2"></i>
|
185 |
+
<span>Générer la dissertation</span>
|
186 |
+
</button>
|
187 |
+
</form>
|
188 |
+
<div id="histoire-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden" aria-live="polite"></div>
|
189 |
+
</div>
|
190 |
+
</section>
|
191 |
+
|
192 |
+
<!-- Bloc Histoire Type 2 (Images) -->
|
193 |
+
<section class="mb-8" data-aos="fade-up">
|
194 |
+
<div class="bg-white rounded-xl shadow-xl p-8 card">
|
195 |
+
<div class="flex items-center mb-6">
|
196 |
+
<i class="fas fa-scroll text-green-600 text-2xl mr-3"></i>
|
197 |
+
<h2 class="text-2xl font-bold text-gray-800">Histoire - Type 2 (Images)</h2>
|
198 |
</div>
|
199 |
+
<form id="histoire-type2-form" class="space-y-6" enctype="multipart/form-data" aria-label="Formulaire histoire images">
|
200 |
+
<div class="space-y-2">
|
201 |
+
<label for="sujet-histoire-type2" class="text-sm font-medium text-gray-700">
|
202 |
+
<i class="fas fa-pen-fancy mr-2"></i>Sujet
|
203 |
+
</label>
|
204 |
+
<textarea name="sujet-histoire-type2" id="sujet-histoire-type2" rows="3" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Entrez le sujet..."></textarea>
|
205 |
+
</div>
|
206 |
+
<div class="space-y-2">
|
207 |
+
<label for="images-histoire-type2" class="text-sm font-medium text-gray-700">
|
208 |
+
<i class="fas fa-images mr-2"></i>Images (Multiple)
|
209 |
+
</label>
|
210 |
+
<input type="file" name="images-histoire-type2" id="images-histoire-type2" multiple class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm">
|
211 |
+
<div id="image-preview-histoire-type2" class="flex flex-wrap"></div>
|
212 |
+
</div>
|
213 |
+
<button type="submit" class="w-full bg-green-600 text-white px-6 py-3 rounded-lg font-medium flex items-center justify-center hover:bg-green-700 transition-colors duration-200">
|
214 |
+
<i class="fas fa-magic mr-2"></i>
|
215 |
+
<span>Générer l'analyse</span>
|
216 |
+
</button>
|
217 |
+
</form>
|
218 |
+
<div id="histoire-type2-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden" aria-live="polite"></div>
|
219 |
+
</div>
|
220 |
+
</section>
|
221 |
+
|
222 |
+
<!-- Bloc Dissertation de Géographie Type 1 & 3 -->
|
223 |
+
<section class="mb-8" data-aos="fade-up">
|
224 |
+
<div class="bg-white rounded-xl shadow-xl p-8 card">
|
225 |
+
<div class="flex items-center mb-6">
|
226 |
+
<i class="fas fa-globe-europe text-purple-600 text-2xl mr-3"></i>
|
227 |
+
<h2 class="text-2xl font-bold text-gray-800">Dissertation de Géographie - Type 1 & 3</h2>
|
228 |
+
</div>
|
229 |
+
<form id="geographie-form" class="space-y-6" aria-label="Formulaire dissertation géographie">
|
230 |
+
<div class="space-y-2">
|
231 |
+
<label for="sujet-geographie" class="text-sm font-medium text-gray-700">
|
232 |
+
<i class="fas fa-pen-fancy mr-2"></i>Sujet de la dissertation
|
233 |
+
</label>
|
234 |
+
<textarea name="sujet-geographie" id="sujet-geographie" rows="3" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Entrez le sujet de votre dissertation..."></textarea>
|
235 |
+
</div>
|
236 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
237 |
+
<div class="space-y-2">
|
238 |
+
<label for="point1-geographie" class="text-sm font-medium text-gray-700">
|
239 |
+
<i class="fas fa-list-ol mr-2"></i>Premier point
|
240 |
+
</label>
|
241 |
+
<input type="text" name="point1-geographie" id="point1-geographie" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Premier argument...">
|
242 |
+
</div>
|
243 |
+
<div class="space-y-2">
|
244 |
+
<label for="point2-geographie" class="text-sm font-medium text-gray-700">
|
245 |
+
<i class="fas fa-list-ol mr-2"></i>Deuxième point
|
246 |
+
</label>
|
247 |
+
<input type="text" name="point2-geographie" id="point2-geographie" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Deuxième argument...">
|
248 |
+
</div>
|
249 |
+
<div class="space-y-2">
|
250 |
+
<label for="point3-geographie" class="text-sm font-medium text-gray-700">
|
251 |
+
<i class="fas fa-list-ol mr-2"></i>Troisième point
|
252 |
+
</label>
|
253 |
+
<input type="text" name="point3-geographie" id="point3-geographie" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Troisième argument...">
|
254 |
</div>
|
255 |
+
</div>
|
256 |
+
<button type="submit" class="w-full bg-purple-600 text-white px-6 py-3 rounded-lg font-medium flex items-center justify-center hover:bg-purple-700 transition-colors duration-200">
|
257 |
+
<i class="fas fa-magic mr-2"></i>
|
258 |
+
<span>Générer la dissertation</span>
|
259 |
+
</button>
|
260 |
+
</form>
|
261 |
+
<div id="geographie-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden" aria-live="polite"></div>
|
262 |
+
</div>
|
263 |
+
</section>
|
264 |
+
|
265 |
+
<!-- Bloc Géographie Type 2 (Images) -->
|
266 |
+
<section class="mb-8" data-aos="fade-up">
|
267 |
+
<div class="bg-white rounded-xl shadow-xl p-8 card">
|
268 |
+
<div class="flex items-center mb-6">
|
269 |
+
<i class="fas fa-map-marked-alt text-yellow-600 text-2xl mr-3"></i>
|
270 |
+
<h2 class="text-2xl font-bold text-gray-800">Géographie - Type 2 (Images)</h2>
|
271 |
</div>
|
272 |
+
<form id="geographie-type2-form" class="space-y-6" enctype="multipart/form-data" aria-label="Formulaire géographie images">
|
273 |
+
<div class="space-y-2">
|
274 |
+
<label for="sujet-geographie-type2" class="text-sm font-medium text-gray-700">
|
275 |
+
<i class="fas fa-pen-fancy mr-2"></i>Sujet
|
276 |
+
</label>
|
277 |
+
<textarea name="sujet-geographie-type2" id="sujet-geographie-type2" rows="3" class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm" placeholder="Entrez le sujet..."></textarea>
|
278 |
+
</div>
|
279 |
+
<div class="space-y-2">
|
280 |
+
<label for="images-geographie-type2" class="text-sm font-medium text-gray-700">
|
281 |
+
<i class="fas fa-images mr-2"></i>Images (Multiple)
|
282 |
+
</label>
|
283 |
+
<input type="file" name="images-geographie-type2" id="images-geographie-type2" multiple class="form-input mt-1 block w-full rounded-lg border-gray-300 shadow-sm">
|
284 |
+
<div id="image-preview-geographie-type2" class="flex flex-wrap"></div>
|
285 |
+
</div>
|
286 |
+
<button type="submit" class="w-full bg-yellow-600 text-white px-6 py-3 rounded-lg font-medium flex items-center justify-center hover:bg-yellow-700 transition-colors duration-200">
|
287 |
+
<i class="fas fa-magic mr-2"></i>
|
288 |
+
<span>Générer l'analyse</span>
|
289 |
+
</button>
|
290 |
+
</form>
|
291 |
+
<div id="geographie-type2-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden" aria-live="polite"></div>
|
292 |
+
</div>
|
293 |
+
</section>
|
294 |
+
</main>
|
295 |
+
|
296 |
+
<!-- Bouton Retour en haut -->
|
297 |
+
<button id="back-to-top" aria-label="Retour en haut">
|
298 |
+
<i class="fas fa-arrow-up"></i>
|
299 |
+
</button>
|
300 |
+
|
301 |
+
<!-- Pied de page -->
|
302 |
+
<footer class="gradient-bg mt-12 py-6" role="contentinfo">
|
303 |
+
<div class="container mx-auto px-6 text-center text-white">
|
304 |
+
<p class="text-sm">© 2024 Mariam - Tous droits réservés</p>
|
305 |
</div>
|
306 |
+
</footer>
|
307 |
+
|
308 |
+
<!-- Scripts personnalisés -->
|
309 |
+
<script>
|
|
|
|
|
|
|
|
|
|
|
310 |
window.addEventListener('load', function() {
|
311 |
+
AOS.init({
|
312 |
+
duration: 800,
|
313 |
+
once: true,
|
314 |
+
offset: 100
|
315 |
+
});
|
316 |
+
|
317 |
+
marked.setOptions({
|
318 |
+
breaks: true,
|
319 |
+
gfm: true,
|
320 |
+
headerIds: false,
|
321 |
+
renderer: new marked.Renderer()
|
322 |
+
});
|
323 |
+
|
324 |
+
function showLoading(outputId) {
|
325 |
+
const output = document.getElementById(outputId);
|
326 |
+
output.classList.remove('hidden');
|
327 |
+
output.innerHTML = `
|
328 |
+
<div class="flex items-center justify-center space-x-3">
|
329 |
+
<div class="spinner h-8 w-8 border-4 border-blue-500 border-t-transparent rounded-full"></div>
|
330 |
+
<span class="text-gray-600">Génération en cours...</span>
|
331 |
+
</div>
|
332 |
+
`;
|
333 |
+
}
|
334 |
+
|
335 |
+
async function submitForm(formId, outputId, endpoint) {
|
336 |
+
const form = document.getElementById(formId);
|
337 |
+
const output = document.getElementById(outputId);
|
338 |
+
|
339 |
+
form.addEventListener('submit', async (e) => {
|
340 |
+
e.preventDefault();
|
341 |
+
showLoading(outputId);
|
342 |
+
|
343 |
+
try {
|
344 |
+
const formData = new FormData(form);
|
345 |
+
const response = await fetch(endpoint, {
|
346 |
+
method: 'POST',
|
347 |
+
body: formData
|
348 |
+
});
|
349 |
+
|
350 |
+
if (!response.ok) throw new Error(`Erreur HTTP: ${response.status}`);
|
351 |
+
|
352 |
+
const result = await response.json();
|
353 |
output.classList.remove('hidden');
|
354 |
output.innerHTML = `
|
355 |
+
<div class="markdown-output prose max-w-none">
|
356 |
+
${marked.parse(result.output)}
|
357 |
+
</div>
|
|
|
358 |
`;
|
359 |
+
|
360 |
+
// Adaptation des tableaux pour mobile
|
361 |
+
Array.from(output.getElementsByTagName('table')).forEach(table => {
|
362 |
+
table.parentNode.style.overflow = 'auto';
|
363 |
+
table.style.minWidth = '100%';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
});
|
365 |
+
} catch (error) {
|
366 |
+
output.classList.remove('hidden');
|
367 |
+
output.innerHTML = `
|
368 |
+
<div class="bg-red-50 border-l-4 border-red-500 p-4">
|
369 |
+
<div class="flex items-center">
|
370 |
+
<i class="fas fa-exclamation-circle text-red-500"></i>
|
371 |
+
<p class="ml-3 text-red-700">Une erreur est survenue : ${error.message}</p>
|
372 |
+
</div>
|
373 |
+
</div>
|
374 |
+
`;
|
375 |
+
}
|
376 |
+
});
|
377 |
+
}
|
378 |
+
|
379 |
+
// Initialisation des formulaires
|
380 |
+
submitForm('histoire-form', 'histoire-output', '/api/histoire');
|
381 |
+
submitForm('histoire-type2-form', 'histoire-type2-output', '/api/histoire-type2');
|
382 |
+
submitForm('geographie-form', 'geographie-output', '/api/geographie');
|
383 |
+
submitForm('geographie-type2-form', 'geographie-type2-output', '/api/geographie-type2');
|
384 |
+
|
385 |
+
// Prévisualisation des images
|
386 |
+
function handleImagePreviews(inputId, previewContainerId) {
|
387 |
+
const input = document.getElementById(inputId);
|
388 |
+
const previewContainer = document.getElementById(previewContainerId);
|
389 |
+
|
390 |
+
input.addEventListener('change', function() {
|
391 |
+
previewContainer.innerHTML = '';
|
392 |
+
Array.from(this.files).forEach(file => {
|
393 |
+
if (file.type.startsWith('image/')) {
|
394 |
+
const reader = new FileReader();
|
395 |
+
reader.onload = (e) => {
|
396 |
+
const img = document.createElement('img');
|
397 |
+
img.src = e.target.result;
|
398 |
+
img.classList.add('image-preview');
|
399 |
+
previewContainer.appendChild(img);
|
400 |
+
};
|
401 |
+
reader.readAsDataURL(file);
|
402 |
+
}
|
403 |
+
});
|
404 |
+
});
|
405 |
+
}
|
406 |
+
|
407 |
+
handleImagePreviews('images-histoire-type2', 'image-preview-histoire-type2');
|
408 |
+
handleImagePreviews('images-geographie-type2', 'image-preview-geographie-type2');
|
409 |
+
|
410 |
+
// Bouton Retour en haut
|
411 |
+
const backToTopBtn = document.getElementById('back-to-top');
|
412 |
+
window.addEventListener('scroll', () => {
|
413 |
+
if (window.scrollY > 300) {
|
414 |
+
backToTopBtn.classList.add('show');
|
415 |
+
} else {
|
416 |
+
backToTopBtn.classList.remove('show');
|
417 |
}
|
418 |
+
});
|
419 |
+
backToTopBtn.addEventListener('click', () => {
|
420 |
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
421 |
+
});
|
422 |
});
|
423 |
+
</script>
|
424 |
</body>
|
425 |
+
</html>
|