Delete templates/index.html
Browse files- templates/index.html +0 -270
templates/index.html
DELETED
@@ -1,270 +0,0 @@
|
|
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>Mariam AI - Analyse Littéraire</title>
|
7 |
-
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/9.1.6/marked.min.js"></script>
|
9 |
-
<style>
|
10 |
-
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Inter:wght@300;400;500;600;700&display=swap');
|
11 |
-
|
12 |
-
.custom-prose h1, .custom-prose h2, .custom-prose h3 {
|
13 |
-
font-family: 'Playfair Display', serif;
|
14 |
-
margin-top: 2em;
|
15 |
-
margin-bottom: 1em;
|
16 |
-
line-height: 1.3;
|
17 |
-
}
|
18 |
-
|
19 |
-
.custom-prose p {
|
20 |
-
margin-bottom: 1.5em;
|
21 |
-
line-height: 1.8;
|
22 |
-
}
|
23 |
-
|
24 |
-
.custom-prose ul, .custom-prose ol {
|
25 |
-
margin-top: 1em;
|
26 |
-
margin-bottom: 1em;
|
27 |
-
padding-left: 1.5em;
|
28 |
-
}
|
29 |
-
|
30 |
-
.custom-prose li {
|
31 |
-
margin-bottom: 0.5em;
|
32 |
-
}
|
33 |
-
|
34 |
-
.markdown-table table {
|
35 |
-
width: 100%;
|
36 |
-
border-collapse: separate;
|
37 |
-
border-spacing: 0;
|
38 |
-
margin: 2em 0;
|
39 |
-
background: white;
|
40 |
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
41 |
-
}
|
42 |
-
|
43 |
-
.markdown-table th {
|
44 |
-
background: #1a365d;
|
45 |
-
color: white;
|
46 |
-
font-weight: 600;
|
47 |
-
padding: 1rem;
|
48 |
-
text-align: left;
|
49 |
-
}
|
50 |
-
|
51 |
-
.markdown-table td {
|
52 |
-
padding: 1rem;
|
53 |
-
border-bottom: 1px solid #e2e8f0;
|
54 |
-
}
|
55 |
-
|
56 |
-
.markdown-table tr:hover {
|
57 |
-
background: #f8fafc;
|
58 |
-
}
|
59 |
-
|
60 |
-
.spinner {
|
61 |
-
border: 4px solid rgba(0, 0, 0, 0.1);
|
62 |
-
width: 3rem;
|
63 |
-
height: 3rem;
|
64 |
-
border-radius: 50%;
|
65 |
-
border-left-color: #1a365d;
|
66 |
-
animation: spin 1s linear infinite;
|
67 |
-
}
|
68 |
-
|
69 |
-
@keyframes spin {
|
70 |
-
to { transform: rotate(360deg); }
|
71 |
-
}
|
72 |
-
|
73 |
-
.fade-enter {
|
74 |
-
opacity: 0;
|
75 |
-
transform: translateY(20px);
|
76 |
-
}
|
77 |
-
|
78 |
-
.fade-enter-active {
|
79 |
-
opacity: 1;
|
80 |
-
transform: translateY(0);
|
81 |
-
transition: opacity 300ms, transform 300ms;
|
82 |
-
}
|
83 |
-
</style>
|
84 |
-
</head>
|
85 |
-
<body class="bg-gradient-to-br from-gray-50 to-gray-100 min-h-screen font-['Inter']">
|
86 |
-
<div class="max-w-4xl mx-auto p-6">
|
87 |
-
<!-- En-tête -->
|
88 |
-
<header class="text-center mb-12">
|
89 |
-
<h1 class="font-['Playfair_Display'] text-5xl font-bold text-gray-900 mb-4">Mariam AI</h1>
|
90 |
-
<p class="text-xl text-gray-600">Assistant d'Analyse Littéraire</p>
|
91 |
-
</header>
|
92 |
-
|
93 |
-
|
94 |
-
<div class="relative">
|
95 |
-
<label for="consignesInput" class="block text-lg font-medium text-gray-700 mb-3">
|
96 |
-
Consignes (optionnel)
|
97 |
-
</label>
|
98 |
-
<input id="consignesInput" name="consignes" type="text" class="w-full border border-gray-300 rounded-md p-2" placeholder="Entrez vos consignes ici">
|
99 |
-
</div>
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
<div class="bg-white rounded-xl shadow-lg p-8">
|
104 |
-
<!-- Zone de téléchargement -->
|
105 |
-
<form id="uploadForm" class="space-y-6">
|
106 |
-
<div class="relative">
|
107 |
-
<label for="imageInput" class="block text-lg font-medium text-gray-700 mb-3">
|
108 |
-
Sélectionnez votre document
|
109 |
-
</label>
|
110 |
-
<div class="mt-2 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg hover:border-blue-500 transition-colors cursor-pointer">
|
111 |
-
<div class="space-y-2 text-center">
|
112 |
-
<svg class="mx-auto h-12 w-12 text-gray-400" stroke="currentColor" fill="none" viewBox="0 0 48 48" aria-hidden="true">
|
113 |
-
<path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
114 |
-
</svg>
|
115 |
-
<div class="text-sm text-gray-600">
|
116 |
-
<label for="imageInput" class="relative cursor-pointer bg-white rounded-md font-medium text-blue-600 hover:text-blue-500 focus-within:outline-none">
|
117 |
-
<span>Télécharger un fichier</span>
|
118 |
-
<input id="imageInput" name="image" type="file" class="sr-only" accept="image/*" required>
|
119 |
-
</label>
|
120 |
-
</div>
|
121 |
-
<p class="text-xs text-gray-500">PNG, JPG jusqu'à 10MB</p>
|
122 |
-
</div>
|
123 |
-
</div>
|
124 |
-
</div>
|
125 |
-
|
126 |
-
<!-- Prévisualisation -->
|
127 |
-
<div id="previewContainer" class="hidden">
|
128 |
-
<p class="text-gray-700 font-medium mb-3">Aperçu du document :</p>
|
129 |
-
<div class="relative rounded-lg overflow-hidden bg-gray-100">
|
130 |
-
<img id="previewImage" src="#" alt="Aperçu" class="w-full max-h-80 object-contain">
|
131 |
-
</div>
|
132 |
-
</div>
|
133 |
-
|
134 |
-
<button type="submit" class="w-full bg-blue-600 text-white rounded-lg px-4 py-3 font-semibold hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
|
135 |
-
Lancer l'analyse
|
136 |
-
</button>
|
137 |
-
</form>
|
138 |
-
|
139 |
-
<!-- Indicateur de chargement -->
|
140 |
-
<div id="loading" class="hidden">
|
141 |
-
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
142 |
-
<div class="bg-white p-6 rounded-lg shadow-xl text-center">
|
143 |
-
<div class="spinner mx-auto mb-4"></div>
|
144 |
-
<p class="text-gray-700 font-medium">Analyse en cours...</p>
|
145 |
-
</div>
|
146 |
-
</div>
|
147 |
-
</div>
|
148 |
-
|
149 |
-
<!-- Résultats -->
|
150 |
-
<div id="result" class="hidden mt-8 space-y-8">
|
151 |
-
<!-- Navigation -->
|
152 |
-
<div class="flex space-x-4 border-b border-gray-200">
|
153 |
-
<button id="dissertationTab" class="px-4 py-2 text-sm font-medium text-blue-600 border-b-2 border-blue-600">
|
154 |
-
Dissertation
|
155 |
-
</button>
|
156 |
-
<button id="tableauTab" class="px-4 py-2 text-sm font-medium text-gray-500 hover:text-gray-700">
|
157 |
-
Tableau d'analyse
|
158 |
-
</button>
|
159 |
-
</div>
|
160 |
-
|
161 |
-
<!-- Contenu Dissertation -->
|
162 |
-
<div id="dissertationContent" class="custom-prose prose prose-lg max-w-none">
|
163 |
-
</div>
|
164 |
-
|
165 |
-
<!-- Contenu Tableau -->
|
166 |
-
<div id="tableauContent" class="hidden markdown-table prose prose-lg max-w-none">
|
167 |
-
<div class="overflow-x-auto">
|
168 |
-
<!-- Le tableau sera injecté ici via Marked -->
|
169 |
-
</div>
|
170 |
-
</div>
|
171 |
-
</div>
|
172 |
-
</div>
|
173 |
-
</div>
|
174 |
-
|
175 |
-
<script>
|
176 |
-
const uploadForm = document.getElementById('uploadForm');
|
177 |
-
const imageInput = document.getElementById('imageInput');
|
178 |
-
const previewContainer = document.getElementById('previewContainer');
|
179 |
-
const previewImage = document.getElementById('previewImage');
|
180 |
-
const loadingIndicator = document.getElementById('loading');
|
181 |
-
const resultDiv = document.getElementById('result');
|
182 |
-
const dissertationTab = document.getElementById('dissertationTab');
|
183 |
-
const tableauTab = document.getElementById('tableauTab');
|
184 |
-
const dissertationContent = document.getElementById('dissertationContent');
|
185 |
-
const tableauContent = document.getElementById('tableauContent');
|
186 |
-
|
187 |
-
// Configuration de marked pour le rendu Markdown
|
188 |
-
marked.setOptions({
|
189 |
-
breaks: true,
|
190 |
-
gfm: true,
|
191 |
-
headerIds: true,
|
192 |
-
langPrefix: 'language-',
|
193 |
-
});
|
194 |
-
|
195 |
-
// Prévisualisation
|
196 |
-
imageInput.addEventListener('change', function() {
|
197 |
-
const file = this.files[0];
|
198 |
-
if (file) {
|
199 |
-
const reader = new FileReader();
|
200 |
-
reader.onload = function(e) {
|
201 |
-
previewImage.src = e.target.result;
|
202 |
-
previewContainer.classList.remove('hidden');
|
203 |
-
}
|
204 |
-
reader.readAsDataURL(file);
|
205 |
-
} else {
|
206 |
-
previewContainer.classList.add('hidden');
|
207 |
-
}
|
208 |
-
});
|
209 |
-
|
210 |
-
// Gestion des onglets
|
211 |
-
dissertationTab.addEventListener('click', function() {
|
212 |
-
dissertationTab.classList.add('text-blue-600', 'border-b-2', 'border-blue-600');
|
213 |
-
tableauTab.classList.remove('text-blue-600', 'border-b-2', 'border-blue-600');
|
214 |
-
dissertationContent.classList.remove('hidden');
|
215 |
-
tableauContent.classList.add('hidden');
|
216 |
-
});
|
217 |
-
|
218 |
-
tableauTab.addEventListener('click', function() {
|
219 |
-
tableauTab.classList.add('text-blue-600', 'border-b-2', 'border-blue-600');
|
220 |
-
dissertationTab.classList.remove('text-blue-600', 'border-b-2', 'border-blue-600');
|
221 |
-
tableauContent.classList.remove('hidden');
|
222 |
-
dissertationContent.classList.add('hidden');
|
223 |
-
});
|
224 |
-
|
225 |
-
// Soumission du formulaire
|
226 |
-
uploadForm.addEventListener('submit', function(e) {
|
227 |
-
e.preventDefault();
|
228 |
-
loadingIndicator.classList.remove('hidden');
|
229 |
-
resultDiv.classList.add('hidden');
|
230 |
-
|
231 |
-
const formData = new FormData(uploadForm);
|
232 |
-
|
233 |
-
fetch('/analyze', {
|
234 |
-
method: 'POST',
|
235 |
-
body: formData
|
236 |
-
})
|
237 |
-
.then(response => response.json())
|
238 |
-
.then(data => {
|
239 |
-
loadingIndicator.classList.add('hidden');
|
240 |
-
if (data.error) {
|
241 |
-
throw new Error(data.error);
|
242 |
-
}
|
243 |
-
|
244 |
-
dissertationContent.innerHTML = marked.parse(data.dissertation);
|
245 |
-
// Injection du tableau dans le conteneur overflow-x-auto
|
246 |
-
tableauContent.querySelector('.overflow-x-auto').innerHTML = marked.parse(data.tableau);
|
247 |
-
|
248 |
-
resultDiv.classList.remove('hidden');
|
249 |
-
// Afficher l'onglet dissertation par défaut
|
250 |
-
dissertationTab.click();
|
251 |
-
|
252 |
-
// Scroll vers les résultats
|
253 |
-
resultDiv.scrollIntoView({ behavior: 'smooth' });
|
254 |
-
})
|
255 |
-
.catch(error => {
|
256 |
-
loadingIndicator.classList.add('hidden');
|
257 |
-
alert("Une erreur est survenue : " + error.message);
|
258 |
-
});
|
259 |
-
});
|
260 |
-
|
261 |
-
// Animation douce pour les transitions
|
262 |
-
document.querySelectorAll('.fade-enter').forEach(element => {
|
263 |
-
element.classList.add('fade-enter-active');
|
264 |
-
setTimeout(() => {
|
265 |
-
element.classList.remove('fade-enter', 'fade-enter-active');
|
266 |
-
}, 300);
|
267 |
-
});
|
268 |
-
</script>
|
269 |
-
</body>
|
270 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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