Current Affairs Quiz /* Basic CSS resets */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; background-color: #f1f8e9; color: #33691e; } .content-container { background-color: #dcedc8; padding: 5px; border-radius: 5px; max-width: auto; margin: 20px auto; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); position: relative; } .header { background-color: #7cb342; color: #ffffff; text-align: center; padding: 20px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); position: relative; } .header h1 { margin: 0; font-size: 28px; } /* Hamburger Menu Icon */ .hamburger { position: absolute; top: 8px; left: 8px; z-index: 1000; width: 20px; height: 15px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; } .hamburger-line { height: 3px; background-color: #fff; border-radius: 2px; } /* Sidebar (Question Nav) */ #questionNavOverlay { position: fixed; top: 0; left: -250px; /* hidden by default */ width: 250px; height: 100%; background-color: #fff; transition: left 0.3s ease-in-out; z-index: 2000; box-shadow: 2px 0 6px rgba(0,0,0,0.3); padding: 20px; overflow-y: auto; } #questionNavOverlay.show { left: 0; /* slide in */ } #questionNavTitle { margin-bottom: 10px; font-weight: bold; font-size: 1.1rem; } .question-nav { display: flex; flex-wrap: wrap; gap: 5px; } .circle-number { width: 30px; height: 30px; border-radius: 50%; background-color: #ccc; color: #000; display: flex; justify-content: center; align-items: center; cursor: pointer; user-select: none; /* Prevent text selection */ transition: background-color 0.2s; } .circle-number:hover { background-color: #aaa; } .circle-number.active { background-color: #4CAF50; color: #fff; } /* Quiz Container */ .quiz-container { background-color: #fff; border-radius: 10px; padding: 5px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); max-width: auto; width: 100%; margin: 0 auto; text-align: center; position: relative; } .question-counter { font-weight: bold; padding: 5px 10px; border-radius: 5px; background-color: #d9edf7; position: absolute; top: 10px; left: 10px; } /* Timer display */ .timer { font-weight: bold; padding: 5px 10px; border-radius: 5px; background-color: #ffcccb; position: absolute; top: 10px; right: 10px; } .question { font-size: 1.2rem; margin-top: 40px; margin-bottom: 20px; text-align: left; } .choices { display: flex; flex-direction: column; gap: 10px; } .choice { padding: 10px; background-color: #f0f0f0; border: 1px solid #ddd; border-radius: 5px; cursor: pointer; transition: background-color 0.3s, box-shadow 0.3s; } .choice:hover { background-color: #e0e0e0; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .choice.selected { background-color: #28a745; /* More vivid green */ color: #fff; } .choice.correct { background-color: #28a745; /* More vivid green */ border-color: #28a745; color: #fff; } .choice.incorrect { background-color: #dc3545; /* More vivid red */ border-color: #dc3545; color: #fff; } .choice.disabled { cursor: not-allowed; pointer-events: none; opacity: 0.6; } .explanation { margin-top: 20px; text-align: left; background-color: #e7f3fe; padding: 15px; border-left: 5px solid #2196F3; border-radius: 5px; } .buttons { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; } .btn { flex: 1 1 auto; padding: 8px 12px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 0.9rem; text-align: center; min-width: 100px; max-width: 150px; transition: none; } .btn.disabled { background-color: #cccccc; cursor: not-allowed; } .hidden { display: none; } /* Result Section */ #resultContent { text-align: center; margin-top: 20px; } .congrats { font-size: 1.5rem; color: #4CAF50; } .sad { font-size: 1.5rem; color: #d32f2f; } /* Popup Message (Optional) */ #popupMessage { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); color: white; padding: 10px 20px; border-radius: 5px; font-size: 1rem; z-index: 5000; display: none; } #popupMessage.show { display: block; } #popupMessage.correct { background-color: #28a745; } #popupMessage.incorrect { background-color: #dc3545; } Current Affairs Quiz on National Events- January, 2025 Questions 1/3 Time: 00:00 Loading question... Previous Check Next Quiz Completed /***** JavaScript Code *****/ // Quiz data (sample) const quizData =[ { "question": "ISRO के स्पेस डॉकिंग एक्सपेरिमेंट (SpaDeX) मिशन का मुख्य उद्देश्य क्या था, जिसने भारत को यह क्षमता हासिल करने वाला चौथा देश बना दिया?", "options": [ "चंद्रमा पर एक रोवर उतारना", "अंतरिक्ष में दो उपग्रहों को सफलतापूर्वक जोड़ना और अलग करना", "मंगल ग्रह पर एक ऑर्बिटर भेजना", "एक नया मौसम उपग्रह लॉन्च करना" ], "correct": 1, "explanation": "स्पेस डॉकिंग एक्सपेरिमेंट (SpaDeX) का मुख्य उद्देश्य अंतरिक्ष में दो उपग्रहों को स्वचालित रूप से जोड़ने (डॉकिंग) और अलग करने (अनडॉकिंग) की क्षमता का प्रदर्शन करना था। इस सफलता ने भारत को अमेरिका, रूस और चीन के बाद यह क्षमता हासिल करने वाला चौथा देश बना दिया है।" }, { "question": "भविष्य में भारी उपग्रहों के प्रक्षेपण के लिए इसरो द्वारा विकसित किए जा रहे नए लॉन्च व्हीकल का नाम क्या है?", "options": [ "GSLV Mk IV", "PSLV-Pro", "Next Generation Launch Vehicle (NGLV)", "Vikram-S" ], "correct": 2, "explanation": "इसरो 4000 किलोग्राम से अधिक वजनी उपग्रहों को प्रक्षेपित करने के लिए एक न्यू जनरेशन लॉन्च व्हीकल (NGLV) विकसित कर रहा है। इसका लक्ष्य 2032 तक इसे तैयार करना है, जिससे भारी उपग्रहों के लिए विदेशी लॉन्च सेवाओं पर भारत की निर्भरता कम हो जाएगी।" }, { "question": "इसरो ने अंतरिक्ष में बीज अंकुरित करने के अपने प्रयोग में किस पौधे के बीजों का सफलतापूर्वक अंकुरण किया?", "options": [ "गेहूं", "पालक", "लोबिया (Cowpea)", "सरसों" ], "correct": 2, "explanation": "इसरो ने पीएसएलवी-सी60 के पीओईएम-4 प्लेटफॉर्म पर लोबिया (Cowpea) के बीजों को 4 दिनों में सफलतापूर्वक अंकुरित किया। यह प्रयोग अंतरिक्ष में पौधों के विकास और खाद्य उत्पादन की व्यवहार्यता का अध्ययन करने के लिए किया गया था।" }, { "question": "भारत के किन दो निजी स्टार्टअप्स ने स्पेसएक्स के रॉकेट से अपने सैटेलाइट प्रक्षेपित करने की योजना बनाई है?", "options": [ "अग्निकुल और स्काईरूट", "बेलाट्रिक्स और ध्रुव स्पेस", "दिगंतरा और पिक्सल", "सत्श्यूर और एस्ट्रो-टेक" ], "correct": 2, "explanation": "भारतीय स्टार्टअप्स दिगंतरा और पिक्सल स्पेसएक्स के रॉकेट से अपने सैटेलाइट प्रक्षेपित करेंगे। पिक्सल हाइपरस्पेक्ट्रल तकनीक का उपयोग करेगा, जबकि दिगंतरा अंतरिक्ष मलबे की निगरानी के लिए दुनिया का पहला कमर्शियल स्पेस कैमरा लॉन्च करेगा।" }, { "question": "सरकार ने इसरो के सतीश धवन अंतरिक्ष केंद्र, श्रीहरिकोटा में किस महत्वपूर्ण सुविधा की स्थापना को मंजूरी दी है?", "options": [ "एक नया अंतरिक्ष संग्रहालय", "एक अंतरिक्ष यात्री प्रशिक्षण केंद्र", "एक तीसरा लॉन्च पैड (TLP)", "एक डीप स्पेस नेटवर्क एंटीना" ], "correct": 2, "explanation": "केंद्र सरकार ने श्रीहरिकोटा में तीसरे लॉन्च पैड (TLP) की स्थापना को मंजूरी दी है। इसका उद्देश्य अगली पीढ़ी के लॉन्च वाहनों (NGLV) और मानवयुक्त मिशनों के लिए लॉन्च इंफ्रास्ट्रक्चर तैयार करना है। यह परियोजना 48 महीनों में पूरी होगी।" }, { "question": "भारत की स्पेस इकोनॉमी को अगले 10 वर्षों में $8 अरब से बढ़ाकर कितने अरब डॉलर तक पहुंचाने का लक्ष्य है?", "options": [ "$22 अरब", "$35 अरब", "$44 अरब", "$50 अरब" ], "correct": 2, "explanation": "भारत की स्पेस इकोनॉमी वर्तमान में $8 अरब पर है और इसे अगले 10 वर्षों में $44 अरब तक बढ़ाने का लक्ष्य रखा गया है। इसके लिए गगनयान, चंद्रयान-4, और भारतीय स्पेस स्टेशन जैसे प्रमुख मिशन नियोजित हैं।" }, { "question": "इसरो का ऐतिहासिक 100वां सफल मिशन कौन सा था, जिसे GSLV-F15 रॉकेट से लॉन्च किया गया?", "options": [ "चंद्रयान-3", "आदित्य-L1", "एनवीएस-02 (NVS-02)", "मंगलयान-2" ], "correct": 2, "explanation": "इसरो का 100वां सफल प्रक्षेपण 29 जनवरी, 2025 को हुआ जब GSLV-F15 रॉकेट ने नेविगेशन उपग्रह एनवीएस-02 (NVS-02) को कक्षा में स्थापित किया। यह भारत की नाविक (NavIC) प्रणाली का विस्तार करता है।" }, { "question": "रक्षा मंत्रालय ने 2025 को किस रूप में मनाने की घोषणा की है?", "options": [ "नौसेना का वर्ष", "स्वदेशीकरण का वर्ष", "सुधारों का वर्ष", "साइबर सुरक्षा का वर्ष" ], "correct": 2, "explanation": "रक्षा मंत्रालय ने 2025 को 'सुधारों का वर्ष' घोषित किया है। इसके तहत तीनों सेनाओं के लिए एकीकृत सैन्य कमान स्थापित करने और AI, हाइपरसोनिक और रोबोटिक्स जैसी नई तकनीकों पर ध्यान केंद्रित करने की योजना है।" }, { "question": "भारतीय तटरक्षक बल (ICG) के लिए गोवा शिपयार्ड लिमिटेड द्वारा लॉन्च किए गए दो नए फास्ट पेट्रोल वेसल्स (FPVS) के नाम क्या हैं?", "options": [ "अजय और विजय", "अमूल्य और अक्षय", "प्रचंड और ध्रुव", "विक्रांत और विराट" ], "correct": 1, "explanation": "गोवा शिपयार्ड लिमिटेड (GSL) ने भारतीय तटरक्षक बल के लिए दो नए फास्ट पेट्रोल वेसल्स 'अमूल्य' और 'अक्षय' का शुभारंभ किया। यह 8 FPVS के बेड़े में तीसरा और चौथा वेसल है।" }, { "question": "भारतीय नौसेना को सौंपी गई प्रोजेक्ट-75 के तहत निर्मित छठी और अंतिम स्कॉर्पीन श्रेणी की पनडुब्बी का नाम क्या है?", "options": [ "आईएनएस करंज", "आईएनएस वेला", "आईएनएस वाग्शीर", "आईएनएस कलवरी" ], "correct": 2, "explanation": "प्रोजेक्ट-75 के तहत निर्मित स्कॉर्पीन श्रेणी की छठी और अंतिम पनडुब्बी 'आईएनएस वाग्शीर' को मझगांव डॉक शिपबिल्डर्स लिमिटेड (MDL) द्वारा नौसेना को सौंपा गया। इसका नाम हिंद महासागर में पाई जाने वाली एक निडर मछली के नाम पर है।" }, { "question": "DRDO द्वारा विकसित मल्टी-लेयर क्लोथिंग सिस्टम का नाम क्या है जो सैनिकों को माइनस 60 डिग्री सेल्सियस तापमान में भी गर्म रखता है?", "options": [ "हिमशक्ति", "स्याचिन सूट", "हिमकवच", "ऑपरेशनल गियर" ], "correct": 2, "explanation": "रक्षा अनुसंधान एवं विकास संगठन (DRDO) ने 'हिमकवच' नामक एक मल्टी-लेयर क्लोथिंग सिस्टम विकसित किया है, जो अत्यधिक ठंडे क्षेत्रों में -60°C से 20°C तक के तापमान में सैन्य कर्मियों की सुरक्षा करने में सक्षम है।" }, { "question": "तीसरी पीढ़ी की 'फायर-एंड-फॉरगेट' एंटी-टैंक गाइडेड मिसाइल, जिसका हाल ही में पोखरण में सफल परीक्षण किया गया, का नाम क्या है?", "options": [ "अग्नि-2", "नाग एमके 2", "प्रहार", "अमोघा-1" ], "correct": 1, "explanation": "स्वदेशी रूप से विकसित, तीसरी पीढ़ी की एंटी-टैंक गाइडेड मिसाइल 'नाग एमके 2' का पोखरण फील्ड फायरिंग रेंज में सफल परीक्षण किया गया। यह 'फायर-एंड-फॉरगेट' मिसाइल इन्फ्रारेड तकनीक का उपयोग करती है और इसकी रेंज 4 किमी है।" }, { "question": "सेना दिवस 2025 पर, भारतीय नौसेना में एक साथ किन तीन युद्धपोतों/पनडुब्बियों को कमीशन किया गया?", "options": [ "INS विक्रांत, INS विक्रमादित्य, INS अरिहंत", "INS कोलकाता, INS कोच्चि, INS चेन्नई", "INS सूरत, INS नीलगिरी, INS वाघशीर", "INS शिवालिक, INS सतपुड़ा, INS सह्याद्री" ], "correct": 2, "explanation": "15 जनवरी 2025 को सेना दिवस पर, मुंबई में एक ऐतिहासिक समारोह में डिस्ट्रॉयर 'INS सूरत', फ्रिगेट 'INS नीलगिरी', और पनडुब्बी 'INS वाघशीर' को एक साथ भारतीय नौसेना में कमीशन किया गया।" }, { "question": "DRDO ने हाल ही में किस इंजन का 120 सेकंड का सफल ग्राउंड टेस्ट किया, जो हाइपरसोनिक मिसाइलों के लिए महत्वपूर्ण है?", "options": [ "टर्बोजेट इंजन", "रैमजेट इंजन", "क्रायोजेनिक इंजन", "स्क्रैमजेट इंजन" ], "correct": 3, "explanation": "DRDO ने हाइपरसोनिक मिसाइलों के लिए विकसित स्क्रैमजेट कॉम्बस्टर इंजन का 120 सेकंड का सफल ग्राउंड टेस्ट किया है। यह इंजन सुपरसोनिक दहन तकनीक पर आधारित है और ध्वनि की गति से 5 गुना (मैक 5) तेज उड़ान में सक्षम बनाता है।" }, { "question": "भारत 2025 में किस यूरोपीय ड्रोन विकास कार्यक्रम में पर्यवेक्षक के रूप में शामिल हुआ है?", "options": [ "स्काई शील्ड प्रोग्राम", "यूरोड्रोन कार्यक्रम", "ग्लोबल हॉक इनिशिएटिव", "प्रेडेटर प्रोजेक्ट" ], "correct": 1, "explanation": "भारत 2025 में पर्यवेक्षक के रूप में 'यूरोड्रोन कार्यक्रम' में शामिल हुआ है। यह जर्मनी, फ्रांस, इटली और स्पेन द्वारा चलाया जा रहा एक €7.1 बिलियन का प्रोजेक्ट है, जो लंबी दूरी के मिशनों के लिए ड्रोन विकसित करने पर केंद्रित है।" }, { "question": "भारतीय सेना की निगरानी और टोही क्षमताओं को आधुनिक बनाने के लिए लॉन्च किए गए नए बैटलफील्ड सर्विलांस सिस्टम का नाम क्या है?", "options": [ "दृष्टि", "संजय (SANJAY)", "इंद्रजाल", "प्रहरी" ], "correct": 1, "explanation": "रक्षा मंत्री राजनाथ सिंह ने 'संजय' (SANJAY) बैटलफील्ड सर्विलांस सिस्टम (BSS) का उद्घाटन किया। यह प्रणाली ग्राउंड और एरियल सेंसर से डेटा एकत्र कर रियल-टाइम यूनिफाइड सर्विलांस पिक्चर प्रदान करती है, जिससे सेना की ISR क्षमताएं बढ़ेंगी।" } ]; let currentQuestionIndex = 0; // Track current question let userAnswers = Array(quizData.length).fill(null); // Track user's answers // Timer variables let totalQuizTime = quizData.length * 30; // total seconds = 30 seconds * no. of questions let timeLeft = totalQuizTime; let timerInterval; // On page load, initialize quiz window.onload = function() { generateQuestionNav(); // Generate the question navigation circles loadQuestion(); startTimer(); // Start the countdown }; // Start the countdown timer function startTimer() { updateTimerDisplay(timeLeft); timerInterval = setInterval(() => { timeLeft--; updateTimerDisplay(timeLeft); if (timeLeft <= 0) { clearInterval(timerInterval); showResults(); // Force show results if time is up } }, 1000); } // Update timer on the screen in mm:ss format function updateTimerDisplay(seconds) { const timerEl = document.getElementById("timer"); const mins = Math.floor(seconds / 60).toString().padStart(2, '0'); const secs = (seconds % 60).toString().padStart(2, '0'); timerEl.innerText = `Time: ${mins}:${secs}`; } // Toggle the question nav when hamburger is pressed const hamburgerBtn = document.getElementById('hamburgerBtn'); hamburgerBtn.addEventListener('click', () => { document.getElementById('questionNavOverlay').classList.toggle('show'); }); // Close hamburger menu if user clicks outside the nav and menu document.addEventListener('click', (e) => { const navOverlay = document.getElementById('questionNavOverlay'); const hamburger = document.getElementById('hamburgerBtn'); // If the menu is open, and the click is outside both the overlay and the hamburger, close it if ( navOverlay.classList.contains('show') && !navOverlay.contains(e.target) && !hamburger.contains(e.target) ) { navOverlay.classList.remove('show'); } }); // Create small clickable circles for each question function generateQuestionNav() { const navContainer = document.getElementById("questionNav"); navContainer.innerHTML = ""; // clear old items if any quizData.forEach((_, index) => { const circle = document.createElement("div"); circle.classList.add("circle-number"); circle.innerText = index + 1; // Show question number (1-based) circle.onclick = () => jumpToQuestion(index); navContainer.appendChild(circle); }); } // Jump to a specific question function jumpToQuestion(qIndex) { currentQuestionIndex = qIndex; // Hide the nav on mobile after selection document.getElementById('questionNavOverlay').classList.remove('show'); // Reset submission/next button state document.getElementById("submitAnswerButton").classList.remove("hidden"); document.getElementById("nextButton").classList.add("hidden"); loadQuestion(); } // Load current question function loadQuestion() { highlightCurrentCircle(); // Hide explanation area and Next button initially document.getElementById("explanation").classList.add("hidden"); document.getElementById("nextButton").classList.add("hidden"); const questionData = quizData[currentQuestionIndex]; document.getElementById("question").innerText = questionData.question; document.getElementById("questionCounter").innerText = `${currentQuestionIndex + 1}/${quizData.length}`; // Clear old choices const choicesContainer = document.getElementById("choices"); choicesContainer.innerHTML = ""; // Populate choices questionData.options.forEach((option, index) => { const choiceElement = document.createElement("div"); choiceElement.className = "choice"; choiceElement.innerText = option; // If previously selected, mark it if (userAnswers[currentQuestionIndex] === index) { choiceElement.classList.add("selected"); } // On clicking a choice choiceElement.onclick = () => { // Clear all selections first document.querySelectorAll(".choice").forEach(c => c.classList.remove("selected")); // Mark this one as selected choiceElement.classList.add("selected"); userAnswers[currentQuestionIndex] = index; }; choicesContainer.appendChild(choiceElement); }); // Handle Previous button visibility document.getElementById("prevButton").style.display = currentQuestionIndex === 0 ? "none" : "inline-block"; } // Highlight the current question circle function highlightCurrentCircle() { const circles = document.querySelectorAll(".circle-number"); circles.forEach((circle, idx) => { circle.classList.remove("active"); if (idx === currentQuestionIndex) { circle.classList.add("active"); } }); } // Submit the current question's answer function submitAnswer() { const questionData = quizData[currentQuestionIndex]; const userAnswer = userAnswers[currentQuestionIndex]; // Show the explanation div const explanationDiv = document.getElementById("explanation"); explanationDiv.classList.remove("hidden"); // Clear previous correctness classes and disable further selection document.querySelectorAll(".choice").forEach((c) => { c.classList.add("disabled"); c.onclick = null; }); // Determine correctness or skipping if (userAnswer === null) { explanationDiv.innerHTML = "You Skipped the question.<br/><br/>व्याख्या: " + questionData.explanation; showPopupMessage("You Skipped the question", false); } else if (userAnswer === questionData.correct) { explanationDiv.innerHTML = "You got it right!<br/><br/>व्याख्या: " + questionData.explanation; showPopupMessage("You got it right", true); // Highlight correct choice document.querySelectorAll(".choice")[userAnswer].classList.add("correct"); } else { explanationDiv.innerHTML = "You got it wrong.<br/><br/>व्याख्या: " + questionData.explanation; showPopupMessage("You got it wrong", false); // Highlight correct choice document.querySelectorAll(".choice")[questionData.correct].classList.add("correct"); // Mark the chosen one as incorrect document.querySelectorAll(".choice")[userAnswer].classList.add("incorrect"); } // Hide the submit button, show the next button document.getElementById("submitAnswerButton").classList.add("hidden"); document.getElementById("nextButton").classList.remove("hidden"); } // Go to the next question or show final results function nextQuestion() { currentQuestionIndex++; if (currentQuestionIndex >= quizData.length) { // Show results if no more questions showResults(); } else { // Reset buttons document.getElementById("submitAnswerButton").classList.remove("hidden"); document.getElementById("nextButton").classList.add("hidden"); loadQuestion(); } } // Go to the previous question function previousQuestion() { if (currentQuestionIndex > 0) { currentQuestionIndex--; document.getElementById("submitAnswerButton").classList.remove("hidden"); document.getElementById("nextButton").classList.add("hidden"); loadQuestion(); } } // Show final quiz results function showResults() { // Stop the timer if it's still running clearInterval(timerInterval); // Calculate correct answers const correctAnswersCount = userAnswers.filter( (ans, i) => ans === quizData[i].correct ).length; // Hide quiz content document.getElementById("quizContent").classList.add("hidden"); // Show results document.getElementById("resultContent").classList.remove("hidden"); const percentage = (correctAnswersCount / quizData.length) * 100; let resultHTML = ""; if (percentage >= 60) { resultHTML = `<div class="congrats">🎉 बधाई हो! आपने ${percentage.toFixed( 2 )}% स्कोर किया है!</div>`; } else { resultHTML = `<div class="sad">😢 आपने ${percentage.toFixed( 2 )}% स्कोर किया है। अगली बार के लिए शुभकामनाएं!</div>`; } document.getElementById("resultMessage").innerHTML = resultHTML; document.getElementById("scoreMessage").innerText = `आपने कुल ${quizData.length} में से ${correctAnswersCount} प्रश्न सही उत्तर दिए हैं।`; } // Optional popup message function showPopupMessage(message, isCorrect) { const popup = document.getElementById('popupMessage'); popup.innerText = message; popup.className = ''; popup.classList.add('show'); popup.classList.add(isCorrect ? 'correct' : 'incorrect'); setTimeout(() => { popup.classList.remove('show'); popup.classList.add('hidden'); }, 2000); } // Button event listeners document.getElementById('prevButton').addEventListener('click', previousQuestion); document.getElementById('submitAnswerButton').addEventListener('click', submitAnswer); document.getElementById('nextButton').addEventListener('click', nextQuestion); // Predefined Darker Color Themes const themes = [ { header: '#a31645', headerText: '#ffffff', container: '#e8c4d6', containerText: '#6e0c36', headings: '#6e0c36' }, // Berry Delight { header: '#00574b', headerText: '#ffffff', container: '#b3dfd7', containerText: '#00382e', headings: '#00382e' }, // Ocean Breeze { header: '#c95a00', headerText: '#ffffff', container: '#dca865', containerText: '#7a3400', headings: '#7a3400' }, // Sunset Glow { header: '#4a0f6f', headerText: '#ffffff', container: '#cdb5e3', containerText: '#320b4a', headings: '#320b4a' }, // Calming Lavender { header: '#1e4d2b', headerText: '#ffffff', container: '#98c1a3', containerText: '#122417', headings: '#122417' }, // Forest Retreat { header: '#c99800', headerText: '#ffffff', container: '#e8d18a', containerText: '#6c4f00', headings: '#6c4f00' }, // Golden Elegance { header: '#01477e', headerText: '#ffffff', container: '#86b9e4', containerText: '#00223d', headings: '#00223d' }, // Sky Calm { header: '#5a3b2e', headerText: '#ffffff', container: '#b8a89c', containerText: '#32211a', headings: '#32211a' }, // Retro Rust { header: '#b34727', headerText: '#ffffff', container: '#f2c29d', containerText: '#6a2915', headings: '#6a2915' }, // Warm Peach { header: '#0f4c43', headerText: '#ffffff', container: '#92c3b8', containerText: '#072822', headings: '#072822' }, // Cool Mint ]; // Apply Random Darker Theme function applyRandomTheme() { const header = document.querySelector('.header'); const container = document.querySelector('.content-container'); const headings = document.querySelectorAll('.content-container h2'); // Select a random theme const randomTheme = themes[Math.floor(Math.random() * themes.length)]; // Apply Header Colors header.style.backgroundColor = randomTheme.header; header.style.color = randomTheme.headerText; // Apply Container Colors container.style.backgroundColor = randomTheme.container; container.style.color = randomTheme.containerText; // Apply Heading Colors headings.forEach((heading) => { heading.style.color = randomTheme.headings; heading.style.borderBottom = `2px solid ${randomTheme.headings}`; }); } // Apply the theme on page load window.onload = function () { applyRandomTheme(); // Set random theme generateQuestionNav(); // Generate question navigation loadQuestion(); // Load the first question startTimer(); // Start the countdown timer };