-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript.js
55 lines (47 loc) · 1.25 KB
/
script.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function splash(n){
setTimeout(function(){
$(".splashScreen").fadeOut(300, function() {
location.replace("menu.html");
});
}, n);
}
function testForTut(){
//alert("tst");
if(localStorage.getItem("havePlayed")===null || localStorage.getItem("havePlayed")===false){
localStorage.setItem("havePlayed",1);
window.location = "tutorial.html";
}
}
function getMoney(){
if(localStorage.getItem("money") === null){
localStorage.setItem("money",0);
}
document.getElementById("moneyContent").innerHTML = localStorage.getItem("money");
}
function setBg(){
var bg = "";
var color = "";
var bgColorDark = "#242424";
var bgColorLight = "#E8E8E8";
var colorDark = "#E8E8E8";
var colorLight = "#242424";
var bgColor = "";
var color = "";
if(localStorage.getItem("bg") === null){
localStorage.setItem("bg",0);
}
if(localStorage.getItem("bg") == 0){
bg=bgColorLight;
color=colorLight;
}else{
bg=bgColorDark;
color=colorDark;
}
$("body").css('background-color', bg);
$("body").css('color', color);
console.log("bgSet");
}
window.onload = function() {
setBg();
/*loadAchievements();*/
}