Spaces:
Running
Running
Update templates/philosophie.html
Browse files- templates/philosophie.html +55 -56
templates/philosophie.html
CHANGED
@@ -12,6 +12,7 @@
|
|
12 |
<link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert2/11.7.3/sweetalert2.min.css" rel="stylesheet">
|
13 |
<script src="https://cdn.tailwindcss.com"></script>
|
14 |
<style>
|
|
|
15 |
.collapsible {
|
16 |
cursor: pointer;
|
17 |
padding: 18px;
|
@@ -36,6 +37,8 @@
|
|
36 |
overflow: hidden;
|
37 |
background-color: white;
|
38 |
}
|
|
|
|
|
39 |
.animate-fadeIn {
|
40 |
animation: fadeIn 0.5s ease-out forwards;
|
41 |
}
|
@@ -58,20 +61,6 @@
|
|
58 |
25% { transform: translateX(-5px); }
|
59 |
75% { transform: translateX(5px); }
|
60 |
}
|
61 |
-
pre {
|
62 |
-
white-space: pre-wrap; /* CSS-3 */
|
63 |
-
white-space: -moz-pre-wrap; /* Mozilla */
|
64 |
-
white-space: -pre-wrap; /* Opera 4-6 */
|
65 |
-
white-space: -o-pre-wrap; /* Opera 7 */
|
66 |
-
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
67 |
-
padding: 1rem;
|
68 |
-
margin-bottom: 1rem;
|
69 |
-
border: 1px solid #ddd;
|
70 |
-
border-radius: 0.5rem;
|
71 |
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
72 |
-
font-family: 'Courier New', Courier, monospace;
|
73 |
-
font-size: 0.9rem;
|
74 |
-
}
|
75 |
</style>
|
76 |
</head>
|
77 |
|
@@ -185,19 +174,20 @@
|
|
185 |
</span>
|
186 |
</button>
|
187 |
|
188 |
-
|
189 |
<div id="response" class="hidden mt-8">
|
190 |
<div class="bg-gradient-to-r from-gray-50 to-white rounded-xl p-6 border border-gray-100">
|
191 |
-
<pre id="response-content" class="
|
192 |
</div>
|
193 |
</div>
|
194 |
|
195 |
<!-- Copy Button -->
|
196 |
<button id="copy-btn" class="hidden w-full py-3 px-6 rounded-xl bg-gray-50 text-gray-700 font-medium border border-gray-200 hover:bg-gray-100 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2">
|
197 |
<span class="flex items-center justify-center space-x-2">
|
198 |
-
|
199 |
-
|
200 |
</svg>
|
|
|
201 |
<span>Copier la dissertation</span>
|
202 |
</span>
|
203 |
</button>
|
@@ -241,8 +231,6 @@
|
|
241 |
}
|
242 |
});
|
243 |
|
244 |
-
|
245 |
-
|
246 |
// Animation des boutons
|
247 |
function addButtonAnimation(buttonId) {
|
248 |
$(`#${buttonId}`).on('mousedown', function() {
|
@@ -333,7 +321,7 @@
|
|
333 |
}
|
334 |
});
|
335 |
|
336 |
-
|
337 |
$('#submit-btn').click(function() {
|
338 |
const question = $('#question').val().trim();
|
339 |
|
@@ -381,8 +369,8 @@
|
|
381 |
Swal.close();
|
382 |
|
383 |
const htmlContent = marked.parse(data.response);
|
384 |
-
|
385 |
-
|
386 |
$('#response').removeClass('hidden').addClass('animate-fadeIn');
|
387 |
$('#copy-btn').removeClass('hidden').addClass('animate-slideUp');
|
388 |
|
@@ -480,43 +468,54 @@
|
|
480 |
updateSavedDissertationsList();
|
481 |
|
482 |
// Gestion de la copie avec retour visuel amélioré
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
.addClass('bg-red-50 text-red-700');
|
507 |
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
|
|
518 |
});
|
519 |
-
});
|
520 |
|
521 |
// Ajout des styles d'animation personnalisés
|
522 |
const style = document.createElement('style');
|
|
|
12 |
<link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert2/11.7.3/sweetalert2.min.css" rel="stylesheet">
|
13 |
<script src="https://cdn.tailwindcss.com"></script>
|
14 |
<style>
|
15 |
+
/* Style pour les sections repliables */
|
16 |
.collapsible {
|
17 |
cursor: pointer;
|
18 |
padding: 18px;
|
|
|
37 |
overflow: hidden;
|
38 |
background-color: white;
|
39 |
}
|
40 |
+
|
41 |
+
/* Styles d'animation */
|
42 |
.animate-fadeIn {
|
43 |
animation: fadeIn 0.5s ease-out forwards;
|
44 |
}
|
|
|
61 |
25% { transform: translateX(-5px); }
|
62 |
75% { transform: translateX(5px); }
|
63 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
</style>
|
65 |
</head>
|
66 |
|
|
|
174 |
</span>
|
175 |
</button>
|
176 |
|
177 |
+
<!-- Response Section -->
|
178 |
<div id="response" class="hidden mt-8">
|
179 |
<div class="bg-gradient-to-r from-gray-50 to-white rounded-xl p-6 border border-gray-100">
|
180 |
+
<pre id="response-content" class="whitespace-pre-wrap font-sans text-gray-800"></pre>
|
181 |
</div>
|
182 |
</div>
|
183 |
|
184 |
<!-- Copy Button -->
|
185 |
<button id="copy-btn" class="hidden w-full py-3 px-6 rounded-xl bg-gray-50 text-gray-700 font-medium border border-gray-200 hover:bg-gray-100 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2">
|
186 |
<span class="flex items-center justify-center space-x-2">
|
187 |
+
<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">
|
188 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
|
189 |
</svg>
|
190 |
+
|
191 |
<span>Copier la dissertation</span>
|
192 |
</span>
|
193 |
</button>
|
|
|
231 |
}
|
232 |
});
|
233 |
|
|
|
|
|
234 |
// Animation des boutons
|
235 |
function addButtonAnimation(buttonId) {
|
236 |
$(`#${buttonId}`).on('mousedown', function() {
|
|
|
321 |
}
|
322 |
});
|
323 |
|
324 |
+
// Gestion de la soumission avec conversion en Markdown et sauvegarde
|
325 |
$('#submit-btn').click(function() {
|
326 |
const question = $('#question').val().trim();
|
327 |
|
|
|
369 |
Swal.close();
|
370 |
|
371 |
const htmlContent = marked.parse(data.response);
|
372 |
+
// Afficher la dissertation en préservant les retours à la ligne
|
373 |
+
$('#response-content').html(htmlContent);
|
374 |
$('#response').removeClass('hidden').addClass('animate-fadeIn');
|
375 |
$('#copy-btn').removeClass('hidden').addClass('animate-slideUp');
|
376 |
|
|
|
468 |
updateSavedDissertationsList();
|
469 |
|
470 |
// Gestion de la copie avec retour visuel amélioré
|
471 |
+
$('#copy-btn').click(function() {
|
472 |
+
const response = $('#response-content').text();
|
473 |
+
|
474 |
+
$(this).addClass('scale-95 bg-violet-100');
|
475 |
+
navigator.clipboard.writeText(response)
|
476 |
+
.then(() => {
|
477 |
+
// Changement d'icône et de texte pour confirmer la copie
|
478 |
+
$(this).find('svg').replaceWith(`
|
479 |
+
<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">
|
480 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
|
481 |
+
</svg>
|
482 |
+
`);
|
483 |
+
$(this).find('span').text('Copié !');
|
484 |
+
|
485 |
+
// Réinitialisation du bouton après 1 seconde
|
486 |
+
setTimeout(() => {
|
487 |
+
$(this).removeClass('scale-95 bg-violet-100');
|
488 |
+
$(this).find('svg').replaceWith(`
|
489 |
+
<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">
|
490 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
|
491 |
+
</svg>
|
492 |
+
`);
|
493 |
+
$(this).find('span').text('Copier la dissertation');
|
494 |
+
}, 2000);
|
495 |
|
496 |
+
Toast.fire({
|
497 |
+
icon: 'success',
|
498 |
+
title: 'Copié avec succès',
|
499 |
+
text: 'Le contenu a été copié dans votre presse-papiers',
|
500 |
+
timer: 2000
|
501 |
+
});
|
502 |
+
})
|
503 |
+
.catch(() => {
|
504 |
+
$(this).removeClass('scale-95 bg-violet-100')
|
505 |
+
.addClass('bg-red-50 text-red-700');
|
|
|
506 |
|
507 |
+
setTimeout(() => {
|
508 |
+
$(this).removeClass('bg-red-50 text-red-700');
|
509 |
+
}, 1000);
|
510 |
|
511 |
+
Toast.fire({
|
512 |
+
icon: 'error',
|
513 |
+
title: 'Erreur de copie',
|
514 |
+
text: 'Impossible de copier le contenu',
|
515 |
+
timer: 3000
|
516 |
+
});
|
517 |
+
});
|
518 |
});
|
|
|
519 |
|
520 |
// Ajout des styles d'animation personnalisés
|
521 |
const style = document.createElement('style');
|