kai774 commited on
Commit
6847ca0
Β·
verified Β·
1 Parent(s): cc51a92

undefined - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +628 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Mnjrika
3
- emoji: πŸ“Š
4
- colorFrom: blue
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: mnjrika
3
+ emoji: 🐳
4
+ colorFrom: red
5
+ colorTo: pink
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,628 @@
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>Erika: Vampire Diaries Survival</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script>
11
+ <link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Montserrat:wght@300;400;600&display=swap" rel="stylesheet">
12
+ <style>
13
+ body {
14
+ font-family: 'Montserrat', sans-serif;
15
+ background-color: #0f0e17;
16
+ color: #f8f8f2;
17
+ }
18
+ .title-font {
19
+ font-family: 'Cinzel', serif;
20
+ }
21
+ .vampire-red {
22
+ color: #ff5555;
23
+ }
24
+ .bg-vampire-dark {
25
+ background-color: #1a1a2e;
26
+ }
27
+ .choice-card {
28
+ transition: all 0.3s ease;
29
+ border: 1px solid #2b2b40;
30
+ }
31
+ .choice-card:hover {
32
+ transform: translateY(-5px);
33
+ box-shadow: 0 10px 20px rgba(255, 85, 85, 0.2);
34
+ border-color: #ff5555;
35
+ }
36
+ .blood-drop {
37
+ position: absolute;
38
+ width: 8px;
39
+ height: 8px;
40
+ background-color: #ff5555;
41
+ border-radius: 50%;
42
+ opacity: 0;
43
+ }
44
+ </style>
45
+ </head>
46
+ <body class="min-h-screen">
47
+ <div class="container mx-auto px-4 py-8 max-w-4xl">
48
+ <!-- Header -->
49
+ <header class="text-center mb-12">
50
+ <h1 class="title-font text-4xl md:text-5xl font-bold mb-4 vampire-red">Erika: Vampire Diaries Survival</h1>
51
+ <p class="text-lg text-gray-300">Will you survive the darkness of Mystic Falls?</p>
52
+ </header>
53
+
54
+ <!-- Intro Section -->
55
+ <div id="intro" class="bg-vampire-dark rounded-lg shadow-lg p-6 mb-8">
56
+ <div class="flex items-center mb-6">
57
+ <div class="w-20 h-20 rounded-full bg-red-900 mr-4 flex items-center justify-center">
58
+ <i data-feather="droplet" class="text-red-400 w-10 h-10"></i>
59
+ </div>
60
+ <div>
61
+ <h2 class="title-font text-2xl vampire-red">Your Story Begins...</h2>
62
+ <p class="text-gray-300">You are Erika, turned into a vampire at 17, now 19, living in Mystic Falls.</p>
63
+ </div>
64
+ </div>
65
+ <p class="mb-4 text-gray-300">Through 30 critical decisions, you'll face moral dilemmas, survival choices, and tests of allegiance. Each choice shapes your fate in the supernatural world.</p>
66
+ <p class="mb-6 text-gray-300">Score 15+ correct answers to survive and protect Mystic Falls. Fail, and you'll be consumed by betrayal, power, or death.</p>
67
+ <button id="start-btn" class="w-full bg-red-900 hover:bg-red-800 text-white font-bold py-3 px-4 rounded-lg transition duration-300 transform hover:scale-105">
68
+ Begin Your Journey
69
+ </button>
70
+ </div>
71
+
72
+ <!-- Quiz Container -->
73
+ <div id="quiz-container" class="hidden bg-vampire-dark rounded-lg shadow-lg p-6 mb-8">
74
+ <div class="flex justify-between items-center mb-6">
75
+ <h2 class="title-font text-2xl vampire-red">Question <span id="question-number">1</span>/30</h2>
76
+ <div class="bg-gray-800 rounded-full px-4 py-1">
77
+ <span id="score" class="font-bold">Score: 0</span>
78
+ </div>
79
+ </div>
80
+
81
+ <div class="mb-8">
82
+ <p id="question-text" class="text-xl mb-6 text-gray-100"></p>
83
+ <div id="choices" class="space-y-4">
84
+ <!-- Choices will be inserted here by JavaScript -->
85
+ </div>
86
+ </div>
87
+
88
+ <div class="flex justify-between">
89
+ <button id="prev-btn" class="bg-gray-700 hover:bg-gray-600 text-white font-bold py-2 px-4 rounded opacity-50 cursor-not-allowed" disabled>
90
+ <i data-feather="arrow-left" class="inline mr-2"></i> Previous
91
+ </button>
92
+ <button id="next-btn" class="bg-red-900 hover:bg-red-800 text-white font-bold py-2 px-4 rounded hidden">
93
+ Next <i data-feather="arrow-right" class="inline ml-2"></i>
94
+ </button>
95
+ <button id="submit-btn" class="bg-green-700 hover:bg-green-600 text-white font-bold py-2 px-4 rounded hidden">
96
+ Submit Answers <i data-feather="check" class="inline ml-2"></i>
97
+ </button>
98
+ </div>
99
+ </div>
100
+
101
+ <!-- Results Section -->
102
+ <div id="results" class="hidden bg-vampire-dark rounded-lg shadow-lg p-6 mb-8">
103
+ <div class="text-center mb-8">
104
+ <h2 class="title-font text-3xl mb-4 vampire-red">Your Fate is Sealed</h2>
105
+ <div id="result-message" class="text-xl mb-6"></div>
106
+ <div class="text-4xl font-bold mb-6">Score: <span id="final-score" class="vampire-red">0</span>/30</div>
107
+ <button id="restart-btn" class="bg-red-900 hover:bg-red-800 text-white font-bold py-3 px-6 rounded-lg transition duration-300">
108
+ Play Again <i data-feather="refresh-cw" class="inline ml-2"></i>
109
+ </button>
110
+ </div>
111
+
112
+ <div id="answers-review" class="border-t border-gray-700 pt-6">
113
+ <h3 class="title-font text-xl mb-4 vampire-red">Your Choices</h3>
114
+ <div id="answers-container" class="space-y-6">
115
+ <!-- Answers will be inserted here by JavaScript -->
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </div>
120
+
121
+ <!-- Welcome Modal -->
122
+ <div id="welcome-modal" class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50">
123
+ <div class="bg-vampire-dark rounded-lg shadow-xl p-8 max-w-md mx-4 border border-red-700">
124
+ <div class="text-center">
125
+ <h3 class="title-font text-2xl vampire-red mb-4">Welcome to Erika's Story!</h3>
126
+ <p class="text-gray-300 mb-6">
127
+ If you lose, you are fat. If you win, you are not fat. Play through Erika's story and at the end you will discover your fate!
128
+ </p>
129
+ <button id="close-welcome" class="bg-red-900 hover:bg-red-800 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
130
+ I Understand
131
+ </button>
132
+ </div>
133
+ </div>
134
+ </div>
135
+
136
+ <script>
137
+ // Show welcome modal on page load
138
+ document.addEventListener('DOMContentLoaded', function() {
139
+ document.getElementById('welcome-modal').classList.remove('hidden');
140
+ });
141
+
142
+ // Close welcome modal
143
+ document.getElementById('close-welcome').addEventListener('click', function() {
144
+ document.getElementById('welcome-modal').classList.add('hidden');
145
+ });
146
+
147
+ feather.replace();
148
+
149
+ // Game data
150
+ const gameData = {
151
+ questions: [
152
+ {
153
+ q: "Damon approaches Erika at night: 'Can I trust you to watch my back, or will you stab me like the others?'",
154
+ choices: {
155
+ "A": "Promise loyalty and mean it.",
156
+ "B": "Pretend to agree, planning betrayal.",
157
+ "C": "Refuse him coldly."
158
+ },
159
+ correct: "A"
160
+ },
161
+ {
162
+ q: "Stefan tells Erika: 'You don't have to be like Damon. Do you believe in redemption?'",
163
+ choices: {
164
+ "A": "Yes, I can still change.",
165
+ "B": "Maybe, if it serves me.",
166
+ "C": "No, redemption is weakness."
167
+ },
168
+ correct: "A"
169
+ },
170
+ {
171
+ q: "Bonnie finds Erika with blood on her hands: 'What have you done?'",
172
+ choices: {
173
+ "A": "Tell her the truth and ask for help.",
174
+ "B": "Compel her to forget.",
175
+ "C": "Threaten her into silence."
176
+ },
177
+ correct: "B"
178
+ },
179
+ {
180
+ q: "Klaus offers a deal: 'Stand with me, or be crushed with the rest.'",
181
+ choices: {
182
+ "A": "Swear allegiance to him.",
183
+ "B": "Refuse and fight.",
184
+ "C": "Pretend to join, waiting to betray."
185
+ },
186
+ correct: "B"
187
+ },
188
+ {
189
+ q: "Caroline asks Erika: 'Would you protect the town, even if it costs you everything?'",
190
+ choices: {
191
+ "A": "Yes, I'll fight for them.",
192
+ "B": "Maybe, if it benefits me.",
193
+ "C": "No, humans aren't worth it."
194
+ },
195
+ correct: "A"
196
+ },
197
+ {
198
+ q: "Damon whispers: 'Matt knows too much. Should we kill him?'",
199
+ choices: {
200
+ "A": "Agree with Damon.",
201
+ "B": "Refuse to harm Matt.",
202
+ "C": "Trick Damon into sparing Matt."
203
+ },
204
+ correct: "B"
205
+ },
206
+ {
207
+ q: "A vampire hunter traps Erika in vervain chains.",
208
+ choices: {
209
+ "A": "Endure and wait for rescue.",
210
+ "B": "Kill him brutally.",
211
+ "C": "Manipulate him into releasing her."
212
+ },
213
+ correct: "C"
214
+ },
215
+ {
216
+ q: "Katherine smirks: 'Learn from me, Erika. I'll teach you how to survive.'",
217
+ choices: {
218
+ "A": "Accept eagerly.",
219
+ "B": "Refuse, I'm not like you.",
220
+ "C": "Pretend to accept, but betray later."
221
+ },
222
+ correct: "B"
223
+ },
224
+ {
225
+ q: "A young witch screams for help against werewolves.",
226
+ choices: {
227
+ "A": "Save the witch.",
228
+ "B": "Ignore her.",
229
+ "C": "Use her as bait."
230
+ },
231
+ correct: "A"
232
+ },
233
+ {
234
+ q: "Alaric warns Erika: 'You're walking a dangerous path. Stop killing innocents.'",
235
+ choices: {
236
+ "A": "Agree and change.",
237
+ "B": "Ignore him.",
238
+ "C": "Threaten him."
239
+ },
240
+ correct: "A"
241
+ },
242
+ {
243
+ q: "Elijah offers her a truce.",
244
+ choices: {
245
+ "A": "Accept respectfully.",
246
+ "B": "Refuse him.",
247
+ "C": "Secretly plot against him."
248
+ },
249
+ correct: "A"
250
+ },
251
+ {
252
+ q: "A child sees her feeding.",
253
+ choices: {
254
+ "A": "Erase the memory.",
255
+ "B": "Kill them.",
256
+ "C": "Let them live with the truth."
257
+ },
258
+ correct: "A"
259
+ },
260
+ {
261
+ q: "Stefan confronts her: 'You betrayed me. Why?'",
262
+ choices: {
263
+ "A": "Admit and explain.",
264
+ "B": "Lie to cover up.",
265
+ "C": "Threaten him."
266
+ },
267
+ correct: "A"
268
+ },
269
+ {
270
+ q: "Damon is bleeding out.",
271
+ choices: {
272
+ "A": "Save him.",
273
+ "B": "Leave him.",
274
+ "C": "Exploit his weakness."
275
+ },
276
+ correct: "C"
277
+ },
278
+ {
279
+ q: "Klaus demands her loyalty again.",
280
+ choices: {
281
+ "A": "Kneel and swear.",
282
+ "B": "Refuse.",
283
+ "C": "Pretend loyalty, planning betrayal."
284
+ },
285
+ correct: "B"
286
+ },
287
+ {
288
+ q: "A relic of vampire power is in her hands.",
289
+ choices: {
290
+ "A": "Share it with friends.",
291
+ "B": "Keep it hidden.",
292
+ "C": "Use it recklessly."
293
+ },
294
+ correct: "A"
295
+ },
296
+ {
297
+ q: "Caroline asks directly: 'Are you still with us, Erika?'",
298
+ choices: {
299
+ "A": "Reassure her, yes.",
300
+ "B": "Admit doubts.",
301
+ "C": "Threaten Caroline."
302
+ },
303
+ correct: "A"
304
+ },
305
+ {
306
+ q: "She finds a cure for vampirism.",
307
+ choices: {
308
+ "A": "Take it for herself.",
309
+ "B": "Destroy it.",
310
+ "C": "Hide it for later."
311
+ },
312
+ correct: "C"
313
+ },
314
+ {
315
+ q: "Mystic Falls is under attack.",
316
+ choices: {
317
+ "A": "Fight to protect.",
318
+ "B": "Hide.",
319
+ "C": "Lead the attackers."
320
+ },
321
+ correct: "A"
322
+ },
323
+ {
324
+ q: "An Original vampire tests her.",
325
+ choices: {
326
+ "A": "Form respectful alliance.",
327
+ "B": "Challenge them directly.",
328
+ "C": "Manipulate them subtly."
329
+ },
330
+ correct: "C"
331
+ },
332
+ {
333
+ q: "Bonnie offers a dangerous spell.",
334
+ choices: {
335
+ "A": "Refuse, too risky.",
336
+ "B": "Accept, risk soul.",
337
+ "C": "Trick her into casting."
338
+ },
339
+ correct: "A"
340
+ },
341
+ {
342
+ q: "A mortal friend begs: 'Please, stop feeding on people.'",
343
+ choices: {
344
+ "A": "Stop feeding on humans.",
345
+ "B": "Refuse.",
346
+ "C": "Compel them to forget."
347
+ },
348
+ correct: "A"
349
+ },
350
+ {
351
+ q: "She's trapped with an enemy vampire.",
352
+ choices: {
353
+ "A": "Cooperate to escape.",
354
+ "B": "Kill them.",
355
+ "C": "Manipulate them."
356
+ },
357
+ correct: "A"
358
+ },
359
+ {
360
+ q: "A human confesses love.",
361
+ choices: {
362
+ "A": "Accept passionately.",
363
+ "B": "Reject to protect them.",
364
+ "C": "Use them for advantage."
365
+ },
366
+ correct: "B"
367
+ },
368
+ {
369
+ q: "A friend betrays her.",
370
+ choices: {
371
+ "A": "Forgive carefully.",
372
+ "B": "Plot revenge.",
373
+ "C": "Cut ties."
374
+ },
375
+ correct: "A"
376
+ },
377
+ {
378
+ q: "Damon smirks: 'Tell me, Erika, do you want power or peace?'",
379
+ choices: {
380
+ "A": "Peace.",
381
+ "B": "Power.",
382
+ "C": "Both."
383
+ },
384
+ correct: "A"
385
+ },
386
+ {
387
+ q: "Klaus traps her in a game of trust: 'Save yourself, or save your friend.'",
388
+ choices: {
389
+ "A": "Save friend.",
390
+ "B": "Save herself.",
391
+ "C": "Let both die."
392
+ },
393
+ correct: "A"
394
+ },
395
+ {
396
+ q: "She dreams of her humanity.",
397
+ choices: {
398
+ "A": "Embrace it.",
399
+ "B": "Reject it.",
400
+ "C": "Stay in between."
401
+ },
402
+ correct: "C"
403
+ },
404
+ {
405
+ q: "Damon asks: 'If I fall, will you stand by me?'",
406
+ choices: {
407
+ "A": "Yes, always.",
408
+ "B": "Only if it benefits me.",
409
+ "C": "No."
410
+ },
411
+ correct: "A"
412
+ },
413
+ {
414
+ q: "The town is burning.",
415
+ choices: {
416
+ "A": "Save the people.",
417
+ "B": "Save herself only.",
418
+ "C": "Use chaos for power."
419
+ },
420
+ correct: "B"
421
+ }
422
+ ],
423
+ scoring: {
424
+ win: "Congratulations! With a score of 15 or more, Erika survives the darkness of Mystic Falls. She protects the town, maintains her humanity, and proves herself worthy of trust among both vampires and humans.",
425
+ lose: "Tragedy strikes! With less than 15 correct answers, Erika fails to navigate the treacherous world of Mystic Falls. Betrayed by allies, consumed by power, or destroyed by her own choices, her story ends in darkness."
426
+ }
427
+ };
428
+
429
+ // Game state
430
+ let currentQuestion = 0;
431
+ let score = 0;
432
+ let userAnswers = Array(gameData.questions.length).fill(null);
433
+
434
+ // DOM elements
435
+ const introSection = document.getElementById('intro');
436
+ const quizContainer = document.getElementById('quiz-container');
437
+ const resultsSection = document.getElementById('results');
438
+ const startBtn = document.getElementById('start-btn');
439
+ const prevBtn = document.getElementById('prev-btn');
440
+ const nextBtn = document.getElementById('next-btn');
441
+ const submitBtn = document.getElementById('submit-btn');
442
+ const restartBtn = document.getElementById('restart-btn');
443
+ const questionNumber = document.getElementById('question-number');
444
+ const questionText = document.getElementById('question-text');
445
+ const choicesContainer = document.getElementById('choices');
446
+ const scoreDisplay = document.getElementById('score');
447
+ const finalScore = document.getElementById('final-score');
448
+ const resultMessage = document.getElementById('result-message');
449
+ const answersContainer = document.getElementById('answers-review');
450
+
451
+ // Start the game
452
+ startBtn.addEventListener('click', () => {
453
+ introSection.classList.add('hidden');
454
+ quizContainer.classList.remove('hidden');
455
+ loadQuestion(currentQuestion);
456
+ createBloodDrops();
457
+ });
458
+
459
+ // Load a question
460
+ function loadQuestion(index) {
461
+ const question = gameData.questions[index];
462
+ questionNumber.textContent = index + 1;
463
+ questionText.textContent = question.q;
464
+
465
+ // Clear previous choices
466
+ choicesContainer.innerHTML = '';
467
+
468
+ // Add new choices
469
+ for (const [key, value] of Object.entries(question.choices)) {
470
+ const choiceDiv = document.createElement('div');
471
+ choiceDiv.className = `choice-card bg-gray-800 p-4 rounded-lg cursor-pointer ${userAnswers[index] === key ? 'border-red-500 border-2' : ''}`;
472
+ choiceDiv.innerHTML = `
473
+ <div class="flex items-center">
474
+ <div class="w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center mr-3 font-bold vampire-red">${key}</div>
475
+ <div>${value}</div>
476
+ </div>
477
+ `;
478
+ choiceDiv.addEventListener('click', () => selectAnswer(key, index));
479
+ choicesContainer.appendChild(choiceDiv);
480
+ }
481
+
482
+ // Update navigation buttons
483
+ prevBtn.disabled = index === 0;
484
+ nextBtn.classList.toggle('hidden', index === gameData.questions.length - 1);
485
+ submitBtn.classList.toggle('hidden', index !== gameData.questions.length - 1);
486
+
487
+ // Update previous button opacity
488
+ prevBtn.classList.toggle('opacity-50', index === 0);
489
+ prevBtn.classList.toggle('cursor-not-allowed', index === 0);
490
+ }
491
+
492
+ // Select an answer
493
+ function selectAnswer(choice, index) {
494
+ userAnswers[index] = choice;
495
+
496
+ // Highlight selected choice
497
+ const choices = choicesContainer.querySelectorAll('.choice-card');
498
+ choices.forEach((c, i) => {
499
+ const choiceKey = Object.keys(gameData.questions[index].choices)[i];
500
+ if (userAnswers[index] === choiceKey) {
501
+ c.classList.add('border-red-500', 'border-2');
502
+ } else {
503
+ c.classList.remove('border-red-500', 'border-2');
504
+ }
505
+ });
506
+
507
+ // Enable next button if not on last question
508
+ if (index !== gameData.questions.length - 1) {
509
+ nextBtn.classList.remove('hidden');
510
+ submitBtn.classList.add('hidden');
511
+ }
512
+ }
513
+
514
+ // Next question
515
+ nextBtn.addEventListener('click', () => {
516
+ if (currentQuestion < gameData.questions.length - 1) {
517
+ currentQuestion++;
518
+ loadQuestion(currentQuestion);
519
+ }
520
+ });
521
+
522
+ // Previous question
523
+ prevBtn.addEventListener('click', () => {
524
+ if (currentQuestion > 0) {
525
+ currentQuestion--;
526
+ loadQuestion(currentQuestion);
527
+ }
528
+ });
529
+
530
+ // Submit answers
531
+ submitBtn.addEventListener('click', () => {
532
+ calculateScore();
533
+ showResults();
534
+ });
535
+
536
+ // Calculate final score
537
+ function calculateScore() {
538
+ score = 0;
539
+ for (let i = 0; i < gameData.questions.length; i++) {
540
+ if (userAnswers[i] === gameData.questions[i].correct) {
541
+ score++;
542
+ }
543
+ }
544
+ }
545
+
546
+ // Show results
547
+ function showResults() {
548
+ quizContainer.classList.add('hidden');
549
+ resultsSection.classList.remove('hidden');
550
+
551
+ finalScore.textContent = score;
552
+
553
+ if (score >= 15) {
554
+ resultMessage.textContent = gameData.scoring.win;
555
+ resultMessage.classList.add('text-green-400');
556
+ } else {
557
+ resultMessage.textContent = gameData.scoring.lose;
558
+ resultMessage.classList.add('text-red-400');
559
+ }
560
+
561
+ // Show all answers with correct/incorrect indicators
562
+ answersContainer.innerHTML = '';
563
+ for (let i = 0; i < gameData.questions.length; i++) {
564
+ const question = gameData.questions[i];
565
+ const userAnswer = userAnswers[i];
566
+ const isCorrect = userAnswer === question.correct;
567
+
568
+ const answerDiv = document.createElement('div');
569
+ answerDiv.className = `p-4 rounded-lg ${isCorrect ? 'bg-green-900 bg-opacity-30' : 'bg-red-900 bg-opacity-30'}`;
570
+ answerDiv.innerHTML = `
571
+ <div class="font-bold mb-2">Question ${i + 1}: ${question.q}</div>
572
+ <div class="mb-1 ${userAnswer === 'A' ? 'font-bold' : ''}">
573
+ <span class="inline-block w-6">A:</span> ${question.choices.A}
574
+ ${userAnswer === 'A' ? (isCorrect ? 'βœ“' : 'βœ—') : ''}
575
+ ${question.correct === 'A' && !isCorrect ? 'βœ“' : ''}
576
+ </div>
577
+ <div class="mb-1 ${userAnswer === 'B' ? 'font-bold' : ''}">
578
+ <span class="inline-block w-6">B:</span> ${question.choices.B}
579
+ ${userAnswer === 'B' ? (isCorrect ? 'βœ“' : 'βœ—') : ''}
580
+ ${question.correct === 'B' && !isCorrect ? 'βœ“' : ''}
581
+ </div>
582
+ <div class="${userAnswer === 'C' ? 'font-bold' : ''}">
583
+ <span class="inline-block w-6">C:</span> ${question.choices.C}
584
+ ${userAnswer === 'C' ? (isCorrect ? 'βœ“' : 'βœ—') : ''}
585
+ ${question.correct === 'C' && !isCorrect ? 'βœ“' : ''}
586
+ </div>
587
+ `;
588
+ answersContainer.appendChild(answerDiv);
589
+ }
590
+ }
591
+
592
+ // Restart game
593
+ restartBtn.addEventListener('click', () => {
594
+ currentQuestion = 0;
595
+ score = 0;
596
+ userAnswers = Array(gameData.questions.length).fill(null);
597
+
598
+ resultsSection.classList.add('hidden');
599
+ introSection.classList.remove('hidden');
600
+
601
+ // Reset score display
602
+ scoreDisplay.textContent = 'Score: 0';
603
+ });
604
+
605
+ // Create blood drop animation elements
606
+ function createBloodDrops() {
607
+ for (let i = 0; i < 20; i++) {
608
+ const drop = document.createElement('div');
609
+ drop.className = 'blood-drop';
610
+ drop.style.left = `${Math.random() * 100}%`;
611
+ drop.style.top = `${Math.random() * 100}%`;
612
+ document.body.appendChild(drop);
613
+
614
+ // Animate the drop
615
+ anime({
616
+ targets: drop,
617
+ translateY: [0, 100],
618
+ opacity: [0.8, 0],
619
+ duration: 2000 + Math.random() * 3000,
620
+ delay: Math.random() * 5000,
621
+ loop: true,
622
+ easing: 'easeInQuad'
623
+ });
624
+ }
625
+ }
626
+ </script>
627
+ </body>
628
+ </html>