dennis20014 commited on
Commit
4977d53
·
verified ·
1 Parent(s): 78ac06f

undefined - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +944 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Fun Stuff
3
- emoji: 📈
4
- colorFrom: red
5
- colorTo: purple
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: fun-stuff
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,944 @@
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="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Digital Monster Digivice</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 pulse {
11
+ 0% { transform: scale(1); }
12
+ 50% { transform: scale(1.05); }
13
+ 100% { transform: scale(1); }
14
+ }
15
+
16
+ @keyframes shake {
17
+ 0% { transform: translateX(0); }
18
+ 25% { transform: translateX(-5px); }
19
+ 50% { transform: translateX(5px); }
20
+ 75% { transform: translateX(-5px); }
21
+ 100% { transform: translateX(0); }
22
+ }
23
+
24
+ @keyframes float {
25
+ 0% { transform: translateY(0); }
26
+ 50% { transform: translateY(-10px); }
27
+ 100% { transform: translateY(0); }
28
+ }
29
+
30
+ .digivice-screen {
31
+ background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
32
+ box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
33
+ }
34
+
35
+ .digimon-sprite {
36
+ image-rendering: pixelated;
37
+ }
38
+
39
+ .button-glow {
40
+ box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.7);
41
+ }
42
+
43
+ .notification {
44
+ animation: pulse 1s infinite;
45
+ }
46
+
47
+ .hungry {
48
+ animation: shake 0.5s infinite;
49
+ }
50
+
51
+ .happy {
52
+ animation: float 2s infinite;
53
+ }
54
+ </style>
55
+ </head>
56
+ <body class="bg-gray-900 min-h-screen flex items-center justify-center p-4">
57
+ <div class="relative w-full max-w-md">
58
+ <!-- Digivice Body -->
59
+ <div class="relative bg-black rounded-3xl p-6 shadow-2xl border-4 border-gray-800 overflow-hidden">
60
+ <!-- Antenna -->
61
+ <div class="absolute -top-6 left-1/2 transform -translate-x-1/2 w-4 h-8 bg-red-600 rounded-t-full"></div>
62
+
63
+ <!-- Screen Area -->
64
+ <div class="digivice-screen rounded-xl p-4 mb-6 h-64 relative overflow-hidden">
65
+ <!-- Screen Content -->
66
+ <div id="screen-content" class="h-full flex flex-col">
67
+ <!-- Default screen will be loaded here -->
68
+ </div>
69
+
70
+ <!-- Screen Glow Effect -->
71
+ <div class="absolute inset-0 rounded-xl pointer-events-none" style="box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.2);"></div>
72
+ </div>
73
+
74
+ <!-- Buttons -->
75
+ <div class="flex justify-between mb-4">
76
+ <button id="btn-a" class="bg-blue-600 text-white w-12 h-12 rounded-full flex items-center justify-center text-xl font-bold hover:bg-blue-500 transition-all">
77
+ A
78
+ </button>
79
+ <button id="btn-b" class="bg-red-600 text-white w-12 h-12 rounded-full flex items-center justify-center text-xl font-bold hover:bg-red-500 transition-all">
80
+ B
81
+ </button>
82
+ </div>
83
+
84
+ <div class="flex justify-center space-x-4">
85
+ <button id="btn-up" class="bg-yellow-500 text-gray-900 w-12 h-12 rounded-full flex items-center justify-center text-xl font-bold hover:bg-yellow-400 transition-all">
86
+ <i class="fas fa-arrow-up"></i>
87
+ </button>
88
+ <button id="btn-down" class="bg-yellow-500 text-gray-900 w-12 h-12 rounded-full flex items-center justify-center text-xl font-bold hover:bg-yellow-400 transition-all">
89
+ <i class="fas fa-arrow-down"></i>
90
+ </button>
91
+ </div>
92
+
93
+ <div class="flex justify-center mt-4">
94
+ <button id="btn-c" class="bg-green-600 text-white w-12 h-12 rounded-full flex items-center justify-center text-xl font-bold hover:bg-green-500 transition-all">
95
+ C
96
+ </button>
97
+ </div>
98
+
99
+ <!-- Speaker Holes -->
100
+ <div class="flex justify-center space-x-1 mt-6">
101
+ <div class="w-2 h-2 bg-gray-400 rounded-full"></div>
102
+ <div class="w-2 h-2 bg-gray-400 rounded-full"></div>
103
+ <div class="w-2 h-2 bg-gray-400 rounded-full"></div>
104
+ <div class="w-2 h-2 bg-gray-400 rounded-full"></div>
105
+ </div>
106
+
107
+ <!-- Battery Indicator -->
108
+ <div class="absolute bottom-2 right-4 flex items-center">
109
+ <span class="text-xs text-white mr-1">BATT</span>
110
+ <div class="w-12 h-4 border border-gray-400 rounded flex overflow-hidden">
111
+ <div id="battery-level" class="bg-green-500 h-full w-full"></div>
112
+ </div>
113
+ </div>
114
+ </div>
115
+
116
+ <!-- Strap Holder -->
117
+ <div class="absolute -left-2 top-1/2 transform -translate-y-1/2 w-4 h-16 bg-gray-700 rounded-l"></div>
118
+ <div class="absolute -right-2 top-1/2 transform -translate-y-1/2 w-4 h-16 bg-gray-700 rounded-r"></div>
119
+ </div>
120
+
121
+ <script>
122
+ // Digimon Data
123
+ const digimonData = {
124
+ botamon: {
125
+ name: "Botamon",
126
+ stage: "Baby I",
127
+ sprite: "●",
128
+ color: "text-purple-300",
129
+ evolutions: ["koromon"],
130
+ requirements: { careMistakes: 3, battles: 0, age: 1 }
131
+ },
132
+ koromon: {
133
+ name: "Koromon",
134
+ stage: "Baby II",
135
+ sprite: "●",
136
+ color: "text-pink-300",
137
+ evolutions: ["agumon", "betamon"],
138
+ requirements: { careMistakes: 3, battles: 0, age: 2 }
139
+ },
140
+ agumon: {
141
+ name: "Agumon",
142
+ stage: "Child",
143
+ sprite: `
144
+ /\\_/\\
145
+ ( o.o )
146
+ > ^ <
147
+ `,
148
+ color: "text-yellow-300",
149
+ evolutions: ["greymon", "tyrannomon"],
150
+ requirements: { careMistakes: 5, battles: 5, age: 4 }
151
+ },
152
+ betamon: {
153
+ name: "Betamon",
154
+ stage: "Child",
155
+ sprite: `
156
+ /\\_/\\
157
+ ( x.x )
158
+ > ~ <
159
+ `,
160
+ color: "text-blue-300",
161
+ evolutions: ["seadramon", "devimon"],
162
+ requirements: { careMistakes: 5, battles: 5, age: 4 }
163
+ },
164
+ greymon: {
165
+ name: "Greymon",
166
+ stage: "Adult",
167
+ sprite: `
168
+ /\\___/\\
169
+ ( o.o )
170
+ / ^ \\
171
+ `,
172
+ color: "text-orange-300",
173
+ evolutions: ["metalgreymon", "skullgreymon"],
174
+ requirements: { careMistakes: 8, battles: 15, age: 8 }
175
+ },
176
+ tyrannomon: {
177
+ name: "Tyrannomon",
178
+ stage: "Adult",
179
+ sprite: `
180
+ /\\___/\\
181
+ ( O.O )
182
+ / ^ \\
183
+ `,
184
+ color: "text-red-300",
185
+ evolutions: ["mastertyrannomon"],
186
+ requirements: { careMistakes: 8, battles: 15, age: 8 }
187
+ },
188
+ seadramon: {
189
+ name: "Seadramon",
190
+ stage: "Adult",
191
+ sprite: `
192
+ ~\\___/~
193
+ ( o.o )
194
+ / ^ \\
195
+ `,
196
+ color: "text-teal-300",
197
+ evolutions: ["megaseadramon"],
198
+ requirements: { careMistakes: 8, battles: 15, age: 8 }
199
+ },
200
+ devimon: {
201
+ name: "Devimon",
202
+ stage: "Adult",
203
+ sprite: `
204
+ /\\___/\\
205
+ ( X.X )
206
+ / ^ \\
207
+ `,
208
+ color: "text-purple-500",
209
+ evolutions: ["mydoomon"],
210
+ requirements: { careMistakes: 8, battles: 15, age: 8 }
211
+ }
212
+ };
213
+
214
+ // Game State
215
+ let gameState = {
216
+ currentDigimon: null,
217
+ digimonList: [],
218
+ selectedDigimon: null,
219
+ screen: "main",
220
+ stats: {
221
+ hunger: 100,
222
+ happiness: 100,
223
+ energy: 100,
224
+ cleanliness: 100,
225
+ age: 0,
226
+ battles: 0,
227
+ wins: 0,
228
+ losses: 0,
229
+ careMistakes: 0,
230
+ lastFed: Date.now(),
231
+ lastPlayed: Date.now(),
232
+ lastCleaned: Date.now(),
233
+ lastSleep: Date.now()
234
+ },
235
+ time: {
236
+ day: 1,
237
+ hour: 8,
238
+ minute: 0,
239
+ paused: false
240
+ },
241
+ notifications: []
242
+ };
243
+
244
+ // DOM Elements
245
+ const screenContent = document.getElementById('screen-content');
246
+ const batteryLevel = document.getElementById('battery-level');
247
+ const buttons = {
248
+ a: document.getElementById('btn-a'),
249
+ b: document.getElementById('btn-b'),
250
+ c: document.getElementById('btn-c'),
251
+ up: document.getElementById('btn-up'),
252
+ down: document.getElementById('btn-down')
253
+ };
254
+
255
+ // Initialize the game
256
+ function initGame() {
257
+ // Start with a new Digimon
258
+ createNewDigimon();
259
+
260
+ // Start game loop
261
+ setInterval(gameLoop, 1000);
262
+
263
+ // Set up button listeners
264
+ setupButtons();
265
+
266
+ // Initial render
267
+ renderScreen();
268
+ }
269
+
270
+ // Game loop
271
+ function gameLoop() {
272
+ if (gameState.time.paused) return;
273
+
274
+ // Update time
275
+ gameState.time.minute += 5;
276
+ if (gameState.time.minute >= 60) {
277
+ gameState.time.minute = 0;
278
+ gameState.time.hour++;
279
+ if (gameState.time.hour >= 24) {
280
+ gameState.time.hour = 0;
281
+ gameState.time.day++;
282
+ gameState.stats.age++;
283
+ checkEvolution();
284
+ }
285
+ }
286
+
287
+ // Update stats
288
+ updateStats();
289
+
290
+ // Check for notifications
291
+ checkNotifications();
292
+
293
+ // Update battery (random for effect)
294
+ if (Math.random() < 0.01) {
295
+ updateBattery();
296
+ }
297
+
298
+ // Render
299
+ renderScreen();
300
+ }
301
+
302
+ // Update Digimon stats over time
303
+ function updateStats() {
304
+ const now = Date.now();
305
+ const hoursSinceFed = (now - gameState.stats.lastFed) / (1000 * 60 * 60);
306
+ const hoursSincePlayed = (now - gameState.stats.lastPlayed) / (1000 * 60 * 60);
307
+ const hoursSinceCleaned = (now - gameState.stats.lastCleaned) / (1000 * 60 * 60);
308
+ const hoursSinceSleep = (now - gameState.stats.lastSleep) / (1000 * 60 * 60);
309
+
310
+ // Hunger decreases over time
311
+ if (hoursSinceFed > 2) {
312
+ gameState.stats.hunger = Math.max(0, gameState.stats.hunger - 5);
313
+ if (gameState.stats.hunger < 30 && !gameState.notifications.includes('hungry')) {
314
+ gameState.notifications.push('hungry');
315
+ }
316
+ }
317
+
318
+ // Happiness decreases if not played with
319
+ if (hoursSincePlayed > 3) {
320
+ gameState.stats.happiness = Math.max(0, gameState.stats.happiness - 3);
321
+ if (gameState.stats.happiness < 30 && !gameState.notifications.includes('bored')) {
322
+ gameState.notifications.push('bored');
323
+ }
324
+ }
325
+
326
+ // Cleanliness decreases over time
327
+ if (hoursSinceCleaned > 4) {
328
+ gameState.stats.cleanliness = Math.max(0, gameState.stats.cleanliness - 4);
329
+ if (gameState.stats.cleanliness < 30 && !gameState.notifications.includes('dirty')) {
330
+ gameState.notifications.push('dirty');
331
+ }
332
+ }
333
+
334
+ // Energy decreases if not slept
335
+ if (hoursSinceSleep > 6) {
336
+ gameState.stats.energy = Math.max(0, gameState.stats.energy - 4);
337
+ if (gameState.stats.energy < 30 && !gameState.notifications.includes('tired')) {
338
+ gameState.notifications.push('tired');
339
+ }
340
+ }
341
+
342
+ // Care mistakes if stats get too low
343
+ if (gameState.stats.hunger <= 0 || gameState.stats.happiness <= 0 ||
344
+ gameState.stats.cleanliness <= 0 || gameState.stats.energy <= 0) {
345
+ gameState.stats.careMistakes++;
346
+
347
+ // Reset stats to prevent multiple care mistakes at once
348
+ if (gameState.stats.hunger <= 0) gameState.stats.hunger = 30;
349
+ if (gameState.stats.happiness <= 0) gameState.stats.happiness = 30;
350
+ if (gameState.stats.cleanliness <= 0) gameState.stats.cleanliness = 30;
351
+ if (gameState.stats.energy <= 0) gameState.stats.energy = 30;
352
+
353
+ gameState.notifications.push('careMistake');
354
+ }
355
+ }
356
+
357
+ // Check for evolution conditions
358
+ function checkEvolution() {
359
+ if (!gameState.currentDigimon) return;
360
+
361
+ const currentDigiData = digimonData[gameState.currentDigimon];
362
+ const requirements = currentDigiData.requirements;
363
+
364
+ // Check if requirements are met
365
+ if (gameState.stats.age >= requirements.age &&
366
+ gameState.stats.battles >= requirements.battles &&
367
+ gameState.stats.careMistakes <= requirements.careMistakes) {
368
+
369
+ // Randomly select an evolution path
370
+ const possibleEvolutions = currentDigiData.evolutions;
371
+ const nextEvolution = possibleEvolutions[Math.floor(Math.random() * possibleEvolutions.length)];
372
+
373
+ // Evolve the Digimon
374
+ gameState.currentDigimon = nextEvolution;
375
+ gameState.notifications.push('evolution');
376
+ }
377
+ }
378
+
379
+ // Create a new Digimon
380
+ function createNewDigimon() {
381
+ gameState.currentDigimon = "botamon";
382
+ gameState.digimonList.push({
383
+ name: "Botamon",
384
+ type: "botamon",
385
+ stats: { ...gameState.stats }
386
+ });
387
+ gameState.selectedDigimon = 0;
388
+
389
+ // Reset stats
390
+ gameState.stats = {
391
+ hunger: 100,
392
+ happiness: 100,
393
+ energy: 100,
394
+ cleanliness: 100,
395
+ age: 0,
396
+ battles: 0,
397
+ wins: 0,
398
+ losses: 0,
399
+ careMistakes: 0,
400
+ lastFed: Date.now(),
401
+ lastPlayed: Date.now(),
402
+ lastCleaned: Date.now(),
403
+ lastSleep: Date.now()
404
+ };
405
+
406
+ gameState.notifications.push('newDigimon');
407
+ }
408
+
409
+ // Update battery level (visual effect only)
410
+ function updateBattery() {
411
+ const levels = ['w-0', 'w-1/4', 'w-1/2', 'w-3/4', 'w-full'];
412
+ const colors = ['bg-red-500', 'bg-yellow-500', 'bg-green-500'];
413
+
414
+ // Randomly change battery level for effect
415
+ const randomLevel = levels[Math.floor(Math.random() * levels.length)];
416
+ const randomColor = colors[Math.floor(Math.random() * colors.length)];
417
+
418
+ batteryLevel.className = `h-full ${randomLevel} ${randomColor}`;
419
+ }
420
+
421
+ // Check for notifications
422
+ function checkNotifications() {
423
+ // Check if any stats are critically low
424
+ if (gameState.stats.hunger < 20 && !gameState.notifications.includes('starving')) {
425
+ gameState.notifications.push('starving');
426
+ }
427
+
428
+ if (gameState.stats.happiness < 20 && !gameState.notifications.includes('depressed')) {
429
+ gameState.notifications.push('depressed');
430
+ }
431
+
432
+ if (gameState.stats.cleanliness < 20 && !gameState.notifications.includes('filthy')) {
433
+ gameState.notifications.push('filthy');
434
+ }
435
+
436
+ if (gameState.stats.energy < 20 && !gameState.notifications.includes('exhausted')) {
437
+ gameState.notifications.push('exhausted');
438
+ }
439
+ }
440
+
441
+ // Render the current screen
442
+ function renderScreen() {
443
+ let content = '';
444
+
445
+ switch (gameState.screen) {
446
+ case 'main':
447
+ content = renderMainScreen();
448
+ break;
449
+ case 'stats':
450
+ content = renderStatsScreen();
451
+ break;
452
+ case 'care':
453
+ content = renderCareScreen();
454
+ break;
455
+ case 'battle':
456
+ content = renderBattleScreen();
457
+ break;
458
+ case 'digivolve':
459
+ content = renderDigivolveScreen();
460
+ break;
461
+ case 'settings':
462
+ content = renderSettingsScreen();
463
+ break;
464
+ default:
465
+ content = renderMainScreen();
466
+ }
467
+
468
+ screenContent.innerHTML = content;
469
+
470
+ // Add notification indicator if any
471
+ if (gameState.notifications.length > 0) {
472
+ const notificationBtn = document.getElementById('notification-btn');
473
+ if (notificationBtn) {
474
+ notificationBtn.classList.add('notification');
475
+ }
476
+ }
477
+ }
478
+
479
+ // Render main screen
480
+ function renderMainScreen() {
481
+ const digimon = gameState.currentDigimon ? digimonData[gameState.currentDigimon] : null;
482
+ const hour = gameState.time.hour.toString().padStart(2, '0');
483
+ const minute = gameState.time.minute.toString().padStart(2, '0');
484
+
485
+ let digimonDisplay = '';
486
+ if (digimon) {
487
+ // Add animation classes based on state
488
+ let animationClass = '';
489
+ if (gameState.notifications.includes('hungry') || gameState.notifications.includes('starving')) {
490
+ animationClass = 'hungry';
491
+ } else if (gameState.stats.happiness > 70) {
492
+ animationClass = 'happy';
493
+ }
494
+
495
+ digimonDisplay = `
496
+ <div class="flex-1 flex flex-col items-center justify-center ${digimon.color} ${animationClass}">
497
+ <pre class="digimon-sprite text-4xl mb-2">${digimon.sprite}</pre>
498
+ <div class="text-center">
499
+ <div class="text-lg font-bold">${digimon.name}</div>
500
+ <div class="text-xs">${digimon.stage}</div>
501
+ </div>
502
+ </div>
503
+ `;
504
+ } else {
505
+ digimonDisplay = `
506
+ <div class="flex-1 flex items-center justify-center text-white">
507
+ No Digimon
508
+ </div>
509
+ `;
510
+ }
511
+
512
+ return `
513
+ <div class="h-full flex flex-col">
514
+ <!-- Status Bar -->
515
+ <div class="flex justify-between items-center text-white text-xs mb-2">
516
+ <div>Day ${gameState.time.day}</div>
517
+ <div>${hour}:${minute}</div>
518
+ <div id="notification-btn" class="w-4 h-4 rounded-full bg-red-500 ${gameState.notifications.length > 0 ? 'notification' : 'opacity-0'}"></div>
519
+ </div>
520
+
521
+ <!-- Digimon Display -->
522
+ ${digimonDisplay}
523
+
524
+ <!-- Menu Options -->
525
+ <div class="grid grid-cols-3 gap-2 text-white text-xs text-center mt-auto">
526
+ <div class="bg-blue-800 p-1 rounded">STATS</div>
527
+ <div class="bg-green-800 p-1 rounded">CARE</div>
528
+ <div class="bg-red-800 p-1 rounded">BATTLE</div>
529
+ </div>
530
+ </div>
531
+ `;
532
+ }
533
+
534
+ // Render stats screen
535
+ function renderStatsScreen() {
536
+ const digimon = gameState.currentDigimon ? digimonData[gameState.currentDigimon] : null;
537
+
538
+ return `
539
+ <div class="h-full flex flex-col text-white">
540
+ <div class="text-center font-bold mb-2">${digimon ? digimon.name : 'No Digimon'} STATS</div>
541
+
542
+ <div class="flex-1 grid grid-cols-2 gap-2 text-xs">
543
+ <div class="bg-gray-800 p-2 rounded">
544
+ <div>HUNGER</div>
545
+ <div class="w-full bg-gray-700 h-4 rounded mt-1">
546
+ <div class="bg-red-500 h-full rounded" style="width: ${gameState.stats.hunger}%"></div>
547
+ </div>
548
+ </div>
549
+
550
+ <div class="bg-gray-800 p-2 rounded">
551
+ <div>HAPPINESS</div>
552
+ <div class="w-full bg-gray-700 h-4 rounded mt-1">
553
+ <div class="bg-yellow-500 h-full rounded" style="width: ${gameState.stats.happiness}%"></div>
554
+ </div>
555
+ </div>
556
+
557
+ <div class="bg-gray-800 p-2 rounded">
558
+ <div>ENERGY</div>
559
+ <div class="w-full bg-gray-700 h-4 rounded mt-1">
560
+ <div class="bg-blue-500 h-full rounded" style="width: ${gameState.stats.energy}%"></div>
561
+ </div>
562
+ </div>
563
+
564
+ <div class="bg-gray-800 p-2 rounded">
565
+ <div>CLEANLINESS</div>
566
+ <div class="w-full bg-gray-700 h-4 rounded mt-1">
567
+ <div class="bg-green-500 h-full rounded" style="width: ${gameState.stats.cleanliness}%"></div>
568
+ </div>
569
+ </div>
570
+
571
+ <div class="bg-gray-800 p-2 rounded">
572
+ <div>AGE</div>
573
+ <div>${gameState.stats.age} days</div>
574
+ </div>
575
+
576
+ <div class="bg-gray-800 p-2 rounded">
577
+ <div>BATTLES</div>
578
+ <div>${gameState.stats.wins}W/${gameState.stats.losses}L</div>
579
+ </div>
580
+
581
+ <div class="bg-gray-800 p-2 rounded">
582
+ <div>CARE MISTAKES</div>
583
+ <div>${gameState.stats.careMistakes}</div>
584
+ </div>
585
+
586
+ <div class="bg-gray-800 p-2 rounded">
587
+ <div>STAGE</div>
588
+ <div>${digimon ? digimon.stage : 'N/A'}</div>
589
+ </div>
590
+ </div>
591
+
592
+ <div class="mt-auto text-center text-xs">
593
+ Press B to return
594
+ </div>
595
+ </div>
596
+ `;
597
+ }
598
+
599
+ // Render care screen
600
+ function renderCareScreen() {
601
+ return `
602
+ <div class="h-full flex flex-col text-white">
603
+ <div class="text-center font-bold mb-2">CARE MENU</div>
604
+
605
+ <div class="flex-1 grid grid-cols-2 gap-2">
606
+ <button id="care-feed" class="bg-red-600 p-2 rounded flex flex-col items-center justify-center ${gameState.notifications.includes('hungry') ? 'button-glow' : ''}">
607
+ <i class="fas fa-utensils text-2xl mb-1"></i>
608
+ <div class="text-xs">FEED</div>
609
+ </button>
610
+
611
+ <button id="care-play" class="bg-yellow-600 p-2 rounded flex flex-col items-center justify-center ${gameState.notifications.includes('bored') ? 'button-glow' : ''}">
612
+ <i class="fas fa-gamepad text-2xl mb-1"></i>
613
+ <div class="text-xs">PLAY</div>
614
+ </button>
615
+
616
+ <button id="care-clean" class="bg-blue-600 p-2 rounded flex flex-col items-center justify-center ${gameState.notifications.includes('dirty') ? 'button-glow' : ''}">
617
+ <i class="fas fa-shower text-2xl mb-1"></i>
618
+ <div class="text-xs">CLEAN</div>
619
+ </button>
620
+
621
+ <button id="care-sleep" class="bg-purple-600 p-2 rounded flex flex-col items-center justify-center ${gameState.notifications.includes('tired') ? 'button-glow' : ''}">
622
+ <i class="fas fa-moon text-2xl mb-1"></i>
623
+ <div class="text-xs">SLEEP</div>
624
+ </button>
625
+
626
+ <button id="care-medicine" class="bg-green-600 p-2 rounded flex flex-col items-center justify-center">
627
+ <i class="fas fa-pills text-2xl mb-1"></i>
628
+ <div class="text-xs">MEDICINE</div>
629
+ </button>
630
+
631
+ <button id="care-scold" class="bg-gray-600 p-2 rounded flex flex-col items-center justify-center">
632
+ <i class="fas fa-angry text-2xl mb-1"></i>
633
+ <div class="text-xs">SCOLD</div>
634
+ </button>
635
+ </div>
636
+
637
+ <div class="mt-auto text-center text-xs">
638
+ Press B to return
639
+ </div>
640
+ </div>
641
+ `;
642
+ }
643
+
644
+ // Render battle screen
645
+ function renderBattleScreen() {
646
+ const opponents = ["Numemon", "Gazimon", "Gotsumon", "Patamon", "Gabumon"];
647
+ const randomOpponent = opponents[Math.floor(Math.random() * opponents.length)];
648
+
649
+ return `
650
+ <div class="h-full flex flex-col text-white">
651
+ <div class="text-center font-bold mb-2">BATTLE MENU</div>
652
+
653
+ <div class="flex-1 flex flex-col items-center justify-center">
654
+ <div class="text-lg mb-4">VS ${randomOpponent}</div>
655
+
656
+ <div class="grid grid-cols-2 gap-4 w-full">
657
+ <button id="battle-fight" class="bg-red-600 p-2 rounded">
658
+ <div class="text-xs">FIGHT</div>
659
+ </button>
660
+
661
+ <button id="battle-run" class="bg-blue-600 p-2 rounded">
662
+ <div class="text-xs">RUN</div>
663
+ </button>
664
+ </div>
665
+ </div>
666
+
667
+ <div class="mt-auto text-center text-xs">
668
+ Press B to return
669
+ </div>
670
+ </div>
671
+ `;
672
+ }
673
+
674
+ // Render digivolve screen
675
+ function renderDigivolveScreen() {
676
+ const digimon = gameState.currentDigimon ? digimonData[gameState.currentDigimon] : null;
677
+ const nextStage = digimon ? digimon.evolutions[0] : null;
678
+ const nextDigimon = nextStage ? digimonData[nextStage] : null;
679
+
680
+ return `
681
+ <div class="h-full flex flex-col items-center justify-center text-white">
682
+ <div class="text-center font-bold mb-4">DIGIVOLUTION!</div>
683
+
684
+ <div class="flex items-center justify-center space-x-8 mb-4">
685
+ <div class="text-center">
686
+ <pre class="digimon-sprite text-4xl ${digimon.color}">${digimon.sprite}</pre>
687
+ <div class="text-xs">${digimon.name}</div>
688
+ </div>
689
+
690
+ <div class="text-2xl">→</div>
691
+
692
+ <div class="text-center">
693
+ <pre class="digimon-sprite text-4xl ${nextDigimon.color}">${nextDigimon.sprite}</pre>
694
+ <div class="text-xs">${nextDigimon.name}</div>
695
+ </div>
696
+ </div>
697
+
698
+ <div class="text-center text-xs mb-4">
699
+ Your ${digimon.name} is evolving into ${nextDigimon.name}!
700
+ </div>
701
+
702
+ <button id="digivolve-confirm" class="bg-green-600 px-4 py-2 rounded">
703
+ CONTINUE
704
+ </button>
705
+ </div>
706
+ `;
707
+ }
708
+
709
+ // Render settings screen
710
+ function renderSettingsScreen() {
711
+ return `
712
+ <div class="h-full flex flex-col text-white">
713
+ <div class="text-center font-bold mb-2">SETTINGS</div>
714
+
715
+ <div class="flex-1 grid grid-cols-2 gap-2">
716
+ <button id="settings-time" class="bg-blue-600 p-2 rounded flex flex-col items-center justify-center">
717
+ <i class="fas fa-clock text-2xl mb-1"></i>
718
+ <div class="text-xs">TIME</div>
719
+ </button>
720
+
721
+ <button id="settings-sound" class="bg-green-600 p-2 rounded flex flex-col items-center justify-center">
722
+ <i class="fas fa-volume-up text-2xl mb-1"></i>
723
+ <div class="text-xs">SOUND</div>
724
+ </button>
725
+
726
+ <button id="settings-reset" class="bg-red-600 p-2 rounded flex flex-col items-center justify-center">
727
+ <i class="fas fa-trash text-2xl mb-1"></i>
728
+ <div class="text-xs">RESET</div>
729
+ </button>
730
+
731
+ <button id="settings-about" class="bg-yellow-600 p-2 rounded flex flex-col items-center justify-center">
732
+ <i class="fas fa-info-circle text-2xl mb-1"></i>
733
+ <div class="text-xs">ABOUT</div>
734
+ </button>
735
+ </div>
736
+
737
+ <div class="mt-auto text-center text-xs">
738
+ Press B to return
739
+ </div>
740
+ </div>
741
+ `;
742
+ }
743
+
744
+ // Handle button presses
745
+ function setupButtons() {
746
+ // A Button - Contextual action
747
+ buttons.a.addEventListener('click', () => {
748
+ switch (gameState.screen) {
749
+ case 'main':
750
+ // Toggle between Digimon and menu
751
+ break;
752
+ case 'care':
753
+ // Default action in care menu
754
+ break;
755
+ case 'battle':
756
+ // Attack in battle
757
+ break;
758
+ }
759
+ });
760
+
761
+ // B Button - Back/return
762
+ buttons.b.addEventListener('click', () => {
763
+ if (gameState.screen !== 'main') {
764
+ gameState.screen = 'main';
765
+ renderScreen();
766
+ } else {
767
+ // Check notifications
768
+ if (gameState.notifications.length > 0) {
769
+ handleNotification();
770
+ }
771
+ }
772
+ });
773
+
774
+ // C Button - Menu
775
+ buttons.c.addEventListener('click', () => {
776
+ if (gameState.screen === 'main') {
777
+ gameState.screen = 'settings';
778
+ renderScreen();
779
+ }
780
+ });
781
+
782
+ // Up Button - Navigate up
783
+ buttons.up.addEventListener('click', () => {
784
+ if (gameState.screen === 'main') {
785
+ gameState.screen = 'stats';
786
+ renderScreen();
787
+ }
788
+ });
789
+
790
+ // Down Button - Navigate down
791
+ buttons.down.addEventListener('click', () => {
792
+ if (gameState.screen === 'main') {
793
+ gameState.screen = 'care';
794
+ renderScreen();
795
+ } else if (gameState.screen === 'care') {
796
+ gameState.screen = 'battle';
797
+ renderScreen();
798
+ }
799
+ });
800
+
801
+ // Care menu buttons
802
+ document.addEventListener('click', (e) => {
803
+ if (e.target.closest('#care-feed')) {
804
+ feedDigimon();
805
+ } else if (e.target.closest('#care-play')) {
806
+ playWithDigimon();
807
+ } else if (e.target.closest('#care-clean')) {
808
+ cleanDigimon();
809
+ } else if (e.target.closest('#care-sleep')) {
810
+ putDigimonToSleep();
811
+ } else if (e.target.closest('#battle-fight')) {
812
+ startBattle();
813
+ } else if (e.target.closest('#digivolve-confirm')) {
814
+ confirmEvolution();
815
+ }
816
+ });
817
+ }
818
+
819
+ // Handle notifications
820
+ function handleNotification() {
821
+ if (gameState.notifications.length === 0) return;
822
+
823
+ const notification = gameState.notifications.shift();
824
+ let message = '';
825
+
826
+ switch (notification) {
827
+ case 'hungry':
828
+ message = `${digimonData[gameState.currentDigimon].name} is hungry!`;
829
+ break;
830
+ case 'starving':
831
+ message = `${digimonData[gameState.currentDigimon].name} is starving!`;
832
+ break;
833
+ case 'bored':
834
+ message = `${digimonData[gameState.currentDigimon].name} wants to play!`;
835
+ break;
836
+ case 'depressed':
837
+ message = `${digimonData[gameState.currentDigimon].name} is depressed!`;
838
+ break;
839
+ case 'dirty':
840
+ message = `${digimonData[gameState.currentDigimon].name} needs cleaning!`;
841
+ break;
842
+ case 'filthy':
843
+ message = `${digimonData[gameState.currentDigimon].name} is filthy!`;
844
+ break;
845
+ case 'tired':
846
+ message = `${digimonData[gameState.currentDigimon].name} is tired!`;
847
+ break;
848
+ case 'exhausted':
849
+ message = `${digimonData[gameState.currentDigimon].name} is exhausted!`;
850
+ break;
851
+ case 'careMistake':
852
+ message = `Care mistake! ${digimonData[gameState.currentDigimon].name} wasn't cared for properly.`;
853
+ break;
854
+ case 'newDigimon':
855
+ message = `A new Digimon has appeared!`;
856
+ break;
857
+ case 'evolution':
858
+ gameState.screen = 'digivolve';
859
+ break;
860
+ default:
861
+ message = `Notification: ${notification}`;
862
+ }
863
+
864
+ if (message) {
865
+ alert(message); // In a real app, we'd show this in the Digivice screen
866
+ }
867
+
868
+ renderScreen();
869
+ }
870
+
871
+ // Care actions
872
+ function feedDigimon() {
873
+ gameState.stats.hunger = Math.min(100, gameState.stats.hunger + 30);
874
+ gameState.stats.lastFed = Date.now();
875
+ removeNotification('hungry');
876
+ removeNotification('starving');
877
+ renderScreen();
878
+ }
879
+
880
+ function playWithDigimon() {
881
+ gameState.stats.happiness = Math.min(100, gameState.stats.happiness + 30);
882
+ gameState.stats.energy = Math.max(0, gameState.stats.energy - 10);
883
+ gameState.stats.lastPlayed = Date.now();
884
+ removeNotification('bored');
885
+ removeNotification('depressed');
886
+ renderScreen();
887
+ }
888
+
889
+ function cleanDigimon() {
890
+ gameState.stats.cleanliness = Math.min(100, gameState.stats.cleanliness + 40);
891
+ gameState.stats.lastCleaned = Date.now();
892
+ removeNotification('dirty');
893
+ removeNotification('filthy');
894
+ renderScreen();
895
+ }
896
+
897
+ function putDigimonToSleep() {
898
+ gameState.stats.energy = Math.min(100, gameState.stats.energy + 50);
899
+ gameState.stats.lastSleep = Date.now();
900
+ removeNotification('tired');
901
+ removeNotification('exhausted');
902
+ renderScreen();
903
+ }
904
+
905
+ function removeNotification(type) {
906
+ gameState.notifications = gameState.notifications.filter(n => n !== type);
907
+ }
908
+
909
+ // Battle system
910
+ function startBattle() {
911
+ const winChance = 0.5 +
912
+ (gameState.stats.happiness / 200) +
913
+ (gameState.stats.energy / 200) -
914
+ (gameState.stats.careMistakes * 0.05);
915
+
916
+ const didWin = Math.random() < winChance;
917
+
918
+ if (didWin) {
919
+ gameState.stats.battles++;
920
+ gameState.stats.wins++;
921
+ gameState.stats.happiness = Math.min(100, gameState.stats.happiness + 10);
922
+ alert(`${digimonData[gameState.currentDigimon].name} won the battle!`);
923
+ } else {
924
+ gameState.stats.battles++;
925
+ gameState.stats.losses++;
926
+ gameState.stats.energy = Math.max(0, gameState.stats.energy - 20);
927
+ alert(`${digimonData[gameState.currentDigimon].name} lost the battle...`);
928
+ }
929
+
930
+ gameState.screen = 'main';
931
+ renderScreen();
932
+ }
933
+
934
+ // Evolution
935
+ function confirmEvolution() {
936
+ gameState.screen = 'main';
937
+ renderScreen();
938
+ }
939
+
940
+ // Initialize the game when the page loads
941
+ window.addEventListener('DOMContentLoaded', initGame);
942
+ </script>
943
+ <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=dennis20014/fun-stuff" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
944
+ </html>