├── 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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    18 | 19 | 20 | -------------------------------------------------------------------------------- /6. Create a Progress Bar/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz 8 | 9 | 10 | 11 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    18 | 19 | 20 | -------------------------------------------------------------------------------- /12. Create a Spinning Loader/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz 8 | 9 | 10 | 11 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 |
    12 |
    13 |

    Quick Quiz

    14 | Play 15 | High Scores 16 |
    17 |
    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 | 37 | 38 | -------------------------------------------------------------------------------- /12. Create a Spinning Loader/end.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Congrats! 8 | 9 | 10 | 11 |
    12 |
    13 |

    14 |
    15 | 21 | 30 |
    31 | Play Again 32 | Go Home 33 |
    34 |
    35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /7. Create and Style the End Page/end.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Congrats! 8 | 9 | 10 | 11 |
    12 |
    13 |

    14 |
    15 | 21 | 30 |
    31 | Play Again 32 | Go Home 33 |
    34 |
    35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /10. Fetch Questions from Local JSON File/end.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Congrats! 8 | 9 | 10 | 11 |
    12 |
    13 |

    14 |
    15 | 21 | 30 |
    31 | Play Again 32 | Go Home 33 |
    34 |
    35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /8. Save High Scores in Local Storage/end.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Congrats! 8 | 9 | 10 | 11 |
    12 |
    13 |

    14 |
    15 | 21 | 30 |
    31 | Play Again 32 | Go Home 33 |
    34 |
    35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /11. Fetch API Questions from Open Trivia API/end.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Congrats! 8 | 9 | 10 | 11 |
    12 |
    13 |

    14 |
    15 | 21 | 30 |
    31 | Play Again 32 | Go Home 33 |
    34 |
    35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /9. Load and Display High Scores from Local Storage/end.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Congrats! 8 | 9 | 10 | 11 |
    12 |
    13 |

    14 |
    15 | 21 | 30 |
    31 | Play Again 32 | Go Home 33 |
    34 |
    35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /6. Create a Progress Bar/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 | 36 | /* HUD */ 37 | 38 | #hud { 39 | display: flex; 40 | justify-content: space-between; 41 | } 42 | 43 | .hud-prefix { 44 | text-align: center; 45 | font-size: 2rem; 46 | } 47 | 48 | .hud-main-text { 49 | text-align: center; 50 | } 51 | 52 | #progressBar { 53 | width: 20rem; 54 | height: 4rem; 55 | border: 0.3rem solid #56a5eb; 56 | margin-top: 1.5rem; 57 | } 58 | 59 | #progressBarFull { 60 | height: 3.4rem; 61 | background-color: #56a5eb; 62 | width: 0%; 63 | } 64 | -------------------------------------------------------------------------------- /7. Create and Style the End 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 | width: 100%; 26 | } 27 | 28 | .correct { 29 | background-color: #28a745; 30 | } 31 | 32 | .incorrect { 33 | background-color: #dc3545; 34 | } 35 | 36 | /* HUD */ 37 | 38 | #hud { 39 | display: flex; 40 | justify-content: space-between; 41 | } 42 | 43 | .hud-prefix { 44 | text-align: center; 45 | font-size: 2rem; 46 | } 47 | 48 | .hud-main-text { 49 | text-align: center; 50 | } 51 | 52 | #progressBar { 53 | width: 20rem; 54 | height: 4rem; 55 | border: 0.3rem solid #56a5eb; 56 | margin-top: 1.5rem; 57 | } 58 | 59 | #progressBarFull { 60 | height: 3.4rem; 61 | background-color: #56a5eb; 62 | width: 0%; 63 | } 64 | -------------------------------------------------------------------------------- /8. Save High Scores in Local Storage/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 | 36 | /* HUD */ 37 | 38 | #hud { 39 | display: flex; 40 | justify-content: space-between; 41 | } 42 | 43 | .hud-prefix { 44 | text-align: center; 45 | font-size: 2rem; 46 | } 47 | 48 | .hud-main-text { 49 | text-align: center; 50 | } 51 | 52 | #progressBar { 53 | width: 20rem; 54 | height: 4rem; 55 | border: 0.3rem solid #56a5eb; 56 | margin-top: 1.5rem; 57 | } 58 | 59 | #progressBarFull { 60 | height: 3.4rem; 61 | background-color: #56a5eb; 62 | width: 0%; 63 | } 64 | -------------------------------------------------------------------------------- /10. Fetch Questions from Local JSON File/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 | 36 | /* HUD */ 37 | 38 | #hud { 39 | display: flex; 40 | justify-content: space-between; 41 | } 42 | 43 | .hud-prefix { 44 | text-align: center; 45 | font-size: 2rem; 46 | } 47 | 48 | .hud-main-text { 49 | text-align: center; 50 | } 51 | 52 | #progressBar { 53 | width: 20rem; 54 | height: 4rem; 55 | border: 0.3rem solid #56a5eb; 56 | margin-top: 1.5rem; 57 | } 58 | 59 | #progressBarFull { 60 | height: 3.4rem; 61 | background-color: #56a5eb; 62 | width: 0%; 63 | } 64 | -------------------------------------------------------------------------------- /11. Fetch API Questions from Open Trivia API/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 | 36 | /* HUD */ 37 | 38 | #hud { 39 | display: flex; 40 | justify-content: space-between; 41 | } 42 | 43 | .hud-prefix { 44 | text-align: center; 45 | font-size: 2rem; 46 | } 47 | 48 | .hud-main-text { 49 | text-align: center; 50 | } 51 | 52 | #progressBar { 53 | width: 20rem; 54 | height: 4rem; 55 | border: 0.3rem solid #56a5eb; 56 | margin-top: 1.5rem; 57 | } 58 | 59 | #progressBarFull { 60 | height: 3.4rem; 61 | background-color: #56a5eb; 62 | width: 0%; 63 | } 64 | -------------------------------------------------------------------------------- /9. Load and Display High Scores from Local Storage/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 | 36 | /* HUD */ 37 | 38 | #hud { 39 | display: flex; 40 | justify-content: space-between; 41 | } 42 | 43 | .hud-prefix { 44 | text-align: center; 45 | font-size: 2rem; 46 | } 47 | 48 | .hud-main-text { 49 | text-align: center; 50 | } 51 | 52 | #progressBar { 53 | width: 20rem; 54 | height: 4rem; 55 | border: 0.3rem solid #56a5eb; 56 | margin-top: 1.5rem; 57 | } 58 | 59 | #progressBarFull { 60 | height: 3.4rem; 61 | background-color: #56a5eb; 62 | width: 0%; 63 | } 64 | -------------------------------------------------------------------------------- /2. Create and Style the Game Page/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |

    What is the answer to this questions?

    15 |
    16 |

    A

    17 |

    Choice 1

    18 |
    19 |
    20 |

    B

    21 |

    Choice 2

    22 |
    23 |
    24 |

    C

    25 |

    Choice 3

    26 |
    27 |
    28 |

    D

    29 |

    Choice 4

    30 |
    31 |
    32 |
    33 | 34 | 35 | -------------------------------------------------------------------------------- /3. Display Hard Coded Question and Answers/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |

    What is the answer to this questions?

    15 |
    16 |

    A

    17 |

    Choice 1

    18 |
    19 |
    20 |

    B

    21 |

    Choice 2

    22 |
    23 |
    24 |

    C

    25 |

    Choice 3

    26 |
    27 |
    28 |

    D

    29 |

    Choice 4

    30 |
    31 |
    32 |
    33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /4. Display Feedback for Correct and Incorrect Answers/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |

    What is the answer to this questions?

    15 |
    16 |

    A

    17 |

    Choice 1

    18 |
    19 |
    20 |

    B

    21 |

    Choice 2

    22 |
    23 |
    24 |

    C

    25 |

    Choice 3

    26 |
    27 |
    28 |

    D

    29 |

    Choice 4

    30 |
    31 |
    32 |
    33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Quiz App Master/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 | 36 | /* HUD */ 37 | 38 | #hud { 39 | display: flex; 40 | justify-content: space-between; 41 | } 42 | 43 | .hud-prefix { 44 | text-align: center; 45 | font-size: 2rem; 46 | } 47 | 48 | .hud-main-text { 49 | text-align: center; 50 | } 51 | 52 | #progressBar { 53 | width: 20rem; 54 | height: 4rem; 55 | border: 0.3rem solid #56a5eb; 56 | margin-top: 1.5rem; 57 | } 58 | 59 | #progressBarFull { 60 | height: 3.4rem; 61 | background-color: #56a5eb; 62 | width: 0%; 63 | } 64 | 65 | /* LOADER */ 66 | #loader { 67 | border: 1.6rem solid white; 68 | border-radius: 50%; 69 | border-top: 1.6rem solid #56a5eb; 70 | width: 12rem; 71 | height: 12rem; 72 | animation: spin 2s linear infinite; 73 | } 74 | 75 | @keyframes spin { 76 | 0% { 77 | transform: rotate(0deg); 78 | } 79 | 100% { 80 | transform: rotate(360deg); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /12. Create a Spinning Loader/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 | 36 | /* HUD */ 37 | 38 | #hud { 39 | display: flex; 40 | justify-content: space-between; 41 | } 42 | 43 | .hud-prefix { 44 | text-align: center; 45 | font-size: 2rem; 46 | } 47 | 48 | .hud-main-text { 49 | text-align: center; 50 | } 51 | 52 | #progressBar { 53 | width: 20rem; 54 | height: 4rem; 55 | border: 0.3rem solid #56a5eb; 56 | margin-top: 1.5rem; 57 | } 58 | 59 | #progressBarFull { 60 | height: 3.4rem; 61 | background-color: #56a5eb; 62 | width: 0%; 63 | } 64 | 65 | /* LOADER */ 66 | #loader { 67 | border: 1.6rem solid white; 68 | border-radius: 50%; 69 | border-top: 1.6rem solid #56a5eb; 70 | width: 12rem; 71 | height: 12rem; 72 | animation: spin 2s linear infinite; 73 | } 74 | 75 | @keyframes spin { 76 | 0% { 77 | transform: rotate(0deg); 78 | } 79 | 100% { 80 | transform: rotate(360deg); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /5. Create a Head's Up Display/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    15 |
    16 |

    17 | Question 18 |

    19 |

    20 |
    21 |
    22 |

    23 | Score 24 |

    25 |

    26 | 0 27 |

    28 |
    29 |
    30 |

    What is the answer to this questions?

    31 |
    32 |

    A

    33 |

    Choice 1

    34 |
    35 |
    36 |

    B

    37 |

    Choice 2

    38 |
    39 |
    40 |

    C

    41 |

    Choice 3

    42 |
    43 |
    44 |

    D

    45 |

    Choice 4

    46 |
    47 |
    48 |
    49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Quiz App Master/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 | 51 |
    52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /12. Create a Spinning Loader/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 | 51 |
    52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /6. Create a Progress Bar/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    15 |
    16 |

    17 | Question 18 |

    19 |
    20 |
    21 |
    22 |
    23 |
    24 |

    25 | Score 26 |

    27 |

    28 | 0 29 |

    30 |
    31 |
    32 |

    What is the answer to this questions?

    33 |
    34 |

    A

    35 |

    Choice 1

    36 |
    37 |
    38 |

    B

    39 |

    Choice 2

    40 |
    41 |
    42 |

    C

    43 |

    Choice 3

    44 |
    45 |
    46 |

    D

    47 |

    Choice 4

    48 |
    49 |
    50 |
    51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /7. Create and Style the End Page/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    15 |
    16 |

    17 | Question 18 |

    19 |
    20 |
    21 |
    22 |
    23 |
    24 |

    25 | Score 26 |

    27 |

    28 | 0 29 |

    30 |
    31 |
    32 |

    What is the answer to this questions?

    33 |
    34 |

    A

    35 |

    Choice 1

    36 |
    37 |
    38 |

    B

    39 |

    Choice 2

    40 |
    41 |
    42 |

    C

    43 |

    Choice 3

    44 |
    45 |
    46 |

    D

    47 |

    Choice 4

    48 |
    49 |
    50 |
    51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /10. Fetch Questions from Local JSON File/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    15 |
    16 |

    17 | Question 18 |

    19 |
    20 |
    21 |
    22 |
    23 |
    24 |

    25 | Score 26 |

    27 |

    28 | 0 29 |

    30 |
    31 |
    32 |

    What is the answer to this questions?

    33 |
    34 |

    A

    35 |

    Choice 1

    36 |
    37 |
    38 |

    B

    39 |

    Choice 2

    40 |
    41 |
    42 |

    C

    43 |

    Choice 3

    44 |
    45 |
    46 |

    D

    47 |

    Choice 4

    48 |
    49 |
    50 |
    51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /8. Save High Scores in Local Storage/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    15 |
    16 |

    17 | Question 18 |

    19 |
    20 |
    21 |
    22 |
    23 |
    24 |

    25 | Score 26 |

    27 |

    28 | 0 29 |

    30 |
    31 |
    32 |

    What is the answer to this questions?

    33 |
    34 |

    A

    35 |

    Choice 1

    36 |
    37 |
    38 |

    B

    39 |

    Choice 2

    40 |
    41 |
    42 |

    C

    43 |

    Choice 3

    44 |
    45 |
    46 |

    D

    47 |

    Choice 4

    48 |
    49 |
    50 |
    51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /11. Fetch API Questions from Open Trivia API/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    15 |
    16 |

    17 | Question 18 |

    19 |
    20 |
    21 |
    22 |
    23 |
    24 |

    25 | Score 26 |

    27 |

    28 | 0 29 |

    30 |
    31 |
    32 |

    What is the answer to this questions?

    33 |
    34 |

    A

    35 |

    Choice 1

    36 |
    37 |
    38 |

    B

    39 |

    Choice 2

    40 |
    41 |
    42 |

    C

    43 |

    Choice 3

    44 |
    45 |
    46 |

    D

    47 |

    Choice 4

    48 |
    49 |
    50 |
    51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /9. Load and Display High Scores from Local Storage/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Quick Quiz - Play 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    15 |
    16 |

    17 | Question 18 |

    19 |
    20 |
    21 |
    22 |
    23 |
    24 |

    25 | Score 26 |

    27 |

    28 | 0 29 |

    30 |
    31 |
    32 |

    What is the answer to this questions?

    33 |
    34 |

    A

    35 |

    Choice 1

    36 |
    37 |
    38 |

    B

    39 |

    Choice 2

    40 |
    41 |
    42 |

    C

    43 |

    Choice 3

    44 |
    45 |
    46 |

    D

    47 |

    Choice 4

    48 |
    49 |
    50 |
    51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /2. Create and Style the Game Page/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | } 54 | 55 | .container > * { 56 | width: 100%; 57 | } 58 | 59 | .flex-column { 60 | display: flex; 61 | flex-direction: column; 62 | } 63 | 64 | .flex-center { 65 | justify-content: center; 66 | align-items: center; 67 | } 68 | 69 | .justify-center { 70 | justify-content: center; 71 | } 72 | 73 | .text-center { 74 | text-align: center; 75 | } 76 | 77 | .hidden { 78 | display: none; 79 | } 80 | 81 | /* BUTTONS */ 82 | .btn { 83 | font-size: 1.8rem; 84 | padding: 1rem 0; 85 | width: 20rem; 86 | text-align: center; 87 | border: 0.1rem solid #56a5eb; 88 | margin-bottom: 1rem; 89 | text-decoration: none; 90 | color: #56a5eb; 91 | background-color: white; 92 | } 93 | 94 | .btn:hover { 95 | cursor: pointer; 96 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 97 | transform: translateY(-0.1rem); 98 | transition: transform 150ms; 99 | } 100 | 101 | .btn[disabled]:hover { 102 | cursor: not-allowed; 103 | box-shadow: none; 104 | transform: none; 105 | } 106 | -------------------------------------------------------------------------------- /1. Create Home Page and Application Styling/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | } 54 | 55 | .container > * { 56 | width: 100%; 57 | } 58 | 59 | .flex-column { 60 | display: flex; 61 | flex-direction: column; 62 | } 63 | 64 | .flex-center { 65 | justify-content: center; 66 | align-items: center; 67 | } 68 | 69 | .justify-center { 70 | justify-content: center; 71 | } 72 | 73 | .text-center { 74 | text-align: center; 75 | } 76 | 77 | .hidden { 78 | display: none; 79 | } 80 | 81 | /* BUTTONS */ 82 | .btn { 83 | font-size: 1.8rem; 84 | padding: 1rem 0; 85 | width: 20rem; 86 | text-align: center; 87 | border: 0.1rem solid #56a5eb; 88 | margin-bottom: 1rem; 89 | text-decoration: none; 90 | color: #56a5eb; 91 | background-color: white; 92 | } 93 | 94 | .btn:hover { 95 | cursor: pointer; 96 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 97 | transform: translateY(-0.1rem); 98 | transition: transform 150ms; 99 | } 100 | 101 | .btn[disabled]:hover { 102 | cursor: not-allowed; 103 | box-shadow: none; 104 | transform: none; 105 | } 106 | -------------------------------------------------------------------------------- /6. Create a Progress Bar/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | -------------------------------------------------------------------------------- /5. Create a Head's Up Display/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | -------------------------------------------------------------------------------- /3. Display Hard Coded Question and Answers/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | -------------------------------------------------------------------------------- /4. Display Feedback for Correct and Incorrect Answers/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | -------------------------------------------------------------------------------- /Quiz App Master/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | 108 | /* FORMS */ 109 | form { 110 | width: 100%; 111 | display: flex; 112 | flex-direction: column; 113 | align-items: center; 114 | } 115 | 116 | input { 117 | margin-bottom: 1rem; 118 | width: 20rem; 119 | padding: 1.5rem; 120 | font-size: 1.8rem; 121 | border: none; 122 | box-shadow: 0 0.1rem 1.4rem 0 rgba(86, 185, 235, 0.5); 123 | } 124 | 125 | input::placeholder { 126 | color: #aaa; 127 | } 128 | -------------------------------------------------------------------------------- /12. Create a Spinning Loader/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | 108 | /* FORMS */ 109 | form { 110 | width: 100%; 111 | display: flex; 112 | flex-direction: column; 113 | align-items: center; 114 | } 115 | 116 | input { 117 | margin-bottom: 1rem; 118 | width: 20rem; 119 | padding: 1.5rem; 120 | font-size: 1.8rem; 121 | border: none; 122 | box-shadow: 0 0.1rem 1.4rem 0 rgba(86, 185, 235, 0.5); 123 | } 124 | 125 | input::placeholder { 126 | color: #aaa; 127 | } 128 | -------------------------------------------------------------------------------- /7. Create and Style the End Page/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | 108 | /* FORMS */ 109 | form { 110 | width: 100%; 111 | display: flex; 112 | flex-direction: column; 113 | align-items: center; 114 | } 115 | 116 | input { 117 | margin-bottom: 1rem; 118 | width: 20rem; 119 | padding: 1.5rem; 120 | font-size: 1.8rem; 121 | border: none; 122 | box-shadow: 0 0.1rem 1.4rem 0 rgba(86, 185, 235, 0.5); 123 | } 124 | 125 | input::placeholder { 126 | color: #aaa; 127 | } 128 | -------------------------------------------------------------------------------- /10. Fetch Questions from Local JSON File/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | 108 | /* FORMS */ 109 | form { 110 | width: 100%; 111 | display: flex; 112 | flex-direction: column; 113 | align-items: center; 114 | } 115 | 116 | input { 117 | margin-bottom: 1rem; 118 | width: 20rem; 119 | padding: 1.5rem; 120 | font-size: 1.8rem; 121 | border: none; 122 | box-shadow: 0 0.1rem 1.4rem 0 rgba(86, 185, 235, 0.5); 123 | } 124 | 125 | input::placeholder { 126 | color: #aaa; 127 | } 128 | -------------------------------------------------------------------------------- /8. Save High Scores in Local Storage/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | 108 | /* FORMS */ 109 | form { 110 | width: 100%; 111 | display: flex; 112 | flex-direction: column; 113 | align-items: center; 114 | } 115 | 116 | input { 117 | margin-bottom: 1rem; 118 | width: 20rem; 119 | padding: 1.5rem; 120 | font-size: 1.8rem; 121 | border: none; 122 | box-shadow: 0 0.1rem 1.4rem 0 rgba(86, 185, 235, 0.5); 123 | } 124 | 125 | input::placeholder { 126 | color: #aaa; 127 | } 128 | -------------------------------------------------------------------------------- /11. Fetch API Questions from Open Trivia API/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | 108 | /* FORMS */ 109 | form { 110 | width: 100%; 111 | display: flex; 112 | flex-direction: column; 113 | align-items: center; 114 | } 115 | 116 | input { 117 | margin-bottom: 1rem; 118 | width: 20rem; 119 | padding: 1.5rem; 120 | font-size: 1.8rem; 121 | border: none; 122 | box-shadow: 0 0.1rem 1.4rem 0 rgba(86, 185, 235, 0.5); 123 | } 124 | 125 | input::placeholder { 126 | color: #aaa; 127 | } 128 | -------------------------------------------------------------------------------- /9. Load and Display High Scores from Local Storage/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | background-color: #ecf5ff; 3 | font-size: 62.5%; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | font-family: Arial, Helvetica, sans-serif; 9 | margin: 0; 10 | padding: 0; 11 | color: #333; 12 | } 13 | 14 | h1, 15 | h2, 16 | h3, 17 | h4 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | h1 { 22 | font-size: 5.4rem; 23 | color: #56a5eb; 24 | margin-bottom: 5rem; 25 | } 26 | 27 | h1 > span { 28 | font-size: 2.4rem; 29 | font-weight: 500; 30 | } 31 | 32 | h2 { 33 | font-size: 4.2rem; 34 | margin-bottom: 4rem; 35 | font-weight: 700; 36 | } 37 | 38 | h3 { 39 | font-size: 2.8rem; 40 | font-weight: 500; 41 | } 42 | 43 | /* UTILITIES */ 44 | 45 | .container { 46 | width: 100vw; 47 | height: 100vh; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | max-width: 80rem; 52 | margin: 0 auto; 53 | padding: 2rem; 54 | } 55 | 56 | .container > * { 57 | width: 100%; 58 | } 59 | 60 | .flex-column { 61 | display: flex; 62 | flex-direction: column; 63 | } 64 | 65 | .flex-center { 66 | justify-content: center; 67 | align-items: center; 68 | } 69 | 70 | .justify-center { 71 | justify-content: center; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .hidden { 79 | display: none; 80 | } 81 | 82 | /* BUTTONS */ 83 | .btn { 84 | font-size: 1.8rem; 85 | padding: 1rem 0; 86 | width: 20rem; 87 | text-align: center; 88 | border: 0.1rem solid #56a5eb; 89 | margin-bottom: 1rem; 90 | text-decoration: none; 91 | color: #56a5eb; 92 | background-color: white; 93 | } 94 | 95 | .btn:hover { 96 | cursor: pointer; 97 | box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5); 98 | transform: translateY(-0.1rem); 99 | transition: transform 150ms; 100 | } 101 | 102 | .btn[disabled]:hover { 103 | cursor: not-allowed; 104 | box-shadow: none; 105 | transform: none; 106 | } 107 | 108 | /* FORMS */ 109 | form { 110 | width: 100%; 111 | display: flex; 112 | flex-direction: column; 113 | align-items: center; 114 | } 115 | 116 | input { 117 | margin-bottom: 1rem; 118 | width: 20rem; 119 | padding: 1.5rem; 120 | font-size: 1.8rem; 121 | border: none; 122 | box-shadow: 0 0.1rem 1.4rem 0 rgba(86, 185, 235, 0.5); 123 | } 124 | 125 | input::placeholder { 126 | color: #aaa; 127 | } 128 | -------------------------------------------------------------------------------- /3. Display Hard Coded Question and Answers/game.js: -------------------------------------------------------------------------------- 1 | const question = document.getElementById('question'); 2 | const choices = Array.from(document.getElementsByClassName('choice-text')); 3 | 4 | let currentQuestion = {}; 5 | let acceptingAnswers = false; 6 | let score = 0; 7 | let questionCounter = 0; 8 | let availableQuesions = []; 9 | 10 | let questions = [ 11 | { 12 | question: 'Inside which HTML element do we put the JavaScript??', 13 | choice1: '