brainrotscript
Version:
🧠 A brainrot programming language that compiles to JavaScript - because why write normal code when you can write code that's absolutely sending you? 💀
194 lines (165 loc) • 5.82 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Simple Brainrot Quiz</title>
<!-- All the styling for our quiz -->
<style>
/* Reset default styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Main page styling */
body {
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
color: white;
display: flex;
justify-content: center;
align-items: center;
}
/* Main container that holds everything */
.main-container {
background: rgba(255, 255, 255, 0.1);
border-radius: 20px;
padding: 40px;
width: 90%;
max-width: 600px;
backdrop-filter: blur(10px);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
/* Headings */
h1 {
text-align: center;
margin-bottom: 20px;
}
/* Paragraphs */
p {
text-align: center;
margin-bottom: 20px;
}
/* All buttons share these styles */
button {
background: linear-gradient(45deg, #ff6b6b, #ee5a24);
border: none;
border-radius: 10px;
padding: 15px 30px;
color: white;
font-size: 1.1rem;
cursor: pointer;
width: 100%;
margin: 10px 0;
transition: transform 0.2s;
}
/* Button hover effect */
button:hover {
transform: translateY(-2px);
}
/* Answer buttons have slightly different style */
.answer-btn {
background: rgba(255, 255, 255, 0.2);
text-align: left;
}
.answer-btn:hover {
background: rgba(255, 255, 255, 0.3);
}
/* Selected answer style */
.answer-btn.selected {
background: linear-gradient(45deg, #48ca7e, #56ab2f);
}
/* Hide elements by default */
.hidden {
display: none ;
}
/* Score cards in results */
.score-container {
display: flex;
justify-content: space-around;
margin: 30px 0;
}
.score-card {
background: rgba(255, 255, 255, 0.1);
padding: 20px;
border-radius: 10px;
text-align: center;
}
/* Review section */
.review-section {
background: rgba(0, 0, 0, 0.2);
border-radius: 10px;
padding: 20px;
margin-top: 20px;
max-height: 300px;
overflow-y: auto;
}
.review-item {
margin-bottom: 15px;
padding: 10px;
background: rgba(255, 255, 255, 0.05);
border-radius: 5px;
}
.correct-review {
border-left: 3px solid #48ca7e;
}
.wrong-review {
border-left: 3px solid #ff6b6b;
}
</style>
</head>
<body>
<!-- Everything goes inside this container -->
<div class="main-container">
<!-- SCREEN 1: Welcome Screen (shown at start) -->
<div id="welcome-screen">
<h1>🧠 Simple Brainrot Quiz</h1>
<p>Test your knowledge of Gen-Z slang!</p>
<p>10 questions - Let's see how you do!</p>
<button onclick="startQuiz()">Start Quiz 🚀</button>
</div>
<!-- SCREEN 2: Quiz Screen (hidden at start) -->
<div id="quiz-screen" class="hidden">
<!-- Shows "Question 1 of 10" etc -->
<p id="question-counter">Question 1 of 10</p>
<!-- The actual question text -->
<h2 id="question-text">Question will appear here</h2>
<!-- Answer buttons will be added here by JavaScript -->
<div id="answer-buttons">
<!-- JavaScript will add buttons here -->
</div>
</div>
<!-- SCREEN 3: Results Screen (hidden at start) -->
<div id="results-screen" class="hidden">
<h1>🎉 Quiz Complete!</h1>
<!-- Main score display -->
<h2 id="final-score">You scored 0 out of 10!</h2>
<!-- Message based on score -->
<p id="score-message">Good job!</p>
<!-- Score breakdown -->
<div class="score-container">
<div class="score-card">
<h3>✅ Correct</h3>
<p id="correct-count">0</p>
</div>
<div class="score-card">
<h3>❌ Wrong</h3>
<p id="wrong-count">0</p>
</div>
</div>
<!-- Review button -->
<button onclick="toggleReview()">📋 See All Answers</button>
<!-- Review section (hidden by default) -->
<div id="review-section" class="review-section hidden">
<!-- JavaScript will add review items here -->
</div>
<!-- Restart button -->
<button onclick="startQuiz()">Try Again 🔄</button>
</div>
</div>
<!-- Load our JavaScript -->
<script src="js/quiz-simple.js"></script>
</body>
</html>