This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
176 lines (158 loc) · 4.25 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
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="icon-72x72.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="icon-114x114.png" />
<title>🚀 fastlane 🚀</title>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="./easing.js"></script>
<script type="text/javascript">
$(document).ready(function() {
document.ontouchstart = function(e){
e.preventDefault();
}
var user = "admin"
var password = null
var url = "https://refresher.fastlane.tools/"
if (password == null) {
url += "rockets"
}
function spawnRocket(x, toolName, time) {
var top = $("#sky").height() - 15
if (password != null) {
color = colors()[toolName]
} else {
color = allColors()[Math.round(Math.random() * allColors().length)]
}
style = "left: " + x + "px;" +
"top: " + top + "px;" +
"background-color: " + color
var el = $('<div/>', {
class: "rocket " + toolName,
style: style
}).appendTo('#sky');
el.animate({
top: -el.height(),
easing: 'easeOutCubic'
}, time, function() {
$(this).remove();
})
}
function colors() {
return {
fastlane: "white",
deliver: "#E83F1A",
snapshot: "#1B7FFB",
frameit: "#88C258",
pem: "#8F3DE5",
sigh: "#1FBCD2",
produce: "#FCD648",
cert: "#607D8B",
codes: "#795548",
pilot: "#4CA3EB",
gym: "#7A81FF",
scan: "#FF3500",
supply: "#D502BC",
watchbuild: "white",
match: "#FD972D",
screengrab: "#257E6D"
}
}
function allColors() {
return [
"white",
"#E83F1A",
"#1B7FFB",
"#88C258",
"#8F3DE5",
"#1FBCD2",
"#FCD648",
"#607D8B",
"#795548",
"#4CA3EB",
"#7A81FF",
"#FF3500",
"#D502BC",
"#FD972D",
"#257E6D"
]
}
var usedColumns = []
var rocketWidth = 25
function leftForRocket(time) {
for (i = 0; i < 100; i++) {
value = Math.random() * $("#sky").width()
column = Math.round(value / rocketWidth)
if (usedColumns[column] != true) {
usedColumns[column] = true
setTimeout(freeUp, time / 2, column)
return column * rocketWidth
}
}
console.log("No space for spawning this rocket")
console.log(usedColumns)
return -100
}
function freeUp(column) {
usedColumns[column] = false
}
function timeForRocket() {
return 10000 + Math.random() * 40000
}
var intervalTime = 5000
var lastResults = {}
function loadFromServer() {
$.ajax({
type: "GET",
url: url,
dataType: 'json',
async: true,
beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", "Basic " + btoa(user + ":" + password)); },
success: function (results) {
if (lastResults != null) {
$.each(results, function(key, value) {
while (value > lastResults[key]) {
console.log("Spawning " + key)
time = timeForRocket()
left = leftForRocket(time)
setTimeout(spawnRocket, Math.random() * intervalTime, left, key, time)
lastResults[key]++
}
if (value < lastResults[key]) {
// it's a new, a new life
lastResults = null
}
});
}
lastResults = results
}
});
}
setInterval(loadFromServer, intervalTime)
loadFromServer()
})
</script>
<style type="text/css">
* {
margin: 0px;
padding: 0px;
overflow: hidden;
}
.rocket {
width: 10px;
height: 30px;
position: absolute;
}
#sky {
height: 100%;
background-color: black;
}
</style>
<div id="sky">
</div>
</body>
</html>