diff --git a/.idea/LuggageTracker.iml b/.idea/LuggageTracker.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/LuggageTracker.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..775b866 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..57a5904 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..6e68533 Binary files /dev/null and b/favicon.ico differ diff --git a/home.php b/home.php new file mode 100644 index 0000000..5f5df60 --- /dev/null +++ b/home.php @@ -0,0 +1,22 @@ + + + + + Luggage Tracker + + + + + +
+
+

Registration

+

Contact Steven Tracey + via email + to get your QR code

+
+
+ + + + diff --git a/snippets/footer.php b/snippets/footer.php new file mode 100644 index 0000000..ea454ea --- /dev/null +++ b/snippets/footer.php @@ -0,0 +1,4 @@ + + diff --git a/snippets/header.php b/snippets/header.php new file mode 100644 index 0000000..1084632 --- /dev/null +++ b/snippets/header.php @@ -0,0 +1,7 @@ + + +
+ icon +

Luggage Tracker

+
+
\ No newline at end of file diff --git a/static/icon.png b/static/icon.png new file mode 100644 index 0000000..62bc996 Binary files /dev/null and b/static/icon.png differ diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..b45e01f --- /dev/null +++ b/static/style.css @@ -0,0 +1,166 @@ +:root { + --dark: #1f363dff; + --dark-click: #152429; + --mid-dark: #40798cff; + --mid: #70a9a1ff; + --mid-light: #9ec1a3ff; + --light: #cfe0c3ff; + font-family: Verdana,sans-serif; +} + +body { + margin: 0; + height: 100vh; + 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: 80px; +} + +.spacer { + flex: 0 0 64px; +} + +.header-icon { + display: block; + flex: 0 0 64px; + width: 15vw; + height: auto; + max-height: 80px; +} + +.title { + flex: 1; + text-align: center; + color: var(--light); +} + +.footer { + background-color: var(--dark); + display: flex; + flex: 0 0 auto; + height: 80px; +} + +.footer-text { + display: inherit; + align-content: center; + justify-content: center; + margin: auto; + background-color: inherit; + border: none; + outline: none; + text-align: center; + color: white; +} + +.footer-text a { + cursor: pointer; + text-decoration: none; + color: var(--mid-light); + padding-left: 5px; +} + +.footer-text a:hover { + color: var(--mid); +} + +.contact-link { + cursor: pointer; + color: var(--mid-dark); + text-decoration: none; +} + +.contact-link a:hover { + color: var(--mid); +} + +.container { + flex: 1 0 auto; + display: flex; + justify-content: center; + align-items: center; + padding: 0; + background-image: linear-gradient( + to bottom right, + var(--mid-light), + var(--mid-dark) + ); +} + +.content { + display: flex; + width: 90vw; + max-width: 800px; + padding: 1.5rem; + background: white; + border-radius: 5px; + text-align: center; +} + +.content h3 { + text-align: center; +} + +.content p { + 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 { + color: var(--light); + background-color: var(--dark); +} + +.content button:active { + background-color: var(--dark-click); +} + +.flex-vertical { + flex-direction: column; +} + +.flex-horizontal { + flex-direction: row; +} + +.hidden { + display: none; +} + +.section-one { + flex: 0 0 auto; +} + +.section-two { + display: flex; + flex: 1 0 auto; +} + +#status { + margin-bottom: 0; +} \ No newline at end of file diff --git a/static/verify.js b/static/verify.js new file mode 100644 index 0000000..55cd22f --- /dev/null +++ b/static/verify.js @@ -0,0 +1,35 @@ +let baseUrl = "http://localhost:8000" + +document.getElementById("submitBtn").addEventListener('click', function(e) { + let code = document.getElementById("code").value; + console.log("Clicked: " + code); + + const path = window.location.pathname; + const parts = path.split("/"); + //const user = parts.pop(); + + const user = "tracey" + fetch(baseUrl + "/api/verify/" + user, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + 'Authorization': "Basic " + code, + } + }).then(response => response.json()) + .then(data => { + let statusText = document.getElementById("status"); + console.log(data); + statusText.classList.remove("hidden"); + if (data.status === 404) { + // Not found + statusText.innerText = "User with that code not found"; + } else if (data.status === 200) { + // Display found and redirect to baseUrl/u/user/info with auth token + statusText.innerText = "User found, redirecting..."; + window.location.replace(baseUrl + "/u/" + user + "/info") + } else { + // Error + statusText.innerText = "Error, please send this to Steven to be fixed. Error: " + data.error; + } + }) +}) \ No newline at end of file diff --git a/verify.php b/verify.php new file mode 100644 index 0000000..f94017d --- /dev/null +++ b/verify.php @@ -0,0 +1,27 @@ + + + + + Luggage Tracker + + + + + +
+
+
+ + + +
+
+ +
+
+
+ + + + +