Alex59000 commited on
Commit
2c868fc
·
verified ·
1 Parent(s): f8bedf5

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +495 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Tamacodechi
3
- emoji:
4
- colorFrom: indigo
5
- colorTo: yellow
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: tamacodechi
3
+ emoji: 🐳
4
+ colorFrom: blue
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,495 @@
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>Tamacodechi - Le Tamagotchi des Développeurs</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
+ <style>
10
+ @keyframes bounce {
11
+ 0%, 100% { transform: translateY(0); }
12
+ 50% { transform: translateY(-10px); }
13
+ }
14
+ .bounce-animation {
15
+ animation: bounce 1s infinite;
16
+ }
17
+ .progress-bar {
18
+ transition: width 0.5s ease-in-out;
19
+ }
20
+ .tamagotchi-screen {
21
+ box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.5);
22
+ }
23
+ .pixel-art {
24
+ image-rendering: pixelated;
25
+ }
26
+ </style>
27
+ </head>
28
+ <body class="bg-gray-900 text-white min-h-screen flex items-center justify-center p-4">
29
+ <div class="container mx-auto max-w-md">
30
+ <div class="bg-gray-800 rounded-3xl p-6 shadow-2xl border-4 border-cyan-400 relative overflow-hidden">
31
+ <!-- En-tête avec titre et niveau -->
32
+ <div class="flex justify-between items-center mb-4">
33
+ <h1 class="text-2xl font-bold text-cyan-400">
34
+ <i class="fas fa-code mr-2"></i>Tamacodechi
35
+ </h1>
36
+ <div class="bg-gray-700 px-3 py-1 rounded-full text-sm font-mono">
37
+ Niveau: <span id="level">1</span>
38
+ </div>
39
+ </div>
40
+
41
+ <!-- Écran du Tamacodechi -->
42
+ <div class="tamagotchi-screen bg-black rounded-xl p-4 mb-6 h-64 flex flex-col items-center justify-center relative overflow-hidden">
43
+ <div id="pet-container" class="relative">
44
+ <div id="pet" class="text-6xl pixel-art bounce-animation">👨‍💻</div>
45
+ <div id="pet-status" class="absolute -bottom-6 left-1/2 transform -translate-x-1/2 text-xs bg-black bg-opacity-70 px-2 py-1 rounded whitespace-nowrap"></div>
46
+ </div>
47
+ <div id="message" class="mt-4 text-center text-sm text-cyan-300 font-mono"></div>
48
+ <div id="evolution" class="absolute top-0 left-0 w-full h-full flex items-center justify-center hidden">
49
+ <div class="text-4xl animate-pulse text-yellow-300">LEVEL UP!</div>
50
+ </div>
51
+ </div>
52
+
53
+ <!-- Barres de statut -->
54
+ <div class="space-y-3 mb-6">
55
+ <div>
56
+ <div class="flex justify-between text-xs mb-1">
57
+ <span><i class="fas fa-heart text-red-400 mr-1"></i> Santé</span>
58
+ <span id="health-value">100%</span>
59
+ </div>
60
+ <div class="w-full bg-gray-700 rounded-full h-2">
61
+ <div id="health-bar" class="progress-bar bg-red-500 h-2 rounded-full" style="width: 100%"></div>
62
+ </div>
63
+ </div>
64
+
65
+ <div>
66
+ <div class="flex justify-between text-xs mb-1">
67
+ <span><i class="fas fa-hamburger text-yellow-400 mr-1"></i> Nourriture</span>
68
+ <span id="food-value">100%</span>
69
+ </div>
70
+ <div class="w-full bg-gray-700 rounded-full h-2">
71
+ <div id="food-bar" class="progress-bar bg-yellow-500 h-2 rounded-full" style="width: 100%"></div>
72
+ </div>
73
+ </div>
74
+
75
+ <div>
76
+ <div class="flex justify-between text-xs mb-1">
77
+ <span><i class="fas fa-bolt text-blue-400 mr-1"></i> Énergie</span>
78
+ <span id="energy-value">100%</span>
79
+ </div>
80
+ <div class="w-full bg-gray-700 rounded-full h-2">
81
+ <div id="energy-bar" class="progress-bar bg-blue-500 h-2 rounded-full" style="width: 100%"></div>
82
+ </div>
83
+ </div>
84
+
85
+ <div>
86
+ <div class="flex justify-between text-xs mb-1">
87
+ <span><i class="fas fa-laugh-beam text-green-400 mr-1"></i> Bonheur</span>
88
+ <span id="happiness-value">100%</span>
89
+ </div>
90
+ <div class="w-full bg-gray-700 rounded-full h-2">
91
+ <div id="happiness-bar" class="progress-bar bg-green-500 h-2 rounded-full" style="width: 100%"></div>
92
+ </div>
93
+ </div>
94
+
95
+ <div>
96
+ <div class="flex justify-between text-xs mb-1">
97
+ <span><i class="fas fa-brain text-purple-400 mr-1"></i> XP</span>
98
+ <span id="xp-value">0/100</span>
99
+ </div>
100
+ <div class="w-full bg-gray-700 rounded-full h-2">
101
+ <div id="xp-bar" class="progress-bar bg-purple-500 h-2 rounded-full" style="width: 0%"></div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+
106
+ <!-- Boutons d'action -->
107
+ <div class="grid grid-cols-3 gap-3">
108
+ <button id="feed-btn" class="bg-yellow-600 hover:bg-yellow-500 text-white py-2 px-3 rounded-lg flex flex-col items-center text-xs">
109
+ <i class="fas fa-utensils mb-1"></i>
110
+ Nourrir
111
+ </button>
112
+ <button id="play-btn" class="bg-green-600 hover:bg-green-500 text-white py-2 px-3 rounded-lg flex flex-col items-center text-xs">
113
+ <i class="fas fa-gamepad mb-1"></i>
114
+ Jouer
115
+ </button>
116
+ <button id="sleep-btn" class="bg-blue-600 hover:bg-blue-500 text-white py-2 px-3 rounded-lg flex flex-col items-center text-xs">
117
+ <i class="fas fa-moon mb-1"></i>
118
+ Dormir
119
+ </button>
120
+ <button id="code-btn" class="bg-purple-600 hover:bg-purple-500 text-white py-2 px-3 rounded-lg flex flex-col items-center text-xs">
121
+ <i class="fas fa-code mb-1"></i>
122
+ Coder
123
+ </button>
124
+ <button id="clean-btn" class="bg-pink-600 hover:bg-pink-500 text-white py-2 px-3 rounded-lg flex flex-col items-center text-xs">
125
+ <i class="fas fa-broom mb-1"></i>
126
+ Nettoyer
127
+ </button>
128
+ <button id="heal-btn" class="bg-red-600 hover:bg-red-500 text-white py-2 px-3 rounded-lg flex flex-col items-center text-xs">
129
+ <i class="fas fa-medkit mb-1"></i>
130
+ Soigner
131
+ </button>
132
+ </div>
133
+
134
+ <!-- Boutons spéciaux -->
135
+ <div class="flex justify-between mt-4">
136
+ <button id="debug-btn" class="bg-gray-700 hover:bg-gray-600 text-xs py-1 px-3 rounded-full">
137
+ <i class="fas fa-bug mr-1"></i>Debug
138
+ </button>
139
+ <button id="save-btn" class="bg-cyan-700 hover:bg-cyan-600 text-xs py-1 px-3 rounded-full">
140
+ <i class="fas fa-save mr-1"></i>Sauvegarder
141
+ </button>
142
+ <button id="load-btn" class="bg-cyan-700 hover:bg-cyan-600 text-xs py-1 px-3 rounded-full">
143
+ <i class="fas fa-folder-open mr-1"></i>Charger
144
+ </button>
145
+ </div>
146
+
147
+ <!-- Console de debug -->
148
+ <div id="debug-console" class="mt-4 bg-black text-green-400 font-mono text-xs p-2 rounded-lg h-24 overflow-y-auto hidden">
149
+ <div>System initialized...</div>
150
+ </div>
151
+ </div>
152
+
153
+ <!-- Crédits -->
154
+ <div class="text-center text-gray-500 text-xs mt-4">
155
+ Tamacodechi v1.0 - Le Tamagotchi des développeurs
156
+ </div>
157
+ </div>
158
+
159
+ <script>
160
+ // État du Tamacodechi
161
+ const state = {
162
+ health: 100,
163
+ food: 100,
164
+ energy: 100,
165
+ happiness: 100,
166
+ xp: 0,
167
+ level: 1,
168
+ xpToNextLevel: 100,
169
+ isSleeping: false,
170
+ isSick: false,
171
+ isDirty: false,
172
+ evolutionStage: 0,
173
+ lastAction: null,
174
+ messages: [
175
+ "Salut ! Je suis ton Tamacodechi!",
176
+ "J'ai faim...",
177
+ "Joue avec moi!",
178
+ "Je veux coder!",
179
+ "J'ai besoin de dormir...",
180
+ "Je me sens seul...",
181
+ "Je suis malade...",
182
+ "Je suis sale...",
183
+ "Je veux apprendre!",
184
+ "Je m'ennuie..."
185
+ ]
186
+ };
187
+
188
+ // Éléments du DOM
189
+ const elements = {
190
+ pet: document.getElementById('pet'),
191
+ petStatus: document.getElementById('pet-status'),
192
+ message: document.getElementById('message'),
193
+ evolution: document.getElementById('evolution'),
194
+ healthBar: document.getElementById('health-bar'),
195
+ healthValue: document.getElementById('health-value'),
196
+ foodBar: document.getElementById('food-bar'),
197
+ foodValue: document.getElementById('food-value'),
198
+ energyBar: document.getElementById('energy-bar'),
199
+ energyValue: document.getElementById('energy-value'),
200
+ happinessBar: document.getElementById('happiness-bar'),
201
+ happinessValue: document.getElementById('happiness-value'),
202
+ xpBar: document.getElementById('xp-bar'),
203
+ xpValue: document.getElementById('xp-value'),
204
+ level: document.getElementById('level'),
205
+ debugConsole: document.getElementById('debug-console')
206
+ };
207
+
208
+ // Boutons d'action
209
+ const buttons = {
210
+ feed: document.getElementById('feed-btn'),
211
+ play: document.getElementById('play-btn'),
212
+ sleep: document.getElementById('sleep-btn'),
213
+ code: document.getElementById('code-btn'),
214
+ clean: document.getElementById('clean-btn'),
215
+ heal: document.getElementById('heal-btn'),
216
+ debug: document.getElementById('debug-btn'),
217
+ save: document.getElementById('save-btn'),
218
+ load: document.getElementById('load-btn')
219
+ };
220
+
221
+ // Évolution du Tamacodechi
222
+ const evolutionStages = [
223
+ { emoji: "👶", name: "Bébé Codeur", xpRequired: 0 },
224
+ { emoji: "👦", name: "Apprenti Dev", xpRequired: 100 },
225
+ { emoji: "👨‍💻", name: "Développeur", xpRequired: 300 },
226
+ { emoji: "🧙‍♂️", name: "Codeur Pro", xpRequired: 600 },
227
+ { emoji: "🧙‍♂️", name: "Hacker", xpRequired: 1000 }
228
+ ];
229
+
230
+ // Initialisation
231
+ function init() {
232
+ updateUI();
233
+ setRandomMessage();
234
+ startGameLoop();
235
+ setupEventListeners();
236
+ logToConsole("Tamacodechi initialisé!");
237
+ }
238
+
239
+ // Boucle de jeu
240
+ function startGameLoop() {
241
+ setInterval(() => {
242
+ // Dégradation naturelle des stats
243
+ if (!state.isSleeping) {
244
+ state.food = Math.max(0, state.food - 1);
245
+ state.energy = Math.max(0, state.energy - 1);
246
+ state.happiness = Math.max(0, state.happiness - 0.5);
247
+ } else {
248
+ // Récupération pendant le sommeil
249
+ state.energy = Math.min(100, state.energy + 2);
250
+ state.health = Math.min(100, state.health + 0.5);
251
+ }
252
+
253
+ // Effets secondaires
254
+ if (state.food < 30) {
255
+ state.health = Math.max(0, state.health - 0.5);
256
+ }
257
+
258
+ if (state.energy < 20) {
259
+ state.health = Math.max(0, state.health - 0.5);
260
+ }
261
+
262
+ if (state.happiness < 20) {
263
+ state.health = Math.max(0, state.health - 0.3);
264
+ }
265
+
266
+ // Maladie aléatoire
267
+ if (Math.random() < 0.005 && !state.isSick) {
268
+ state.isSick = true;
269
+ showMessage("Je ne me sens pas bien...");
270
+ }
271
+
272
+ // Saleté aléatoire
273
+ if (Math.random() < 0.01 && !state.isDirty) {
274
+ state.isDirty = true;
275
+ showMessage("Je suis tout sale!");
276
+ }
277
+
278
+ // Vérifier l'évolution
279
+ checkEvolution();
280
+
281
+ // Mettre à jour l'UI
282
+ updateUI();
283
+
284
+ // Changer de message aléatoirement
285
+ if (Math.random() < 0.05) {
286
+ setRandomMessage();
287
+ }
288
+
289
+ }, 3000);
290
+ }
291
+
292
+ // Mise à jour de l'interface
293
+ function updateUI() {
294
+ // Mettre à jour les barres de progression
295
+ elements.healthBar.style.width = `${state.health}%`;
296
+ elements.foodBar.style.width = `${state.food}%`;
297
+ elements.energyBar.style.width = `${state.energy}%`;
298
+ elements.happinessBar.style.width = `${state.happiness}%`;
299
+ elements.xpBar.style.width = `${(state.xp / state.xpToNextLevel) * 100}%`;
300
+
301
+ // Mettre à jour les valeurs textuelles
302
+ elements.healthValue.textContent = `${Math.round(state.health)}%`;
303
+ elements.foodValue.textContent = `${Math.round(state.food)}%`;
304
+ elements.energyValue.textContent = `${Math.round(state.energy)}%`;
305
+ elements.happinessValue.textContent = `${Math.round(state.happiness)}%`;
306
+ elements.xpValue.textContent = `${Math.round(state.xp)}/${state.xpToNextLevel}`;
307
+ elements.level.textContent = state.level;
308
+
309
+ // Changer l'apparence en fonction de l'état
310
+ if (state.isSick) {
311
+ elements.pet.style.color = "red";
312
+ elements.petStatus.textContent = "Malade";
313
+ elements.petStatus.style.color = "red";
314
+ } else if (state.isDirty) {
315
+ elements.pet.style.color = "brown";
316
+ elements.petStatus.textContent = "Sale";
317
+ elements.petStatus.style.color = "brown";
318
+ } else if (state.isSleeping) {
319
+ elements.pet.style.color = "blue";
320
+ elements.petStatus.textContent = "Endormi";
321
+ elements.petStatus.style.color = "blue";
322
+ } else if (state.food < 30) {
323
+ elements.pet.style.color = "yellow";
324
+ elements.petStatus.textContent = "Affamé";
325
+ elements.petStatus.style.color = "yellow";
326
+ } else if (state.energy < 30) {
327
+ elements.pet.style.color = "orange";
328
+ elements.petStatus.textContent = "Fatigué";
329
+ elements.petStatus.style.color = "orange";
330
+ } else if (state.happiness < 30) {
331
+ elements.pet.style.color = "pink";
332
+ elements.petStatus.textContent = "Triste";
333
+ elements.petStatus.style.color = "pink";
334
+ } else {
335
+ elements.pet.style.color = "white";
336
+ elements.petStatus.textContent = evolutionStages[state.evolutionStage].name;
337
+ elements.petStatus.style.color = "cyan";
338
+ }
339
+
340
+ // Désactiver les boutons si nécessaire
341
+ buttons.play.disabled = state.isSleeping;
342
+ buttons.code.disabled = state.isSleeping;
343
+ buttons.feed.disabled = state.isSleeping;
344
+ buttons.clean.disabled = state.isSleeping;
345
+ buttons.heal.disabled = state.isSleeping;
346
+
347
+ // Changer l'emoji en fonction du stade d'évolution
348
+ elements.pet.textContent = evolutionStages[state.evolutionStage].emoji;
349
+ }
350
+
351
+ // Vérifier l'évolution
352
+ function checkEvolution() {
353
+ if (state.xp >= state.xpToNextLevel && state.evolutionStage < evolutionStages.length - 1) {
354
+ state.level++;
355
+ state.evolutionStage++;
356
+ state.xp = 0;
357
+ state.xpToNextLevel = evolutionStages[state.evolutionStage].xpRequired;
358
+
359
+ // Animation d'évolution
360
+ elements.evolution.classList.remove('hidden');
361
+ setTimeout(() => {
362
+ elements.evolution.classList.add('hidden');
363
+ }, 2000);
364
+
365
+ showMessage(`Je suis maintenant un ${evolutionStages[state.evolutionStage].name}!`);
366
+ logToConsole(`Évolution! Nouveau niveau: ${state.level}`);
367
+ }
368
+ }
369
+
370
+ // Afficher un message
371
+ function showMessage(msg) {
372
+ elements.message.textContent = msg;
373
+ setTimeout(() => {
374
+ if (elements.message.textContent === msg) {
375
+ elements.message.textContent = '';
376
+ }
377
+ }, 3000);
378
+ }
379
+
380
+ // Message aléatoire
381
+ function setRandomMessage() {
382
+ if (!state.lastAction || Date.now() - state.lastAction > 5000) {
383
+ const randomMsg = state.messages[Math.floor(Math.random() * state.messages.length)];
384
+ showMessage(randomMsg);
385
+ }
386
+ }
387
+
388
+ // Journalisation dans la console de debug
389
+ function logToConsole(msg) {
390
+ const now = new Date();
391
+ const timeString = now.toLocaleTimeString();
392
+ const entry = document.createElement('div');
393
+ entry.textContent = `[${timeString}] ${msg}`;
394
+ elements.debugConsole.appendChild(entry);
395
+ elements.debugConsole.scrollTop = elements.debugConsole.scrollHeight;
396
+ }
397
+
398
+ // Configuration des écouteurs d'événements
399
+ function setupEventListeners() {
400
+ // Nourrir
401
+ buttons.feed.addEventListener('click', () => {
402
+ state.food = Math.min(100, state.food + 30);
403
+ state.lastAction = Date.now();
404
+ showMessage("Miam! C'est bon!");
405
+ logToConsole("Tamacodechi nourri");
406
+ updateUI();
407
+ });
408
+
409
+ // Jouer
410
+ buttons.play.addEventListener('click', () => {
411
+ state.happiness = Math.min(100, state.happiness + 25);
412
+ state.energy = Math.max(0, state.energy - 10);
413
+ state.lastAction = Date.now();
414
+ showMessage("Yeah! C'est amusant!");
415
+ logToConsole("Joué avec Tamacodechi");
416
+ updateUI();
417
+ });
418
+
419
+ // Dormir/Réveiller
420
+ buttons.sleep.addEventListener('click', () => {
421
+ state.isSleeping = !state.isSleeping;
422
+ state.lastAction = Date.now();
423
+ if (state.isSleeping) {
424
+ showMessage("Zzzzzz...");
425
+ logToConsole("Tamacodechi endormi");
426
+ } else {
427
+ showMessage("Je me sens reposé!");
428
+ logToConsole("Tamacodechi réveillé");
429
+ }
430
+ updateUI();
431
+ });
432
+
433
+ // Coder
434
+ buttons.code.addEventListener('click', () => {
435
+ state.xp = Math.min(state.xpToNextLevel, state.xp + 10);
436
+ state.energy = Math.max(0, state.energy - 15);
437
+ state.happiness = Math.min(100, state.happiness + 5);
438
+ state.lastAction = Date.now();
439
+ showMessage("J'adore coder!");
440
+ logToConsole("Tamacodechi a codé");
441
+ updateUI();
442
+ });
443
+
444
+ // Nettoyer
445
+ buttons.clean.addEventListener('click', () => {
446
+ state.isDirty = false;
447
+ state.happiness = Math.min(100, state.happiness + 10);
448
+ state.lastAction = Date.now();
449
+ showMessage("Merci de m'avoir nettoyé!");
450
+ logToConsole("Tamacodechi nettoyé");
451
+ updateUI();
452
+ });
453
+
454
+ // Soigner
455
+ buttons.heal.addEventListener('click', () => {
456
+ state.isSick = false;
457
+ state.health = Math.min(100, state.health + 30);
458
+ state.lastAction = Date.now();
459
+ showMessage("Je me sens mieux!");
460
+ logToConsole("Tamacodechi soigné");
461
+ updateUI();
462
+ });
463
+
464
+ // Debug
465
+ buttons.debug.addEventListener('click', () => {
466
+ elements.debugConsole.classList.toggle('hidden');
467
+ });
468
+
469
+ // Sauvegarder
470
+ buttons.save.addEventListener('click', () => {
471
+ localStorage.setItem('tamacodechi_save', JSON.stringify(state));
472
+ showMessage("Progression sauvegardée!");
473
+ logToConsole("Jeu sauvegardé");
474
+ });
475
+
476
+ // Charger
477
+ buttons.load.addEventListener('click', () => {
478
+ const savedData = localStorage.getItem('tamacodechi_save');
479
+ if (savedData) {
480
+ Object.assign(state, JSON.parse(savedData));
481
+ showMessage("Bienvenue de retour!");
482
+ logToConsole("Jeu chargé");
483
+ updateUI();
484
+ } else {
485
+ showMessage("Aucune sauvegarde trouvée");
486
+ logToConsole("Aucune sauvegarde trouvée");
487
+ }
488
+ });
489
+ }
490
+
491
+ // Démarrer le jeu
492
+ window.onload = init;
493
+ </script>
494
+ <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=Alex59000/tamacodechi" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
495
+ </html>