├── images
└── cover.png
├── Quiz App Master
├── highscores.css
├── highscores.js
├── index.html
├── highscores.html
├── questions.json
├── end.js
├── end.html
├── game.css
├── game.html
├── app.css
└── game.js
├── 12. Create a Spinning Loader
├── highscores.css
├── highscores.js
├── index.html
├── highscores.html
├── questions.json
├── end.js
├── end.html
├── game.css
├── game.html
├── app.css
└── game.js
├── 10. Fetch Questions from Local JSON File
├── highscores.css
├── highscores.js
├── index.html
├── highscores.html
├── questions.json
├── end.js
├── end.html
├── game.css
├── game.html
├── app.css
└── game.js
├── 11. Fetch API Questions from Open Trivia API
├── highscores.css
├── highscores.js
├── index.html
├── highscores.html
├── questions.json
├── end.js
├── end.html
├── game.css
├── game.html
├── app.css
└── game.js
├── 9. Load and Display High Scores from Local Storage
├── highscores.css
├── highscores.js
├── index.html
├── highscores.html
├── end.js
├── end.html
├── game.css
├── game.html
├── app.css
└── game.js
├── .vscode
└── launch.json
├── 7. Create and Style the End Page
├── end.js
├── index.html
├── end.html
├── game.css
├── game.html
├── app.css
└── game.js
├── 2. Create and Style the Game Page
├── game.css
├── index.html
├── game.html
└── app.css
├── 3. Display Hard Coded Question and Answers
├── game.css
├── index.html
├── game.html
├── app.css
└── game.js
├── 6. Create a Progress Bar
├── index.html
├── game.css
├── game.html
├── app.css
└── game.js
├── 5. Create a Head's Up Display
├── index.html
├── game.css
├── game.html
├── app.css
└── game.js
├── 8. Save High Scores in Local Storage
├── index.html
├── end.js
├── end.html
├── game.css
├── game.html
├── app.css
└── game.js
├── 1. Create Home Page and Application Styling
├── index.html
└── app.css
├── 4. Display Feedback for Correct and Incorrect Answers
├── index.html
├── game.css
├── game.html
├── app.css
└── game.js
├── LICENSE
└── ReadMe.md
/images/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesqquick/Build-A-Quiz-App-With-HTML-CSS-and-JavaScript/HEAD/images/cover.png
--------------------------------------------------------------------------------
/Quiz App Master/highscores.css:
--------------------------------------------------------------------------------
1 | #highScoresList {
2 | list-style: none;
3 | padding-left: 0;
4 | margin-bottom: 4rem;
5 | }
6 |
7 | .high-score {
8 | font-size: 2.8rem;
9 | margin-bottom: 0.5rem;
10 | }
11 |
12 | .high-score:hover {
13 | transform: scale(1.025);
14 | }
15 |
--------------------------------------------------------------------------------
/12. Create a Spinning Loader/highscores.css:
--------------------------------------------------------------------------------
1 | #highScoresList {
2 | list-style: none;
3 | padding-left: 0;
4 | margin-bottom: 4rem;
5 | }
6 |
7 | .high-score {
8 | font-size: 2.8rem;
9 | margin-bottom: 0.5rem;
10 | }
11 |
12 | .high-score:hover {
13 | transform: scale(1.025);
14 | }
15 |
--------------------------------------------------------------------------------
/10. Fetch Questions from Local JSON File/highscores.css:
--------------------------------------------------------------------------------
1 | #highScoresList {
2 | list-style: none;
3 | padding-left: 0;
4 | margin-bottom: 4rem;
5 | }
6 |
7 | .high-score {
8 | font-size: 2.8rem;
9 | margin-bottom: 0.5rem;
10 | }
11 |
12 | .high-score:hover {
13 | transform: scale(1.025);
14 | }
15 |
--------------------------------------------------------------------------------
/11. Fetch API Questions from Open Trivia API/highscores.css:
--------------------------------------------------------------------------------
1 | #highScoresList {
2 | list-style: none;
3 | padding-left: 0;
4 | margin-bottom: 4rem;
5 | }
6 |
7 | .high-score {
8 | font-size: 2.8rem;
9 | margin-bottom: 0.5rem;
10 | }
11 |
12 | .high-score:hover {
13 | transform: scale(1.025);
14 | }
15 |
--------------------------------------------------------------------------------
/9. Load and Display High Scores from Local Storage/highscores.css:
--------------------------------------------------------------------------------
1 | #highScoresList {
2 | list-style: none;
3 | padding-left: 0;
4 | margin-bottom: 4rem;
5 | }
6 |
7 | .high-score {
8 | font-size: 2.8rem;
9 | margin-bottom: 0.5rem;
10 | }
11 |
12 | .high-score:hover {
13 | transform: scale(1.025);
14 | }
15 |
--------------------------------------------------------------------------------
/Quiz App Master/highscores.js:
--------------------------------------------------------------------------------
1 | const highScoresList = document.getElementById("highScoresList");
2 | const highScores = JSON.parse(localStorage.getItem("highScores")) || [];
3 |
4 | highScoresList.innerHTML = highScores
5 | .map(score => {
6 | return `
${score.name} - ${score.score}`;
7 | })
8 | .join("");
9 |
--------------------------------------------------------------------------------
/12. Create a Spinning Loader/highscores.js:
--------------------------------------------------------------------------------
1 | const highScoresList = document.getElementById("highScoresList");
2 | const highScores = JSON.parse(localStorage.getItem("highScores")) || [];
3 |
4 | highScoresList.innerHTML = highScores
5 | .map(score => {
6 | return `${score.name} - ${score.score}`;
7 | })
8 | .join("");
9 |
--------------------------------------------------------------------------------
/10. Fetch Questions from Local JSON File/highscores.js:
--------------------------------------------------------------------------------
1 | const highScoresList = document.getElementById("highScoresList");
2 | const highScores = JSON.parse(localStorage.getItem("highScores")) || [];
3 |
4 | highScoresList.innerHTML = highScores
5 | .map(score => {
6 | return `${score.name} - ${score.score}`;
7 | })
8 | .join("");
9 |
--------------------------------------------------------------------------------
/11. Fetch API Questions from Open Trivia API/highscores.js:
--------------------------------------------------------------------------------
1 | const highScoresList = document.getElementById("highScoresList");
2 | const highScores = JSON.parse(localStorage.getItem("highScores")) || [];
3 |
4 | highScoresList.innerHTML = highScores
5 | .map(score => {
6 | return `${score.name} - ${score.score}`;
7 | })
8 | .join("");
9 |
--------------------------------------------------------------------------------
/9. Load and Display High Scores from Local Storage/highscores.js:
--------------------------------------------------------------------------------
1 | const highScoresList = document.getElementById("highScoresList");
2 | const highScores = JSON.parse(localStorage.getItem("highScores")) || [];
3 |
4 | highScoresList.innerHTML = highScores
5 | .map(score => {
6 | return `${score.name} - ${score.score}`;
7 | })
8 | .join("");
9 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "chrome",
9 | "request": "launch",
10 | "name": "Launch Chrome against localhost",
11 | "url": "http://localhost:5500",
12 | "webRoot": "${workspaceFolder}"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/7. Create and Style the End Page/end.js:
--------------------------------------------------------------------------------
1 | const username = document.getElementById('username');
2 | const saveScoreBtn = document.getElementById('saveScoreBtn');
3 | const finalScore = document.getElementById('finalScore');
4 | const mostRecentScore = localStorage.getItem('mostRecentScore');
5 | finalScore.innerText = mostRecentScore;
6 |
7 | username.addEventListener('keyup', () => {
8 | saveScoreBtn.disabled = !username.value;
9 | });
10 |
11 | saveHighScore = (e) => {
12 | e.preventDefault();
13 | };
14 |
--------------------------------------------------------------------------------
/2. Create and Style the Game Page/game.css:
--------------------------------------------------------------------------------
1 | .choice-container {
2 | display: flex;
3 | margin-bottom: 0.5rem;
4 | width: 100%;
5 | font-size: 1.8rem;
6 | border: 0.1rem solid rgb(86, 165, 235, 0.25);
7 | background-color: white;
8 | }
9 |
10 | .choice-container:hover {
11 | cursor: pointer;
12 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5);
13 | transform: translateY(-0.1rem);
14 | transition: transform 150ms;
15 | }
16 |
17 | .choice-prefix {
18 | padding: 1.5rem 2.5rem;
19 | background-color: #56a5eb;
20 | color: white;
21 | }
22 |
23 | .choice-text {
24 | padding: 1.5rem;
25 | }
26 |
--------------------------------------------------------------------------------
/3. Display Hard Coded Question and Answers/game.css:
--------------------------------------------------------------------------------
1 | .choice-container {
2 | display: flex;
3 | margin-bottom: 0.5rem;
4 | width: 100%;
5 | font-size: 1.8rem;
6 | border: 0.1rem solid rgb(86, 165, 235, 0.25);
7 | background-color: white;
8 | }
9 |
10 | .choice-container:hover {
11 | cursor: pointer;
12 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5);
13 | transform: translateY(-0.1rem);
14 | transition: transform 150ms;
15 | }
16 |
17 | .choice-prefix {
18 | padding: 1.5rem 2.5rem;
19 | background-color: #56a5eb;
20 | color: white;
21 | }
22 |
23 | .choice-text {
24 | padding: 1.5rem;
25 | width: 100%;
26 | }
27 |
--------------------------------------------------------------------------------
/Quiz App Master/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/6. Create a Progress Bar/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/12. Create a Spinning Loader/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/5. Create a Head's Up Display/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/2. Create and Style the Game Page/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/7. Create and Style the End Page/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/8. Save High Scores in Local Storage/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/1. Create Home Page and Application Styling/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/10. Fetch Questions from Local JSON File/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/11. Fetch API Questions from Open Trivia API/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/3. Display Hard Coded Question and Answers/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/4. Display Feedback for Correct and Incorrect Answers/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/9. Load and Display High Scores from Local Storage/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Quick Quiz
8 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Quiz App Master/highscores.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | High Scores
8 |
9 |
10 |
11 |
12 |
13 |
14 |
High Scores
15 |
16 |
Go Home
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/12. Create a Spinning Loader/highscores.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | High Scores
8 |
9 |
10 |
11 |
12 |
13 |
14 |
High Scores
15 |
16 |
Go Home
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/4. Display Feedback for Correct and Incorrect Answers/game.css:
--------------------------------------------------------------------------------
1 | .choice-container {
2 | display: flex;
3 | margin-bottom: 0.5rem;
4 | width: 100%;
5 | font-size: 1.8rem;
6 | border: 0.1rem solid rgb(86, 165, 235, 0.25);
7 | background-color: white;
8 | }
9 |
10 | .choice-container:hover {
11 | cursor: pointer;
12 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5);
13 | transform: translateY(-0.1rem);
14 | transition: transform 150ms;
15 | }
16 |
17 | .choice-prefix {
18 | padding: 1.5rem 2.5rem;
19 | background-color: #56a5eb;
20 | color: white;
21 | }
22 |
23 | .choice-text {
24 | padding: 1.5rem;
25 | width: 100%;
26 | }
27 |
28 | .correct {
29 | background-color: #28a745;
30 | }
31 |
32 | .incorrect {
33 | background-color: #dc3545;
34 | }
35 |
--------------------------------------------------------------------------------
/10. Fetch Questions from Local JSON File/highscores.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | High Scores
8 |
9 |
10 |
11 |
12 |
13 |
14 |
High Scores
15 |
16 |
Go Home
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/11. Fetch API Questions from Open Trivia API/highscores.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | High Scores
8 |
9 |
10 |
11 |
12 |
13 |
14 |
High Scores
15 |
16 |
Go Home
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/9. Load and Display High Scores from Local Storage/highscores.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | High Scores
8 |
9 |
10 |
11 |
12 |
13 |
14 |
High Scores
15 |
16 |
Go Home
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Quiz App Master/questions.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "question": "Inside which HTML element do we put the JavaScript??",
4 | "choice1": "
36 |