-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.html
105 lines (105 loc) · 4.17 KB
/
Index.html
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PipeLAY</title>
<style>
body{
background-color: rgb(64, 64, 236);
}
.button {
border: none;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
transition-duration: 0.4s;
cursor: pointer;
}
.button1 {
color: rgb(69, 116, 15);
border: 2px black;
background-color: rgb(17, 73, 156);
}
.button1:hover {
color: rgb(0, 238, 255);
border: 2px black;
background-color: rgb(11, 158, 184);
}
.button2{
color: rgb(0, 10, 150);
font-size: 52px;
text-align: center;
text-decoration-style: solid;
text-indent: 50px;
}
.button2:hover{
color: rgb(11, 158, 184);
font-size: 52px;
text-align: center;
text-decoration-style: solid;
text-indent: 50px;
}
</style>
</head>
<body>
<div style="text-align: center;">
<h1><div class="button button2" id="Header"><h1>PipeLAY</h1></div></h1>
<div class="button button1" onclick="SetUp()"><h1>SetUp The Game</h1></div><br>
<div class="button button1" onclick="OpenMenu()"><h1>Open Game Menu</h1></div><br>
<div class="button button1" onclick="alert('Nothing has been done succesfully...')"><h1>Do NoThInG</h1></div><br>
</div>
<script>
let Header= document.getElementById("Header");
const Load ="\n\nLoading...";
const Normal = "PipeLAY";
const StrogeId = "PipeLAY.";
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function SetUp(){
if(Header.innerText != Load){
Header.innerText = Load;
sleep(200).then(()=> {
localStorage.setItem(StrogeId+"Ready",true);
localStorage.setItem(StrogeId+"Levels",JSON.stringify([
{Empty: false,BackgroundColor: "rgb(11,158,184)",
PipePlace:[[5,1,3,3,1,1,3,3,],
[3,1,1,1,1,1,1,3,],
[3,3,1,1,3,3,1,1,],
[3,3,3,3,3,3,3,5,],],
Answer:[[0, 2, 0, 0, 1, 2, 0, 0],
[0, 0, 2, 1, 3, 0, 2, 0],
[0, 0, 0, 3, 0, 0, 0, 2],
[0, 0, 0, 0, 0, 0, 0, 0],]},
{Empty: false,BackgroundColor: "rgb(11,158,184)",
PipePlace:[[5,0,1,1,0,0,0,1,],
[3,3,1,1,3,1,0,1,],
[3,3,3,3,1,1,3,3,],
[3,3,3,3,1,0,0,5,],],
Answer:[[0, 0, 2, 1, 0, 0, 0, 2],
[0, 0, 0, 3, 0, 1, 0, 3],
[0, 0, 0, 0, 1, 3, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],]}, {Empty: true},
{Empty: true}, {Empty: true}, {Empty: true},
{Empty: true}, {Empty: true}, {Empty: true},
{Empty: true}, {Empty: true}, {Empty: true},]));
localStorage.setItem(StrogeId+"ActiveLevel",-1);
alert("SetUp has been successfully made.");
window.location.reload(false); });
}
}
function OpenMenu(){
if(localStorage.getItem(StrogeId+"Ready") != "true")
alert("You should do a SetUp before playing the game.\n"+
"If you have already done it your save data is broken and lost.");
else if(Header.innerText == Normal)
location.href = "./GameMenu.html"
}
</script>
</body>
</html>