-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
84 lines (82 loc) · 4.24 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
<!doctype html>
<html lang="en" style="height: 100%;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="./img/launch.png">
<meta name="theme-color" content="#ffffff">
<link rel="manifest" href="./manifest.json">
<link rel="apple-touch-icon" href="./img/launch.png">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<title>Hinckley Parking</title>
</head>
<body style="margin:5px;font-family: 'Open Sans', sans-serif;height: 100%;">
<div class="container" style="height: 100%;">
<div class="row align-items-center" style="height: 100%;">
<div class="col-sm-6">
<canvas id="qr" style="width:100%"></canvas>
</div>
<div class="col-sm-6">
<h1 style="display:inline-block;vertical-align:top;text-align:center;">This voucher will expire <span id="durationRemaining"></span></h1>
<button style="width:150px;display:block;margin:30px 0px" onclick="location.reload();" class="mx-auto btn btn-primary"><i class="fas fa-sync-alt"></i> Refresh</button>
<button id="shareButton" style="width:150px;display:none" class="mx-auto btn btn-success" onclick="navigator.share({url:'https://atiernan.github.io/HinckleyParking',title: document.title,})"><i class="fas fa-share-alt"></i> Share</button>
</div>
</div>
</div>
<script src="./js/qrious.min.js"></script>
<script src="./js/moment.js"></script>
<script>
/* S001P1220181227175508A
* S001 Static
* P12 Printer number
* 2018 Expiry Year
* 12 Expiry Month
* 27 Expiry Date
* 17 Expiry Hour
* 55 Expiry Minute
* 08 Expiry Second
* A Static
*/
let expiryDate;
function updateExpiryString() {
durationRemaining.innerHTML = expiryDate.fromNow();
}
(function() {
expiryDate = moment().add(1, 'hour');
updateExpiryString();
var code = "S001P12" + expiryDate.format('YYYYMMDDhhmmss') + "A";
var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
var size = Math.max(w,h);
var qr = new QRious({
element: document.getElementById('qr'),
value: code,
size: size,
level: "L"
});
if (navigator.share) {
document.getElementById('shareButton').style.display = "block";
}
setInterval(function(){
if (expiryDate.isAfter()) {
updateExpiryString();
} else {
location.reload();
}
}, 1000);
})();
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-131508026-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-131508026-1');
</script>
</body>
<html>