-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.js
32 lines (26 loc) · 1.16 KB
/
utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Global constants
const correctMsg = "Correct!";
const wrongMsg = "Wrong!";
const highScoresKey = "highScoresList";
const timePerQuestion = 10;
// Elements from index.html
const timeEl = document.getElementById("time");
const startScrnEl = document.getElementById("start-screen");
const questionsEl = document.getElementById("questions");
const questionTitleEl = document.getElementById("question-title");
const choicesEl = document.getElementById("choices");
const endScrnEl = document.getElementById("end-screen");
const finalScoreEl = document.getElementById("final-score");
const feedbackEl = document.getElementById("feedback");
// Inputs from index.html
const initialsInput = document.getElementById("initials");
// Sounds from index.html
const incorrectSound = new Audio("assets/sfx/incorrect.wav");
const correctSound = new Audio("assets/sfx/correct.wav");
// Buttons from index.html
const startBtn = document.getElementById("start");
const submitScoreBtn = document.getElementById("submit");
// Lists from highscores.html
const highScoresOl = document.getElementById("highscores");
// Buttons from highscores.html
const clearHighScoresBtn = document.getElementById("clear");