-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
229 lines (228 loc) · 10.2 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#161616">
<meta name="apple-mobile-web-app-title" content="Dimini Inc.">
<meta name="application-name" content="Dimini Inc.">
<meta name="msapplication-TileColor" content="#161616">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
<meta name="viewport" content="initial-scale=1" id="viewport">
<meta name="mailru-domain" content="8D5ZHxJsjMRCp9En" />
<title>To the Center of the World - Dimini Inc.</title>
<meta name="description" content="To the Center of the World, Ludum Dare 48 - Dimini Inc.">
<link rel="canonical" href="http://dimini.tk/en/software/center-of-world/web">
<link rel="alternate" hreflang="en" href="http://dimini.tk/en/software/center-of-world/web" />
<link rel="alternate" hreflang="ru" href="http://dimini.tk/ru/software/center-of-world/web" />
<meta property="og:title" content="To the Center of the World - Dimini Inc." />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://dimini.tk/en/software/center-of-world/web" />
<meta property="og:image" content="https://dimini.tk/site-logo.png" />
<meta property="og:description" content="To the Center of the World, Ludum Dare 48 - Dimini Inc." />
<script>
window.onload = function () {
window.scrollTo(0, 0);
let losses=0;
let enemy_count = 300+Math.floor(Math.random()*700);
field = document.getElementById("field");
for (var j = enemy_count; j >= 0; j--) {
var enemy = document.createElement("img");
enemy.src="./enemy.png" ;
enemy.style.width="15px";
enemy.style.top=Math.floor(Math.random()*94000)+5000+"px";
enemy.style.left= Math.floor(Math.random()*window.innerWidth/2)+window.innerWidth/4+"px";
enemy.style.position="absolute";
enemy.id="enemy"+j.toString();
document.getElementById("gamefield").appendChild(enemy);
}
let i=0;
let hMove = [];
let vMove=[];
let tick=[]
setInterval(function(){
for (var j = enemy_count; j >= 0; j--) {
if (Math.floor(Math.random()*10)>=tick[j] || tick[j]==undefined){
hMove[j]=Math.floor(Math.random()*20)-10;
vMove[j]=Math.floor(Math.random()*20)-10;
tick[j]=Math.floor(Math.random()*10);
}
}
}, 100)
setInterval(function(){
for (var j = enemy_count; j >= 0; j--) {
enemy1=document.getElementById("enemy"+j.toString());
enemy1.style.left=parseInt(enemy1.style.left, 10)+hMove[j]+"px";
enemy1.style.top=parseInt(enemy1.style.top, 10)+vMove[j]+"px";
player = document.getElementById("player");
enemy1=document.getElementById("enemy"+j.toString());
rectPlayer=player.getBoundingClientRect();
rectEnemy1 = enemy1.getBoundingClientRect();
rect1=rectPlayer;rect2=rectEnemy1;
var overlap = !(rect1.right < rect2.left ||
rect1.left > rect2.right ||
rect1.bottom < rect2.top ||
rect1.top > rect2.bottom)
if (overlap===true){
counter=0;
losses++;
if (losses==10){
alert("Try harder!")
}
if (losses==20){
alert("Is this a rocket science for you?")
}
if (losses==30){
alert("Are you searching for bugs or something?")
}
window.scrollTo(0, 0);
}
}
}, 200)
let counter=0;
window.addEventListener('scroll', function(e) {
counter++;
player = document.getElementById("player");
enemy1=document.getElementById("enemy1");
rectPlayer=player.getBoundingClientRect();
rectEnemy1 = enemy1.getBoundingClientRect();
rect1=rectPlayer;rect2=rectEnemy1;
var overlap = !(rect1.right < rect2.left ||
rect1.left > rect2.right ||
rect1.bottom < rect2.top ||
rect1.top > rect2.bottom)
if (overlap===true){
window.scrollTo(0, 0);
counter=0;
losses++;
if (losses==10){
alert("Try harder!")
}
if (losses==20){
alert("Is this a rocket science for you?")
}
if (losses==30){
alert("Are you searching for bugs or something?")
}
}
if ((window.innerHeight + window.pageYOffset) >= document.body.offsetHeight) {
if (counter<1000){
alert('You have rushed to the bottom using full throttle, but unfortunately nobody from the crew have survived this journey!');
window.scrollTo(0, 0);
counter=0
} else {
if (document.getElementById("cliffhanger").style.display=="none"){
alert('Congratulations! You have successfully reached the bottom, and landed your ship!');
document.getElementById("cliffhanger").style.display="block";
} else {
alert('At least that was what you have thought, but suddenly ground collapsed, and it seems like your problems have only begun.\n To be continued...')
}
}
}
});
function scrollDistance (callback, refresh = 100) {
if (!callback || typeof callback !== 'function') return;
let isScrolling, start, end, distance;
window.addEventListener('scroll', function (event) {
if (!start) {
start = window.pageYOffset;
}
window.clearTimeout(isScrolling);
isScrolling = setTimeout(function() {
end = window.pageYOffset;
distance = end - start;
callback(distance, start, end);
start = null;
end = null;
distance = null;
}, refresh);
}, false);
}
let bDist;
let tDist;
scrollDistance(function (distance) {
player = document.getElementById("player");
enemy1=document.getElementById("enemy1");
rectPlayer=player.getBoundingClientRect();
rectEnemy1 = enemy1.getBoundingClientRect();
rect1=rectPlayer;rect2=rectEnemy1;
if (distance>0){
bDist=distance;
tDist=0;
} else {
bDist=0;
tDist=-distance;
}
var overlap = !(rect1.right < rect2.left ||
rect1.left > rect2.right ||
rect1.bottom-bDist < rect2.top ||
rect1.top+tDist > rect2.bottom)
if (overlap===true){
window.scrollTo(0, 0);
counter=0;
losses++;
if (losses==10){
alert("Try harder!")
}
if (losses==20){
alert("Is this a rocket science for you?")
}
if (losses==30){
alert("Are you searching for bugs or something?")
}
}
});
};
</script>
</head>
<body style="margin:0; padding: 0; overflow-x: hidden">
<audio autoplay loop id="audio">
<source src="music.wav" type="audio/wav">
</audio>
<img src="audio.png" style=" top: 0px; left: 0px; position: fixed;" class="glyphicon glyphicon-play-circle b-play" id="play" onclick="play()"></button>
<script>
function play() {
var audio = document.getElementById('audio');
if (audio.paused) {
audio.play();
}else{
audio.pause();
}
}
</script>
<div id="site">
<div style="background: linear-gradient(#fff, #000); height: 100000px; overflow-x: hidden" id="gamefield">
<img src="./ship.png" width="25px" style=" top: 100px; left: 49%; position: fixed;" id="player">
<p style="top: 10px; left: 10px; position: absolute;">As a part of a space exploration expedition you have reached some planet, it looks empty on the surface, but it has some big hole, which looks like a big mine, in it. You have decided to investigate it and try to land inside this mine.</p>
<p style="top: 5000px; left: 10px; position: absolute;">Looks like there are some creatures on this planet after all, we'd better avoid them</p>
<p style="top: 25000px; left: 10px; position: absolute;">It's getting dark in here</p>
<p style="top: 55000px; left: 10px; position: absolute; color: white;">Are we there yet?</p>
<p style="top: 60000px; left: 10px; position: absolute; color: white;">Are we there yet?</p>
<p style="top: 65000px; left: 10px; position: absolute; color: white;">Are we there yet?</p>
<p style="top: 75000px; left: 10px; position: absolute; color: white;">What about now?</p>
<p style="top: 85000px; left: 10px; position: absolute; color: white;">It is too dark in here, you are not sure for how long you are trying to reach the bottom. Maybe it was not the best idea, and it is better to emerge?</p>
<p style="top: 95000px; left: 10px; position: absolute;">Dimini Inc., 2021</p>
<!-- <img src="./enemy.png" width="15px" style="top: 1000px; left: 10px; position: absolute;" id="enemy1"> -->
</div>
<div style="background: linear-gradient(#000, #f00); height: 100px; overflow-x: hidden; display: none" id="cliffhanger">
<img src="./ship.png" width="25px" style=" top: 100px; left: 49%; position: fixed;" id="player">
<!-- <img src="./enemy.png" width="15px" style="top: 1000px; left: 10px; position: absolute;" id="enemy1"> -->
</div>
</div>
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-TKDW72" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>!function(e,t,a,n,g){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var m=t.getElementsByTagName(a)[0],r=t.createElement(a);r.async=!0,r.src="//www.googletagmanager.com/gtm.js?id=GTM-TKDW72",m.parentNode.insertBefore(r,m)}(window,document,"script","dataLayer")</script>
</body>
</html>