-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
189 lines (183 loc) · 6.75 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
189
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="A free turn-based strategy game that runs in you browser. Expand your kingdom, build up your economy and crush your enemies!">
<meta name="keywords" content="konkr, konkr.io, game, strategy, turn-based, web game, online game, html5, fun, phaser">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="canonical" href="https://www.konkr.io/">
<link rel="icon" type="image/png" sizes="16x16" href="./icons/regular-16.png">
<link rel="apple-touch-icon" href="./icons/regular-192.png">
<link rel="manifest" href="./manifest.json">
<meta name="theme-color" content="#9bd6f2">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="application-name" content="Konkr">
<meta name="apple-mobile-web-app-title" content="Konkr">
<meta name="msapplication-TileColor" content="#9bd6f2">
<meta name="msapplication-starturl" content="./">
<link rel="shortcut icon" href="./icons/favicon-16x16.png" type="image/png">
<link rel="apple-touch-icon" href="./icons/icons-192x192.png">
<link rel="stylesheet" href="./css/main.css">
<title>Konkr.io</title>
<style>html,
body {
font-family: Georgia, Arial, Trebuchet;
margin: 0;
background-color: #9bd6f2;
overflow: hidden
}
h1 {
text-align: center;
position: fixed;
font-size: 2em;
font-weight: normal;
top: calc(50vh + 120px);
left: 0;
margin: 0 auto;
width: 100%;
color: #161632;
}
h2 {
text-align: center;
position: fixed;
font-size: 1em;
font-weight: normal;
font-style: italic;
top: calc(50% + 170px);
left: 0;
margin: 0 auto;
width: 100%;
color: #161632;
}
.center-screen {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
min-height: 100vh;
}
#phaser-game {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.hidden {
visibility: hidden
}
li {
text-align: left;
}
#status {
margin: 15px auto;
position: relative;
color: white;
font-size: 1em;
font-weight: bold;
font-style: italic;
}
/* news box */
#news-box {
position: absolute;
padding: 14px;
background-color: #aedcf2f2;
border-radius: 14px;
width: 400px;
left: calc(50% - 200px);
bottom: 40px;
transition: all 300ms ease-in-out;
}
/* hide news box if there's not enough screen estate for it */
@media only screen and (max-width: 890px) {
#news-box {
visibility: hidden;
}
}
/* Dat.gui styles */
.dg.main {
position: absolute;
left: 0px
}
/* Loader */
#loader {
width: 10px;
height: 10px;
border-radius: 50%;
display: block;
margin: 15px auto;
position: relative;
color: #FFF;
left: -100px;
box-sizing: border-box;
animation: shadowRolling 2s linear infinite;
}
@keyframes shadowRolling {
0% {
box-shadow: 0px 0 rgba(255, 255, 255, 0), 0px 0 rgba(255, 255, 255, 0), 0px 0 rgba(255, 255, 255, 0), 0px 0 rgba(255, 255, 255, 0);
}
12% {
box-shadow: 100px 0 white, 0px 0 rgba(255, 255, 255, 0), 0px 0 rgba(255, 255, 255, 0), 0px 0 rgba(255, 255, 255, 0);
}
25% {
box-shadow: 110px 0 white, 100px 0 white, 0px 0 rgba(255, 255, 255, 0), 0px 0 rgba(255, 255, 255, 0);
}
36% {
box-shadow: 120px 0 white, 110px 0 white, 100px 0 white, 0px 0 rgba(255, 255, 255, 0);
}
50% {
box-shadow: 130px 0 white, 120px 0 white, 110px 0 white, 100px 0 white;
}
62% {
box-shadow: 200px 0 rgba(255, 255, 255, 0), 130px 0 white, 120px 0 white, 110px 0 white;
}
75% {
box-shadow: 200px 0 rgba(255, 255, 255, 0), 200px 0 rgba(255, 255, 255, 0), 130px 0 white, 120px 0 white;
}
87% {
box-shadow: 200px 0 rgba(255, 255, 255, 0), 200px 0 rgba(255, 255, 255, 0), 200px 0 rgba(255, 255, 255, 0), 130px 0 white;
}
100% {
box-shadow: 200px 0 rgba(255, 255, 255, 0), 200px 0 rgba(255, 255, 255, 0), 200px 0 rgba(255, 255, 255, 0), 200px 0 rgba(255, 255, 255, 0);
}
}
</style>
<script defer="defer" src="vendors.js"></script><script defer="defer" src="main.js"></script>
</head>
<body class="center-screen">
<span id="loader"></span>
<article id="status">
<noscript>Please enable javascript to play this game.</noscript>
</article>
<div id="phaser-game" class="hidden" style="pointer-events: auto"></div>
<div id="news-box">{{ content }}</div>
<script>const BUILD_NUMBER = '2.1.29-build-2895342715'
// store current time for timing page load
window.tStart = performance.now()
const statusElement = document.getElementById('status')
const loaderElement = document.getElementById('loader')
window.setLoadingStatus = (status, isLoading) => {
statusElement.innerText = status
if (isLoading === false) {
loaderElement.remove()
}
}
// if news-box has no content, inject warning
const newsBox = document.getElementById('news-box')
if (newsBox?.innerText === '{{ ' + 'content }}') {
newsBox.innerHTML = `<p></p><b>⚠ Warning:</b> Playing unsupported game version</p><p><code>${BUILD_NUMBER}</code></p>
<p>Visit <a href='https://www.konkr.io'>www.konkr.io</a> to play the latest stable release.<br/>
Or don't, I'm not your boss, but proceed with caution.</p>`
}
setLoadingStatus('loading game...')
window.addEventListener('load', boot)
function boot(safeMode = false) {
setLoadingStatus('loading game...')
window.launchGame()
}
</script>
</body>
</html>