-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
188 lines (164 loc) · 3.91 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<html>
<head>
<script type="text/javascript"></script>
<audio autoplay>
<source src="space.mp3" type="audio/mpeg" />
</audio>
<script src="add_removeArtifacts.js"></script>
</head>
<style>
/*
Stylized background borrowed from Nazar The Vis Azhar, via https://codepen.io/NazarTheVis/pen/zqXMqP
*/
@import "susy";
@import "compass/reset";
.stars,
.twinkling,
.clouds {
position: absolute;
display: block;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
}
.stars {
z-index: 0;
background: #000 url("https://image.ibb.co/mjnygo/stars.png") repeat top
center;
}
.twinkling {
z-index: 1;
background: transparent url("https://image.ibb.co/ir1DE8/twinkling.png")
repeat top center;
animation: move-twink-back 250s linear infinite;
}
@keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
#title {
z-index: 1;
text-align: center;
opacity: 0.9;
color: #187dff;
font-size: 135px;
font-family: starnext;
}
html,
body {
margin: 0;
height: 100%;
overflow: hidden;
}
.container {
text-align: center;
margin: auto;
}
.container button {
background-color: rgba(0, 0, 225, 0.75);
}
.button {
padding-top: 20px;
width: 550px;
height: 40px;
transform: skew(-40deg);
padding-bottom: 60px;
margin-top: 40px;
cursor: pointer;
}
.container button p {
text-align: center;
transform: skew(40deg);
color: white;
font-family: arcade;
font-size: 35px;
margin: 0 0 0 0;
transition: color 0.3s;
}
.container button:hover {
background-color: #3695ff;
opacity: 0.8;
}
.container button p:hover {
color: black;
}
#options {
text-align: center;
}
@font-face {
font-family: "starnext";
src: url("starnext.ttf") format("truetype");
}
@font-face {
font-family: "arcade";
src: url("arcade.ttf") format("truetype");
}
</style>
<body>
<script src="loadGame.js"></script>
<div class="stars">
<div class="twinkling">
<h1 id="title">Space Hunt<br />Adventure</h1>
<div class="container" id="options">
<button
id="standard"
type="reset"
class="button"
onClick="setArtifacts(), loadMap()"
>
<p>new game</p>
</button>
<br />
<button
id="load"
type="reset"
class="button"
onClick="loadSaveState()"
>
<p>load game</p>
</button>
<br />
<button id="admin" type="reset" class="button" onClick="validate()">
<p>dev mode</p>
</button>
</div>
</div>
</div>
<script>
function loadMap() {
localStorage.setItem("userType", "user");
var defaulConfig = {
energy: "1000",
supplies: "100",
credits: "100",
xCoord: "0",
yCoord: "0",
dies: true,
wormholeFixed: true,
maxSize: "128"
};
localStorage.setItem("config", JSON.stringify(defaulConfig));
window.location.href = "SpaceHunt Core HTML.html";
}
function loadSettings() {
localStorage.setItem("userType", "administrator");
window.location.href = "Settings.html";
}
function validate() {
var pwd = prompt("Enter 'Password': ");
if (pwd == "Password") {
loadSettings();
} else {
alert("Incorrect password. Please try again or don't.");
}
}
</script>
</body>
</html>