html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!--
MADE BY AMIR
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>💖 Valentine's Day Quiz 💖</title>
</head>
<body>
<div class="container">
<header>
<h1>💖 Valentine's Day Quiz 💖</h1>
<p>Are you a love guru? Take this fun quiz to test your Valentine's Day knowledge and romantic insights!</p>
</header>
<button id="start-quiz-button">Start Quiz</button>
<div id="quiz-container" class="hidden">
<!-- Progress indicator will be inserted here by JS -->
<div id="question-container">
<h2 id="question">Question will be loaded here...</h2>
</div>
<!-- Feedback messages will be inserted here by JS -->
<div id="options-container">
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@import url('https://fonts.googleapis.com/css2?family=Lobster+Two:wght@400;700&family=Poppins:wght@300;400;500;600&display=swap');
body {
font-family: 'Poppins', sans-serif;
background-color: #fce4ec;
color: #512da8;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-size: 200px;
background-repeat: repeat;
padding: 20px;
box-sizing: border-box;
}
.container {
background-color: rgba(255, 255, 255, 0.95);
padding: 30px;
border-radius: 20px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
text-align: center;
width: 100%;
max-width: 700px;
transition: transform 0.3s ease-in-out;
box-sizing: border-box;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const quizContainer = document.getElementById('quiz-container');
const questionContainer = document.getElementById('question-container');
const questionElement = document.getElementById('question');
const optionsContainer = document.getElementById('options-container');
const nextButton = document.getElementById('next-button');
const resultsContainer = document.getElementById('results-container');
const scoreMessageElement = document.getElementById('score-message');
const finalScoreElement = document.getElementById('final-score');
const loveMessageElement = document.getElementById('love-message');
const restartButton = document.getElementById('restart-button');
const startQuizButton = document.getElementById('start-quiz-button');
const headerSection = document.querySelector('header');
let currentQuestionIndex = 0;
let score = 0;
let questions = [];
let answerSelected = false;
questions = [
{
question: "What is the traditional color associated with Valentine's Day?",
options: ["Red", "Blue", "Green", "Yellow"],
correctAnswer: "Red"
},
{
question: "Who is the Roman god of love often associated with Valentine's Day?",
options: ["Mars", "Jupiter", "Cupid", "Apollo"],
correctAnswer: "Cupid"
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run