Docfile commited on
Commit
62a8b0f
·
verified ·
1 Parent(s): b22bf3b

Update templates/histoire.html

Browse files
Files changed (1) hide show
  1. templates/histoire.html +403 -405
templates/histoire.html CHANGED
@@ -1,427 +1,425 @@
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
- <!-- CSS -->
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 principaux -->
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
- body {
20
- font-family: 'Poppins', sans-serif;
21
- }
22
- .gradient-background {
23
- background: linear-gradient(120deg, #1a365d 0%, #2563eb 100%);
24
- }
25
- .card-hover {
26
- transition: transform 0.3s ease-in-out;
27
- }
28
- .card-hover:hover {
29
- transform: translateY(-5px);
30
- }
31
- .loading-spinner {
32
- animation: spin 1s linear infinite;
33
- }
34
- @keyframes spin {
35
- 0% { transform: rotate(0deg); }
36
- 100% { transform: rotate(360deg); }
37
- }
38
- .form-input {
39
- transition: all 0.3s ease;
40
- }
41
- .form-input:focus {
42
- transform: scale(1.01);
43
- }
44
- .image-preview {
45
- max-width: 200px;
46
- max-height: 200px;
47
- margin: 10px;
48
- border: 1px solid #ccc;
49
- }
50
- /* Styles améliorés pour le Markdown sur mobile */
51
- .markdown-output {
52
- width: 100%;
53
- overflow-wrap: break-word;
54
- word-wrap: break-word;
55
- hyphens: auto;
56
- }
57
- .markdown-output p {
58
- margin: 1em 0;
59
- line-height: 1.6;
60
- font-size: 16px;
61
- }
62
- .markdown-output h1,
63
- .markdown-output h2,
64
- .markdown-output h3,
65
- .markdown-output h4 {
66
- margin: 1.5em 0 0.5em;
67
- line-height: 1.3;
68
- }
69
- .markdown-output ul,
70
- .markdown-output ol {
71
- padding-left: 1.5em;
72
- margin: 1em 0;
73
- }
74
- .markdown-output li {
75
- margin: 0.5em 0;
76
- line-height: 1.4;
77
- }
78
- @media (max-width: 768px) {
79
- .markdown-output {
80
- font-size: 15px;
81
- }
82
- .markdown-output p {
83
- margin: 0.8em 0;
84
- }
85
- .markdown-output ul,
86
- .markdown-output ol {
87
- padding-left: 1.2em;
88
- }
89
- .markdown-output h1 { font-size: 1.8em; }
90
- .markdown-output h2 { font-size: 1.5em; }
91
- .markdown-output h3 { font-size: 1.3em; }
92
- .markdown-output h4 { font-size: 1.1em; }
93
- .markdown-output pre {
94
- padding: 1em;
95
- overflow-x: auto;
96
- white-space: pre-wrap;
97
- word-wrap: break-word;
98
- }
99
- .markdown-output code {
100
- word-break: break-word;
101
- }
102
- }
103
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  </head>
105
- <body class="bg-slate-100 min-h-screen">
106
- <!-- Navigation -->
107
- <nav class="gradient-background shadow-lg">
108
- <div class="container mx-auto px-6 py-4">
109
- <div class="flex items-center justify-between">
110
- <div class="flex items-center">
111
- <i class="fas fa-book-open text-white text-2xl mr-3"></i>
112
- <h1 class="text-white text-2xl font-bold">Mariam </h1>
113
- </div>
114
- <div class="text-white text-sm">
115
- <i class="fas fa-graduation-cap mr-2"></i>
116
- Histoire et Géographie
117
- </div>
118
- </div>
119
- </div>
120
  </nav>
121
-
122
- <!-- Main Content -->
123
- <div class="container mx-auto p-6">
124
- <!-- Introduction Section -->
125
- <div class="text-center mb-12">
126
- <h2 class="text-3xl font-bold text-gray-800 mb-4">Assistant de Rédaction</h2>
127
- <p class="text-gray-600 max-w-2xl mx-auto">
128
- Générez des dissertations structurées et détaillées pour vos devoirs d'histoire et de géographie.
129
- </p>
 
 
 
 
 
 
 
 
 
130
  </div>
131
-
132
- <!-- Histoire Type 1&3 -->
133
- <div class="mb-8" data-aos="fade-up">
134
- <div class="bg-white rounded-xl shadow-xl p-8 card-hover">
135
- <div class="flex items-center mb-6">
136
- <i class="fas fa-landmark text-blue-600 text-2xl mr-3"></i>
137
- <h2 class="text-2xl font-bold text-gray-800">Dissertation d'Histoire - Type 1 & 3</h2>
138
- </div>
139
- <form id="histoire-form" class="space-y-6">
140
- <div class="space-y-2">
141
- <label for="sujet-histoire" class="text-sm font-medium text-gray-700 block">
142
- <i class="fas fa-pen-fancy mr-2"></i>Sujet de la dissertation
143
- </label>
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
- </div>
186
-
187
- <!-- Histoire Type 2 -->
188
- <div class="mb-8" data-aos="fade-up">
189
- <div class="bg-white rounded-xl shadow-xl p-8 card-hover">
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
- </div>
219
-
220
- <!-- Géographie Type 1 & 3 -->
221
- <div class="mb-8" data-aos="fade-up">
222
- <div class="bg-white rounded-xl shadow-xl p-8 card-hover">
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
- <!-- Géographie Type 2 -->
276
- <div class="mb-8" data-aos="fade-up">
277
- <div class="bg-white rounded-xl shadow-xl p-8 card-hover">
278
- <div class="flex items-center mb-6">
279
- <i class="fas fa-map-marked-alt text-yellow-600 text-2xl mr-3"></i>
280
- <h2 class="text-2xl font-bold text-gray-800">Géographie - Type 2 (Images)</h2>
281
- </div>
282
- <form id="geographie-type2-form" class="space-y-6" enctype="multipart/form-data">
283
- <div class="space-y-2">
284
- <label for="sujet-geographie-type2" class="text-sm font-medium text-gray-700 block">
285
- <i class="fas fa-pen-fancy mr-2"></i>Sujet
286
- </label>
287
- <textarea name="sujet-geographie-type2" id="sujet-geographie-type2" rows="3"
288
- 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"
289
- placeholder="Entrez le sujet..."></textarea>
290
- </div>
291
- <div class="space-y-2">
292
- <label for="images-geographie-type2" class="text-sm font-medium text-gray-700 block">
293
- <i class="fas fa-images mr-2"></i>Images (Multiple)
294
- </label>
295
- <input type="file" name="images-geographie-type2" id="images-geographie-type2" multiple
296
- 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">
297
- <div id="image-preview-geographie-type2" class="flex flex-wrap"></div>
298
- </div>
299
- <button type="submit" class="w-full bg-yellow-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-yellow-700 transition-colors duration-200 flex items-center justify-center">
300
- <i class="fas fa-magic mr-2"></i>
301
- <span>Générer l'analyse</span>
302
- </button>
303
- </form>
304
- <div id="geographie-type2-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  </div>
308
-
309
- <footer class="gradient-background mt-12 py-6">
310
- <div class="container mx-auto px-6 text-center text-white">
311
- <p class="text-sm">© 2024 Mariam- Tous droits réservés</p>
312
- </div>
313
- </footer>
314
-
315
- <!-- Scripts -->
316
- <script>
317
  window.addEventListener('load', function() {
318
- AOS.init({
319
- duration: 800,
320
- once: true,
321
- offset: 100
322
- });
323
-
324
- // Configuration personnalisée de marked pour un meilleur rendu mobile
325
- marked.setOptions({
326
- breaks: true,
327
- gfm: true,
328
- headerIds: false,
329
- renderer: new marked.Renderer()
330
- });
331
-
332
- function showLoading(outputId) {
333
- const output = document.getElementById(outputId);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  output.classList.remove('hidden');
335
  output.innerHTML = `
336
- <div class="flex items-center justify-center space-x-3">
337
- <div class="loading-spinner h-8 w-8 border-4 border-blue-500 border-t-transparent rounded-full"></div>
338
- <span class="text-gray-600">Génération en cours...</span>
339
- </div>
340
  `;
341
- }
342
-
343
- async function submitForm(formId, outputId, endpoint) {
344
- const form = document.getElementById(formId);
345
- const output = document.getElementById(outputId);
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
- handleImagePreviews('images-histoire-type2', 'image-preview-histoire-type2');
423
- handleImagePreviews('images-geographie-type2', 'image-preview-geographie-type2');
 
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>