-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (61 loc) · 2.15 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
<!DOCTYPE html>
<html lang="en">
<title>Bin Calendar</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
@media (prefers-color-scheme: dark) {
:root {
background-color: #000000;
color: #FFFFFF;
}
a {
color: lightblue;
}
}
</style>
<head>
<script>
function getUrl() {
const form = document.getElementById('uprnForm');
let reminderMinutesParam = ""
if (form[1].value) {
let a = form[1].value.split(':')
let originalMinutes = (+a[0]) * 60 + (+a[1])
let reminderMinutes = 1440 - originalMinutes
reminderMinutesParam = "&reminderMinutes=" + reminderMinutes
}
document.getElementById("url-result").innerText = "https://bin-calendar.nova.do?uprn=" + form[0].value + reminderMinutesParam
}
</script>
</head>
<body>
<h1>Bin Calendar Subscription</h1>
<p>
Provides a subscription link for automatic bin calendar updates.
Specifically from Southampton Council.
</p>
<p>
You can use a tool such as <a href="https://uprn.uk">https://uprn.uk</a>
to find the UPRN you require.
</p>
<form onsubmit="event.preventDefault(); getUrl()" type="text/JavaScript" id="uprnForm">
<label for="uprn">UPRN</label>
<input type="number" id="uprn" name="uprn" required><br />
<label for="reminderTime">Include reminder at this time the day before (24 hour format)</label>
<input type="time" id="reminderTime" name="reminderTime" min="00:10" max="23:50"><br />
<input type="submit" value="Get URL">
</form>
<p>
Once your link is generated, it can be used to subscribe to the calendar in applications such as Apple's Calendar
app (e.g. Settings > Calendar > Accounts > Add Account > Other > Add Subscribed Calendar > Paste link here.)
</p>
<p id="url-result"></p>
<footer>
<p>
Created by <a href="https://www.charlesomer.co.uk">Charles</a>.<br />
<a href="https://github.com/charlesomer/bin-calendar">Source Code</a>
</p>
</footer>
</body>
</html>