V2 ish
This commit is contained in:
69
html/genqr.html
Normal file
69
html/genqr.html
Normal file
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, internal-scale=1, viewport-fit=cover">
|
||||
<title>My Luggage Info</title>
|
||||
<link rel="stylesheet" href="/static/style.css?v=43">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="header">
|
||||
<a class="icon-link" href="/">
|
||||
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
||||
</a>
|
||||
<h1 class="title">My Luggage Info</h1>
|
||||
<div class="spacer"></div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="content flex-vertical">
|
||||
<div class="section-one">
|
||||
<h1>QR Code</h1>
|
||||
<a id="qr-link" href="">
|
||||
<div id="qr"></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="section-two">
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<p class="footer-text">Made hastily by <a class="footer-text" href="https://www.linkedin.com/in/steven-tracey18/">Steven Tracey</a></p>
|
||||
</footer>
|
||||
|
||||
<script src="/static/qrcode.min.js"></script>
|
||||
<script>
|
||||
const path = window.location.pathname;
|
||||
const parts = path.split("/");
|
||||
const user = parts.pop();
|
||||
let url = location.protocol + "//" + location.host + "/u/" + user;
|
||||
|
||||
const qrcode = new QRCode(document.getElementById('qr'), {
|
||||
text: url,
|
||||
width: 1024,
|
||||
height: 1024,
|
||||
colorDark : '#000',
|
||||
colorLight : '#fff',
|
||||
correctLevel : QRCode.CorrectLevel.L
|
||||
});
|
||||
|
||||
let qrLink = document.getElementById("qr-link");
|
||||
let qrImg = document.querySelector("#qr img");
|
||||
console.log(qrImg.src);
|
||||
qrLink.setAttribute("download", "qrcode-" + user + ".png");
|
||||
|
||||
const delay = ms => new Promise(res => setTimeout(res, ms));
|
||||
const setHref = async () => {
|
||||
while (!qrLink.href.startsWith("data:")) {
|
||||
await delay(100);
|
||||
qrLink.setAttribute("href", qrImg.src);
|
||||
console.log("Refreshing...");
|
||||
}
|
||||
document.getElementById("loading").remove();
|
||||
};
|
||||
setHref();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,7 +9,9 @@
|
||||
<body>
|
||||
|
||||
<header class="header">
|
||||
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
||||
<a class="icon-link" href="/">
|
||||
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
||||
</a>
|
||||
<h1 class="title">My Luggage Info</h1>
|
||||
<div class="spacer"></div>
|
||||
</header>
|
||||
|
||||
65
html/register.html
Normal file
65
html/register.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, internal-scale=1, viewport-fit=cover">
|
||||
<title>My Luggage Info</title>
|
||||
<link rel="stylesheet" href="/static/style.css?v=43">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="header">
|
||||
<a class="icon-link" href="/">
|
||||
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
||||
</a>
|
||||
<h1 class="title">My Luggage Info</h1>
|
||||
<div class="spacer"></div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="content flex-vertical">
|
||||
<div class="section-one">
|
||||
<h1>Registration</h1>
|
||||
</div>
|
||||
<div class="section-two">
|
||||
<form id="reg-form" accept-charset="UTF-8" action="/api/register" method="post">
|
||||
<div class="inputs">
|
||||
<div class="flex flex-vertical">
|
||||
<label class="label-left" for="name">Name</label>
|
||||
<input id="name" name="name" type="text" placeholder="John Doe">
|
||||
<label class="label-left" for="user-id">User ID</label>
|
||||
<input id="user-id" name="user-id" type="text" placeholder="jdoe">
|
||||
<label class="label-left" for="email">Email Address</label>
|
||||
<input id="email" name="email" type="text" placeholder="johndoe@example.com">
|
||||
<label class="label-left" for="phone-number">Phone Number</label>
|
||||
<input id="phone-number" name="phone-number" type="text" placeholder="+1(212)555-1234">
|
||||
<label class="label-left" for="registration_code">Registration Code</label>
|
||||
<input id="registration_code" name="registration_code" type="text" placeholder="xxxxxxxx">
|
||||
<p id="msg-box"></p>
|
||||
</div>
|
||||
<div class="flex flex-vertical">
|
||||
<label class="label-left" for="street1">Street Line 1</label>
|
||||
<input id="street1" name="street1" type="text" placeholder="123 Main Street">
|
||||
<label class="label-left" for="street2">Street Line 2</label>
|
||||
<input id="street2" name="street2" type="text" placeholder="(Optional)">
|
||||
<label class="label-left" for="city">City</label>
|
||||
<input id="city" name="city" type="text" placeholder="Anytown">
|
||||
<label class="label-left" for="state">State</label>
|
||||
<input id="state" name="state" type="text" placeholder="New York">
|
||||
<label class="label-left" for="postal-code">Postal Code</label>
|
||||
<input id="postal-code" name="postal-code" type="text" placeholder="12345">
|
||||
<label class="label-left" for="country">Country</label>
|
||||
<input id="country" name="country" type="text" placeholder="United States">
|
||||
</div>
|
||||
</div>
|
||||
<input class="btn" type="submit" value="Register">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<p class="footer-text">Made hastily by <a class="footer-text" href="https://www.linkedin.com/in/steven-tracey18/">Steven Tracey</a></p>
|
||||
</footer>
|
||||
<script src="/static/register.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,29 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, internal-scale=1, viewport-fit=cover">
|
||||
<title>My Luggage Info</title>
|
||||
<link rel="stylesheet" href="/static/style.css?v=43">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="header">
|
||||
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
||||
<h1 class="title">My Luggage Info</h1>
|
||||
<div class="spacer"></div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="content flex-vertical">
|
||||
<div class="section-one">
|
||||
<h1>Unauthorized</h1>
|
||||
<p>Maybe you had the wrong code?</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<p class="footer-text">Made hastily by <a class="footer-text" href="https://www.linkedin.com/in/steven-tracey18/">Steven Tracey</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,7 +9,9 @@
|
||||
<body>
|
||||
|
||||
<header class="header">
|
||||
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
||||
<a class="icon-link" href="/">
|
||||
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
||||
</a>
|
||||
<h1 class="title">My Luggage Info</h1>
|
||||
<div class="spacer"></div>
|
||||
</header>
|
||||
@@ -18,10 +20,10 @@
|
||||
<div class="section-one flex-horizontal">
|
||||
<label for="code">Secret Code (SC):</label>
|
||||
<input id="code" type="text">
|
||||
<button id="submitBtn">Submit</button>
|
||||
<button id="submitBtn" class="btn">Submit</button>
|
||||
</div>
|
||||
<div class="section-two flex-vertical">
|
||||
<p id="status" class="hidden">Text</p>
|
||||
<p id="status" class="hidden"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user