V1
This commit is contained in:
parent
fd0211efce
commit
356669fdfd
19
error.php
Normal file
19
error.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
|
||||||
|
<body>
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT'].'/snippets/header.php' ?>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="content flex-vertical">
|
||||||
|
<div class="section-one">
|
||||||
|
<h1>Error</h1>
|
||||||
|
<p>Please report the following to Steven</p>
|
||||||
|
<p>{{ .error }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT'].'/snippets/footer.php' ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
6
home.php
6
home.php
@ -1,10 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Luggage Tracker</title>
|
|
||||||
<link rel="stylesheet" href="/static/style.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>
|
||||||
|
|
||||||
|
23
info.php
Normal file
23
info.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
|
||||||
|
<body>
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="content flex-vertical">
|
||||||
|
<div class="section-one flex-vertical">
|
||||||
|
<h1>Owner Information</h1>
|
||||||
|
</div>
|
||||||
|
<div class="section-two flex-vertical align-left">
|
||||||
|
<p>Contact Name: {{ .contact_name }}</p>
|
||||||
|
<p>Phone Number: {{ .phone_number }}</p>
|
||||||
|
<p>Email Address: {{ .email_address }}</p>
|
||||||
|
<p>Address: {{ .address }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/footer.php" ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
6
snippets/head.php
Normal file
6
snippets/head.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<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>
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
<img class="header-icon" src="/static/icon.png" alt="icon"/>
|
||||||
<h1 class="title">Luggage Tracker</h1>
|
<h1 class="title">My Luggage Info</h1>
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
</header>
|
</header>
|
157
static/style.css
157
static/style.css
@ -8,14 +8,85 @@
|
|||||||
font-family: Verdana,sans-serif;
|
font-family: Verdana,sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
@media only screen and (min-width: 300px) {
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
height: 92vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: var(--mid-dark);
|
||||||
|
padding: 0 1rem;
|
||||||
|
height: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spacer {
|
||||||
|
flex: 0 0 72px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-icon {
|
||||||
|
display: block;
|
||||||
|
flex: 0 0 72px;
|
||||||
|
width: 20vw;
|
||||||
|
height: auto;
|
||||||
|
max-height: 85px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
background-color: var(--dark);
|
||||||
|
display: flex;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
height: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
width: 85vw;
|
||||||
|
max-width: 800px;
|
||||||
|
padding: 1.5rem;
|
||||||
|
background: white;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content input {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content button {
|
||||||
|
color: var(--dark);
|
||||||
|
background-color: var(--light);
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-color: var(--dark);
|
||||||
|
padding: 8px 12px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-left {
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-left: 5vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 700px) {
|
||||||
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -23,18 +94,58 @@ body {
|
|||||||
background-color: var(--mid-dark);
|
background-color: var(--mid-dark);
|
||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
.spacer {
|
||||||
flex: 0 0 64px;
|
flex: 0 0 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-icon {
|
.header-icon {
|
||||||
display: block;
|
display: block;
|
||||||
flex: 0 0 64px;
|
flex: 0 0 64px;
|
||||||
width: 15vw;
|
width: 15vw;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-height: 80px;
|
max-height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
background-color: var(--dark);
|
||||||
|
display: flex;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
width: 90vw;
|
||||||
|
max-width: 800px;
|
||||||
|
padding: 1.5rem;
|
||||||
|
background: white;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content input {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content button {
|
||||||
|
color: var(--dark);
|
||||||
|
background-color: var(--light);
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-color: var(--dark);
|
||||||
|
padding: 8px 12px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-left {
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-left: 5vw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
@ -43,13 +154,6 @@ body {
|
|||||||
color: var(--light);
|
color: var(--light);
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
|
||||||
background-color: var(--dark);
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
height: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-text {
|
.footer-text {
|
||||||
display: inherit;
|
display: inherit;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
@ -96,13 +200,7 @@ body {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content h1 {
|
||||||
display: flex;
|
|
||||||
width: 90vw;
|
|
||||||
max-width: 800px;
|
|
||||||
padding: 1.5rem;
|
|
||||||
background: white;
|
|
||||||
border-radius: 5px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,23 +212,6 @@ body {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content input {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content button {
|
|
||||||
color: var(--dark);
|
|
||||||
background-color: var(--light);
|
|
||||||
border-radius: 8px;
|
|
||||||
border: 2px solid;
|
|
||||||
border-color: var(--dark);
|
|
||||||
padding: 8px 12px;
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content button:hover {
|
.content button:hover {
|
||||||
color: var(--light);
|
color: var(--light);
|
||||||
background-color: var(--dark);
|
background-color: var(--dark);
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
let baseUrl = "http://localhost:8000"
|
|
||||||
|
|
||||||
document.getElementById("submitBtn").addEventListener('click', function(e) {
|
document.getElementById("submitBtn").addEventListener('click', function(e) {
|
||||||
let code = document.getElementById("code").value;
|
let code = document.getElementById("code").value;
|
||||||
console.log("Clicked: " + code);
|
console.log("Clicked: " + code);
|
||||||
|
|
||||||
const path = window.location.pathname;
|
const path = window.location.pathname;
|
||||||
const parts = path.split("/");
|
const parts = path.split("/");
|
||||||
//const user = parts.pop();
|
const user = parts.pop();
|
||||||
|
|
||||||
const user = "tracey"
|
fetch("/api/verify/" + user, {
|
||||||
fetch(baseUrl + "/api/verify/" + user, {
|
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -26,7 +23,7 @@ document.getElementById("submitBtn").addEventListener('click', function(e) {
|
|||||||
} else if (data.status === 200) {
|
} else if (data.status === 200) {
|
||||||
// Display found and redirect to baseUrl/u/user/info with auth token
|
// Display found and redirect to baseUrl/u/user/info with auth token
|
||||||
statusText.innerText = "User found, redirecting...";
|
statusText.innerText = "User found, redirecting...";
|
||||||
window.location.replace(baseUrl + "/u/" + user + "/info")
|
window.location.replace("/u/" + user + "/info?token=" + data.token);
|
||||||
} else {
|
} else {
|
||||||
// Error
|
// Error
|
||||||
statusText.innerText = "Error, please send this to Steven to be fixed. Error: " + data.error;
|
statusText.innerText = "Error, please send this to Steven to be fixed. Error: " + data.error;
|
||||||
|
18
unauthorized.php
Normal file
18
unauthorized.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
|
||||||
|
<body>
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/footer.php" ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,10 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Luggage Tracker</title>
|
|
||||||
<link rel="stylesheet" href="/static/style.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>
|
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user