From 0517b9e3176a218e15cdaa0d9a0a558206f44e1d Mon Sep 17 00:00:00 2001 From: Bye <bye@byecorps.com> Date: Tue, 31 Oct 2023 18:43:21 +0000 Subject: [PATCH] php !! --- .gitignore | 2 + 404.html | 2 + bcid_prototyping/index.html | 9 +-- footer.php | 3 + bcid_prototyping/header.html => header.php | 0 index.php | 58 +++++++++++++++++++ landing.html | 11 ++++ signin.php | 0 .../styles => styles}/colours.css | 6 +- .../styles => styles}/design.css | 12 +++- .../styles => styles}/global.css | 2 +- .../styles => styles}/layout.css | 0 {bcid_prototyping/styles => styles}/types.css | 6 +- 13 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 404.html create mode 100644 footer.php rename bcid_prototyping/header.html => header.php (100%) create mode 100644 index.php create mode 100644 landing.html create mode 100644 signin.php rename {bcid_prototyping/styles => styles}/colours.css (89%) rename {bcid_prototyping/styles => styles}/design.css (78%) rename {bcid_prototyping/styles => styles}/global.css (100%) rename {bcid_prototyping/styles => styles}/layout.css (100%) rename {bcid_prototyping/styles => styles}/types.css (91%) diff --git a/.gitignore b/.gitignore index 64637c5..afa9876 100644 --- a/.gitignore +++ b/.gitignore @@ -129,3 +129,5 @@ dmypy.json .pyre/ font-awesome/ + +config.php diff --git a/404.html b/404.html new file mode 100644 index 0000000..e2066aa --- /dev/null +++ b/404.html @@ -0,0 +1,2 @@ +<h1>404</h1> +<p>Sorry, that page couldn't be found.</p> \ No newline at end of file diff --git a/bcid_prototyping/index.html b/bcid_prototyping/index.html index 0baf76d..b99e68a 100644 --- a/bcid_prototyping/index.html +++ b/bcid_prototyping/index.html @@ -10,26 +10,27 @@ <link rel="stylesheet" href="./fontawesome/css/all.css"> </head> <body> - <header> + <!-- <header> <div class="start"> <a href="/" id="sitetitle"><span class="bc-1">Bye</span><span class="bc-2">Corps</span><span class="bc-3"> ID</span></a></div> <div class="end"> - <!-- <div class="accountnav"> + < !-- <div class="accountnav"> <a href="/account" class="account">Hey there, Bye! <i class="fa-solid fa-fw fa-angle-down"></i></a> - </div> --> + </div> -- > <div class="accountnav"> <a href="/login" class="account"><i class="fa-solid fa-key"></i> Sign in</a> <a href="/register" class="account"><i class="fa-solid fa-arrow-right-to-bracket"></i> Create an account</a> </div> </div> - </header> + </header> --> <main> <div class="hero"> <div class="hero-text"> <h1><span class="bc-1">Bye</span><span class="bc-2">Corps</span><span class="bc-3"> ID</span></h1> <p>Log into ByeCorps and beyond with a single ID.</p> + <!-- <p><input type="email" name="loginEmail" id="loginEmail" placeholder="Email" /></p> --> <a href="/login" class="button">Sign in</a> <a href="/register" class="button">Create an account</a> </div> diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..5ea6a24 --- /dev/null +++ b/footer.php @@ -0,0 +1,3 @@ +<footer> + © ByeCorps <?php echo(date("Y")); ?> +</footer> \ No newline at end of file diff --git a/bcid_prototyping/header.html b/header.php similarity index 100% rename from bcid_prototyping/header.html rename to header.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..c4ee53f --- /dev/null +++ b/index.php @@ -0,0 +1,58 @@ +<?php + +session_start(); + +$host_string = $_SERVER['HTTP_HOST']; +$host = explode('.', $host_string); +$uri_string = $_SERVER['REQUEST_URI']; +$query_string = explode('?', $uri_string); +$uri = array_values(array_filter(explode('/', $uri_string))); + +if(isset($query_string[1])) { + $uri_string = $query_string[0]; + $query_string = explode('&', $query_string[1]); + $query = array(); + foreach($query_string as $string) { + $bits = explode('=', $string); + $query[$bits[0]] = $bits[1]; + } +} +else { + $query = array(); +} + + +?> + +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>ByeCorps ID</title> + + <link rel="stylesheet" href="/styles/global.css"> + <link rel="stylesheet" href="/fontawesome/css/all.css"> +</head> +<body> + <?php include("header.php"); ?> + <main> + <?php + // routing + if (!$uri) { + // empty array means index + include("landing.html"); + } + else if ($query_string[0] == "/signin") { + include("signin.php"); + } + else { + http_response_code(404); + include("404.html"); + } + ?> + </main> + <?php include("footer.php"); ?> +</body> +</html> \ No newline at end of file diff --git a/landing.html b/landing.html new file mode 100644 index 0000000..d6f90fa --- /dev/null +++ b/landing.html @@ -0,0 +1,11 @@ +<main> + <div class="hero"> + <div class="hero-text"> + <h1><span class="bc-1">Bye</span><span class="bc-2">Corps</span><span class="bc-3"> ID</span></h1> + <p>Log into ByeCorps and beyond with a single ID.</p> + <!-- <p><input type="email" name="loginEmail" id="loginEmail" placeholder="Email" /></p> --> + <a href="/signin" class="button primary">Sign in</a> + <a href="/register" class="button">Create an account</a> + </div> + </div> +</main> \ No newline at end of file diff --git a/signin.php b/signin.php new file mode 100644 index 0000000..e69de29 diff --git a/bcid_prototyping/styles/colours.css b/styles/colours.css similarity index 89% rename from bcid_prototyping/styles/colours.css rename to styles/colours.css index 1ec43db..2d91167 100644 --- a/bcid_prototyping/styles/colours.css +++ b/styles/colours.css @@ -12,9 +12,11 @@ --fern-green: #65743a; --flax: #efdd8d; --mindaro: #f4fdaf; + + color-scheme: light dark; } -button, .button { +button.primary, .button.primary { color: var(--black-bean); background-color: var(--flax); } @@ -29,7 +31,7 @@ header a { } @media screen and (prefers-color-scheme: dark) { - button, .button { + button.primary, .button.primary { color: var(--flax); background-color: var(--dark-slate-gray); } diff --git a/bcid_prototyping/styles/design.css b/styles/design.css similarity index 78% rename from bcid_prototyping/styles/design.css rename to styles/design.css index 326ccc9..7de58d3 100644 --- a/bcid_prototyping/styles/design.css +++ b/styles/design.css @@ -17,4 +17,14 @@ button, .button { header a { text-decoration: none; -} \ No newline at end of file +} + +/* inputs */ + +input { + all: unset; + padding: 1em; + text-align: start; + + border-radius: 1em; +} diff --git a/bcid_prototyping/styles/global.css b/styles/global.css similarity index 100% rename from bcid_prototyping/styles/global.css rename to styles/global.css index 2dc7eca..59f2674 100644 --- a/bcid_prototyping/styles/global.css +++ b/styles/global.css @@ -1,7 +1,7 @@ -@import url(./colours.css); @import url(./types.css); @import url(./design.css); @import url(./layout.css); +@import url(./colours.css); :root { color-scheme: light dark; diff --git a/bcid_prototyping/styles/layout.css b/styles/layout.css similarity index 100% rename from bcid_prototyping/styles/layout.css rename to styles/layout.css diff --git a/bcid_prototyping/styles/types.css b/styles/types.css similarity index 91% rename from bcid_prototyping/styles/types.css rename to styles/types.css index e267029..6fce88f 100644 --- a/bcid_prototyping/styles/types.css +++ b/styles/types.css @@ -20,4 +20,8 @@ html { .bc-3 { font-weight: 400; -} \ No newline at end of file +} + +.center { + text-align: center; +} -- GitLab