-
Notifications
You must be signed in to change notification settings - Fork 0
/
result.js
40 lines (35 loc) · 1.1 KB
/
result.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
33
34
35
36
37
38
39
40
$(document).ready(function() {
if(localStorage["name"] != null){
$("#congrats").html("CONGRATULATIONS " + localStorage["name"] + "!!!");
}
else{
$("#congrats").html("CONGRATULATIONS!!!");
}
if(localStorage["level"] == "test"){
if((localStorage["score"] >= 0) && (localStorage["score"] < 5))
{
$("#display-level").html("YOUR LEVEL IS EASY");
}
else if((localStorage["score"] >= 5) && (localStorage["score"] < 10))
{
$("#display-level").html("YOUR LEVEL IS MEDIUM");
}
else if((localStorage["score"] >= 10))
{
$("#display-level").html("YOUR LEVEL IS HARD");
}
}
else if(localStorage["level"] == "easy")
{
$("#display-level").html("LEVEL: EASY");
}
else if(localStorage["level"] == "medium")
{
$("#display-level").html("LEVEL: MEDIUM");
}
else if(localStorage["level"] == "hard")
{
$("#display-level").html("LEVEL: HARD");
}
$("#display-score").html("Score: " + localStorage["score"]);
});