Spaces:
Sleeping
Sleeping
Update templates/philosophie.html (#2)
Browse files- Update templates/philosophie.html (08980db378ceed4183f2bf6d077cb729a776fc40)
- templates/philosophie.html +15 -29
templates/philosophie.html
CHANGED
|
@@ -12,7 +12,6 @@
|
|
| 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,8 +36,6 @@
|
|
| 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 |
}
|
|
@@ -175,19 +172,18 @@
|
|
| 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 |
-
|
| 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 |
-
|
| 188 |
-
|
| 189 |
</svg>
|
| 190 |
-
|
| 191 |
<span>Copier la dissertation</span>
|
| 192 |
</span>
|
| 193 |
</button>
|
|
@@ -231,6 +227,8 @@
|
|
| 231 |
}
|
| 232 |
});
|
| 233 |
|
|
|
|
|
|
|
| 234 |
// Animation des boutons
|
| 235 |
function addButtonAnimation(buttonId) {
|
| 236 |
$(`#${buttonId}`).on('mousedown', function() {
|
|
@@ -321,7 +319,7 @@
|
|
| 321 |
}
|
| 322 |
});
|
| 323 |
|
| 324 |
-
|
| 325 |
$('#submit-btn').click(function() {
|
| 326 |
const question = $('#question').val().trim();
|
| 327 |
|
|
@@ -369,8 +367,8 @@
|
|
| 369 |
Swal.close();
|
| 370 |
|
| 371 |
const htmlContent = marked.parse(data.response);
|
| 372 |
-
// Afficher la dissertation
|
| 373 |
-
|
| 374 |
$('#response').removeClass('hidden').addClass('animate-fadeIn');
|
| 375 |
$('#copy-btn').removeClass('hidden').addClass('animate-slideUp');
|
| 376 |
|
|
@@ -469,29 +467,17 @@
|
|
| 469 |
|
| 470 |
// Gestion de la copie avec retour visuel amélioré
|
| 471 |
$('#copy-btn').click(function() {
|
| 472 |
-
const response = $('#response
|
| 473 |
|
| 474 |
$(this).addClass('scale-95 bg-violet-100');
|
| 475 |
navigator.clipboard.writeText(response)
|
| 476 |
.then(() => {
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 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('
|
| 488 |
-
|
| 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',
|
|
|
|
| 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 |
overflow: hidden;
|
| 37 |
background-color: white;
|
| 38 |
}
|
|
|
|
|
|
|
| 39 |
.animate-fadeIn {
|
| 40 |
animation: fadeIn 0.5s ease-out forwards;
|
| 41 |
}
|
|
|
|
| 172 |
</button>
|
| 173 |
|
| 174 |
<!-- Response Section -->
|
| 175 |
+
<div id="response" class="hidden mt-8 prose prose-violet max-w-none">
|
| 176 |
<div class="bg-gradient-to-r from-gray-50 to-white rounded-xl p-6 border border-gray-100">
|
| 177 |
+
<!-- La réponse sera insérée ici -->
|
| 178 |
</div>
|
| 179 |
</div>
|
| 180 |
|
| 181 |
<!-- Copy Button -->
|
| 182 |
<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">
|
| 183 |
<span class="flex items-center justify-center space-x-2">
|
| 184 |
+
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| 185 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
|
| 186 |
</svg>
|
|
|
|
| 187 |
<span>Copier la dissertation</span>
|
| 188 |
</span>
|
| 189 |
</button>
|
|
|
|
| 227 |
}
|
| 228 |
});
|
| 229 |
|
| 230 |
+
|
| 231 |
+
|
| 232 |
// Animation des boutons
|
| 233 |
function addButtonAnimation(buttonId) {
|
| 234 |
$(`#${buttonId}`).on('mousedown', function() {
|
|
|
|
| 319 |
}
|
| 320 |
});
|
| 321 |
|
| 322 |
+
// Gestion de la soumission avec conversion en Markdown et sauvegarde
|
| 323 |
$('#submit-btn').click(function() {
|
| 324 |
const question = $('#question').val().trim();
|
| 325 |
|
|
|
|
| 367 |
Swal.close();
|
| 368 |
|
| 369 |
const htmlContent = marked.parse(data.response);
|
| 370 |
+
// Afficher la dissertation
|
| 371 |
+
$('#response > div').html(htmlContent);
|
| 372 |
$('#response').removeClass('hidden').addClass('animate-fadeIn');
|
| 373 |
$('#copy-btn').removeClass('hidden').addClass('animate-slideUp');
|
| 374 |
|
|
|
|
| 467 |
|
| 468 |
// Gestion de la copie avec retour visuel amélioré
|
| 469 |
$('#copy-btn').click(function() {
|
| 470 |
+
const response = $('#response').text();
|
| 471 |
|
| 472 |
$(this).addClass('scale-95 bg-violet-100');
|
| 473 |
navigator.clipboard.writeText(response)
|
| 474 |
.then(() => {
|
| 475 |
+
$(this).removeClass('scale-95 bg-violet-100')
|
| 476 |
+
.addClass('bg-green-50 text-green-700');
|
| 477 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 478 |
setTimeout(() => {
|
| 479 |
+
$(this).removeClass('bg-green-50 text-green-700');
|
| 480 |
+
}, 1000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 481 |
|
| 482 |
Toast.fire({
|
| 483 |
icon: 'success',
|