ID221183 commited on
Commit
03d3b5b
·
verified ·
1 Parent(s): 2c8e7f5

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +731 -19
index.html CHANGED
@@ -1,19 +1,731 @@
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>Babana - The Ultimate Banana Experience</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ :root {
15
+ --primary-yellow: #FFE135;
16
+ --dark-yellow: #FFD700;
17
+ --light-yellow: #FFF8DC;
18
+ --green: #7FB069;
19
+ --brown: #8B4513;
20
+ --dark-brown: #654321;
21
+ --shadow: rgba(0, 0, 0, 0.1);
22
+ --text-dark: #2C3E50;
23
+ }
24
+
25
+ body {
26
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
27
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
28
+ min-height: 100vh;
29
+ overflow-x: hidden;
30
+ position: relative;
31
+ }
32
+
33
+ /* Animated background bananas */
34
+ .floating-bananas {
35
+ position: fixed;
36
+ width: 100%;
37
+ height: 100%;
38
+ pointer-events: none;
39
+ overflow: hidden;
40
+ z-index: 1;
41
+ }
42
+
43
+ .floating-banana {
44
+ position: absolute;
45
+ font-size: 2rem;
46
+ animation: float 15s infinite linear;
47
+ opacity: 0.1;
48
+ }
49
+
50
+ @keyframes float {
51
+ from {
52
+ transform: translateX(-100px) rotate(0deg);
53
+ }
54
+ to {
55
+ transform: translateX(calc(100vw + 100px)) rotate(360deg);
56
+ }
57
+ }
58
+
59
+ /* Header */
60
+ header {
61
+ background: rgba(255, 255, 255, 0.95);
62
+ backdrop-filter: blur(10px);
63
+ padding: 1rem 2rem;
64
+ box-shadow: 0 4px 20px var(--shadow);
65
+ position: relative;
66
+ z-index: 10;
67
+ display: flex;
68
+ justify-content: space-between;
69
+ align-items: center;
70
+ }
71
+
72
+ .logo {
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 1rem;
76
+ font-size: 1.8rem;
77
+ font-weight: bold;
78
+ color: var(--text-dark);
79
+ }
80
+
81
+ .banana-icon {
82
+ font-size: 2.5rem;
83
+ animation: bounce 2s infinite;
84
+ }
85
+
86
+ @keyframes bounce {
87
+ 0%, 100% { transform: translateY(0); }
88
+ 50% { transform: translateY(-10px); }
89
+ }
90
+
91
+ nav {
92
+ display: flex;
93
+ gap: 2rem;
94
+ }
95
+
96
+ nav button {
97
+ background: none;
98
+ border: none;
99
+ color: var(--text-dark);
100
+ font-size: 1rem;
101
+ cursor: pointer;
102
+ padding: 0.5rem 1rem;
103
+ border-radius: 25px;
104
+ transition: all 0.3s ease;
105
+ position: relative;
106
+ overflow: hidden;
107
+ }
108
+
109
+ nav button::before {
110
+ content: '';
111
+ position: absolute;
112
+ top: 50%;
113
+ left: 50%;
114
+ width: 0;
115
+ height: 0;
116
+ background: var(--primary-yellow);
117
+ border-radius: 50%;
118
+ transform: translate(-50%, -50%);
119
+ transition: width 0.5s, height 0.5s;
120
+ }
121
+
122
+ nav button:hover::before {
123
+ width: 100%;
124
+ height: 100%;
125
+ }
126
+
127
+ nav button:hover {
128
+ color: var(--text-dark);
129
+ transform: translateY(-2px);
130
+ }
131
+
132
+ nav button span {
133
+ position: relative;
134
+ z-index: 1;
135
+ }
136
+
137
+ /* Main Container */
138
+ .container {
139
+ max-width: 1200px;
140
+ margin: 2rem auto;
141
+ padding: 0 2rem;
142
+ position: relative;
143
+ z-index: 5;
144
+ }
145
+
146
+ /* Sections */
147
+ .section {
148
+ display: none;
149
+ animation: fadeIn 0.5s ease;
150
+ }
151
+
152
+ .section.active {
153
+ display: block;
154
+ }
155
+
156
+ @keyframes fadeIn {
157
+ from {
158
+ opacity: 0;
159
+ transform: translateY(20px);
160
+ }
161
+ to {
162
+ opacity: 1;
163
+ transform: translateY(0);
164
+ }
165
+ }
166
+
167
+ /* Game Section */
168
+ .game-container {
169
+ background: rgba(255, 255, 255, 0.95);
170
+ border-radius: 20px;
171
+ padding: 2rem;
172
+ box-shadow: 0 10px 40px var(--shadow);
173
+ text-align: center;
174
+ }
175
+
176
+ .game-title {
177
+ font-size: 2.5rem;
178
+ color: var(--text-dark);
179
+ margin-bottom: 1rem;
180
+ }
181
+
182
+ .score-board {
183
+ display: flex;
184
+ justify-content: center;
185
+ gap: 3rem;
186
+ margin-bottom: 2rem;
187
+ }
188
+
189
+ .score-item {
190
+ background: linear-gradient(135deg, var(--primary-yellow), var(--dark-yellow));
191
+ padding: 1rem 2rem;
192
+ border-radius: 15px;
193
+ box-shadow: 0 4px 15px rgba(255, 209, 0, 0.3);
194
+ }
195
+
196
+ .score-label {
197
+ font-size: 0.9rem;
198
+ color: var(--text-dark);
199
+ margin-bottom: 0.5rem;
200
+ }
201
+
202
+ .score-value {
203
+ font-size: 2rem;
204
+ font-weight: bold;
205
+ color: var(--text-dark);
206
+ }
207
+
208
+ .banana-game-area {
209
+ display: grid;
210
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
211
+ gap: 1.5rem;
212
+ margin: 2rem auto;
213
+ max-width: 600px;
214
+ }
215
+
216
+ .banana-card {
217
+ background: linear-gradient(135deg, var(--light-yellow), var(--primary-yellow));
218
+ border-radius: 15px;
219
+ padding: 2rem;
220
+ cursor: pointer;
221
+ transition: all 0.3s ease;
222
+ position: relative;
223
+ overflow: hidden;
224
+ box-shadow: 0 4px 15px var(--shadow);
225
+ }
226
+
227
+ .banana-card::before {
228
+ content: '';
229
+ position: absolute;
230
+ top: -50%;
231
+ left: -50%;
232
+ width: 200%;
233
+ height: 200%;
234
+ background: radial-gradient(circle, transparent, rgba(255, 255, 255, 0.3));
235
+ transform: rotate(45deg);
236
+ transition: all 0.5s;
237
+ opacity: 0;
238
+ }
239
+
240
+ .banana-card:hover::before {
241
+ animation: shine 0.5s ease;
242
+ }
243
+
244
+ @keyframes shine {
245
+ 0% {
246
+ transform: translateX(-100%) translateY(-100%) rotate(45deg);
247
+ opacity: 0;
248
+ }
249
+ 50% {
250
+ opacity: 1;
251
+ }
252
+ 100% {
253
+ transform: translateX(100%) translateY(100%) rotate(45deg);
254
+ opacity: 0;
255
+ }
256
+ }
257
+
258
+ .banana-card:hover {
259
+ transform: translateY(-5px) scale(1.05);
260
+ box-shadow: 0 8px 25px rgba(255, 209, 0, 0.4);
261
+ }
262
+
263
+ .banana-card.peeled {
264
+ background: linear-gradient(135deg, #FFF, #F0F0F0);
265
+ transform: rotate(180deg) scale(0.9);
266
+ }
267
+
268
+ .banana-emoji {
269
+ font-size: 3rem;
270
+ margin-bottom: 0.5rem;
271
+ transition: all 0.3s ease;
272
+ }
273
+
274
+ .banana-card:hover .banana-emoji {
275
+ transform: scale(1.2) rotate(10deg);
276
+ }
277
+
278
+ .banana-card.peeled .banana-emoji {
279
+ filter: grayscale(100%);
280
+ opacity: 0.5;
281
+ }
282
+
283
+ /* Facts Section */
284
+ .facts-container {
285
+ background: rgba(255, 255, 255, 0.95);
286
+ border-radius: 20px;
287
+ padding: 2rem;
288
+ box-shadow: 0 10px 40px var(--shadow);
289
+ }
290
+
291
+ .fact-card {
292
+ background: linear-gradient(135deg, var(--light-yellow), white);
293
+ border-radius: 15px;
294
+ padding: 1.5rem;
295
+ margin-bottom: 1.5rem;
296
+ border-left: 5px solid var(--primary-yellow);
297
+ transition: all 0.3s ease;
298
+ cursor: pointer;
299
+ }
300
+
301
+ .fact-card:hover {
302
+ transform: translateX(10px);
303
+ box-shadow: 0 5px 20px var(--shadow);
304
+ }
305
+
306
+ .fact-number {
307
+ display: inline-block;
308
+ background: var(--primary-yellow);
309
+ color: var(--text-dark);
310
+ width: 30px;
311
+ height: 30px;
312
+ border-radius: 50%;
313
+ text-align: center;
314
+ line-height: 30px;
315
+ font-weight: bold;
316
+ margin-right: 1rem;
317
+ }
318
+
319
+ .fact-text {
320
+ color: var(--text-dark);
321
+ font-size: 1.1rem;
322
+ line-height: 1.6;
323
+ }
324
+
325
+ /* Counter Section */
326
+ .counter-container {
327
+ background: rgba(255, 255, 255, 0.95);
328
+ border-radius: 20px;
329
+ padding: 2rem;
330
+ box-shadow: 0 10px 40px var(--shadow);
331
+ text-align: center;
332
+ }
333
+
334
+ .big-counter {
335
+ font-size: 5rem;
336
+ font-weight: bold;
337
+ background: linear-gradient(135deg, var(--primary-yellow), var(--dark-yellow));
338
+ -webkit-background-clip: text;
339
+ -webkit-text-fill-color: transparent;
340
+ background-clip: text;
341
+ margin: 2rem 0;
342
+ animation: pulse 2s infinite;
343
+ }
344
+
345
+ @keyframes pulse {
346
+ 0%, 100% { transform: scale(1); }
347
+ 50% { transform: scale(1.05); }
348
+ }
349
+
350
+ .counter-buttons {
351
+ display: flex;
352
+ justify-content: center;
353
+ gap: 1rem;
354
+ margin-top: 2rem;
355
+ }
356
+
357
+ .btn {
358
+ background: linear-gradient(135deg, var(--primary-yellow), var(--dark-yellow));
359
+ border: none;
360
+ color: var(--text-dark);
361
+ padding: 1rem 2rem;
362
+ border-radius: 50px;
363
+ font-size: 1.1rem;
364
+ font-weight: bold;
365
+ cursor: pointer;
366
+ transition: all 0.3s ease;
367
+ box-shadow: 0 4px 15px rgba(255, 209, 0, 0.3);
368
+ }
369
+
370
+ .btn:hover {
371
+ transform: translateY(-3px);
372
+ box-shadow: 0 6px 20px rgba(255, 209, 0, 0.4);
373
+ }
374
+
375
+ .btn:active {
376
+ transform: translateY(0);
377
+ }
378
+
379
+ /* Footer */
380
+ footer {
381
+ text-align: center;
382
+ padding: 2rem;
383
+ color: white;
384
+ margin-top: 3rem;
385
+ position: relative;
386
+ z-index: 5;
387
+ }
388
+
389
+ .footer-link {
390
+ color: var(--primary-yellow);
391
+ text-decoration: none;
392
+ font-weight: bold;
393
+ transition: all 0.3s ease;
394
+ }
395
+
396
+ .footer-link:hover {
397
+ color: white;
398
+ text-shadow: 0 0 10px rgba(255, 209, 0, 0.5);
399
+ }
400
+
401
+ /* Responsive */
402
+ @media (max-width: 768px) {
403
+ header {
404
+ flex-direction: column;
405
+ gap: 1rem;
406
+ }
407
+
408
+ nav {
409
+ flex-wrap: wrap;
410
+ justify-content: center;
411
+ }
412
+
413
+ .game-title {
414
+ font-size: 1.8rem;
415
+ }
416
+
417
+ .score-board {
418
+ gap: 1rem;
419
+ }
420
+
421
+ .big-counter {
422
+ font-size: 3rem;
423
+ }
424
+
425
+ .banana-game-area {
426
+ grid-template-columns: repeat(2, 1fr);
427
+ }
428
+ }
429
+
430
+ /* Toast Notification */
431
+ .toast {
432
+ position: fixed;
433
+ bottom: 2rem;
434
+ right: 2rem;
435
+ background: linear-gradient(135deg, var(--primary-yellow), var(--dark-yellow));
436
+ color: var(--text-dark);
437
+ padding: 1rem 2rem;
438
+ border-radius: 10px;
439
+ box-shadow: 0 5px 20px var(--shadow);
440
+ transform: translateX(400px);
441
+ transition: transform 0.3s ease;
442
+ z-index: 1000;
443
+ }
444
+
445
+ .toast.show {
446
+ transform: translateX(0);
447
+ }
448
+ </style>
449
+ </head>
450
+ <body>
451
+ <!-- Animated Background -->
452
+ <div class="floating-bananas" id="floatingBananas"></div>
453
+
454
+ <!-- Header -->
455
+ <header>
456
+ <div class="logo">
457
+ <span class="banana-icon">🍌</span>
458
+ <span>Babana</span>
459
+ </div>
460
+ <nav>
461
+ <button onclick="showSection('game')"><span>🎮 Game</span></button>
462
+ <button onclick="showSection('facts')"><span>📚 Facts</span></button>
463
+ <button onclick="showSection('counter')"><span>🔢 Counter</span></button>
464
+ </nav>
465
+ </header>
466
+
467
+ <!-- Main Container -->
468
+ <div class="container">
469
+ <!-- Game Section -->
470
+ <section id="game" class="section active">
471
+ <div class="game-container">
472
+ <h1 class="game-title">🍌 Banana Peeling Challenge 🍌</h1>
473
+ <div class="score-board">
474
+ <div class="score-item">
475
+ <div class="score-label">Bananas Peeled</div>
476
+ <div class="score-value" id="peeledCount">0</div>
477
+ </div>
478
+ <div class="score-item">
479
+ <div class="score-label">Time</div>
480
+ <div class="score-value" id="gameTime">0s</div>
481
+ </div>
482
+ <div class="score-item">
483
+ <div class="score-label">High Score</div>
484
+ <div class="score-value" id="highScore">0</div>
485
+ </div>
486
+ </div>
487
+ <button class="btn" onclick="startGame()">Start New Game</button>
488
+ <div class="banana-game-area" id="bananaGameArea">
489
+ <!-- Bananas will be generated here -->
490
+ </div>
491
+ </div>
492
+ </section>
493
+
494
+ <!-- Facts Section -->
495
+ <section id="facts" class="section">
496
+ <div class="facts-container">
497
+ <h1 class="game-title">🍌 Amazing Banana Facts 🍌</h1>
498
+ <div class="fact-card" onclick="animateFact(this)">
499
+ <span class="fact-number">1</span>
500
+ <span class="fact-text">Bananas are berries, but strawberries aren't! Botanically, bananas develop from a flower containing one ovary.</span>
501
+ </div>
502
+ <div class="fact-card" onclick="animateFact(this)">
503
+ <span class="fact-number">2</span>
504
+ <span class="fact-text">Humans have been cultivating bananas for over 7,000 years, making them one of the oldest cultivated fruits.</span>
505
+ </div>
506
+ <div class="fact-card" onclick="animateFact(this)">
507
+ <span class="fact-number">3</span>
508
+ <span class="fact-text">A cluster of bananas is called a "hand," and a single banana is a "finger."</span>
509
+ </div>
510
+ <div class="fact-card" onclick="animateFact(this)">
511
+ <span class="fact-number">4</span>
512
+ <span class="fact-text">Bananas are naturally radioactive due to their potassium content, but you'd need to eat millions to be affected.</span>
513
+ </div>
514
+ <div class="fact-card" onclick="animateFact(this)">
515
+ <span class="fact-number">5</span>
516
+ <span class="fact-text">The banana plant is technically a herb, and the banana itself is a berry - the largest herbaceous flowering plant!</span>
517
+ </div>
518
+ <div class="fact-card" onclick="animateFact(this)">
519
+ <span class="fact-number">6</span>
520
+ <span class="fact-text">India is the world's largest banana producer, growing over 30 million tons annually.</span>
521
+ </div>
522
+ <div class="fact-card" onclick="animateFact(this)">
523
+ <span class="fact-number">7</span>
524
+ <span class="fact-text">Bananas can help improve your mood due to their tryptophan content, which the body converts to serotonin.</span>
525
+ </div>
526
+ </div>
527
+ </section>
528
+
529
+ <!-- Counter Section -->
530
+ <section id="counter" class="section">
531
+ <div class="counter-container">
532
+ <h1 class="game-title">🍌 Banana Counter 🍌</h1>
533
+ <p style="color: var(--text-dark); font-size: 1.2rem; margin-bottom: 1rem;">How many bananas have you eaten today?</p>
534
+ <div class="big-counter" id="bananaCounter">0</div>
535
+ <div class="counter-buttons">
536
+ <button class="btn" onclick="incrementCounter()">Add Banana 🍌</button>
537
+ <button class="btn" onclick="decrementCounter()">Remove Banana 🗑️</button>
538
+ <button class="btn" onclick="resetCounter()">Reset 🔄</button>
539
+ </div>
540
+ <div style="margin-top: 2rem;">
541
+ <p style="color: var(--text-dark); font-size: 1rem;" id="bananaMessage">Start counting your bananas!</p>
542
+ </div>
543
+ </div>
544
+ </section>
545
+ </div>
546
+
547
+ <!-- Footer -->
548
+ <footer>
549
+ <p>Made with 🍌 love | Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="footer-link">anycoder</a></p>
550
+ </footer>
551
+
552
+ <!-- Toast Notification -->
553
+ <div class="toast" id="toast"></div>
554
+
555
+ <script>
556
+ // Initialize floating bananas
557
+ function createFloatingBananas() {
558
+ const container = document.getElementById('floatingBananas');
559
+ for (let i = 0; i < 5; i++) {
560
+ const banana = document.createElement('div');
561
+ banana.className = 'floating-banana';
562
+ banana.textContent = '🍌';
563
+ banana.style.top = Math.random() * 100 + '%';
564
+ banana.style.animationDelay = Math.random() * 15 + 's';
565
+ banana.style.animationDuration = (15 + Math.random() * 10) + 's';
566
+ container.appendChild(banana);
567
+ }
568
+ }
569
+
570
+ // Section Navigation
571
+ function showSection(sectionName) {
572
+ const sections = document.querySelectorAll('.section');
573
+ sections.forEach(section => {
574
+ section.classList.remove('active');
575
+ });
576
+ document.getElementById(sectionName).classList.add('active');
577
+ }
578
+
579
+ // Game Logic
580
+ let gameActive = false;
581
+ let peeledCount = 0;
582
+ let gameTime = 0;
583
+ let gameTimer = null;
584
+ let highScore = localStorage.getItem('bananaHighScore') || 0;
585
+
586
+ document.getElementById('highScore').textContent = highScore;
587
+
588
+ function startGame() {
589
+ gameActive = true;
590
+ peeledCount = 0;
591
+ gameTime = 0;
592
+ document.getElementById('peeledCount').textContent = peeledCount;
593
+ document.getElementById('gameTime').textContent = '0s';
594
+
595
+ generateBananas();
596
+ startTimer();
597
+ showToast('Game Started! Peel all the bananas! 🍌');
598
+ }
599
+
600
+ function generateBananas() {
601
+ const gameArea = document.getElementById('bananaGameArea');
602
+ gameArea.innerHTML = '';
603
+
604
+ for (let i = 0; i < 8; i++) {
605
+ const bananaCard = document.createElement('div');
606
+ bananaCard.className = 'banana-card';
607
+ bananaCard.innerHTML = `
608
+ <div class="banana-emoji">🍌</div>
609
+ <div style="color: var(--text-dark); font-weight: bold;">Click to Peel!</div>
610
+ `;
611
+ bananaCard.onclick = function() { peelBanana(this); };
612
+ gameArea.appendChild(bananaCard);
613
+ }
614
+ }
615
+
616
+ function peelBanana(card) {
617
+ if (!gameActive || card.classList.contains('peeled')) return;
618
+
619
+ card.classList.add('peeled');
620
+ card.innerHTML = `
621
+ <div class="banana-emoji">🍌</div>
622
+ <div style="color: var(--text-dark); font-weight: bold;">Peeled!</div>
623
+ `;
624
+
625
+ peeledCount++;
626
+ document.getElementById('peeledCount').textContent = peeledCount;
627
+
628
+ if (peeledCount === 8) {
629
+ endGame();
630
+ }
631
+ }
632
+
633
+ function startTimer() {
634
+ if (gameTimer) clearInterval(gameTimer);
635
+ gameTimer = setInterval(() => {
636
+ gameTime++;
637
+ document.getElementById('gameTime').textContent = gameTime + 's';
638
+ }, 1000);
639
+ }
640
+
641
+ function endGame() {
642
+ gameActive = false;
643
+ clearInterval(gameTimer);
644
+
645
+ if (peeledCount > highScore) {
646
+ highScore = peeledCount;
647
+ localStorage.setItem('bananaHighScore', highScore);
648
+ document.getElementById('highScore').textContent = highScore;
649
+ showToast(`🎉 New High Score: ${highScore} bananas!`);
650
+ } else {
651
+ showToast(`Game Over! You peeled ${peeledCount} bananas in ${gameTime} seconds!`);
652
+ }
653
+ }
654
+
655
+ // Counter Logic
656
+ let bananaCount = 0;
657
+
658
+ function incrementCounter() {
659
+ bananaCount++;
660
+ updateCounter();
661
+ animateCounterChange();
662
+ }
663
+
664
+ function decrementCounter() {
665
+ if (bananaCount > 0) {
666
+ bananaCount--;
667
+ updateCounter();
668
+ animateCounterChange();
669
+ }
670
+ }
671
+
672
+ function resetCounter() {
673
+ bananaCount = 0;
674
+ updateCounter();
675
+ showToast('Counter reset! 🔄');
676
+ }
677
+
678
+ function updateCounter() {
679
+ document.getElementById('bananaCounter').textContent = bananaCount;
680
+ updateMessage();
681
+ }
682
+
683
+ function updateMessage() {
684
+ const messageEl = document.getElementById('bananaMessage');
685
+ if (bananaCount === 0) {
686
+ messageEl.textContent = "Start counting your bananas!";
687
+ } else if (bananaCount < 3) {
688
+ messageEl.textContent = "That's a good start! 🍌";
689
+ } else if (bananaCount < 6) {
690
+ messageEl.textContent = "You're on a roll! 🍌🍌🍌";
691
+ } else {
692
+ messageEl.textContent = "Wow! That's a lot of bananas! 🍌🍌🍌🍌🍌🍌";
693
+ }
694
+ }
695
+
696
+ function animateCounterChange() {
697
+ const counter = document.getElementById('bananaCounter');
698
+ counter.style.transform = 'scale(1.3)';
699
+ setTimeout(() => {
700
+ counter.style.transform = 'scale(1)';
701
+ }, 200);
702
+ }
703
+
704
+ // Fact Animation
705
+ function animateFact(card) {
706
+ card.style.transform = 'scale(1.05)';
707
+ card.style.background = 'linear-gradient(135deg, var(--primary-yellow), var(--light-yellow))';
708
+
709
+ setTimeout(() => {
710
+ card.style.transform = '';
711
+ card.style.background = '';
712
+ }, 300);
713
+ }
714
+
715
+ // Toast Notification
716
+ function showToast(message) {
717
+ const toast = document.getElementById('toast');
718
+ toast.textContent = message;
719
+ toast.classList.add('show');
720
+
721
+ setTimeout(() => {
722
+ toast.classList.remove('show');
723
+ }, 3000);
724
+ }
725
+
726
+ // Initialize
727
+ createFloatingBananas();
728
+ generateBananas();
729
+ </script>
730
+ </body>
731
+ </html>