-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
96 lines (81 loc) · 2.32 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
85
86
87
88
89
90
91
92
93
94
95
96
<html>
<head>
<title>Endy Lab QR Code Maker</title>
<script src="./qrcode.min.js"></script>
<script src="./qart-lib.js"></script>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<style type="text/css">
body {
font-family: monospace, sans-serif;
}
.container {
width: 400px;
border: 0px solid black;
border-radius: 5px;
padding: 10px;
}
h1, .text {
width: 380px;
padding: 0;
margin-top: 0;
margin-bottom: 0;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.text p {
display: inline;
}
#qart canvas {
display: none;
}
#qart img {
margin-left: auto;
margin-right: auto;
}
input {
height: 20px;
width: 100%;
border: 1px solid black;
margin-bottom: -1px;
background-color: white;
}
.logo-image {
display: none;
}
</style>
</head>
<body>
<div class="container">
<h1>Get Help</h1>
<div class="text"><p id="title">Endy Lab</p></div>
<div id="entry">
<input id="name" type="text" value="device name" onfocus="this.value = ''"><br>
<input id="url" type="text" value="url" onfocus="this.value = ''"><br>
<input type="button" value="go" onclick="makeQR();"></div>
<div id="qart"></div>
<div class="text"><p>Scan for instructions</p></div>
</div>
<img class="logo-image" src="./get-help.png">
<script>
var qrcode = new QRCode("qart");
qrcode.clear();
function makeQR() {
qrcode.makeCode(document.getElementById('url').value, {
text: document.getElementById('url').value,
width: 256,
height: 256,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
document.getElementById('title').innerHTML = document.getElementById('name').value;
document.getElementById('entry').style = "display: none;"
}
var url = new URL(window.location.href);
if (url.searchParams.has("name")) document.getElementById('name').value = url.searchParams.get("name");
if (url.searchParams.has("url")) document.getElementById('url').value = url.searchParams.get("url");
if (url.searchParams.has("name") && url.searchParams.has("url")) makeQR();
</script>
</body>
</html>