Docfile commited on
Commit
c6fc2a7
·
verified ·
1 Parent(s): cd099aa

Update templates/histoire.html

Browse files
Files changed (1) hide show
  1. templates/histoire.html +230 -78
templates/histoire.html CHANGED
@@ -3,103 +3,255 @@
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</title>
 
 
 
 
 
 
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.2/marked.min.js"></script>
9
- <script src="https://cdn.jsdelivr.net/npm/@gradio/client@0.1.4/dist/index.min.js"></script>
10
- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
11
- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  </head>
13
- <body class="bg-gray-100 min-h-screen">
14
- <nav class="bg-blue-600 p-4">
15
- <h1 class="text-white text-2xl font-bold">Histoire et Géographie</h1>
16
- </nav>
17
- <div class="container mx-auto p-8">
18
- <div class="mb-8 bg-white rounded-lg shadow-lg p-6">
19
- <h2 class="text-xl font-bold mb-4">Histoire type 1&3</h2>
20
- <form id="histoire-form" class="space-y-4">
21
- <div>
22
- <label for="sujet-histoire" class="block text-sm font-medium text-gray-700">Sujet:</label>
23
- <textarea id="sujet-histoire" rows="2" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50"></textarea>
24
- </div>
25
- <div>
26
- <label for="point1-histoire" class="block text-sm font-medium text-gray-700">Point 1:</label>
27
- <input type="text" id="point1-histoire" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50">
28
- </div>
29
- <div>
30
- <label for="point2-histoire" class="block text-sm font-medium text-gray-700">Point 2:</label>
31
- <input type="text" id="point2-histoire" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50">
32
  </div>
33
- <div>
34
- <label for="point3-histoire" class="block text-sm font-medium text-gray-700">Point 3:</label>
35
- <input type="text" id="point3-histoire" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50">
36
  </div>
37
- <button type="submit" class="w-full bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50">Générer</button>
38
- </form>
39
- <div id="histoire-output" class="mt-4 p-4 bg-gray-50 rounded-lg"></div>
40
  </div>
 
41
 
42
- <div class="mb-8 bg-white rounded-lg shadow-lg p-6">
43
- <h2 class="text-xl font-bold mb-4">Histoire type 2</h2>
44
- <form id="histoire-type2-form" class="space-y-4">
45
- <div>
46
- <label for="sujet-histoire-type2" class="block text-sm font-medium text-gray-700">Sujet:</label>
47
- <textarea id="sujet-histoire-type2" rows="2" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50"></textarea>
48
- </div>
49
- <div>
50
- <label for="point1-histoire-type2" class="block text-sm font-medium text-gray-700">Point 1:</label>
51
- <input type="text" id="point1-histoire-type2" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50">
52
- </div>
53
- <div>
54
- <label for="point2-histoire-type2" class="block text-sm font-medium text-gray-700">Point 2:</label>
55
- <input type="text" id="point2-histoire-type2" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50">
 
 
56
  </div>
57
- <div>
58
- <label for="point3-histoire-type2" class="block text-sm font-medium text-gray-700">Point 3:</label>
59
- <input type="text" id="point3-histoire-type2" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  </div>
61
- <button type="submit" class="w-full bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50">Générer</button>
62
- </form>
63
- <div id="histoire-type2-output" class="mt-4 p-4 bg-gray-50 rounded-lg"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </div>
65
 
66
- <div class="bg-white rounded-lg shadow-lg p-6">
67
- <h2 class="text-xl font-bold mb-4">Géographie</h2>
68
- <form id="geographie-form" class="space-y-4">
69
- <div>
70
- <label for="sujet-geographie" class="block text-sm font-medium text-gray-700">Sujet:</label>
71
- <textarea id="sujet-geographie" rows="3" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50"></textarea>
72
  </div>
73
- <button type="submit" class="w-full bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50">Générer</button>
74
- </form>
75
- <div id="geographie-output" class="mt-4 p-4 bg-gray-50 rounded-lg"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  </div>
77
  </div>
78
 
 
 
 
 
 
 
 
79
  <script>
80
- async function submitForm(formId, outputId, endpoint) {
81
- const form = document.getElementById(formId);
82
- const output = document.getElementById(outputId);
 
 
 
 
 
83
 
84
- form.addEventListener('submit', async (e) => {
85
- e.preventDefault();
86
- output.innerHTML = '<p>Chargement en cours...</p>';
 
 
 
 
 
 
 
87
 
88
- const formData = new FormData(form);
89
- const response = await fetch(endpoint, {
90
- method: 'POST',
91
- body: formData
92
- });
93
 
94
- const result = await response.json();
95
- output.innerHTML = marked.parse(result.output);
96
- MathJax.typesetPromise([output]);
97
- });
98
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
- submitForm('histoire-form', 'histoire-output', '/api/histoire');
101
- submitForm('histoire-type2-form', 'histoire-type2-output', '/api/histoire-type2');
102
- submitForm('geographie-form', 'geographie-output', '/api/geographie');
 
103
  </script>
104
  </body>
105
- </html>
 
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/aos@2.3.4/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
+ </style>
45
  </head>
46
+ <body class="bg-slate-100 min-h-screen">
47
+ <!-- Navigation -->
48
+ <nav class="gradient-background shadow-lg">
49
+ <div class="container mx-auto px-6 py-4">
50
+ <div class="flex items-center justify-between">
51
+ <div class="flex items-center">
52
+ <i class="fas fa-book-open text-white text-2xl mr-3"></i>
53
+ <h1 class="text-white text-2xl font-bold">Mariam </h1>
 
 
 
 
 
 
 
 
 
 
 
54
  </div>
55
+ <div class="text-white text-sm">
56
+ <i class="fas fa-graduation-cap mr-2"></i>
57
+ Histoire et Géographie
58
  </div>
59
+ </div>
 
 
60
  </div>
61
+ </nav>
62
 
63
+ <!-- Main Content -->
64
+ <div class="container mx-auto p-6">
65
+ <!-- Introduction Section -->
66
+ <div class="text-center mb-12">
67
+ <h2 class="text-3xl font-bold text-gray-800 mb-4">Assistant de Rédaction</h2>
68
+ <p class="text-gray-600 max-w-2xl mx-auto">
69
+ Générez des dissertations structurées et détaillées pour vos devoirs d'histoire et de géographie.
70
+ </p>
71
+ </div>
72
+
73
+ <!-- Histoire Type 1&3 -->
74
+ <div class="mb-8" data-aos="fade-up">
75
+ <div class="bg-white rounded-xl shadow-xl p-8 card-hover">
76
+ <div class="flex items-center mb-6">
77
+ <i class="fas fa-landmark text-blue-600 text-2xl mr-3"></i>
78
+ <h2 class="text-2xl font-bold text-gray-800">Dissertation d'Histoire - Type 1 & 3</h2>
79
  </div>
80
+ <form id="histoire-form" class="space-y-6">
81
+ <div class="space-y-2">
82
+ <label for="sujet-histoire" class="text-sm font-medium text-gray-700 block">
83
+ <i class="fas fa-pen-fancy mr-2"></i>Sujet de la dissertation
84
+ </label>
85
+ <textarea name="sujet-histoire" id="sujet-histoire" rows="3"
86
+ 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"
87
+ placeholder="Entrez le sujet de votre dissertation..."></textarea>
88
+ </div>
89
+
90
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
91
+ <div class="space-y-2">
92
+ <label for="pointt1-histoire" class="text-sm font-medium text-gray-700 block">
93
+ <i class="fas fa-list-ol mr-2"></i>Premier point
94
+ </label>
95
+ <input type="text" name="pointt1-histoire" id="pointt1-histoire"
96
+ 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"
97
+ placeholder="Premier argument...">
98
+ </div>
99
+
100
+ <div class="space-y-2">
101
+ <label for="point2-histoire" class="text-sm font-medium text-gray-700 block">
102
+ <i class="fas fa-list-ol mr-2"></i>Deuxième point
103
+ </label>
104
+ <input type="text" name="point2-histoire" id="point2-histoire"
105
+ 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"
106
+ placeholder="Deuxième argument...">
107
+ </div>
108
+
109
+ <div class="space-y-2">
110
+ <label for="point3-histoire" class="text-sm font-medium text-gray-700 block">
111
+ <i class="fas fa-list-ol mr-2"></i>Troisième point
112
+ </label>
113
+ <input type="text" name="point3-histoire" id="point3-histoire"
114
+ 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"
115
+ placeholder="Troisième argument...">
116
+ </div>
117
+ </div>
118
+
119
+ <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">
120
+ <i class="fas fa-magic mr-2"></i>
121
+ <span>Générer la dissertation</span>
122
+ </button>
123
+ </form>
124
+ <div id="histoire-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden"></div>
125
+ </div>
126
+ </div>
127
+
128
+ <!-- Histoire Type 2 -->
129
+ <div class="mb-8" data-aos="fade-up">
130
+ <div class="bg-white rounded-xl shadow-xl p-8 card-hover">
131
+ <div class="flex items-center mb-6">
132
+ <i class="fas fa-scroll text-green-600 text-2xl mr-3"></i>
133
+ <h2 class="text-2xl font-bold text-gray-800">Histoire - Type 2</h2>
134
  </div>
135
+ <form id="histoire-type2-form" class="space-y-6">
136
+ <div class="space-y-2">
137
+ <label for="sujet-histoire-type2" class="text-sm font-medium text-gray-700 block">
138
+ <i class="fas fa-pen-fancy mr-2"></i>Sujet
139
+ </label>
140
+ <textarea name="sujet-histoire-type2" id="sujet-histoire-type2" rows="3"
141
+ 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"
142
+ placeholder="Entrez le sujet..."></textarea>
143
+ </div>
144
+ <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">
145
+ <i class="fas fa-magic mr-2"></i>
146
+ <span>Générer l'analyse</span>
147
+ </button>
148
+ </form>
149
+ <div id="histoire-type2-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden"></div>
150
+ </div>
151
  </div>
152
 
153
+ <!-- Géographie -->
154
+ <div data-aos="fade-up">
155
+ <div class="bg-white rounded-xl shadow-xl p-8 card-hover">
156
+ <div class="flex items-center mb-6">
157
+ <i class="fas fa-globe-europe text-purple-600 text-2xl mr-3"></i>
158
+ <h2 class="text-2xl font-bold text-gray-800">Géographie</h2>
159
  </div>
160
+ <form id="geographie-form" class="space-y-6">
161
+ <div class="space-y-2">
162
+ <label for="sujet-geographie" class="text-sm font-medium text-gray-700 block">
163
+ <i class="fas fa-pen-fancy mr-2"></i>Sujet
164
+ </label>
165
+ <textarea name="sujet-geographie" id="sujet-geographie" rows="3"
166
+ 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"
167
+ placeholder="Entrez le sujet de géographie..."></textarea>
168
+ </div>
169
+ <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">
170
+ <i class="fas fa-magic mr-2"></i>
171
+ <span>Générer l'analyse</span>
172
+ </button>
173
+ </form>
174
+ <div id="geographie-output" class="mt-6 p-6 bg-gray-50 rounded-lg hidden"></div>
175
+ </div>
176
  </div>
177
  </div>
178
 
179
+ <footer class="gradient-background mt-12 py-6">
180
+ <div class="container mx-auto px-6 text-center text-white">
181
+ <p class="text-sm">© 2024 Mariam- Tous droits réservés</p>
182
+ </div>
183
+ </footer>
184
+
185
+ <!-- Scripts -->
186
  <script>
187
+ // Attendre que tous les scripts soient chargés
188
+ window.addEventListener('load', function() {
189
+ // Initialize AOS
190
+ AOS.init({
191
+ duration: 800,
192
+ once: true,
193
+ offset: 100
194
+ });
195
 
196
+ function showLoading(outputId) {
197
+ const output = document.getElementById(outputId);
198
+ output.classList.remove('hidden');
199
+ output.innerHTML = `
200
+ <div class="flex items-center justify-center space-x-3">
201
+ <div class="loading-spinner h-8 w-8 border-4 border-blue-500 border-t-transparent rounded-full"></div>
202
+ <span class="text-gray-600">Génération en cours...</span>
203
+ </div>
204
+ `;
205
+ }
206
 
207
+ async function submitForm(formId, outputId, endpoint) {
208
+ const form = document.getElementById(formId);
209
+ const output = document.getElementById(outputId);
 
 
210
 
211
+ form.addEventListener('submit', async (e) => {
212
+ e.preventDefault();
213
+ showLoading(outputId);
214
+
215
+ try {
216
+ const formData = new FormData(form);
217
+ const response = await fetch(endpoint, {
218
+ method: 'POST',
219
+ body: formData
220
+ });
221
+
222
+ if (!response.ok) {
223
+ throw new Error(`HTTP error! status: ${response.status}`);
224
+ }
225
+
226
+ const result = await response.json();
227
+ output.classList.remove('hidden');
228
+ output.innerHTML = `
229
+ <div class="prose max-w-none">
230
+ ${marked.parse(result.output)}
231
+ </div>
232
+ `;
233
+ } catch (error) {
234
+ output.classList.remove('hidden');
235
+ output.innerHTML = `
236
+ <div class="bg-red-50 border-l-4 border-red-500 p-4">
237
+ <div class="flex items-center">
238
+ <div class="flex-shrink-0">
239
+ <i class="fas fa-exclamation-circle text-red-500"></i>
240
+ </div>
241
+ <div class="ml-3">
242
+ <p class="text-red-700">Une erreur est survenue: ${error.message}</p>
243
+ </div>
244
+ </div>
245
+ </div>
246
+ `;
247
+ }
248
+ });
249
+ }
250
 
251
+ submitForm('histoire-form', 'histoire-output', '/api/histoire');
252
+ submitForm('histoire-type2-form', 'histoire-type2-output', '/api/histoire-type2');
253
+ submitForm('geographie-form', 'geographie-output', '/api/geographie');
254
+ });
255
  </script>
256
  </body>
257
+ </html>