Update templates/index.html
Browse files- templates/index.html +79 -1
templates/index.html
CHANGED
|
@@ -57,7 +57,6 @@
|
|
| 57 |
transform: translateY(0px);
|
| 58 |
}
|
| 59 |
|
| 60 |
-
|
| 61 |
.container {
|
| 62 |
display: flex;
|
| 63 |
flex-direction: column;
|
|
@@ -67,6 +66,59 @@
|
|
| 67 |
border-radius: 12px;
|
| 68 |
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
| 69 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
.upload-section {
|
| 71 |
display: flex;
|
| 72 |
flex-direction: column;
|
|
@@ -225,6 +277,23 @@
|
|
| 225 |
</div>
|
| 226 |
|
| 227 |
<div class="container">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
<div id="upload-section" class="upload-section">
|
| 229 |
<div class="upload-icon">📤</div>
|
| 230 |
<p>Cliquez ou glissez-déposez une image ici</p>
|
|
@@ -265,6 +334,11 @@
|
|
| 265 |
|
| 266 |
let selectedFile = null;
|
| 267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
uploadSection.addEventListener('click', () => fileInput.click());
|
| 269 |
|
| 270 |
uploadSection.addEventListener('dragover', (e) => {
|
|
@@ -319,6 +393,9 @@
|
|
| 319 |
solveButton.addEventListener('click', () => {
|
| 320 |
if (!selectedFile) return;
|
| 321 |
|
|
|
|
|
|
|
|
|
|
| 322 |
solveButton.disabled = true;
|
| 323 |
solveButton.textContent = '⏳ Traitement...';
|
| 324 |
solvingContainer.style.display = 'block';
|
|
@@ -330,6 +407,7 @@
|
|
| 330 |
|
| 331 |
const formData = new FormData();
|
| 332 |
formData.append('image', selectedFile);
|
|
|
|
| 333 |
|
| 334 |
fetch('/solve', {
|
| 335 |
method: 'POST',
|
|
|
|
| 57 |
transform: translateY(0px);
|
| 58 |
}
|
| 59 |
|
|
|
|
| 60 |
.container {
|
| 61 |
display: flex;
|
| 62 |
flex-direction: column;
|
|
|
|
| 66 |
border-radius: 12px;
|
| 67 |
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
| 68 |
}
|
| 69 |
+
|
| 70 |
+
.style-selection {
|
| 71 |
+
background-color: #f9f9f9;
|
| 72 |
+
padding: 20px;
|
| 73 |
+
border-radius: 10px;
|
| 74 |
+
border: 1px solid #e0e0e0;
|
| 75 |
+
margin-bottom: 15px;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.style-selection h3 {
|
| 79 |
+
margin: 0 0 15px 0;
|
| 80 |
+
color: #2c3e50;
|
| 81 |
+
font-size: 1.2em;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.radio-group {
|
| 85 |
+
display: flex;
|
| 86 |
+
flex-direction: column;
|
| 87 |
+
gap: 12px;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
.radio-option {
|
| 91 |
+
display: flex;
|
| 92 |
+
align-items: center;
|
| 93 |
+
gap: 10px;
|
| 94 |
+
padding: 10px;
|
| 95 |
+
border-radius: 6px;
|
| 96 |
+
transition: background-color 0.2s;
|
| 97 |
+
cursor: pointer;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
.radio-option:hover {
|
| 101 |
+
background-color: #f0f4f8;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.radio-option input[type="radio"] {
|
| 105 |
+
width: 18px;
|
| 106 |
+
height: 18px;
|
| 107 |
+
accent-color: #3498db;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
.radio-option label {
|
| 111 |
+
cursor: pointer;
|
| 112 |
+
font-weight: 500;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.radio-description {
|
| 116 |
+
font-size: 0.9em;
|
| 117 |
+
color: #666;
|
| 118 |
+
margin-left: 28px;
|
| 119 |
+
margin-top: -8px;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
.upload-section {
|
| 123 |
display: flex;
|
| 124 |
flex-direction: column;
|
|
|
|
| 277 |
</div>
|
| 278 |
|
| 279 |
<div class="container">
|
| 280 |
+
<div class="style-selection">
|
| 281 |
+
<h3>🎨 Choisissez le style de résolution</h3>
|
| 282 |
+
<div class="radio-group">
|
| 283 |
+
<div class="radio-option" onclick="selectStyle('light')">
|
| 284 |
+
<input type="radio" id="style-light" name="resolution-style" value="light">
|
| 285 |
+
<label for="style-light">📝 Résolution Light</label>
|
| 286 |
+
</div>
|
| 287 |
+
<div class="radio-description">Format simple et épuré, idéal pour une lecture rapide</div>
|
| 288 |
+
|
| 289 |
+
<div class="radio-option" onclick="selectStyle('colorful')">
|
| 290 |
+
<input type="radio" id="style-colorful" name="resolution-style" value="colorful" checked>
|
| 291 |
+
<label for="style-colorful">🌈 Résolution Colorée</label>
|
| 292 |
+
</div>
|
| 293 |
+
<div class="radio-description">Format richement formaté avec couleurs, boîtes et mise en page élégante</div>
|
| 294 |
+
</div>
|
| 295 |
+
</div>
|
| 296 |
+
|
| 297 |
<div id="upload-section" class="upload-section">
|
| 298 |
<div class="upload-icon">📤</div>
|
| 299 |
<p>Cliquez ou glissez-déposez une image ici</p>
|
|
|
|
| 334 |
|
| 335 |
let selectedFile = null;
|
| 336 |
|
| 337 |
+
// Fonction pour sélectionner le style de résolution
|
| 338 |
+
window.selectStyle = function(style) {
|
| 339 |
+
document.getElementById(`style-${style}`).checked = true;
|
| 340 |
+
};
|
| 341 |
+
|
| 342 |
uploadSection.addEventListener('click', () => fileInput.click());
|
| 343 |
|
| 344 |
uploadSection.addEventListener('dragover', (e) => {
|
|
|
|
| 393 |
solveButton.addEventListener('click', () => {
|
| 394 |
if (!selectedFile) return;
|
| 395 |
|
| 396 |
+
// Récupérer le style sélectionné
|
| 397 |
+
const selectedStyle = document.querySelector('input[name="resolution-style"]:checked').value;
|
| 398 |
+
|
| 399 |
solveButton.disabled = true;
|
| 400 |
solveButton.textContent = '⏳ Traitement...';
|
| 401 |
solvingContainer.style.display = 'block';
|
|
|
|
| 407 |
|
| 408 |
const formData = new FormData();
|
| 409 |
formData.append('image', selectedFile);
|
| 410 |
+
formData.append('style', selectedStyle); // Ajouter le style sélectionné
|
| 411 |
|
| 412 |
fetch('/solve', {
|
| 413 |
method: 'POST',
|