Spaces:
Sleeping
Sleeping
Update templates/philosophie.html
Browse files- templates/philosophie.html +147 -29
templates/philosophie.html
CHANGED
|
@@ -13,52 +13,167 @@
|
|
| 13 |
<link href="https://fonts.googleapis.com/css2?family=Kalam&family=Lato:wght@400;700&display=swap" rel="stylesheet">
|
| 14 |
|
| 15 |
<style>
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
| 25 |
-
.error { color: #c0392b; text-align: center; margin-top: 20px; font-weight: bold; }
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
.dissertation-paper {
|
| 28 |
font-family: 'Kalam', cursive;
|
| 29 |
font-size: 20px;
|
| 30 |
color: #1a2a4c;
|
| 31 |
background-color: #fdfaf4;
|
| 32 |
-
line-height:
|
| 33 |
background-image: linear-gradient(transparent 97%, #d8e2ee 98%);
|
| 34 |
-
background-size: 100%
|
| 35 |
-
border-left:
|
| 36 |
padding-left: 4em;
|
| 37 |
-
margin: 40px -
|
| 38 |
padding-top: 30px;
|
| 39 |
-
padding-bottom:
|
| 40 |
padding-right: 30px;
|
| 41 |
-webkit-print-color-adjust: exact;
|
| 42 |
print-color-adjust: exact;
|
| 43 |
-
-webkit-font-smoothing: antialiased;
|
| 44 |
-
background-clip: padding-box;
|
| 45 |
}
|
| 46 |
-
.dissertation-paper h2 { font-size: 1.5em; text-align: center; margin-bottom: 1.
|
| 47 |
-
.dissertation-paper h3 { font-size: 1.2em; margin-top:
|
| 48 |
-
.dissertation-paper .development-block { margin-top:
|
| 49 |
.dissertation-paper p { text-align: justify; margin: 0; padding: 0; }
|
| 50 |
-
.dissertation-paper .prof { text-align: center; font-style: italic; margin-bottom:
|
| 51 |
.dissertation-paper .indented { text-indent: 3em; }
|
| 52 |
-
.dissertation-paper .transition { margin-top:
|
| 53 |
-
.dissertation-paper .pdf-button-container { text-align: center; margin-top: 3.6em; }
|
| 54 |
-
.dissertation-paper .pdf-button { font-family: 'Lato', sans-serif; font-size: 16px; padding: 10px 20px; width: auto; }
|
| 55 |
.dissertation-paper, .dissertation-paper * { box-sizing: border-box; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
.avoid-page-break { page-break-inside: avoid; break-inside: avoid; }
|
| 57 |
</style>
|
| 58 |
</head>
|
| 59 |
<body>
|
| 60 |
<div id="app" class="container">
|
| 61 |
<h1>Assistant de Dissertation Philosophique</h1>
|
|
|
|
| 62 |
|
| 63 |
<form @submit.prevent="generateDissertation">
|
| 64 |
<textarea v-model="question" placeholder="Entrez votre sujet de dissertation ici..."></textarea>
|
|
@@ -71,7 +186,14 @@
|
|
| 71 |
<p v-if="errorMessage" class="error">[[ errorMessage ]]</p>
|
| 72 |
|
| 73 |
<div v-if="dissertation" id="dissertation-content" class="dissertation-paper">
|
|
|
|
| 74 |
<h2>Sujet : [[ dissertation.sujet ]]</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
<p class="prof">Prof : [[ dissertation.prof ]]</p>
|
| 76 |
|
| 77 |
<h3>Introduction</h3>
|
|
@@ -90,9 +212,6 @@
|
|
| 90 |
<h3>Conclusion</h3>
|
| 91 |
<p class="indented">[[ dissertation.conclusion ]]</p>
|
| 92 |
|
| 93 |
-
<div class="pdf-button-container" data-html2canvas-ignore="true">
|
| 94 |
-
<button class="pdf-button" @click="generatePDF">Télécharger en PDF</button>
|
| 95 |
-
</div>
|
| 96 |
</div>
|
| 97 |
</div>
|
| 98 |
|
|
@@ -128,7 +247,6 @@
|
|
| 128 |
throw new Error(data.error || "Une erreur inconnue est survenue.");
|
| 129 |
}
|
| 130 |
this.dissertation = data;
|
| 131 |
-
await new Promise(r => setTimeout(r, 50));
|
| 132 |
} catch (error) {
|
| 133 |
this.errorMessage = error.message;
|
| 134 |
} finally {
|
|
@@ -149,14 +267,14 @@
|
|
| 149 |
window.scrollTo(0, 0);
|
| 150 |
|
| 151 |
const options = {
|
| 152 |
-
margin: [
|
| 153 |
filename: 'dissertation-philosophie.pdf',
|
| 154 |
image: { type: 'jpeg', quality: 0.98 },
|
| 155 |
html2canvas: {
|
| 156 |
scale: 2,
|
| 157 |
useCORS: true,
|
| 158 |
logging: true,
|
| 159 |
-
backgroundColor:
|
| 160 |
},
|
| 161 |
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
| 162 |
};
|
|
|
|
| 13 |
<link href="https://fonts.googleapis.com/css2?family=Kalam&family=Lato:wght@400;700&display=swap" rel="stylesheet">
|
| 14 |
|
| 15 |
<style>
|
| 16 |
+
:root {
|
| 17 |
+
--primary-color: #4f46e5; /* Indigo */
|
| 18 |
+
--primary-hover: #4338ca;
|
| 19 |
+
--text-color: #374151; /* Gris foncé */
|
| 20 |
+
--background-color: #f8f9fa;
|
| 21 |
+
--container-bg: #ffffff;
|
| 22 |
+
--border-color: #e5e7eb;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
body {
|
| 26 |
+
font-family: 'Lato', sans-serif;
|
| 27 |
+
background-color: var(--background-color);
|
| 28 |
+
margin: 0;
|
| 29 |
+
padding: 2rem;
|
| 30 |
+
color: var(--text-color);
|
| 31 |
+
-webkit-font-smoothing: antialiased;
|
| 32 |
+
-moz-osx-font-smoothing: grayscale;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
.container {
|
| 36 |
+
max-width: 960px;
|
| 37 |
+
margin: 0 auto;
|
| 38 |
+
background: var(--container-bg);
|
| 39 |
+
padding: 40px;
|
| 40 |
+
border-radius: 12px;
|
| 41 |
+
box-shadow: 0 6px 20px rgba(0,0,0,0.08);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
h1 {
|
| 45 |
+
text-align: center;
|
| 46 |
+
color: #111827;
|
| 47 |
+
margin-bottom: 0.5em;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.type-indicator {
|
| 51 |
+
text-align: center;
|
| 52 |
+
color: #6b7280;
|
| 53 |
+
font-size: 1.1em;
|
| 54 |
+
margin-bottom: 2em;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
textarea {
|
| 58 |
+
width: 100%;
|
| 59 |
+
padding: 15px;
|
| 60 |
+
border-radius: 8px;
|
| 61 |
+
border: 1px solid var(--border-color);
|
| 62 |
+
min-height: 100px;
|
| 63 |
+
margin-bottom: 15px;
|
| 64 |
+
font-size: 16px;
|
| 65 |
+
line-height: 1.6;
|
| 66 |
+
transition: border-color 0.3s, box-shadow 0.3s;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
textarea:focus {
|
| 70 |
+
outline: none;
|
| 71 |
+
border-color: var(--primary-color);
|
| 72 |
+
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
button {
|
| 76 |
+
display: block;
|
| 77 |
+
width: 100%;
|
| 78 |
+
padding: 16px;
|
| 79 |
+
background-color: var(--primary-color);
|
| 80 |
+
color: white;
|
| 81 |
+
border: none;
|
| 82 |
+
border-radius: 8px;
|
| 83 |
+
font-size: 18px;
|
| 84 |
+
font-weight: 700;
|
| 85 |
+
cursor: pointer;
|
| 86 |
+
transition: background-color 0.3s, transform 0.2s;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
button:hover:not(:disabled) {
|
| 90 |
+
background-color: var(--primary-hover);
|
| 91 |
+
transform: translateY(-2px);
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
button:disabled {
|
| 95 |
+
background-color: #9ca3af;
|
| 96 |
+
cursor: not-allowed;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.loader {
|
| 100 |
+
display: block;
|
| 101 |
+
border: 8px solid #f3f3f3;
|
| 102 |
+
border-top: 8px solid var(--primary-color);
|
| 103 |
+
border-radius: 50%;
|
| 104 |
+
width: 50px;
|
| 105 |
+
height: 50px;
|
| 106 |
+
animation: spin 1s linear infinite;
|
| 107 |
+
margin: 30px auto;
|
| 108 |
+
}
|
| 109 |
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
|
|
|
| 110 |
|
| 111 |
+
.error {
|
| 112 |
+
color: #ef4444;
|
| 113 |
+
background-color: #fee2e2;
|
| 114 |
+
text-align: center;
|
| 115 |
+
margin-top: 20px;
|
| 116 |
+
padding: 15px;
|
| 117 |
+
border-radius: 8px;
|
| 118 |
+
font-weight: bold;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/* Styles de la feuille de dissertation */
|
| 122 |
.dissertation-paper {
|
| 123 |
font-family: 'Kalam', cursive;
|
| 124 |
font-size: 20px;
|
| 125 |
color: #1a2a4c;
|
| 126 |
background-color: #fdfaf4;
|
| 127 |
+
line-height: 2; /* Augmenté pour la lisibilité de Kalam */
|
| 128 |
background-image: linear-gradient(transparent 97%, #d8e2ee 98%);
|
| 129 |
+
background-size: 100% 40px; /* Adapté à la nouvelle line-height */
|
| 130 |
+
border-left: 3px solid #ffaaab;
|
| 131 |
padding-left: 4em;
|
| 132 |
+
margin: 40px -40px -40px -40px; /* Correspond au padding du container */
|
| 133 |
padding-top: 30px;
|
| 134 |
+
padding-bottom: 40px;
|
| 135 |
padding-right: 30px;
|
| 136 |
-webkit-print-color-adjust: exact;
|
| 137 |
print-color-adjust: exact;
|
|
|
|
|
|
|
| 138 |
}
|
| 139 |
+
.dissertation-paper h2 { font-size: 1.5em; text-align: center; margin-bottom: 1.5em; }
|
| 140 |
+
.dissertation-paper h3 { font-size: 1.2em; margin-top: 3em; margin-bottom: 1.5em; text-transform: uppercase; text-decoration: underline; }
|
| 141 |
+
.dissertation-paper .development-block { margin-top: 3em; }
|
| 142 |
.dissertation-paper p { text-align: justify; margin: 0; padding: 0; }
|
| 143 |
+
.dissertation-paper .prof { text-align: center; font-style: italic; margin-bottom: 2em; }
|
| 144 |
.dissertation-paper .indented { text-indent: 3em; }
|
| 145 |
+
.dissertation-paper .transition { margin-top: 2em; margin-bottom: 2em; font-style: italic; color: #4a6a9c; }
|
|
|
|
|
|
|
| 146 |
.dissertation-paper, .dissertation-paper * { box-sizing: border-box; }
|
| 147 |
+
|
| 148 |
+
.pdf-button-container {
|
| 149 |
+
display: flex;
|
| 150 |
+
justify-content: flex-end;
|
| 151 |
+
margin-bottom: 2em;
|
| 152 |
+
padding-right: 1em; /* Petit décalage pour ne pas coller au bord */
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
.pdf-button {
|
| 156 |
+
font-family: 'Lato', sans-serif;
|
| 157 |
+
font-size: 14px;
|
| 158 |
+
font-weight: 600;
|
| 159 |
+
padding: 10px 20px;
|
| 160 |
+
width: auto;
|
| 161 |
+
background-color: #e9ecef;
|
| 162 |
+
color: var(--text-color);
|
| 163 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
| 164 |
+
}
|
| 165 |
+
.pdf-button:hover:not(:disabled) {
|
| 166 |
+
background-color: #ced4da;
|
| 167 |
+
transform: translateY(-1px);
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
.avoid-page-break { page-break-inside: avoid; break-inside: avoid; }
|
| 171 |
</style>
|
| 172 |
</head>
|
| 173 |
<body>
|
| 174 |
<div id="app" class="container">
|
| 175 |
<h1>Assistant de Dissertation Philosophique</h1>
|
| 176 |
+
<p class="type-indicator">Type 1</p>
|
| 177 |
|
| 178 |
<form @submit.prevent="generateDissertation">
|
| 179 |
<textarea v-model="question" placeholder="Entrez votre sujet de dissertation ici..."></textarea>
|
|
|
|
| 186 |
<p v-if="errorMessage" class="error">[[ errorMessage ]]</p>
|
| 187 |
|
| 188 |
<div v-if="dissertation" id="dissertation-content" class="dissertation-paper">
|
| 189 |
+
|
| 190 |
<h2>Sujet : [[ dissertation.sujet ]]</h2>
|
| 191 |
+
|
| 192 |
+
<!-- Bouton PDF déplacé en haut -->
|
| 193 |
+
<div class="pdf-button-container" data-html2canvas-ignore="true">
|
| 194 |
+
<button class="pdf-button" @click="generatePDF">Télécharger en PDF</button>
|
| 195 |
+
</div>
|
| 196 |
+
|
| 197 |
<p class="prof">Prof : [[ dissertation.prof ]]</p>
|
| 198 |
|
| 199 |
<h3>Introduction</h3>
|
|
|
|
| 212 |
<h3>Conclusion</h3>
|
| 213 |
<p class="indented">[[ dissertation.conclusion ]]</p>
|
| 214 |
|
|
|
|
|
|
|
|
|
|
| 215 |
</div>
|
| 216 |
</div>
|
| 217 |
|
|
|
|
| 247 |
throw new Error(data.error || "Une erreur inconnue est survenue.");
|
| 248 |
}
|
| 249 |
this.dissertation = data;
|
|
|
|
| 250 |
} catch (error) {
|
| 251 |
this.errorMessage = error.message;
|
| 252 |
} finally {
|
|
|
|
| 267 |
window.scrollTo(0, 0);
|
| 268 |
|
| 269 |
const options = {
|
| 270 |
+
margin: [15, 15, 15, 15], // Marges augmentées pour un meilleur rendu A4
|
| 271 |
filename: 'dissertation-philosophie.pdf',
|
| 272 |
image: { type: 'jpeg', quality: 0.98 },
|
| 273 |
html2canvas: {
|
| 274 |
scale: 2,
|
| 275 |
useCORS: true,
|
| 276 |
logging: true,
|
| 277 |
+
backgroundColor: null, // Transparent pour garder le fond du papier
|
| 278 |
},
|
| 279 |
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
| 280 |
};
|