Spaces:
Running
Running
Update templates/index.html
Browse files- templates/index.html +125 -51
templates/index.html
CHANGED
@@ -3,85 +3,134 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Mariam M-0 |
|
7 |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
|
8 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS_HTML"></script>
|
9 |
<style>
|
10 |
-
@
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
.loader {
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
-
|
|
|
20 |
0% { transform: rotate(0deg); }
|
21 |
100% { transform: rotate(360deg); }
|
22 |
}
|
|
|
23 |
.thought-box {
|
24 |
-
transition:
|
25 |
max-height: 0;
|
26 |
overflow: hidden;
|
27 |
}
|
|
|
28 |
.thought-box.open {
|
29 |
-
max-height:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
</style>
|
32 |
</head>
|
33 |
-
<body class="
|
34 |
-
<div class="container mx-auto max-w-
|
35 |
-
<div class="
|
36 |
-
<div class="
|
37 |
-
<h1 class="text-
|
38 |
-
|
39 |
-
</h1>
|
40 |
</div>
|
41 |
|
42 |
-
<form id="problemForm" class="space-y-
|
43 |
<div class="relative">
|
44 |
-
<div class="
|
45 |
<input type="file" id="imageInput" accept="image/*" class="absolute inset-0 w-full h-full opacity-0 cursor-pointer">
|
46 |
-
<div class="space-y-
|
47 |
-
<
|
48 |
-
<
|
49 |
-
|
50 |
-
|
51 |
-
Glissez une image ou cliquez pour sélectionner
|
52 |
</div>
|
|
|
|
|
53 |
</div>
|
54 |
</div>
|
55 |
</div>
|
56 |
|
57 |
-
<button type="submit" class="w-full
|
58 |
-
Résoudre
|
59 |
</button>
|
60 |
</form>
|
61 |
|
62 |
-
<div id="loader" class="hidden mt-
|
63 |
-
<div class="flex justify-center
|
64 |
-
<
|
|
|
65 |
</div>
|
66 |
-
<div class="text-center mt-4 text-gray-600">Analyse en cours...</div>
|
67 |
</div>
|
68 |
|
69 |
-
<div id="solution" class="mt-
|
70 |
-
<div class="
|
71 |
-
<button id="thoughtsToggle" class="w-full flex justify-between items-center text-left font-
|
72 |
-
<span>Processus de
|
73 |
-
<svg class="w-
|
74 |
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
|
75 |
</svg>
|
76 |
</button>
|
77 |
<div id="thoughtsBox" class="thought-box mt-4">
|
78 |
-
<div id="thoughtsContent" class="prose max-w-none"></div>
|
79 |
</div>
|
80 |
</div>
|
81 |
|
82 |
-
<div class="
|
83 |
-
<h3 class="font-bold text-
|
84 |
-
<div id="answerContent" class="prose max-w-none"></div>
|
85 |
</div>
|
86 |
</div>
|
87 |
</div>
|
@@ -98,12 +147,47 @@
|
|
98 |
const thoughtsToggle = document.getElementById('thoughtsToggle');
|
99 |
const thoughtsBox = document.getElementById('thoughtsBox');
|
100 |
|
101 |
-
// Toggle thoughts
|
102 |
thoughtsToggle.addEventListener('click', () => {
|
103 |
thoughtsBox.classList.toggle('open');
|
104 |
thoughtsToggle.querySelector('svg').classList.toggle('rotate-180');
|
105 |
});
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
form.addEventListener('submit', async (event) => {
|
108 |
event.preventDefault();
|
109 |
const file = imageInput.files[0];
|
@@ -112,7 +196,6 @@
|
|
112 |
return;
|
113 |
}
|
114 |
|
115 |
-
// Show loader
|
116 |
loader.classList.remove('hidden');
|
117 |
solution.classList.add('hidden');
|
118 |
|
@@ -130,7 +213,6 @@
|
|
130 |
thoughtsContent.innerHTML = data.thoughts;
|
131 |
answerContent.innerHTML = data.answer;
|
132 |
|
133 |
-
// Refresh MathJax
|
134 |
if (window.MathJax) {
|
135 |
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
|
136 |
}
|
@@ -146,14 +228,6 @@
|
|
146 |
loader.classList.add('hidden');
|
147 |
}
|
148 |
});
|
149 |
-
|
150 |
-
// File input visualization
|
151 |
-
imageInput.addEventListener('change', function() {
|
152 |
-
const fileName = this.files[0]?.name;
|
153 |
-
if (fileName) {
|
154 |
-
this.parentElement.querySelector('.text-gray-600').textContent = fileName;
|
155 |
-
}
|
156 |
-
});
|
157 |
});
|
158 |
</script>
|
159 |
</body>
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Mariam M-0 | Solution Mathématique</title>
|
7 |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
|
8 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS_HTML"></script>
|
9 |
<style>
|
10 |
+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
|
11 |
+
|
12 |
+
body {
|
13 |
+
font-family: 'Space Grotesk', sans-serif;
|
14 |
+
background: linear-gradient(125deg, #000428 0%, #004e92 100%);
|
15 |
+
min-height: 100vh;
|
16 |
+
}
|
17 |
+
|
18 |
+
.glass-card {
|
19 |
+
background: rgba(255, 255, 255, 0.05);
|
20 |
+
backdrop-filter: blur(10px);
|
21 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
22 |
+
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
|
23 |
+
}
|
24 |
+
|
25 |
+
.uploadArea {
|
26 |
+
background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
|
27 |
+
border: 2px dashed rgba(255, 255, 255, 0.2);
|
28 |
}
|
29 |
+
|
30 |
+
.uploadArea:hover {
|
31 |
+
border-color: #60A5FA;
|
32 |
+
transform: translateY(-2px);
|
33 |
+
}
|
34 |
+
|
35 |
+
.neon-button {
|
36 |
+
background: linear-gradient(90deg, #4F46E5 0%, #60A5FA 100%);
|
37 |
+
box-shadow: 0 0 15px rgba(79, 70, 229, 0.5);
|
38 |
+
transition: all 0.3s ease;
|
39 |
+
}
|
40 |
+
|
41 |
+
.neon-button:hover {
|
42 |
+
box-shadow: 0 0 25px rgba(79, 70, 229, 0.7);
|
43 |
+
transform: translateY(-2px);
|
44 |
+
}
|
45 |
+
|
46 |
.loader {
|
47 |
+
width: 48px;
|
48 |
+
height: 48px;
|
49 |
+
border: 3px solid #FFF;
|
50 |
+
border-bottom-color: transparent;
|
51 |
+
border-radius: 50%;
|
52 |
+
display: inline-block;
|
53 |
+
box-sizing: border-box;
|
54 |
+
animation: rotation 1s linear infinite;
|
55 |
}
|
56 |
+
|
57 |
+
@keyframes rotation {
|
58 |
0% { transform: rotate(0deg); }
|
59 |
100% { transform: rotate(360deg); }
|
60 |
}
|
61 |
+
|
62 |
.thought-box {
|
63 |
+
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
|
64 |
max-height: 0;
|
65 |
overflow: hidden;
|
66 |
}
|
67 |
+
|
68 |
.thought-box.open {
|
69 |
+
max-height: 1000px;
|
70 |
+
}
|
71 |
+
|
72 |
+
.glow {
|
73 |
+
animation: glow 2s ease-in-out infinite alternate;
|
74 |
+
}
|
75 |
+
|
76 |
+
@keyframes glow {
|
77 |
+
from { text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #60A5FA; }
|
78 |
+
to { text-shadow: 0 0 20px #fff, 0 0 30px #4F46E5, 0 0 40px #4F46E5; }
|
79 |
}
|
80 |
</style>
|
81 |
</head>
|
82 |
+
<body class="p-4 md:p-8">
|
83 |
+
<div class="container mx-auto max-w-4xl">
|
84 |
+
<div class="glass-card rounded-3xl p-8 md:p-12">
|
85 |
+
<div class="text-center mb-12">
|
86 |
+
<h1 class="text-5xl font-bold text-white glow mb-4">Mariam M-0</h1>
|
87 |
+
<p class="text-blue-200 text-lg">Solution Mathématique Intelligente</p>
|
|
|
88 |
</div>
|
89 |
|
90 |
+
<form id="problemForm" class="space-y-8">
|
91 |
<div class="relative">
|
92 |
+
<div class="uploadArea rounded-2xl p-12 text-center transition-all duration-300 cursor-pointer">
|
93 |
<input type="file" id="imageInput" accept="image/*" class="absolute inset-0 w-full h-full opacity-0 cursor-pointer">
|
94 |
+
<div class="space-y-4">
|
95 |
+
<div class="w-20 h-20 mx-auto border-2 border-blue-400 rounded-full flex items-center justify-center">
|
96 |
+
<svg class="w-10 h-10 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
97 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
98 |
+
</svg>
|
|
|
99 |
</div>
|
100 |
+
<div class="text-blue-200 text-lg font-medium">Déposez votre image ici</div>
|
101 |
+
<div class="text-blue-300/60 text-sm">ou cliquez pour sélectionner</div>
|
102 |
</div>
|
103 |
</div>
|
104 |
</div>
|
105 |
|
106 |
+
<button type="submit" class="neon-button w-full py-4 rounded-xl text-white font-medium text-lg transition-all duration-300">
|
107 |
+
Résoudre le problème
|
108 |
</button>
|
109 |
</form>
|
110 |
|
111 |
+
<div id="loader" class="hidden mt-12">
|
112 |
+
<div class="flex flex-col items-center justify-center space-y-4">
|
113 |
+
<span class="loader"></span>
|
114 |
+
<div class="text-blue-200 text-lg">Analyse en cours...</div>
|
115 |
</div>
|
|
|
116 |
</div>
|
117 |
|
118 |
+
<div id="solution" class="hidden mt-12 space-y-8">
|
119 |
+
<div class="glass-card rounded-2xl p-6">
|
120 |
+
<button id="thoughtsToggle" class="w-full flex justify-between items-center text-left text-lg font-medium text-white hover:text-blue-300 transition-colors">
|
121 |
+
<span>Processus de Réflexion</span>
|
122 |
+
<svg class="w-6 h-6 transform transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
123 |
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
|
124 |
</svg>
|
125 |
</button>
|
126 |
<div id="thoughtsBox" class="thought-box mt-4">
|
127 |
+
<div id="thoughtsContent" class="prose prose-invert max-w-none text-blue-100"></div>
|
128 |
</div>
|
129 |
</div>
|
130 |
|
131 |
+
<div class="glass-card rounded-2xl p-8">
|
132 |
+
<h3 class="text-2xl font-bold text-white mb-6">Solution</h3>
|
133 |
+
<div id="answerContent" class="prose prose-invert max-w-none text-blue-100"></div>
|
134 |
</div>
|
135 |
</div>
|
136 |
</div>
|
|
|
147 |
const thoughtsToggle = document.getElementById('thoughtsToggle');
|
148 |
const thoughtsBox = document.getElementById('thoughtsBox');
|
149 |
|
|
|
150 |
thoughtsToggle.addEventListener('click', () => {
|
151 |
thoughtsBox.classList.toggle('open');
|
152 |
thoughtsToggle.querySelector('svg').classList.toggle('rotate-180');
|
153 |
});
|
154 |
|
155 |
+
imageInput.addEventListener('change', function(e) {
|
156 |
+
const fileName = this.files[0]?.name;
|
157 |
+
if (fileName) {
|
158 |
+
const textElement = this.parentElement.querySelector('.text-lg');
|
159 |
+
textElement.textContent = `Fichier sélectionné : ${fileName}`;
|
160 |
+
}
|
161 |
+
});
|
162 |
+
|
163 |
+
// Drag and drop effects
|
164 |
+
const dropZone = document.querySelector('.uploadArea');
|
165 |
+
|
166 |
+
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
167 |
+
dropZone.addEventListener(eventName, preventDefaults, false);
|
168 |
+
});
|
169 |
+
|
170 |
+
function preventDefaults(e) {
|
171 |
+
e.preventDefault();
|
172 |
+
e.stopPropagation();
|
173 |
+
}
|
174 |
+
|
175 |
+
['dragenter', 'dragover'].forEach(eventName => {
|
176 |
+
dropZone.addEventListener(eventName, highlight, false);
|
177 |
+
});
|
178 |
+
|
179 |
+
['dragleave', 'drop'].forEach(eventName => {
|
180 |
+
dropZone.addEventListener(eventName, unhighlight, false);
|
181 |
+
});
|
182 |
+
|
183 |
+
function highlight(e) {
|
184 |
+
dropZone.classList.add('border-blue-400');
|
185 |
+
}
|
186 |
+
|
187 |
+
function unhighlight(e) {
|
188 |
+
dropZone.classList.remove('border-blue-400');
|
189 |
+
}
|
190 |
+
|
191 |
form.addEventListener('submit', async (event) => {
|
192 |
event.preventDefault();
|
193 |
const file = imageInput.files[0];
|
|
|
196 |
return;
|
197 |
}
|
198 |
|
|
|
199 |
loader.classList.remove('hidden');
|
200 |
solution.classList.add('hidden');
|
201 |
|
|
|
213 |
thoughtsContent.innerHTML = data.thoughts;
|
214 |
answerContent.innerHTML = data.answer;
|
215 |
|
|
|
216 |
if (window.MathJax) {
|
217 |
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
|
218 |
}
|
|
|
228 |
loader.classList.add('hidden');
|
229 |
}
|
230 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
});
|
232 |
</script>
|
233 |
</body>
|