-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (54 loc) · 1.71 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>Login</title>
<script src="assets/js/api.js"></script>
<!-- Bootstrap CSS -->
<link
rel="stylesheet"
href="node_modules/bootstrap/dist/css/bootstrap.css"
/>
<!-- Custom styles for this template -->
<link href="assets/css/floating-labels.css" rel="stylesheet" />
<link href="assets/css/animations.css" rel="stylesheet" />
</head>
<body>
<form id="loginForm" class="form-signin" style="user-select: none;">
<div class="text-center mb-4">
<img
id="ksg-logo"
class="mb-4"
src="assets/images/ksg-logo-white-on-black.png"
alt=""
width="150"
height="150"
style="border-radius: 50%;"
/>
<h1 class="h3 mb-3 font-weight-normal">X-App</h1>
<p>Vennligst skann kortet ditt for å åpne Soci.</p>
<input name="cardNumber" type="hidden" id="cardNumberInput" required />
<p id="loginOutput" style="color: deeppink;"></p>
</div>
</form>
</body>
</html>
<script type="text/javascript">
// Takes card reader and appends it to the hidden card number input field.
document.onkeydown = function (event) {
if (event.key === "Enter") {
const loginForm = document.getElementById("loginForm");
obtainAuthenticationToken(loginForm);
loginForm.cardNumber.value = "";
setTimeout(() => {
document.getElementById("loginOutput").innerText = "";
}, 3000);
} else {
document.getElementById("cardNumberInput").value += event.key;
}
};
</script>