From a02ac831852accadea13a53a227c0800b449dffc Mon Sep 17 00:00:00 2001 From: rishisulakhe Date: Wed, 19 Jun 2024 15:38:28 +0530 Subject: [PATCH 1/5] Quiz added --- Rishi_20230087/index.html | 0 Rishi_20230087/script.js | 0 Rishi_20230087/style.css | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Rishi_20230087/index.html create mode 100644 Rishi_20230087/script.js create mode 100644 Rishi_20230087/style.css diff --git a/Rishi_20230087/index.html b/Rishi_20230087/index.html new file mode 100644 index 0000000..e69de29 diff --git a/Rishi_20230087/script.js b/Rishi_20230087/script.js new file mode 100644 index 0000000..e69de29 diff --git a/Rishi_20230087/style.css b/Rishi_20230087/style.css new file mode 100644 index 0000000..e69de29 From 717c9ab534e1d240e8924493090c9db294559791 Mon Sep 17 00:00:00 2001 From: rishisulakhe Date: Wed, 19 Jun 2024 16:58:41 +0530 Subject: [PATCH 2/5] Update index.html --- Rishi_20230087/index.html | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Rishi_20230087/index.html b/Rishi_20230087/index.html index e69de29..2b48827 100644 --- a/Rishi_20230087/index.html +++ b/Rishi_20230087/index.html @@ -0,0 +1,40 @@ + + + + + + Quiz App + + + +
+ +
+

Select a Topic

+ + + +
+ + +
+
+

+
+ + +
+
+

+
+ + +
+

Your Score:

+ + +
+
+ + + From b594b875f7cffe5b3d136f07302da36dc73ee5e0 Mon Sep 17 00:00:00 2001 From: rishisulakhe Date: Wed, 19 Jun 2024 16:59:39 +0530 Subject: [PATCH 3/5] Update script.js --- Rishi_20230087/script.js | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/Rishi_20230087/script.js b/Rishi_20230087/script.js index e69de29..11ae40a 100644 --- a/Rishi_20230087/script.js +++ b/Rishi_20230087/script.js @@ -0,0 +1,64 @@ +let currentScreen = 'topic-selection'; +let currentTopic = ''; +let currentQuestionIndex = 0; +let score = 0; + +const questions = { + Physics: [ + { text: 'Magnetic field lines exits in circular loop', correct: true }, + { text: 'Nuclear reaction are the zeroth order reactions', correct: false } + ], + Chemistry: [ + { text: 'SN1 reaction is favourable in tertiary Alkyl halide', correct: true }, + { text: 'AgCl ppt is blue in colour', correct: false } + ], + Computer: [ + { text: 'this keyword in java is used to diiferentiate between actual parameters and formal parameters', correct: true }, + { text: 'Method overloading amd method overriding are same ', correct: false } + ] +}; + +function showScreen(screen) { + document.querySelector(`#${currentScreen}`).classList.remove('active'); + document.querySelector(`#${screen}`).classList.add('active'); + currentScreen = screen; +} + +function selectTopic(topic) { + currentTopic = topic; + currentQuestionIndex = 0; + score = 0; + showScreen('quiz-questions'); + showQuestion(); +} + +function showQuestion() { + const question = questions[currentTopic][currentQuestionIndex]; + document.querySelector('#question-text').innerText = question.text; + document.querySelector('#question-number').innerText = `Question ${currentQuestionIndex + 1} of ${questions[currentTopic].length}`; +} + +function answerQuestion(answer) { + const question = questions[currentTopic][currentQuestionIndex]; + if (question.correct === answer) { + score++; + } + currentQuestionIndex++; + if (currentQuestionIndex < questions[currentTopic].length) { + showQuestion(); + } else { + document.querySelector('#score').innerText = score; + showScreen('final-score'); + } +} + +function retry() { + selectTopic(currentTopic); +} + +function goHome() { + showScreen('topic-selection'); +} + +// Initial setup +showScreen('topic-selection'); From aeb552fdd3937ac0a1a77d70cb84b8829f1a309b Mon Sep 17 00:00:00 2001 From: rishisulakhe Date: Wed, 19 Jun 2024 17:00:22 +0530 Subject: [PATCH 4/5] Update style.css --- Rishi_20230087/style.css | 107 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/Rishi_20230087/style.css b/Rishi_20230087/style.css index e69de29..73686ba 100644 --- a/Rishi_20230087/style.css +++ b/Rishi_20230087/style.css @@ -0,0 +1,107 @@ +body { + font-family: Arial, sans-serif; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; + background: linear-gradient(135deg, #4A90E2, #7B4397, #4A90E2); + color: white; + animation: backgroundGradient 10s ease infinite; + } + + @keyframes backgroundGradient { + 0%,100% { background: linear-gradient(135deg, #4A90E2, #7B4397, #4A90E2); } + 50% { background: linear-gradient(135deg, #7B4397, #4A90E2, #7B4397); } + } + + #myH2 { + color: #232526; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-size: 2.5em; + font-style: italic; + animation: fadeIn 2s ease-in-out; + } + + @keyframes fadeIn { + 0% { opacity: 0; transform: translateY(-20px); } + 100% { opacity: 1; transform: translateY(0); } + } + + #app { + width: 500px; + text-align: center; + padding: 20px; + border: 5px solid #7B4397; + border-radius: 10px; + background: rgba(255, 255, 255, 0.1); + box-shadow: 0 8px 16px rgba(94, 201, 230, 0.3); + animation: popUp 1s ease-in-out; + } + + @keyframes popUp { + 0% { transform: scale(0.5); opacity: 0; } + 100% { transform: scale(1); opacity: 1; } + } + + .screen { + background-color: #7B4397; + display: none; + } + + .screen.active { + display: block; + animation: slideIn 0.5s ease-in-out; + } + + @keyframes slideIn { + 0% { transform: translateX(-100%); opacity: 0; } + 100% { transform: translateX(0); opacity: 1; } + } + + button { + display: block; + margin: 10px auto; + padding: 10px 20px; + font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; + font-size: 16px; + cursor: pointer; + border: none; + border-radius: 5px; + background-color: #7B4397; + color: white; + transition: background-color 0.3s, transform 0.3s; + } + + button:hover { + background-color: #e35f8e; + transform: translateY(-5px); + } + + button:active { + transform: translateY(0); + } + + #question-card { + border: 1px solid #ddd; + padding: 20px; + margin: 20px 0; + border-radius: 10px; + background-color: rgba(255, 255, 255, 0.2); + backdrop-filter: blur(10px); + animation: fadeInCard 1s ease-in-out; + } + + @keyframes fadeInCard { + 0% { opacity: 0; transform: translateY(20px); } + 100% { opacity: 1; transform: translateY(0); } + } + + #swipe-buttons { + display: flex; + justify-content: space-between; + } + + #swipe-buttons button { + width: 45%; + } From 6b176077d8fab323d942c5353f4e2045a96259fc Mon Sep 17 00:00:00 2001 From: rishisulakhe Date: Wed, 19 Jun 2024 17:00:47 +0530 Subject: [PATCH 5/5] Update index.html --- Rishi_20230087/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rishi_20230087/index.html b/Rishi_20230087/index.html index 2b48827..0018fbc 100644 --- a/Rishi_20230087/index.html +++ b/Rishi_20230087/index.html @@ -4,7 +4,7 @@ Quiz App - +