Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Time Loop Trivia Trials</title>
- <style>
- @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Space+Mono:wght@400;700&display=swap');
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- font-family: 'Space Mono', monospace;
- background: linear-gradient(135deg, #0a0e27 0%, #1a0033 50%, #0a0e27 100%);
- color: #fff;
- min-height: 100vh;
- overflow-x: hidden;
- position: relative;
- }
- body::before {
- content: '';
- position: fixed;
- inset: 0;
- background: repeating-linear-gradient(
- 0deg,
- transparent,
- transparent 2px,
- rgba(147, 51, 234, 0.03) 2px,
- rgba(147, 51, 234, 0.03) 4px
- );
- pointer-events: none;
- animation: scanlines 8s linear infinite;
- }
- @keyframes scanlines {
- 0% { transform: translateY(0); }
- 100% { transform: translateY(10px); }
- }
- .container {
- max-width: 900px;
- margin: 0 auto;
- padding: 20px;
- position: relative;
- z-index: 1;
- }
- .header {
- text-align: center;
- margin-bottom: 30px;
- animation: glowPulse 2s ease-in-out infinite;
- }
- h1 {
- font-family: 'Orbitron', sans-serif;
- font-size: 2.5rem;
- font-weight: 900;
- background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
- background-size: 200% 200%;
- -webkit-background-clip: text;
- background-clip: text;
- -webkit-text-fill-color: transparent;
- animation: gradient 3s ease infinite;
- margin-bottom: 10px;
- text-shadow: 0 0 30px rgba(147, 51, 234, 0.5);
- }
- @keyframes gradient {
- 0%, 100% { background-position: 0% 50%; }
- 50% { background-position: 100% 50%; }
- }
- @keyframes glowPulse {
- 0%, 100% { filter: drop-shadow(0 0 20px rgba(147, 51, 234, 0.5)); }
- 50% { filter: drop-shadow(0 0 40px rgba(147, 51, 234, 0.8)); }
- }
- .loop-info {
- display: flex;
- justify-content: space-between;
- margin-bottom: 20px;
- padding: 15px;
- background: rgba(147, 51, 234, 0.1);
- border: 2px solid rgba(147, 51, 234, 0.3);
- border-radius: 10px;
- backdrop-filter: blur(5px);
- }
- .loop-counter {
- font-size: 1.2rem;
- color: #00ffff;
- text-shadow: 0 0 10px currentColor;
- }
- .timeline {
- height: 80px;
- background: rgba(0, 0, 0, 0.5);
- border-radius: 10px;
- padding: 10px;
- margin-bottom: 30px;
- position: relative;
- overflow-x: auto;
- overflow-y: hidden;
- border: 1px solid rgba(147, 51, 234, 0.3);
- }
- .timeline-track {
- height: 100%;
- position: relative;
- display: flex;
- align-items: center;
- gap: 15px;
- padding: 0 10px;
- min-width: max-content;
- }
- .checkpoint {
- width: 15px;
- height: 15px;
- border-radius: 50%;
- background: rgba(147, 51, 234, 0.3);
- border: 2px solid rgba(147, 51, 234, 0.5);
- position: relative;
- z-index: 2;
- transition: all 0.3s ease;
- flex-shrink: 0;
- }
- .checkpoint.active {
- background: linear-gradient(135deg, #00ffff, #ff00ff);
- box-shadow: 0 0 20px rgba(147, 51, 234, 0.8),
- inset 0 0 10px rgba(255, 255, 255, 0.5);
- animation: checkpointPulse 1s ease-in-out infinite;
- }
- .checkpoint.completed {
- background: #00ff88;
- border-color: #00ff88;
- box-shadow: 0 0 15px #00ff88;
- }
- @keyframes checkpointPulse {
- 0%, 100% { transform: scale(1); }
- 50% { transform: scale(1.3); }
- }
- .timeline-line {
- position: absolute;
- height: 2px;
- background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.5), transparent);
- top: 50%;
- left: 0;
- right: 0;
- transform: translateY(-50%);
- z-index: 1;
- }
- .timeline::-webkit-scrollbar {
- height: 6px;
- }
- .timeline::-webkit-scrollbar-track {
- background: rgba(147, 51, 234, 0.1);
- border-radius: 3px;
- }
- .timeline::-webkit-scrollbar-thumb {
- background: rgba(147, 51, 234, 0.5);
- border-radius: 3px;
- }
- .timeline::-webkit-scrollbar-thumb:hover {
- background: rgba(147, 51, 234, 0.7);
- }
- .question-container {
- background: rgba(0, 0, 0, 0.7);
- border: 2px solid rgba(147, 51, 234, 0.5);
- border-radius: 15px;
- padding: 30px;
- margin-bottom: 20px;
- backdrop-filter: blur(10px);
- position: relative;
- overflow: hidden;
- }
- .question-container::before {
- content: '';
- position: absolute;
- inset: -2px;
- background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
- border-radius: 15px;
- opacity: 0;
- z-index: -1;
- transition: opacity 0.3s ease;
- }
- .question-container:hover::before {
- opacity: 0.3;
- animation: rotate 3s linear infinite;
- }
- @keyframes rotate {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
- }
- .question {
- font-size: 1.3rem;
- margin-bottom: 20px;
- color: #fff;
- text-shadow: 0 0 5px rgba(147, 51, 234, 0.5);
- }
- .answers {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
- gap: 15px;
- }
- .answer-btn {
- padding: 15px 20px;
- background: rgba(147, 51, 234, 0.2);
- border: 2px solid rgba(147, 51, 234, 0.5);
- border-radius: 10px;
- color: #fff;
- font-size: 1rem;
- cursor: pointer;
- transition: all 0.3s ease;
- position: relative;
- overflow: hidden;
- }
- .answer-btn::before {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- width: 0;
- height: 0;
- background: radial-gradient(circle, rgba(0, 255, 255, 0.5), transparent);
- transform: translate(-50%, -50%);
- transition: width 0.3s, height 0.3s;
- }
- .answer-btn:hover {
- background: rgba(147, 51, 234, 0.4);
- border-color: #00ffff;
- transform: translateY(-2px);
- box-shadow: 0 5px 20px rgba(147, 51, 234, 0.5);
- }
- .answer-btn:hover::before {
- width: 100%;
- height: 100%;
- }
- .answer-btn.correct {
- background: rgba(0, 255, 136, 0.3);
- border-color: #00ff88;
- animation: correctPulse 0.5s ease;
- }
- .answer-btn.wrong {
- background: rgba(255, 0, 68, 0.3);
- border-color: #ff0044;
- animation: wrongShake 0.5s ease;
- }
- @keyframes correctPulse {
- 0%, 100% { transform: scale(1); }
- 50% { transform: scale(1.05); }
- }
- @keyframes wrongShake {
- 0%, 100% { transform: translateX(0); }
- 25% { transform: translateX(-10px); }
- 75% { transform: translateX(10px); }
- }
- .memory-fragments {
- margin-top: 20px;
- padding: 20px;
- background: rgba(0, 255, 255, 0.05);
- border: 1px solid rgba(0, 255, 255, 0.3);
- border-radius: 10px;
- min-height: 120px;
- max-height: 300px;
- overflow-y: auto;
- }
- .memory-fragments::-webkit-scrollbar {
- width: 6px;
- }
- .memory-fragments::-webkit-scrollbar-track {
- background: rgba(0, 255, 255, 0.1);
- border-radius: 3px;
- }
- .memory-fragments::-webkit-scrollbar-thumb {
- background: rgba(0, 255, 255, 0.5);
- border-radius: 3px;
- }
- .memory-title {
- font-size: 0.9rem;
- color: #00ffff;
- margin-bottom: 10px;
- text-transform: uppercase;
- letter-spacing: 2px;
- }
- .fragment {
- padding: 8px 12px;
- margin: 5px;
- background: rgba(147, 51, 234, 0.2);
- border-left: 3px solid #00ffff;
- border-radius: 5px;
- font-size: 0.9rem;
- display: inline-block;
- animation: fadeInFragment 0.5s ease;
- }
- @keyframes fadeInFragment {
- from {
- opacity: 0;
- transform: translateX(-20px);
- }
- to {
- opacity: 1;
- transform: translateX(0);
- }
- }
- .alternate-path {
- margin-top: 15px;
- padding: 15px;
- background: linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(0, 255, 255, 0.1));
- border: 2px dashed rgba(255, 0, 255, 0.5);
- border-radius: 10px;
- display: none;
- }
- .alternate-path.unlocked {
- display: block;
- animation: pathUnlock 0.5s ease;
- }
- @keyframes pathUnlock {
- from {
- opacity: 0;
- transform: scale(0.9);
- }
- to {
- opacity: 1;
- transform: scale(1);
- }
- }
- .perfect-timeline {
- display: none;
- position: fixed;
- inset: 0;
- background: rgba(0, 0, 0, 0.9);
- z-index: 1000;
- justify-content: center;
- align-items: center;
- backdrop-filter: blur(10px);
- }
- .perfect-timeline.active {
- display: flex;
- animation: fadeIn 0.5s ease;
- }
- .victory-message {
- text-align: center;
- padding: 40px;
- background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(0, 255, 255, 0.2));
- border: 3px solid transparent;
- background-clip: padding-box;
- border-image: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff) 1;
- border-radius: 20px;
- max-width: 600px;
- }
- .victory-title {
- font-family: 'Orbitron', sans-serif;
- font-size: 3rem;
- background: linear-gradient(45deg, #00ff88, #00ffff, #ff00ff);
- -webkit-background-clip: text;
- background-clip: text;
- -webkit-text-fill-color: transparent;
- margin-bottom: 20px;
- animation: victoryGlow 1s ease-in-out infinite;
- }
- @keyframes victoryGlow {
- 0%, 100% { text-shadow: 0 0 30px rgba(0, 255, 136, 0.8); }
- 50% { text-shadow: 0 0 50px rgba(0, 255, 255, 1); }
- }
- .reset-btn {
- padding: 15px 30px;
- background: linear-gradient(135deg, #9333ea, #00ffff);
- border: none;
- border-radius: 10px;
- color: #fff;
- font-size: 1.1rem;
- font-weight: bold;
- cursor: pointer;
- transition: all 0.3s ease;
- margin-top: 20px;
- }
- .reset-btn:hover {
- transform: translateY(-2px);
- box-shadow: 0 10px 30px rgba(147, 51, 234, 0.5);
- }
- @keyframes fadeIn {
- from { opacity: 0; }
- to { opacity: 1; }
- }
- .glitch {
- position: relative;
- animation: glitchText 2s infinite;
- }
- @keyframes glitchText {
- 0%, 100% { text-shadow: 2px 0 #ff00ff, -2px 0 #00ffff; }
- 25% { text-shadow: -2px 0 #ff00ff, 2px 0 #00ffff; }
- 50% { text-shadow: 2px 0 #00ffff, -2px 0 #ff00ff; }
- 75% { text-shadow: -2px 0 #00ffff, 2px 0 #ff00ff; }
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="header">
- <h1 class="glitch">TIME LOOP TRIVIA TRIALS</h1>
- <p style="color: #00ffff; font-size: 0.9rem;">Knowledge persists. Time does not.</p>
- </div>
- <div class="loop-info">
- <div class="loop-counter">Loop Iteration: <span id="loopCount">1</span></div>
- <div class="loop-counter">Progress: <span id="progressCount">0</span>/<span id="totalQuestions">20</span></div>
- </div>
- <div id="encouragement" style="text-align: center; color: #ff00ff; font-size: 0.9rem; margin-bottom: 10px; height: 20px;"></div>
- <div class="timeline">
- <div class="timeline-line"></div>
- <div class="timeline-track" id="timelineTrack"></div>
- </div>
- <div class="question-container" id="questionContainer">
- <div class="question" id="questionText">Loading temporal paradox...</div>
- <div class="answers" id="answersContainer"></div>
- <div class="alternate-path" id="alternatePath"></div>
- </div>
- <div class="memory-fragments">
- <div class="memory-title">⟨ Memory Fragments ⟩</div>
- <div id="memoryContainer"></div>
- </div>
- </div>
- <div class="perfect-timeline" id="perfectTimeline">
- <div class="victory-message">
- <h2 class="victory-title">PERFECT TIMELINE ACHIEVED!</h2>
- <p style="font-size: 1.2rem; margin-bottom: 10px;">Loops Required: <span id="finalLoops">0</span></p>
- <p style="color: #00ffff;">You have mastered the temporal continuum.</p>
- <button class="reset-btn" onclick="hardReset()">Begin New Timeline</button>
- </div>
- </div>
- <script>
- const gameState = {
- currentLoop: 1,
- currentQuestion: 0,
- score: 0,
- memoryFragments: [],
- unlockedPaths: [],
- questionHistory: [],
- perfectRun: true
- };
- const questions = [
- {
- id: 'q1',
- question: 'What planet in our solar system is known as the "Red Planet"?',
- answers: ['Venus', 'Mars', 'Jupiter', 'Mercury'],
- correct: 1,
- fragment: 'Iron oxide gives the rusty color'
- },
- {
- id: 'q2',
- question: 'In computing, what does "AI" stand for?',
- answers: ['Automated Interface', 'Artificial Intelligence', 'Advanced Integration', 'Analog Input'],
- correct: 1,
- fragment: 'Machines that think and learn',
- alternatePath: {
- trigger: 0,
- hint: 'Automation might reveal a hidden path...',
- unlocksAt: 'q8'
- }
- },
- {
- id: 'q3',
- question: 'Which science fiction movie features the line "I\'ll be back"?',
- answers: ['Blade Runner', 'The Matrix', 'The Terminator', 'RoboCop'],
- correct: 2,
- fragment: 'Time-traveling cyborg assassin'
- },
- {
- id: 'q4',
- question: 'What is the speed of light in a vacuum?',
- answers: ['186,000 miles/second', '186,000 km/second', '299,792 km/second', '299,792 miles/second'],
- correct: 2,
- fragment: 'Nothing travels faster than c',
- shortcut: {
- enabled: false,
- question: 'Lightspeed bypass: How many times can light circle Earth in one second?',
- answers: ['3 times', '7 times', '12 times', '20 times'],
- correct: 1
- }
- },
- {
- id: 'q5',
- question: 'In the periodic table, what is the chemical symbol for Gold?',
- answers: ['Go', 'Gd', 'Au', 'Ag'],
- correct: 2,
- fragment: 'Aurum shines eternal'
- },
- {
- id: 'q6',
- question: 'What phenomenon makes the sky appear blue during the day?',
- answers: ['Reflection', 'Refraction', 'Scattering', 'Absorption'],
- correct: 2,
- fragment: 'Short wavelengths scatter more'
- },
- {
- id: 'q7',
- question: 'Which video game features a character collecting rings and running at super speed?',
- answers: ['Mario', 'Sonic', 'Crash Bandicoot', 'Mega Man'],
- correct: 1,
- fragment: 'Gotta go fast through loops'
- },
- {
- id: 'q8',
- question: 'What year did humans first land on the Moon?',
- answers: ['1967', '1969', '1971', '1973'],
- correct: 1,
- fragment: 'One giant leap in \'69',
- shortcut: {
- enabled: false,
- question: 'Lunar shortcut: Which Apollo mission was it?',
- answers: ['Apollo 9', 'Apollo 11', 'Apollo 13', 'Apollo 15'],
- correct: 1
- }
- },
- {
- id: 'q9',
- question: 'In Star Wars, what color is Luke Skywalker\'s first lightsaber?',
- answers: ['Red', 'Green', 'Blue', 'Purple'],
- correct: 2,
- fragment: 'Inherited from his father',
- alternatePath: {
- trigger: 1,
- hint: 'Green leads to a different timeline...',
- unlocksAt: 'q15'
- }
- },
- {
- id: 'q10',
- question: 'What does "HTTP" stand for in web addresses?',
- answers: ['HyperText Transfer Protocol', 'High Tech Transfer Process', 'Home Terminal Transfer Port', 'HyperText Terminal Program'],
- correct: 0,
- fragment: 'The web\'s communication rules'
- },
- {
- id: 'q11',
- question: 'Which planet has the most moons in our solar system?',
- answers: ['Jupiter', 'Saturn', 'Uranus', 'Neptune'],
- correct: 1,
- fragment: 'Ringed giant with 146 satellites'
- },
- {
- id: 'q12',
- question: 'In The Matrix, which pill does Neo take?',
- answers: ['Blue pill', 'Red pill', 'Green pill', 'Purple pill'],
- correct: 1,
- fragment: 'Reality is a choice'
- },
- {
- id: 'q13',
- question: 'What technology allows phones to connect without cables?',
- answers: ['Ethernet', 'Bluetooth', 'Fiber Optic', 'Coaxial'],
- correct: 1,
- fragment: 'Named after a Viking king'
- },
- {
- id: 'q14',
- question: 'What is the name of the theoretical point where gravity becomes infinite?',
- answers: ['Event Horizon', 'Singularity', 'Wormhole', 'Neutron Star'],
- correct: 1,
- fragment: 'Where physics breaks down',
- alternatePath: {
- trigger: 0,
- hint: 'The event horizon hides secrets...',
- unlocksAt: 'q18'
- }
- },
- {
- id: 'q15',
- question: 'Which programming language is known for its coffee cup logo?',
- answers: ['Python', 'JavaScript', 'Java', 'C++'],
- correct: 2,
- fragment: 'Write once, run anywhere',
- shortcut: {
- enabled: false,
- question: 'Code tunnel: What year was it first released?',
- answers: ['1991', '1995', '1999', '2003'],
- correct: 1
- }
- },
- {
- id: 'q16',
- question: 'What does "VR" stand for in gaming?',
- answers: ['Video Recording', 'Virtual Reality', 'Visual Rendering', 'Vector Racing'],
- correct: 1,
- fragment: 'Step into another world'
- },
- {
- id: 'q17',
- question: 'In Back to the Future, how fast must the DeLorean go to time travel?',
- answers: ['66 mph', '77 mph', '88 mph', '99 mph'],
- correct: 2,
- fragment: 'When you see serious temporal displacement'
- },
- {
- id: 'q18',
- question: 'What force keeps planets in orbit around the sun?',
- answers: ['Magnetism', 'Gravity', 'Centrifugal Force', 'Dark Energy'],
- correct: 1,
- fragment: 'The universe\'s invisible tether',
- shortcut: {
- enabled: false,
- question: 'Gravitational bypass: Who discovered the law of universal gravitation?',
- answers: ['Einstein', 'Newton', 'Galileo', 'Kepler'],
- correct: 1
- }
- },
- {
- id: 'q19',
- question: 'Which element makes up most of the air we breathe?',
- answers: ['Oxygen', 'Nitrogen', 'Carbon Dioxide', 'Hydrogen'],
- correct: 1,
- fragment: '78% of every breath',
- alternatePath: {
- trigger: 0,
- hint: 'Oxygen opens a breathing room...',
- unlocksAt: 'q20'
- }
- },
- {
- id: 'q20',
- question: 'What does a "firewall" protect in computing?',
- answers: ['Physical Hardware', 'Network Security', 'Power Supply', 'Monitor Display'],
- correct: 1,
- fragment: 'Digital guardian at the gates',
- shortcut: {
- enabled: false,
- question: 'Security bypass: What layer of the OSI model do most firewalls operate at?',
- answers: ['Layer 1', 'Layer 3', 'Layer 5', 'Layer 7'],
- correct: 1
- }
- }
- ];
- function initGame() {
- createTimeline();
- loadQuestion();
- updateMemoryFragments();
- }
- function createTimeline() {
- const track = document.getElementById('timelineTrack');
- track.innerHTML = '';
- for (let i = 0; i < questions.length; i++) {
- const checkpoint = document.createElement('div');
- checkpoint.className = 'checkpoint';
- checkpoint.id = `checkpoint-${i}`;
- if (i === gameState.currentQuestion) {
- checkpoint.classList.add('active');
- } else if (i < gameState.currentQuestion) {
- checkpoint.classList.add('completed');
- }
- track.appendChild(checkpoint);
- }
- }
- function loadQuestion() {
- const q = questions[gameState.currentQuestion];
- const questionText = document.getElementById('questionText');
- const answersContainer = document.getElementById('answersContainer');
- const alternatePath = document.getElementById('alternatePath');
- const encouragement = document.getElementById('encouragement');
- // Add encouragement messages at milestones
- if (gameState.currentQuestion === 5) {
- encouragement.textContent = '✨ Quarter way through the timeline!';
- } else if (gameState.currentQuestion === 10) {
- encouragement.textContent = '🌟 Halfway there, temporal traveler!';
- } else if (gameState.currentQuestion === 15) {
- encouragement.textContent = '⚡ The perfect timeline is within reach!';
- } else if (gameState.currentQuestion === 18) {
- encouragement.textContent = '🔥 Almost there! Two more to go!';
- } else {
- encouragement.textContent = '';
- }
- // Check for shortcuts
- if (gameState.unlockedPaths.includes(q.id) && q.shortcut) {
- q.shortcut.enabled = true;
- questionText.textContent = q.shortcut.question;
- answersContainer.innerHTML = '';
- q.shortcut.answers.forEach((answer, index) => {
- const btn = createAnswerButton(answer, index, true);
- answersContainer.appendChild(btn);
- });
- alternatePath.innerHTML = '<p style="color: #ff00ff;">⚡ Shortcut Path Activated ⚡</p>';
- alternatePath.classList.add('unlocked');
- } else {
- questionText.textContent = q.question;
- answersContainer.innerHTML = '';
- q.answers.forEach((answer, index) => {
- const btn = createAnswerButton(answer, index, false);
- answersContainer.appendChild(btn);
- });
- // Show alternate path hint if triggered
- if (q.alternatePath && gameState.memoryFragments.includes(q.alternatePath.hint)) {
- alternatePath.innerHTML = `<p style="color: #ff00ff;">🌀 ${q.alternatePath.hint}</p>`;
- alternatePath.classList.add('unlocked');
- } else {
- alternatePath.classList.remove('unlocked');
- }
- }
- updateTimeline();
- }
- function createAnswerButton(text, index, isShortcut) {
- const btn = document.createElement('button');
- btn.className = 'answer-btn';
- btn.textContent = text;
- btn.onclick = () => checkAnswer(index, isShortcut);
- return btn;
- }
- function checkAnswer(selectedIndex, isShortcut = false) {
- const q = questions[gameState.currentQuestion];
- const buttons = document.querySelectorAll('.answer-btn');
- let isCorrect;
- if (isShortcut && q.shortcut) {
- isCorrect = selectedIndex === q.shortcut.correct;
- } else {
- isCorrect = selectedIndex === q.correct;
- // Check for alternate path triggers
- if (q.alternatePath && selectedIndex === q.alternatePath.trigger) {
- if (!gameState.memoryFragments.includes(q.alternatePath.hint)) {
- gameState.memoryFragments.push(q.alternatePath.hint);
- gameState.unlockedPaths.push(q.alternatePath.unlocksAt);
- updateMemoryFragments();
- }
- }
- }
- buttons[selectedIndex].classList.add(isCorrect ? 'correct' : 'wrong');
- if (isCorrect) {
- gameState.score++;
- // Add memory fragment
- if (!gameState.memoryFragments.includes(q.fragment)) {
- gameState.memoryFragments.push(q.fragment);
- updateMemoryFragments();
- }
- setTimeout(() => {
- gameState.currentQuestion++;
- if (gameState.currentQuestion >= questions.length) {
- victoryScreen();
- } else {
- loadQuestion();
- }
- }, 1000);
- } else {
- gameState.perfectRun = false;
- // Add hint fragment on wrong answer
- const hintFragment = `Loop ${gameState.currentLoop}: Wrong at Q${gameState.currentQuestion + 1} - "${q.answers[selectedIndex]}"`;
- if (!gameState.memoryFragments.includes(hintFragment)) {
- gameState.memoryFragments.push(hintFragment);
- }
- setTimeout(() => {
- resetLoop();
- }, 1500);
- }
- }
- function resetLoop() {
- gameState.currentLoop++;
- gameState.currentQuestion = 0;
- gameState.score = 0;
- document.getElementById('loopCount').textContent = gameState.currentLoop;
- document.getElementById('progressCount').textContent = '0';
- updateMemoryFragments();
- loadQuestion();
- }
- function updateTimeline() {
- const checkpoints = document.querySelectorAll('.checkpoint');
- checkpoints.forEach((cp, index) => {
- cp.classList.remove('active', 'completed');
- if (index === gameState.currentQuestion) {
- cp.classList.add('active');
- // Scroll active checkpoint into view
- cp.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
- } else if (index < gameState.currentQuestion) {
- cp.classList.add('completed');
- }
- });
- document.getElementById('progressCount').textContent = gameState.currentQuestion;
- }
- function updateMemoryFragments() {
- const container = document.getElementById('memoryContainer');
- container.innerHTML = '';
- if (gameState.memoryFragments.length === 0) {
- container.innerHTML = '<p style="color: rgba(255,255,255,0.5); font-style: italic;">No fragments collected yet...</p>';
- } else {
- // Add loop wisdom based on attempt count
- if (gameState.currentLoop > 3 && !gameState.memoryFragments.includes('Loop Wisdom: Patterns emerge')) {
- gameState.memoryFragments.unshift('Loop Wisdom: Patterns emerge in repetition');
- }
- if (gameState.currentLoop > 6 && !gameState.memoryFragments.includes('Loop Wisdom: Time is your ally')) {
- gameState.memoryFragments.unshift('Loop Wisdom: Time is your ally, not your enemy');
- }
- if (gameState.currentLoop > 10 && !gameState.memoryFragments.includes('Loop Wisdom: Persistence conquers')) {
- gameState.memoryFragments.unshift('Loop Wisdom: Persistence conquers all timelines');
- }
- gameState.memoryFragments.forEach(fragment => {
- const div = document.createElement('div');
- div.className = 'fragment';
- if (fragment.startsWith('Loop Wisdom:')) {
- div.style.borderColor = '#ff00ff';
- div.style.background = 'rgba(255, 0, 255, 0.2)';
- }
- div.textContent = fragment;
- container.appendChild(div);
- });
- }
- }
- function victoryScreen() {
- document.getElementById('finalLoops').textContent = gameState.currentLoop;
- document.getElementById('perfectTimeline').classList.add('active');
- }
- function hardReset() {
- gameState.currentLoop = 1;
- gameState.currentQuestion = 0;
- gameState.score = 0;
- gameState.memoryFragments = [];
- gameState.unlockedPaths = [];
- gameState.questionHistory = [];
- gameState.perfectRun = true;
- document.getElementById('loopCount').textContent = '1';
- document.getElementById('progressCount').textContent = '0';
- document.getElementById('perfectTimeline').classList.remove('active');
- initGame();
- }
- // Initialize game
- document.getElementById('totalQuestions').textContent = questions.length;
- initGame();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment