-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from mehaksmansoori/main
commit for history button
- Loading branch information
Showing
5 changed files
with
125 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"liveServer.settings.port": 5501 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
function showSpinner() { | ||
var spinner = document.getElementById("spinner"); | ||
if (spinner) { | ||
spinner.style.display = "block"; | ||
} | ||
} | ||
|
||
// Function to hide the spinner | ||
function hideSpinner() { | ||
var spinner = document.getElementById("spinner"); | ||
if (spinner) { | ||
spinner.style.display = "none"; | ||
} | ||
} | ||
showSpinner(); | ||
setTimeout(hideSpinner, 3000); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
const scores = [ | ||
{ date: "2024-01-06", score: 80 }, | ||
{ date: "2024-01-05", score: 75 }, | ||
// Add more scores as needed | ||
]; | ||
|
||
// Function to display score history | ||
function displayScoreHistory() { | ||
const scoreList = document.getElementById("score-list"); | ||
scoreList.innerHTML = ''; // Clear existing list | ||
|
||
scores.forEach((entry) => { | ||
const listItem = document.createElement("li"); | ||
listItem.textContent = `Date: ${entry.date}, Score: ${entry.score}%`; | ||
scoreList.appendChild(listItem); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,75 @@ | ||
<!DOCTYPE html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>Kviz: A quiz app</title> | ||
<link rel="icon" href="./assets/logo-kviz.jpg" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div id="home" class="flex-center flex-column"> | ||
<h1>Kviz</h1> | ||
<div class="flex-row"> | ||
<a class="btn" href="/Dark/index.html">Dark Theme</a> | ||
<a class="btn" href="/Light/index.html">Light Theme</a> | ||
</div> | ||
</div> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>Kviz: A quiz app</title> | ||
<link rel="icon" href="./assets/logo-kviz.jpg" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
<style> | ||
/* Add some basic styling for the score history */ | ||
#score-history { | ||
display: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div id="home" class="flex-center flex-column"> | ||
<h1>Kviz</h1> | ||
<div class="flex-row"> | ||
<a class="btn" href="/Dark/index.html">Dark Theme</a> | ||
<a class="btn" href="/Light/index.html">Light Theme</a> | ||
<a class="btn" href="#" onclick="toggleScoreHistory()">Score History</a> | ||
</div> | ||
</div> | ||
|
||
<!-- <script src="toggle.js"></script> --> | ||
</body> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<!-- ... (your existing head content) ... --> | ||
<script src="index.js"></script> | ||
</head> | ||
<body> | ||
<!-- ... (your existing body content) ... --> | ||
|
||
<!-- Score History Section --> | ||
<div id="score-history"> | ||
<h2>Score History</h2> | ||
<ul id="score-list"></ul> | ||
</div> | ||
</body> | ||
</html> | ||
<!-- ... (your existing JavaScript) ... --> | ||
<script> | ||
// Function to toggle the visibility of the score history | ||
function toggleScoreHistory() { | ||
var scoreHistory = document.getElementById("score-history"); | ||
scoreHistory.style.display = (scoreHistory.style.display === 'block') ? 'none' : 'block'; | ||
|
||
// Call the function to display score history when showing it | ||
if (scoreHistory.style.display === 'block') { | ||
displayScoreHistory(); | ||
} | ||
} | ||
</script> | ||
<!-- ... (your existing JavaScript) ... --> | ||
|
||
|
||
<!-- Spinner Loader --> | ||
<div id="spinner" class="spinner"></div> | ||
|
||
<!-- Uncomment the script if you want to use it --> | ||
<!-- <script src="toggle.js"></script> --> | ||
<script src="SPINNER.js"></script> | ||
|
||
<script> | ||
// Function to toggle the visibility of the score history | ||
function toggleScoreHistory() { | ||
var scoreHistory = document.getElementById("score-history"); | ||
scoreHistory.style.display = (scoreHistory.style.display === 'block') ? 'none' : 'block'; | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters