monsieurCisse1er commited on
Commit
eaffedf
·
verified ·
1 Parent(s): 11d8396

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +594 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Ivoirmath
3
- emoji: 🐨
4
- colorFrom: indigo
5
- colorTo: indigo
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: ivoirmath
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: gray
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,594 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>IVOIRMATH - Apprendre les maths en s'amusant</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js"></script>
10
+ <script>
11
+ tailwind.config = {
12
+ theme: {
13
+ extend: {
14
+ colors: {
15
+ 'ivoire-orange': '#FF8C00',
16
+ 'ivoire-green': '#009A49',
17
+ 'ivoire-yellow': '#FFD700',
18
+ 'ivoire-blue': '#005FAA',
19
+ },
20
+ animation: {
21
+ 'bounce-slow': 'bounce 2s infinite',
22
+ 'tada': 'tada 1s',
23
+ 'wobble': 'wobble 1s',
24
+ 'jello': 'jello 1s',
25
+ }
26
+ }
27
+ }
28
+ }
29
+ </script>
30
+ <style>
31
+ @keyframes bounce {
32
+ 0%, 100% { transform: translateY(0); }
33
+ 50% { transform: translateY(-15px); }
34
+ }
35
+ @keyframes tada {
36
+ 0% { transform: scale(1); }
37
+ 10%, 20% { transform: scale(0.9) rotate(-3deg); }
38
+ 30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
39
+ 40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
40
+ 100% { transform: scale(1) rotate(0); }
41
+ }
42
+ @keyframes wobble {
43
+ 0% { transform: translateX(0%); }
44
+ 15% { transform: translateX(-25%) rotate(-5deg); }
45
+ 30% { transform: translateX(20%) rotate(3deg); }
46
+ 45% { transform: translateX(-15%) rotate(-3deg); }
47
+ 60% { transform: translateX(10%) rotate(2deg); }
48
+ 75% { transform: translateX(-5%) rotate(-1deg); }
49
+ 100% { transform: translateX(0%); }
50
+ }
51
+ @keyframes jello {
52
+ 0%, 100% { transform: scale3d(1, 1, 1); }
53
+ 15% { transform: scale3d(1.25, 0.75, 1); }
54
+ 30% { transform: scale3d(0.75, 1.25, 1); }
55
+ 45% { transform: scale3d(1.15, 0.85, 1); }
56
+ 60% { transform: scale3d(0.95, 1.05, 1); }
57
+ 75% { transform: scale3d(1.05, 0.95, 1); }
58
+ }
59
+ .mascotte {
60
+ transition: all 0.3s ease;
61
+ }
62
+ .operation-box {
63
+ transition: all 0.3s ease;
64
+ }
65
+ .operation-box:hover {
66
+ transform: scale(1.05);
67
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
68
+ }
69
+ .digitalstrateges-logo {
70
+ position: relative;
71
+ font-weight: 800;
72
+ background: linear-gradient(90deg, #FF8C00, #009A49, #005FAA);
73
+ -webkit-background-clip: text;
74
+ background-clip: text;
75
+ color: transparent;
76
+ animation: gradient 5s ease infinite;
77
+ background-size: 200% 200%;
78
+ }
79
+ @keyframes gradient {
80
+ 0% { background-position: 0% 50%; }
81
+ 50% { background-position: 100% 50%; }
82
+ 100% { background-position: 0% 50%; }
83
+ }
84
+ </style>
85
+ </head>
86
+ <body class="bg-gradient-to-b from-ivoire-green to-ivoire-blue min-h-screen font-sans">
87
+ <div class="container mx-auto px-4 py-8">
88
+ <!-- Header -->
89
+ <header class="flex flex-col items-center mb-8">
90
+ <div class="flex items-center justify-center bg-white rounded-full p-4 shadow-lg animate-jello">
91
+ <i class="fas fa-calculator text-ivoire-orange text-4xl mr-3"></i>
92
+ <h1 class="text-3xl font-bold text-ivoire-green">IVOIR<span class="text-ivoire-orange">MATH</span></h1>
93
+ </div>
94
+ <p class="mt-4 text-white text-center text-lg">Apprends les mathématiques en t'amusant !</p>
95
+ </header>
96
+
97
+ <!-- Main Content -->
98
+ <main class="bg-white/90 backdrop-blur-sm rounded-3xl shadow-2xl overflow-hidden border-2 border-white/20">
99
+ <!-- Level Selection -->
100
+ <section id="level-section" class="p-6">
101
+ <h2 class="text-2xl font-bold text-ivoire-green mb-6 text-center">Choisis ton niveau</h2>
102
+ <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
103
+ <button onclick="selectLevel('CP')" class="level-btn bg-gradient-to-br from-ivoire-yellow to-yellow-400 hover:from-yellow-400 hover:to-ivoire-yellow text-white font-bold py-6 px-2 rounded-xl transition-all transform hover:scale-105 shadow-lg">
104
+ <i class="fas fa-star text-2xl mb-2 animate-bounce-slow"></i>
105
+ <span class="block">CP</span>
106
+ <span class="text-xs font-normal">Nombres 0-20</span>
107
+ </button>
108
+ <button onclick="selectLevel('CE1')" class="level-btn bg-gradient-to-br from-ivoire-orange to-orange-500 hover:from-orange-500 hover:to-ivoire-orange text-white font-bold py-6 px-2 rounded-xl transition-all transform hover:scale-105 shadow-lg">
109
+ <i class="fas fa-moon text-2xl mb-2 animate-bounce-slow" style="animation-delay: 0.2s"></i>
110
+ <span class="block">CE1</span>
111
+ <span class="text-xs font-normal">Nombres 0-100</span>
112
+ </button>
113
+ <button onclick="selectLevel('CE2')" class="level-btn bg-gradient-to-br from-ivoire-green to-green-600 hover:from-green-600 hover:to-ivoire-green text-white font-bold py-6 px-2 rounded-xl transition-all transform hover:scale-105 shadow-lg">
114
+ <i class="fas fa-sun text-2xl mb-2 animate-bounce-slow" style="animation-delay: 0.4s"></i>
115
+ <span class="block">CE2</span>
116
+ <span class="text-xs font-normal">Multiplications</span>
117
+ </button>
118
+ <button onclick="selectLevel('CM')" class="level-btn bg-gradient-to-br from-purple-500 to-purple-600 hover:from-purple-600 hover:to-purple-500 text-white font-bold py-6 px-2 rounded-xl transition-all transform hover:scale-105 shadow-lg">
119
+ <i class="fas fa-rocket text-2xl mb-2 animate-bounce-slow" style="animation-delay: 0.6s"></i>
120
+ <span class="block">CM</span>
121
+ <span class="text-xs font-normal">Division</span>
122
+ </button>
123
+ </div>
124
+ </section>
125
+
126
+ <!-- Operation Section (hidden initially) -->
127
+ <section id="operation-section" class="hidden p-6 bg-gray-50/50">
128
+ <div class="flex justify-between items-center mb-6">
129
+ <button onclick="backToLevels()" class="text-ivoire-orange hover:text-orange-700 font-bold flex items-center">
130
+ <i class="fas fa-arrow-left mr-2"></i>Retour
131
+ </button>
132
+ <div class="bg-white px-4 py-2 rounded-full shadow-md border border-gray-200">
133
+ <span id="current-level" class="font-bold text-ivoire-green"></span>
134
+ <span class="text-gray-500 mx-2">|</span>
135
+ <span id="score" class="font-bold">Score: <span class="text-ivoire-orange">0</span></span>
136
+ </div>
137
+ </div>
138
+
139
+ <div class="text-center mb-8">
140
+ <div id="mascotte" class="inline-block mascotte">
141
+ <div class="relative">
142
+ <i class="fas fa-robot text-6xl text-ivoire-orange"></i>
143
+ <div id="mascotte-face" class="absolute inset-0 flex justify-center items-center">
144
+ <i class="fas fa-smile text-xl text-white"></i>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <p id="message" class="mt-4 text-gray-700 font-medium">Prêt pour un nouveau défi ?</p>
149
+ </div>
150
+
151
+ <div id="operation-container" class="bg-white rounded-xl p-6 shadow-lg mb-6 border-2 border-ivoire-orange/20">
152
+ <div class="text-center text-3xl font-bold mb-4" id="operation-display"></div>
153
+ <div class="flex justify-center">
154
+ <input type="number" id="answer-input" class="border-2 border-ivoire-orange rounded-lg px-4 py-3 text-center text-2xl w-40 focus:outline-none focus:ring-2 focus:ring-ivoire-orange focus:border-transparent" placeholder="?" autofocus>
155
+ </div>
156
+ </div>
157
+
158
+ <div class="flex justify-center">
159
+ <button onclick="checkAnswer()" class="bg-gradient-to-r from-ivoire-green to-green-600 hover:from-green-600 hover:to-ivoire-green text-white font-bold py-4 px-10 rounded-full text-lg shadow-lg transition-all transform hover:scale-105 active:scale-95">
160
+ Valider <i class="fas fa-check ml-2"></i>
161
+ </button>
162
+ </div>
163
+
164
+ <div id="feedback" class="mt-6 hidden">
165
+ <div class="bg-blue-50 border-l-4 border-blue-500 p-4 rounded-lg">
166
+ <div class="flex">
167
+ <div class="flex-shrink-0">
168
+ <i class="fas fa-info-circle text-blue-500 text-xl"></i>
169
+ </div>
170
+ <div class="ml-3">
171
+ <p id="feedback-text" class="text-sm text-blue-700"></p>
172
+ </div>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </section>
177
+
178
+ <!-- Progress Section -->
179
+ <section id="progress-section" class="hidden p-6 bg-gray-100/50 border-t border-gray-200">
180
+ <h3 class="text-lg font-bold text-ivoire-green mb-4">Ta progression</h3>
181
+ <div class="bg-white rounded-lg p-4 shadow-md">
182
+ <div class="flex justify-between mb-2">
183
+ <span class="text-gray-700">Opérations réussies</span>
184
+ <span id="correct-count" class="font-bold text-ivoire-green">0</span>
185
+ </div>
186
+ <div class="flex justify-between">
187
+ <span class="text-gray-700">Opérations à revoir</span>
188
+ <span id="incorrect-count" class="font-bold text-ivoire-orange">0</span>
189
+ </div>
190
+ <div class="mt-4">
191
+ <div class="w-full bg-gray-200 rounded-full h-4">
192
+ <div id="progress-bar" class="bg-gradient-to-r from-ivoire-green to-green-500 h-4 rounded-full transition-all duration-500" style="width: 0%"></div>
193
+ </div>
194
+ <div class="text-right mt-1">
195
+ <span id="progress-percent" class="text-xs font-bold text-gray-600">0%</span>
196
+ </div>
197
+ </div>
198
+ </div>
199
+ </section>
200
+ </main>
201
+
202
+ <!-- Footer -->
203
+ <footer class="mt-8 text-center text-white">
204
+ <div class="mb-4 flex justify-center space-x-3">
205
+ <button onclick="shareOnWhatsApp()" class="bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-4 rounded-full inline-flex items-center transition-all transform hover:scale-105">
206
+ <i class="fab fa-whatsapp mr-2"></i> Partager
207
+ </button>
208
+ <button onclick="showSupport()" class="bg-gradient-to-r from-ivoire-orange to-orange-600 hover:from-orange-600 hover:to-ivoire-orange text-white font-bold py-2 px-4 rounded-full inline-flex items-center transition-all transform hover:scale-105">
209
+ <i class="fas fa-heart mr-2"></i> Soutenir
210
+ </button>
211
+ </div>
212
+ <p class="text-sm mb-2">© 2023 IVOIRMATH - Conforme au programme ivoirien</p>
213
+ <p class="text-xs opacity-80">Créé avec <i class="fas fa-heart text-red-400"></i> par <span class="digitalstrateges-logo">DIGITALSTRATEGES</span></p>
214
+ </footer>
215
+ </div>
216
+
217
+ <!-- Support Modal -->
218
+ <div id="support-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
219
+ <div class="bg-white rounded-lg p-6 max-w-md w-full mx-4 animate-jello">
220
+ <div class="flex justify-between items-center mb-4">
221
+ <h3 class="text-xl font-bold text-ivoire-green">Soutenir IVOIRMATH</h3>
222
+ <button onclick="hideSupport()" class="text-gray-500 hover:text-gray-700">
223
+ <i class="fas fa-times"></i>
224
+ </button>
225
+ </div>
226
+ <p class="mb-4">Votre soutien nous aide à améliorer l'application pour tous les enfants !</p>
227
+
228
+ <div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-4 rounded">
229
+ <div class="flex items-start">
230
+ <div class="flex-shrink-0 pt-1">
231
+ <i class="fas fa-money-bill-wave text-yellow-500 text-xl"></i>
232
+ </div>
233
+ <div class="ml-3">
234
+ <p class="text-sm font-medium text-yellow-700">Via Wave Mobile Money :</p>
235
+ <div class="mt-2 flex items-center">
236
+ <i class="fas fa-mobile-alt text-yellow-500 mr-2"></i>
237
+ <span class="font-mono bg-gray-100 px-2 py-1 rounded">+225 07 00 00 00</span>
238
+ </div>
239
+ </div>
240
+ </div>
241
+ </div>
242
+
243
+ <div class="bg-blue-50 border-l-4 border-blue-400 p-4 mb-4 rounded">
244
+ <div class="flex items-start">
245
+ <div class="flex-shrink-0 pt-1">
246
+ <i class="fab fa-paypal text-blue-500 text-xl"></i>
247
+ </div>
248
+ <div class="ml-3">
249
+ <p class="text-sm font-medium text-blue-700">Via PayPal :</p>
250
+ <div class="mt-2">
251
+ <a href="https://paypal.me/digitalstrateges" target="_blank" class="text-blue-600 hover:underline">paypal.me/digitalstrateges</a>
252
+ </div>
253
+ </div>
254
+ </div>
255
+ </div>
256
+
257
+ <button onclick="hideSupport()" class="w-full bg-gradient-to-r from-ivoire-green to-green-600 hover:from-green-600 hover:to-ivoire-green text-white font-bold py-3 px-4 rounded-lg transition-all transform hover:scale-105">
258
+ Fermer
259
+ </button>
260
+ </div>
261
+ </div>
262
+
263
+ <script>
264
+ // Game state
265
+ const gameState = {
266
+ level: null,
267
+ score: 0,
268
+ correctAnswers: 0,
269
+ incorrectAnswers: 0,
270
+ currentOperation: null,
271
+ answer: null,
272
+ streak: 0
273
+ };
274
+
275
+ // Operation generators for each level
276
+ const operationGenerators = {
277
+ 'CP': generateCPOperation,
278
+ 'CE1': generateCE1Operation,
279
+ 'CE2': generateCE2Operation,
280
+ 'CM': generateCMOperation
281
+ };
282
+
283
+ // Select level
284
+ function selectLevel(level) {
285
+ gameState.level = level;
286
+ document.getElementById('current-level').textContent = level;
287
+ document.getElementById('level-section').classList.add('hidden');
288
+ document.getElementById('operation-section').classList.remove('hidden');
289
+ document.getElementById('progress-section').classList.remove('hidden');
290
+ generateNewOperation();
291
+
292
+ // Animation for transition
293
+ const operationSection = document.getElementById('operation-section');
294
+ operationSection.classList.add('animate__animated', 'animate__fadeIn');
295
+ setTimeout(() => {
296
+ operationSection.classList.remove('animate__animated', 'animate__fadeIn');
297
+ }, 500);
298
+ }
299
+
300
+ // Back to level selection
301
+ function backToLevels() {
302
+ document.getElementById('level-section').classList.remove('hidden');
303
+ document.getElementById('operation-section').classList.add('hidden');
304
+ document.getElementById('progress-section').classList.add('hidden');
305
+ document.getElementById('feedback').classList.add('hidden');
306
+ resetGameState();
307
+
308
+ // Animation for transition
309
+ const levelSection = document.getElementById('level-section');
310
+ levelSection.classList.add('animate__animated', 'animate__fadeIn');
311
+ setTimeout(() => {
312
+ levelSection.classList.remove('animate__animated', 'animate__fadeIn');
313
+ }, 500);
314
+ }
315
+
316
+ // Reset game state
317
+ function resetGameState() {
318
+ gameState.score = 0;
319
+ gameState.correctAnswers = 0;
320
+ gameState.incorrectAnswers = 0;
321
+ gameState.streak = 0;
322
+ updateScore();
323
+ }
324
+
325
+ // Generate new operation based on level
326
+ function generateNewOperation() {
327
+ gameState.currentOperation = operationGenerators[gameState.level]();
328
+ document.getElementById('operation-display').textContent = gameState.currentOperation.display;
329
+ document.getElementById('answer-input').value = '';
330
+ document.getElementById('feedback').classList.add('hidden');
331
+ document.getElementById('message').textContent = "Essaie de résoudre cette opération !";
332
+ document.getElementById('answer-input').focus();
333
+
334
+ // Reset mascotte animation
335
+ const mascotte = document.getElementById('mascotte');
336
+ mascotte.className = 'inline-block mascotte';
337
+ mascotte.classList.add('animate-bounce-slow');
338
+
339
+ const face = document.getElementById('mascotte-face');
340
+ face.innerHTML = '<i class="fas fa-smile text-xl text-white"></i>';
341
+ }
342
+
343
+ // Check user answer
344
+ function checkAnswer() {
345
+ const userAnswer = parseInt(document.getElementById('answer-input').value);
346
+ const feedback = document.getElementById('feedback');
347
+ const feedbackText = document.getElementById('feedback-text');
348
+ const mascotte = document.getElementById('mascotte');
349
+ const face = document.getElementById('mascotte-face');
350
+
351
+ if (isNaN(userAnswer)) {
352
+ feedbackText.textContent = "Entre un nombre s'il te plaît !";
353
+ feedback.classList.remove('hidden');
354
+
355
+ // Mascotte sad face
356
+ face.innerHTML = '<i class="fas fa-frown text-xl text-white"></i>';
357
+ mascotte.classList.remove('animate-bounce-slow');
358
+ mascotte.classList.add('animate-wobble');
359
+ return;
360
+ }
361
+
362
+ if (userAnswer === gameState.currentOperation.answer) {
363
+ // Correct answer
364
+ gameState.score += 10;
365
+ gameState.correctAnswers++;
366
+ gameState.streak++;
367
+
368
+ // Bonus for streak
369
+ if (gameState.streak >= 3) {
370
+ const bonus = Math.floor(gameState.streak / 3) * 5;
371
+ gameState.score += bonus;
372
+ }
373
+
374
+ updateScore();
375
+
376
+ // Mascotte happy animation
377
+ mascotte.className = 'inline-block mascotte';
378
+ mascotte.classList.add('animate-tada');
379
+ face.innerHTML = '<i class="fas fa-smile-beam text-xl text-white"></i>';
380
+ document.getElementById('message').textContent = getSuccessMessage();
381
+
382
+ feedbackText.textContent = gameState.currentOperation.explanation || "Excellent travail !";
383
+ if (gameState.streak >= 3) {
384
+ feedbackText.textContent += ` (+${Math.floor(gameState.streak / 3) * 5} points bonus pour ta série de ${gameState.streak} bonnes réponses !)`;
385
+ }
386
+ feedback.classList.remove('hidden');
387
+
388
+ // Confetti celebration
389
+ confetti({
390
+ particleCount: 100,
391
+ spread: 70,
392
+ origin: { y: 0.6 },
393
+ colors: ['#FF8C00', '#009A49', '#FFD700', '#005FAA']
394
+ });
395
+
396
+ setTimeout(generateNewOperation, 2000);
397
+ } else {
398
+ // Incorrect answer
399
+ gameState.incorrectAnswers++;
400
+ gameState.streak = 0;
401
+ updateScore();
402
+
403
+ // Mascotte sad animation
404
+ mascotte.className = 'inline-block mascotte';
405
+ mascotte.classList.add('animate-wobble');
406
+ face.innerHTML = '<i class="fas fa-sad-tear text-xl text-white"></i>';
407
+ document.getElementById('message').textContent = "Presque ! Essaie encore.";
408
+
409
+ feedbackText.textContent = `La réponse correcte était ${gameState.currentOperation.answer}. ${gameState.currentOperation.explanation || ''}`;
410
+ feedback.classList.remove('hidden');
411
+ }
412
+ }
413
+
414
+ // Get random success message
415
+ function getSuccessMessage() {
416
+ const messages = [
417
+ "Bravo ! C'est parfait !",
418
+ "Génial ! Tu es trop fort !",
419
+ "Excellent travail !",
420
+ "Tu es un champion des maths !",
421
+ "Incroyable ! Continue comme ça !",
422
+ "Formidable ! Tu progresses vite !"
423
+ ];
424
+ return messages[Math.floor(Math.random() * messages.length)];
425
+ }
426
+
427
+ // Update score display
428
+ function updateScore() {
429
+ document.getElementById('score').innerHTML = `Score: <span class="text-ivoire-orange">${gameState.score}</span>`;
430
+ document.getElementById('correct-count').textContent = gameState.correctAnswers;
431
+ document.getElementById('incorrect-count').textContent = gameState.incorrectAnswers;
432
+
433
+ const total = gameState.correctAnswers + gameState.incorrectAnswers;
434
+ const percentage = total > 0 ? Math.round((gameState.correctAnswers / total) * 100) : 0;
435
+ document.getElementById('progress-bar').style.width = `${percentage}%`;
436
+ document.getElementById('progress-percent').textContent = `${percentage}%`;
437
+ }
438
+
439
+ // Share on WhatsApp
440
+ function shareOnWhatsApp() {
441
+ const text = `Je viens de marquer ${gameState.score} points sur IVOIRMATH ! Rejoins-moi pour apprendre les maths en s'amusant ! 🚀\n\nCréé par DIGITALSTRATEGES`;
442
+ const url = `https://wa.me/?text=${encodeURIComponent(text)}`;
443
+ window.open(url, '_blank');
444
+ }
445
+
446
+ // Show support modal
447
+ function showSupport() {
448
+ document.getElementById('support-modal').classList.remove('hidden');
449
+ }
450
+
451
+ // Hide support modal
452
+ function hideSupport() {
453
+ document.getElementById('support-modal').classList.add('hidden');
454
+ }
455
+
456
+ // Operation generators
457
+ function generateCPOperation() {
458
+ const num1 = Math.floor(Math.random() * 20);
459
+ const num2 = Math.floor(Math.random() * 20);
460
+ const operations = ['+', '-'];
461
+ const operation = operations[Math.floor(Math.random() * operations.length)];
462
+
463
+ let answer, display, explanation;
464
+
465
+ if (operation === '+') {
466
+ answer = num1 + num2;
467
+ display = `${num1} + ${num2} = ?`;
468
+ explanation = `Addition : ${num1} + ${num2} = ${answer}`;
469
+ } else {
470
+ // Ensure positive result for CP level
471
+ const larger = Math.max(num1, num2);
472
+ const smaller = Math.min(num1, num2);
473
+ answer = larger - smaller;
474
+ display = `${larger} - ${smaller} = ?`;
475
+ explanation = `Soustraction : ${larger} - ${smaller} = ${answer}`;
476
+ }
477
+
478
+ return { display, answer, explanation };
479
+ }
480
+
481
+ function generateCE1Operation() {
482
+ const num1 = Math.floor(Math.random() * 10);
483
+ const num2 = Math.floor(Math.random() * 10);
484
+ const operations = ['+', '-', '×'];
485
+ const operation = operations[Math.floor(Math.random() * operations.length)];
486
+
487
+ let answer, display, explanation;
488
+
489
+ if (operation === '+') {
490
+ answer = num1 + num2;
491
+ display = `${num1} + ${num2} = ?`;
492
+ explanation = `Addition : ${num1} + ${num2} = ${answer}`;
493
+ } else if (operation === '-') {
494
+ const larger = Math.max(num1, num2);
495
+ const smaller = Math.min(num1, num2);
496
+ answer = larger - smaller;
497
+ display = `${larger} - ${smaller} = ?`;
498
+ explanation = `Soustraction : ${larger} - ${smaller} = ${answer}`;
499
+ } else {
500
+ answer = num1 * num2;
501
+ display = `${num1} × ${num2} = ?`;
502
+ explanation = `Multiplication : ${num1} × ${num2} = ${answer}`;
503
+ }
504
+
505
+ return { display, answer, explanation };
506
+ }
507
+
508
+ function generateCE2Operation() {
509
+ const operations = ['+', '-', '×', '÷'];
510
+ const operation = operations[Math.floor(Math.random() * operations.length)];
511
+
512
+ let answer, display, explanation;
513
+
514
+ if (operation === '+' || operation === '-') {
515
+ const num1 = Math.floor(Math.random() * 50);
516
+ const num2 = Math.floor(Math.random() * 50);
517
+
518
+ if (operation === '+') {
519
+ answer = num1 + num2;
520
+ display = `${num1} + ${num2} = ?`;
521
+ explanation = `Addition : ${num1} + ${num2} = ${answer}`;
522
+ } else {
523
+ const larger = Math.max(num1, num2);
524
+ const smaller = Math.min(num1, num2);
525
+ answer = larger - smaller;
526
+ display = `${larger} - ${smaller} = ?`;
527
+ explanation = `Soustraction : ${larger} - ${smaller} = ${answer}`;
528
+ }
529
+ } else if (operation === '×') {
530
+ const num1 = Math.floor(Math.random() * 12) + 1;
531
+ const num2 = Math.floor(Math.random() * 12) + 1;
532
+ answer = num1 * num2;
533
+ display = `${num1} × ${num2} = ?`;
534
+ explanation = `Multiplication : ${num1} × ${num2} = ${answer}`;
535
+ } else {
536
+ // Division with whole number results
537
+ const num2 = Math.floor(Math.random() * 10) + 1;
538
+ const answer = Math.floor(Math.random() * 10) + 1;
539
+ const num1 = num2 * answer;
540
+ display = `${num1} ÷ ${num2} = ?`;
541
+ explanation = `Division : ${num1} ÷ ${num2} = ${answer} (car ${num2} × ${answer} = ${num1})`;
542
+ }
543
+
544
+ return { display, answer, explanation };
545
+ }
546
+
547
+ function generateCMOperation() {
548
+ const operations = ['+', '-', '×', '÷'];
549
+ const operation = operations[Math.floor(Math.random() * operations.length)];
550
+
551
+ let answer, display, explanation;
552
+
553
+ if (operation === '+' || operation === '-') {
554
+ const num1 = Math.floor(Math.random() * 100);
555
+ const num2 = Math.floor(Math.random() * 100);
556
+
557
+ if (operation === '+') {
558
+ answer = num1 + num2;
559
+ display = `${num1} + ${num2} = ?`;
560
+ explanation = `Addition : ${num1} + ${num2} = ${answer}`;
561
+ } else {
562
+ const larger = Math.max(num1, num2);
563
+ const smaller = Math.min(num1, num2);
564
+ answer = larger - smaller;
565
+ display = `${larger} - ${smaller} = ?`;
566
+ explanation = `Soustraction : ${larger} - ${smaller} = ${answer}`;
567
+ }
568
+ } else if (operation === '×') {
569
+ const num1 = Math.floor(Math.random() * 15) + 1;
570
+ const num2 = Math.floor(Math.random() * 15) + 1;
571
+ answer = num1 * num2;
572
+ display = `${num1} × ${num2} = ?`;
573
+ explanation = `Multiplication : ${num1} × ${num2} = ${answer}`;
574
+ } else {
575
+ // Division with possible remainders
576
+ const num2 = Math.floor(Math.random() * 12) + 1;
577
+ const num1 = Math.floor(Math.random() * 10) * num2;
578
+ answer = num1 / num2;
579
+ display = `${num1} ÷ ${num2} = ?`;
580
+ explanation = `Division : ${num1} ÷ ${num2} = ${answer}`;
581
+ }
582
+
583
+ return { display, answer, explanation };
584
+ }
585
+
586
+ // Handle Enter key in answer input
587
+ document.getElementById('answer-input').addEventListener('keypress', function(e) {
588
+ if (e.key === 'Enter') {
589
+ checkAnswer();
590
+ }
591
+ });
592
+ </script>
593
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=monsieurCisse1er/ivoirmath" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
594
+ </html>