-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsettings.html
More file actions
54 lines (45 loc) · 2.11 KB
/
Copy pathsettings.html
File metadata and controls
54 lines (45 loc) · 2.11 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Mathu | Settings</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Fredoka+One" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- favicon -->
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="shortcut icon" href="/favicon/favicon.ico">
</head>
<body>
<h1>Settings</h1>
<div id="explanation-wrapper">
<div id="explanation">
<p>You will not be able to submit your score if you change any of these settings.</p>
</div>
</div>
<h2>Question Count</h2>
<input autofocus id="qCount" style="opacity:1;"><br><br><br>
<input type="checkbox" autofocus id="include-neg" style="opacity:1;">
<h2 style="display: inline;">Include Negative Numbers</h2><br><br><br>
<button class="button red" onclick="resetSettings();">Reset</button><br><br>
<button class="button" onclick="updateSettings(); history.back(-1)">Save</button>
<script>
window.onload = function(){
document.getElementById("qCount").value = localStorage.getItem("qCount");
document.getElementById("include-neg").checked = JSON.parse(localStorage.getItem("negSubtraction"));
}
function updateSettings(){
localStorage.setItem("qCount", document.getElementById("qCount").value);
localStorage.setItem("negSubtraction", document.getElementById("include-neg").checked);
}
function resetSettings(){
document.getElementById("qCount").value = 10;
document.getElementById("include-neg").checked = true;
localStorage.setItem("qCount", 10);
localStorage.setItem("include-neg", true)
}
</script>
</body>
</html>