-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
84 lines (83 loc) · 2.74 KB
/
index.html
File metadata and controls
84 lines (83 loc) · 2.74 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#111827" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="mobile-web-app-title" content="Checkin" />
<link rel="manifest" href="manifest.json" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.0/cdn/themes/light.css"
/>
<script
type="module"
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.0/cdn/shoelace.js"
></script>
<style>
:root {
--max-width: 75ch;
--gap: 1rem;
--sl-font-sans: "Inter", system-ui, sans-serif;
}
body {
font-family: var(--sl-font-sans);
display: grid;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
margin: 0;
}
.spinner-page {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
padding: 1rem;
}
</style>
<script type="module" src="js/checkin-login.js"></script>
<script type="module" src="js/checkin-save.js"></script>
<script type="module" src="js/checkin-home.js"></script>
<title>Checkin</title>
</head>
<body>
<div id="page">
<div class="spinner-page">
<sl-spinner style="--size: 50vw"></sl-spinner>
</div>
</div>
<script type="module">
const client_id = "https://checkin.swf.pub/client.jsonld";
const redirect_uri = "https://checkin.swf.pub/";
document.addEventListener("DOMContentLoaded", () => {
const params = new URLSearchParams(window.location.search);
document.getElementById("page").innerHTML = params.get("state")
? `<checkin-save
client-id=${client_id}
redirect-uri=${redirect_uri}
success-uri=${redirect_uri}
/>`
: !localStorage.getItem("access_token")
? `<checkin-login
client-id=${client_id}
redirect-uri=${redirect_uri} />`
: `<checkin-home
client-id=${client_id}
redirect-uri=${redirect_uri} />`;
});
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker
.register("/js/service-worker.js")
.catch((err) => console.error("SW registration failed:", err));
});
}
</script>
</body>
</html>