-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
302 lines (274 loc) · 15.2 KB
/
index.html
File metadata and controls
302 lines (274 loc) · 15.2 KB
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<!DOCTYPE html>
<html lang="en" manifest="manifest.appcache" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<title>InstaBail</title>
<meta name="viewport" content="width=device-width">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="InstaBail">
<meta name="description" content="An app to help you instantly bail on your mates">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@shutdownscanner">
<meta name="twitter:creator" content="@shutdownscanner">
<meta name="twitter:title" content="InstaBail">
<meta name="twitter:description" content="An app to help you instantly bail on your mates" />
<meta name="twitter:image" content="https://instabail.uk/instabail-twitter.png" />
<meta property="og:title" content="InstaBail" />
<meta property="og:type" content="website" />
<meta property="og:description" content="An app to help you instantly bail on your mates" />
<meta property="og:image" content="https://instabail.uk/android-icon-192x192.png" />
<meta property="og:url" content="https://instabail.uk" />
<link rel="apple-touch-icon" sizes="57x57" href="apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#ffd800">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="ms-icon-144x144.png">
<link rel="stylesheet" href="InstaBail.min.css" />
<link rel="stylesheet" href="jquery.mobile.icons.min.css" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-mobile/1.4.5/jquery.mobile.structure.min.css"
rel="stylesheet" />
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js', { scope: './' });
}
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mobile/1.4.5/jquery.mobile.min.js"></script>
</head>
<body>
<div data-role="page" id="home">
<div data-role="header" data-position="fixed">
<a data-icon="heart" href="#love" data-prefetch="true" data-transition="flip"
data-direction="reverse">Love</a>
<h1>InstaBail</h1>
<a data-icon="info" data-iconpos="right" href="#about" data-prefetch="true" data-transition="flip">Info</a>
</div>
<div data-role="content">
<div style="height: 100px; text-align: center;">
<img src="android-icon-192x192.png" alt="InstaBail" width="96" />
</div>
<textarea rows="4" name="textArea" id="textArea"
style="height: 100px !important;">Really sorry, can't make it today due to staying at home to protect the lives of others. See you soon! :)</textarea>
<p>
<a href="#" data-role="button" data-icon="refresh" data-iconpos="right" id="bailBtn">
Generate a new bail!
</a>
</p>
<p> </p>
<p>
<a href="mailto:?subject=Sorry!&body=Really%20sorry%2C%20can't%20make%20it%20today%20due%20to%20staying%20at%20home%20to%20protect%20the%20lives%20of%20others.%20See%20you%20soon!%20%3A)%20-%20https%3A%2F%2Finstabail.uk"
data-role="button" data-icon="mail" data-iconpos="right" id="emailBtn">Send as email</a>
</p>
<p>
<a href="sms:?body=Really%20sorry%2C%20can't%20make%20it%20today%20due%20to%20staying%20at%20home%20to%20protect%20the%20lives%20of%20others.%20See%20you%20soon!%20%3A)%20-%20https%3A%2F%2Finstabail.uk"
data-role="button" data-icon="comment" data-iconpos="right" id="smsBtn">Send as SMS</a>
</p>
<p>
<a href="whatsapp://send?text=Really%20sorry%2C%20can't%20make%20it%20today%20due%20to%20staying%20at%20home%20to%20protect%20the%20lives%20of%20others.%20See%20you%20soon!%20%3A)%20-%20https%3A%2F%2Finstabail.uk"
data-role="button" data-icon="phone" data-iconpos="right" id="waBtn">Send with WhatsApp</a>
</p>
<p>
<a href="https://twitter.com/intent/tweet?text=Really%20sorry%2C%20can't%20make%20it%20today%20due%20to%20staying%20at%20home%20to%20protect%20the%20lives%20of%20others.%20See%20you%20soon!%20%3A)%20-%20https%3A%2F%2Finstabail.uk&related=shutdownscanner"
data-role="button" data-icon="action" data-iconpos="right" id="twitBtn">Tweet on Twitter</a>
</p>
</div>
</div>
<div data-role="page" id="about">
<div data-role="header" data-position="fixed">
<h1>About InstaBail</h1>
<a data-icon="home" data-iconpos="right" href="#home" data-prefetch="true" data-transition="flip"
class="ui-btn-right" data-rel="back">Home</a>
</div>
<div data-role="content">
<p>
InstaBail is a fun offline mobile web app that generates random excuses (bails) and easily lets you
share them.
It uses real-time train delay information for more realistic bails.
</p>
<p>This project is treeware! If you found it entertaining then please plant a tree for me.</p>
<a href="https://offset.earth/unitsetsoftware" data-role="button" target="_blank">Buy me a tree! 🌳</a>
<a href="https://unop.uk" data-role="button" target="_blank">Read my blog</a>
<a href="https://unop.uk/book/" data-role="button" target="_blank">Buy my book</a>
<a href="https://unop.uk/hire-me/" data-role="button" target="_blank">Hire me</a>
<a href="https://twitter.com/shutdownscanner" data-role="button" target="_blank">Follow me on Twitter</a>
<p>InstaBail uses the TfL API and my Huxley project to proxy live railway departure data.</p>
<a href="https://github.com/jpsingleton/Huxley2" data-role="button" target="_blank">View Huxley on
GitHub</a>
<div style="text-align: center;">♥</div>
</div>
</div>
<div data-role="page" id="love">
<div data-role="header" data-position="fixed">
<a data-icon="home" href="#home" data-prefetch="true" data-transition="flip">Home</a>
<h1>InstaBail</h1>
</div>
<div data-role="content">
<div style="text-align: center;">
<p>
Love you too!
</p>
<p>
♥
</p>
<p>
You should add this app to your home screen!
Simply press the share/menu button in the browser toolbar then press "Add to Home Screen".
If you launch the app from there it will run full screen.
It even works offline (but you won't get all the bails without internet).
</p>
<p>
Please help spread the word about InstaBail by sharing it with your friends!
</p>
</div>
<p>
<a href="mailto:?subject=I love InstaBail!&body=I love InstaBail! An app to help you instantly bail on your mates with comedy excuses. - https://instabail.uk"
data-role="button" data-icon="mail" data-iconpos="right">Share by email</a>
</p>
<p>
<a href="sms:?body=I love InstaBail! An app to help you instantly bail on your mates with comedy excuses. - https://instabail.uk"
data-role="button" data-icon="comment" data-iconpos="right">Share by SMS</a>
</p>
<p>
<a href="whatsapp://send?text=I love InstaBail! An app to help you instantly bail on your mates with comedy excuses. - https://instabail.uk"
data-role="button" data-icon="phone" data-iconpos="right">Share on WhatsApp</a>
</p>
<p>
<a href="https://twitter.com/intent/tweet?text=InstaBail! An app to help you instantly bail on your mates with comedy excuses.&url=https%3A%2F%2Finstabail.uk&hashtags=InstaBail&via=shutdownscanner&related=yoflowuk"
data-role="button" data-icon="action" data-iconpos="right">Share on Twitter</a>
</p>
<p>
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Finstabail.uk&t=InstaBail"
data-role="button" data-icon="action" data-iconpos="right">Share on Facebook</a>
</p>
</div>
</div>
<script type="text/javascript">
var bailCount = 0;
var bails = [
"staying at home to protect the lives of others",
"leaves on the line",
"being a lazy waste cadet",
"getting very drunk last night",
"wanting to stay in bed",
"the state of the economy",
"losing my phone and/or wallet",
"extenuating circumstances",
"getting a better offer",
"the wrong type of snow",
"taking a pregnant stranger to hospital",
"being attacked by a badger/fox",
"the ongoing conflict in the Middle East",
"NSA/GCHQ surveillance",
"ecumenical matters",
"operational concerns",
"the fact that WINTER IS COMING",
"watching cats on YouTube",
"cooking crystal",
"getting locked in a pub toilet",
"being burnt by the Fenchurch Street death ray",
"my cats breaking the webcam that I use to check up on them",
"making dim sum",
"my housemate being in the shower",
"Google maps saying the venue was in the wrong place",
"Ed Balls",
"a previous delay",
"jetlag from my trip to Portugal",
"#IndustrialAction"
];
$.mobile.ajaxEnabled = false;
$("#bailBtn").on("click", generateBail);
$("#textArea").on("input", setButtons);
function generateBail() {
var bail = "Really sorry, can't make it today due to " + bails[Math.floor(Math.random() * bails.length)] + ". See you soon! :)";
$("#textArea").val(bail);
setButtons();
bailCount++;
if (localStorage.getItem('no-gc') === 't') return;
if (window.goatcounter && window.goatcounter.count) {
window.goatcounter.count({
path: 'instabail-generated-' + bailCount,
event: true
});
}
}
function setButtons() {
var bail = $("#textArea").val();
var sendBail = encodeURIComponent(bail + " - https://instabail.uk");
$("#emailBtn").attr("href", "mailto:?subject=Sorry!&body=" + sendBail);
$("#smsBtn").attr("href", "sms:?body=" + sendBail);
$("#waBtn").attr("href", "whatsapp://send?text=" + sendBail);
$("#twitBtn").attr("href", "https://twitter.com/intent/tweet?text=" + sendBail + "&related=shutdownscanner");
}
$.get("https://api.tfl.gov.uk/line/mode/tube,overground,dlr,elizabeth-line,tram,national-rail,cable-car/status", function (lines) {
$.each(lines, function (lineIndex, line) {
$.each(line.lineStatuses, function (lineStatusIndex, lineStatus) {
if (lineStatus.statusSeverity !== 10) {
var lineName = line.name;
if (line.modeName === "tube") {
lineName = "the " + lineName + " line";
}
if (line.modeName === "dlr" || line.modeName === "tram") {
lineName = "the " + lineName;
}
var statusDesc = lineStatus.statusSeverityDescription.toLowerCase();
if (lineStatus.statusSeverity === 2) {
statusDesc += " service";
}
var bail = statusDesc + " on " + lineName;
if (bails.indexOf(bail) === -1) { // Only add if not present to avoid duplicates
bails.push(bail);
return false; // Break so only one bail from each line
}
}
});
});
});
function railBails(origin) {
$.get("https://huxley2.azurewebsites.net/delays/" + origin + "/to/London/50", function (resp) {
if (resp.delays) {
bails.push("train delays between " + resp.locationName + " and " + resp.filterLocationName);
}
});
}
railBails("Clapham Junction");
railBails("Tunbridge Wells");
railBails("Birmingham New Street");
railBails("Bath Spa");
$.get("https://instabail.uk/bails.json", function (resp) {
Array.prototype.push.apply(bails, resp);
});
if (localStorage.getItem('no-gc') !== 't') {
var t = setInterval(function () {
if (window.goatcounter && window.goatcounter.count) {
clearInterval(t);
window.goatcounter.count({
path: 'instabail-loaded',
event: true
});
}
}, 100);
}
</script>
<script>
if (window.location.hash === '#no-gc')
localStorage.setItem('no-gc', 't');
if (localStorage.getItem('no-gc') === 't')
window.goatcounter = { no_onload: true };
</script>
<script data-goatcounter="https://instabail.goatcounter.com/count" async src="https://gc.zgo.at/count.js"></script>
</body>
</html>