Spaces:
Running
Running
Update templates/philosophie.html
Browse files- templates/philosophie.html +50 -35
templates/philosophie.html
CHANGED
|
@@ -58,6 +58,20 @@
|
|
| 58 |
25% { transform: translateX(-5px); }
|
| 59 |
75% { transform: translateX(5px); }
|
| 60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
</style>
|
| 62 |
</head>
|
| 63 |
|
|
@@ -171,10 +185,10 @@
|
|
| 171 |
</span>
|
| 172 |
</button>
|
| 173 |
|
| 174 |
-
|
| 175 |
-
<div id="response" class="hidden mt-8
|
| 176 |
<div class="bg-gradient-to-r from-gray-50 to-white rounded-xl p-6 border border-gray-100">
|
| 177 |
-
|
| 178 |
</div>
|
| 179 |
</div>
|
| 180 |
|
|
@@ -367,8 +381,8 @@
|
|
| 367 |
Swal.close();
|
| 368 |
|
| 369 |
const htmlContent = marked.parse(data.response);
|
| 370 |
-
|
| 371 |
-
$('#response
|
| 372 |
$('#response').removeClass('hidden').addClass('animate-fadeIn');
|
| 373 |
$('#copy-btn').removeClass('hidden').addClass('animate-slideUp');
|
| 374 |
|
|
@@ -466,42 +480,43 @@
|
|
| 466 |
updateSavedDissertationsList();
|
| 467 |
|
| 468 |
// Gestion de la copie avec retour visuel amélioré
|
| 469 |
-
|
| 470 |
-
|
| 471 |
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
|
|
|
| 492 |
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
});
|
| 504 |
});
|
|
|
|
| 505 |
|
| 506 |
// Ajout des styles d'animation personnalisés
|
| 507 |
const style = document.createElement('style');
|
|
|
|
| 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 |
</span>
|
| 186 |
</button>
|
| 187 |
|
| 188 |
+
<!-- Response Section -->
|
| 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="prose prose-violet max-w-none whitespace-pre-wrap"></pre>
|
| 192 |
</div>
|
| 193 |
</div>
|
| 194 |
|
|
|
|
| 381 |
Swal.close();
|
| 382 |
|
| 383 |
const htmlContent = marked.parse(data.response);
|
| 384 |
+
// Afficher la dissertation en préservant les retours à la ligne
|
| 385 |
+
$('#response-content').html(htmlContent);
|
| 386 |
$('#response').removeClass('hidden').addClass('animate-fadeIn');
|
| 387 |
$('#copy-btn').removeClass('hidden').addClass('animate-slideUp');
|
| 388 |
|
|
|
|
| 480 |
updateSavedDissertationsList();
|
| 481 |
|
| 482 |
// Gestion de la copie avec retour visuel amélioré
|
| 483 |
+
$('#copy-btn').click(function() {
|
| 484 |
+
const response = $('#response-content').text();
|
| 485 |
|
| 486 |
+
$(this).addClass('scale-95 bg-violet-100');
|
| 487 |
+
navigator.clipboard.writeText(response)
|
| 488 |
+
.then(() => {
|
| 489 |
+
$(this).removeClass('scale-95 bg-violet-100')
|
| 490 |
+
.addClass('bg-green-50 text-green-700');
|
| 491 |
|
| 492 |
+
setTimeout(() => {
|
| 493 |
+
$(this).removeClass('bg-green-50 text-green-700');
|
| 494 |
+
}, 1000);
|
| 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((err) => {
|
| 504 |
+
console.error('Erreur lors de la copie: ', err);
|
| 505 |
+
$(this).removeClass('scale-95 bg-violet-100')
|
| 506 |
+
.addClass('bg-red-50 text-red-700');
|
| 507 |
|
| 508 |
+
setTimeout(() => {
|
| 509 |
+
$(this).removeClass('bg-red-50 text-red-700');
|
| 510 |
+
}, 1000);
|
| 511 |
|
| 512 |
+
Toast.fire({
|
| 513 |
+
icon: 'error',
|
| 514 |
+
title: 'Erreur de copie',
|
| 515 |
+
text: 'Impossible de copier le contenu',
|
| 516 |
+
timer: 3000
|
| 517 |
+
});
|
|
|
|
| 518 |
});
|
| 519 |
+
});
|
| 520 |
|
| 521 |
// Ajout des styles d'animation personnalisés
|
| 522 |
const style = document.createElement('style');
|