Update templates/index.html
Browse files- templates/index.html +113 -219
templates/index.html
CHANGED
@@ -3,266 +3,160 @@
|
|
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 |
-
|
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 |
-
|
13 |
-
font-family: '
|
14 |
-
|
15 |
-
margin-bottom: 1em;
|
16 |
-
line-height: 1.3;
|
17 |
}
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
line-height: 1.8;
|
22 |
}
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
28 |
}
|
29 |
-
|
30 |
-
|
31 |
-
|
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 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
-
|
69 |
-
|
70 |
-
|
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-
|
86 |
-
|
|
|
|
|
87 |
<!-- En-tête -->
|
88 |
-
<header class="text-center mb-12">
|
89 |
-
<h1 class="
|
90 |
-
<p class="text-
|
91 |
</header>
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
<form id="uploadForm" class="space-y-6">
|
96 |
-
|
97 |
-
|
98 |
-
|
|
|
|
|
99 |
</label>
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
113 |
</div>
|
114 |
</div>
|
115 |
|
116 |
-
<!-- Champ Consignes optionnel -->
|
117 |
-
<div
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
|
|
122 |
</div>
|
123 |
|
124 |
-
<!--
|
125 |
-
<div
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
</div>
|
131 |
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
134 |
</button>
|
135 |
</form>
|
136 |
|
137 |
-
|
138 |
-
<div id="loading" class="hidden">
|
139 |
-
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
140 |
-
<div class="bg-white p-6 rounded-lg shadow-xl text-center">
|
141 |
-
<div class="spinner mx-auto mb-4"></div>
|
142 |
-
<p class="text-gray-700 font-medium">Analyse en cours...</p>
|
143 |
-
</div>
|
144 |
</div>
|
145 |
-
</div>
|
146 |
|
147 |
-
<!-- Résultats -->
|
148 |
-
<div id="result" class="hidden
|
149 |
-
<!--
|
150 |
-
|
151 |
-
<button id="dissertationTab" class="px-4 py-2 text-sm font-medium text-blue-600 border-b-2 border-blue-600">
|
152 |
-
Dissertation
|
153 |
-
</button>
|
154 |
-
<button id="tableauTab" class="px-4 py-2 text-sm font-medium text-gray-500 hover:text-gray-700">
|
155 |
-
Tableau d'analyse
|
156 |
-
</button>
|
157 |
-
</div>
|
158 |
|
159 |
-
|
160 |
-
<div id="dissertationContent" class="custom-prose prose prose-lg max-w-none">
|
161 |
-
</div>
|
162 |
|
163 |
-
|
164 |
-
<
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
</div>
|
169 |
-
</div>
|
170 |
-
</div>
|
171 |
-
</div>
|
172 |
|
173 |
<script>
|
|
|
|
|
|
|
|
|
174 |
const uploadForm = document.getElementById('uploadForm');
|
175 |
const imageInput = document.getElementById('imageInput');
|
176 |
-
const
|
177 |
-
const
|
178 |
-
const
|
179 |
-
const resultDiv = document.getElementById('result');
|
180 |
-
const dissertationTab = document.getElementById('dissertationTab');
|
181 |
-
const tableauTab = document.getElementById('tableauTab');
|
182 |
-
const dissertationContent = document.getElementById('dissertationContent');
|
183 |
-
const tableauContent = document.getElementById('tableauContent');
|
184 |
-
|
185 |
-
// Configuration de marked pour le rendu Markdown
|
186 |
-
marked.setOptions({
|
187 |
-
breaks: true,
|
188 |
-
gfm: true,
|
189 |
-
headerIds: true,
|
190 |
-
langPrefix: 'language-',
|
191 |
-
});
|
192 |
-
|
193 |
-
// Prévisualisation
|
194 |
-
imageInput.addEventListener('change', function() {
|
195 |
-
const file = this.files[0];
|
196 |
-
if (file) {
|
197 |
-
const reader = new FileReader();
|
198 |
-
reader.onload = function(e) {
|
199 |
-
previewImage.src = e.target.result;
|
200 |
-
previewContainer.classList.remove('hidden');
|
201 |
-
}
|
202 |
-
reader.readAsDataURL(file);
|
203 |
-
} else {
|
204 |
-
previewContainer.classList.add('hidden');
|
205 |
-
}
|
206 |
-
});
|
207 |
|
208 |
-
//
|
209 |
-
|
210 |
-
dissertationTab.classList.add('text-blue-600', 'border-b-2', 'border-blue-600');
|
211 |
-
tableauTab.classList.remove('text-blue-600', 'border-b-2', 'border-blue-600');
|
212 |
-
dissertationContent.classList.remove('hidden');
|
213 |
-
tableauContent.classList.add('hidden');
|
214 |
-
});
|
215 |
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
});
|
222 |
|
223 |
-
|
224 |
-
uploadForm.addEventListener('submit', function(e) {
|
225 |
-
e.preventDefault();
|
226 |
-
loadingIndicator.classList.remove('hidden');
|
227 |
-
resultDiv.classList.add('hidden');
|
228 |
-
|
229 |
-
const formData = new FormData(uploadForm);
|
230 |
|
231 |
-
fetch('/analyze', {
|
232 |
-
method: 'POST',
|
233 |
-
body: formData
|
234 |
-
})
|
235 |
-
.then(response => response.json())
|
236 |
-
.then(data => {
|
237 |
-
loadingIndicator.classList.add('hidden');
|
238 |
-
if (data.error) {
|
239 |
-
throw new Error(data.error);
|
240 |
-
}
|
241 |
-
|
242 |
-
dissertationContent.innerHTML = marked.parse(data.dissertation);
|
243 |
-
// Injection du tableau dans le conteneur overflow-x-auto
|
244 |
-
tableauContent.querySelector('.overflow-x-auto').innerHTML = marked.parse(data.tableau);
|
245 |
-
|
246 |
-
resultDiv.classList.remove('hidden');
|
247 |
-
// Afficher l'onglet dissertation par défaut
|
248 |
-
dissertationTab.click();
|
249 |
-
|
250 |
-
// Scroll vers les résultats
|
251 |
-
resultDiv.scrollIntoView({ behavior: 'smooth' });
|
252 |
-
})
|
253 |
-
.catch(error => {
|
254 |
-
loadingIndicator.classList.add('hidden');
|
255 |
-
alert("Une erreur est survenue : " + error.message);
|
256 |
-
});
|
257 |
-
});
|
258 |
-
|
259 |
-
// Animation douce pour les transitions
|
260 |
-
document.querySelectorAll('.fade-enter').forEach(element => {
|
261 |
-
element.classList.add('fade-enter-active');
|
262 |
-
setTimeout(() => {
|
263 |
-
element.classList.remove('fade-enter', 'fade-enter-active');
|
264 |
-
}, 300);
|
265 |
-
});
|
266 |
</script>
|
|
|
267 |
</body>
|
268 |
-
</html>
|
|
|
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 (Bientôt !)</title>
|
7 |
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<!-- Pas besoin de Marked.js car rien ne sera rendu -->
|
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 |
+
body {
|
13 |
+
font-family: 'Inter', sans-serif;
|
14 |
+
-webkit-tap-highlight-color: transparent;
|
|
|
|
|
15 |
}
|
16 |
|
17 |
+
h1, h2, h3, h4, h5, h6 {
|
18 |
+
font-family: 'Playfair Display', serif;
|
|
|
19 |
}
|
20 |
|
21 |
+
/* Styles pour désactiver visuellement la zone de drop */
|
22 |
+
.disabled-drop-zone {
|
23 |
+
cursor: not-allowed;
|
24 |
+
opacity: 0.6;
|
25 |
+
/* Suppression des effets de hover */
|
26 |
+
/* Tailwind: remove hover:border-blue-500 */
|
27 |
}
|
28 |
+
.disabled-drop-zone .text-blue-600 {
|
29 |
+
color: #6b7280; /* gray-500 */
|
30 |
+
/* Suppression du hover sur le texte */
|
31 |
+
/* Tailwind: remove hover:text-blue-700 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
34 |
+
/* Styles pour le message "Coming Soon" */
|
35 |
+
.coming-soon-banner {
|
36 |
+
display: flex;
|
37 |
+
align-items: center;
|
38 |
+
gap: 0.75rem; /* space-x-3 */
|
39 |
+
background-color: #fef3c7; /* yellow-100 */
|
40 |
+
color: #92400e; /* yellow-800 */
|
41 |
+
padding: 0.75rem 1rem; /* p-3 sm:p-4 */
|
42 |
+
border-radius: 0.5rem; /* rounded-lg */
|
43 |
+
border: 1px solid #fde68a; /* yellow-200 */
|
44 |
+
font-size: 0.875rem; /* text-sm */
|
45 |
+
font-weight: 500; /* font-medium */
|
46 |
+
text-align: center;
|
47 |
+
justify-content: center;
|
48 |
}
|
49 |
+
@media (min-width: 640px) {
|
50 |
+
.coming-soon-banner {
|
51 |
+
font-size: 1rem; /* text-base */
|
52 |
+
}
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
55 |
</style>
|
56 |
</head>
|
57 |
+
<body class="bg-gradient-to-br from-gray-50 to-blue-50 min-h-screen text-gray-800">
|
58 |
+
|
59 |
+
<div class="max-w-3xl mx-auto px-4 py-6 sm:px-6 sm:py-8">
|
60 |
+
|
61 |
<!-- En-tête -->
|
62 |
+
<header class="text-center mb-8 sm:mb-12">
|
63 |
+
<h1 class="text-4xl sm:text-5xl font-bold text-gray-900 mb-2">Mariam AI</h1>
|
64 |
+
<p class="text-base sm:text-lg text-gray-600">Votre Assistant d'Analyse Littéraire</p>
|
65 |
</header>
|
66 |
|
67 |
+
<!-- Carte Principale -->
|
68 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
|
69 |
+
<form id="uploadForm" class="p-5 sm:p-8 space-y-5 sm:space-y-6">
|
70 |
+
|
71 |
+
<!-- Zone de téléchargement (Désactivée) -->
|
72 |
+
<div>
|
73 |
+
<label for="imageInput" class="block text-base sm:text-lg font-semibold text-gray-800 mb-3 opacity-60">
|
74 |
+
1. Choisissez votre document
|
75 |
</label>
|
76 |
+
<!-- Ajout de classes pour désactivation visuelle -->
|
77 |
+
<div id="dropZone" class="disabled-drop-zone mt-2 flex flex-col items-center justify-center px-4 py-8 sm:px-6 sm:py-10 border-2 border-gray-300 border-dashed rounded-lg bg-gray-50">
|
78 |
+
<div class="text-center">
|
79 |
+
<svg class="mx-auto h-10 w-10 text-gray-400 mb-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
80 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.33-2.33 4.5 4.5 0 013.75 8.775h-1.5M6.75 19.5h10.5" />
|
81 |
+
</svg>
|
82 |
+
<div class="text-sm sm:text-base text-gray-600">
|
83 |
+
<span class="font-medium text-blue-600">Cliquez pour choisir</span> ou glissez-déposez
|
84 |
+
</div>
|
85 |
+
<p class="text-xs sm:text-sm text-gray-500 mt-1">PNG, JPG, PDF (max 10MB)</p>
|
86 |
+
<!-- Input désactivé -->
|
87 |
+
<input id="imageInput" name="image" type="file" class="sr-only" accept="image/*,application/pdf" disabled>
|
88 |
+
</div>
|
89 |
+
<!-- Le nom du fichier ne s'affichera pas -->
|
90 |
+
<div id="fileName" class="mt-3 text-sm font-medium text-gray-700 hidden"></div>
|
91 |
</div>
|
92 |
</div>
|
93 |
|
94 |
+
<!-- Champ Consignes optionnel (Désactivé) -->
|
95 |
+
<div>
|
96 |
+
<label for="consignesInput" class="block text-base sm:text-lg font-semibold text-gray-800 mb-3 opacity-60">
|
97 |
+
2. Consignes <span class="text-sm font-normal text-gray-500">(optionnel)</span>
|
98 |
+
</label>
|
99 |
+
<!-- Textarea désactivée -->
|
100 |
+
<textarea id="consignesInput" name="consignes" rows="3" class="w-full border border-gray-300 rounded-md p-3 text-sm placeholder-gray-400 transition duration-150 ease-in-out bg-gray-100 cursor-not-allowed" placeholder="Ex: Analyser les thèmes principaux..." disabled></textarea>
|
101 |
</div>
|
102 |
|
103 |
+
<!-- Message "Coming Soon" -->
|
104 |
+
<div class="coming-soon-banner" role="alert">
|
105 |
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 sm:w-6 sm:h-6">
|
106 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" />
|
107 |
+
</svg>
|
108 |
+
<span>Cette fonctionnalité sera bientôt disponible !</span>
|
109 |
</div>
|
110 |
|
111 |
+
<!-- Bouton (Désactivé) -->
|
112 |
+
<button type="submit" class="w-full bg-gray-400 text-white rounded-lg px-4 py-3 text-base font-semibold focus:outline-none cursor-not-allowed shadow-md flex items-center justify-center space-x-2" disabled>
|
113 |
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-5 h-5">
|
114 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423L16.5 15.75l.394 1.183a2.25 2.25 0 001.423 1.423L19.5 18.75l-1.183.394a2.25 2.25 0 00-1.423 1.423z" />
|
115 |
+
</svg>
|
116 |
+
<span>Lancer l'analyse</span>
|
117 |
</button>
|
118 |
</form>
|
119 |
|
120 |
+
<!-- Indicateur de chargement (Inutile ici, gardé caché) -->
|
121 |
+
<div id="loading" class="hidden fixed inset-0 bg-black bg-opacity-60 flex items-center justify-center z-50 p-4">
|
|
|
|
|
|
|
|
|
|
|
122 |
</div>
|
|
|
123 |
|
124 |
+
<!-- Résultats (Section entière cachée et jamais affichée) -->
|
125 |
+
<div id="result" class="hidden border-t border-gray-200">
|
126 |
+
<!-- Contenu des résultats (ne sera jamais rempli) -->
|
127 |
+
</div> <!-- Fin #result -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
+
</div> <!-- Fin Carte Principale -->
|
|
|
|
|
130 |
|
131 |
+
<footer class="text-center mt-8 mb-4">
|
132 |
+
<p class="text-xs text-gray-500">© 2024 Mariam AI - Tous droits réservés.</p>
|
133 |
+
</footer>
|
134 |
+
|
135 |
+
</div> <!-- Fin Container Principal -->
|
|
|
|
|
|
|
|
|
136 |
|
137 |
<script>
|
138 |
+
// Pas de JavaScript interactif nécessaire pour une page "Coming Soon"
|
139 |
+
// On pourrait laisser le script vide ou commenter l'ancien code.
|
140 |
+
|
141 |
+
/*
|
142 |
const uploadForm = document.getElementById('uploadForm');
|
143 |
const imageInput = document.getElementById('imageInput');
|
144 |
+
const dropZone = document.getElementById('dropZone');
|
145 |
+
const fileNameDisplay = document.getElementById('fileName');
|
146 |
+
// ... autres const si elles étaient utilisées pour des éléments toujours présents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
+
// TOUT LE CODE DE GESTION D'UPLOAD, DE PREVIEW, D'ONGLETS ET DE SUBMIT EST SUPPRIMÉ OU COMMENTÉ
|
149 |
+
// car la fonctionnalité n'est pas active.
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
+
// uploadForm.addEventListener('submit', function(e) {
|
152 |
+
// e.preventDefault();
|
153 |
+
// // Ne rien faire
|
154 |
+
// });
|
155 |
+
*/
|
|
|
156 |
|
157 |
+
console.log("Page Mariam AI - Fonctionnalité en cours de développement.");
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
</script>
|
160 |
+
|
161 |
</body>
|
162 |
+
</html>
|