From 59f399c866d53a3528cc53aee8f9cbaae322ab37 Mon Sep 17 00:00:00 2001 From: bruno Date: Thu, 11 Jan 2024 09:27:03 +0100 Subject: [PATCH] update --- res/wrapper.png => assets/images/city.png | Bin assets/style.css | 146 ++++++++++++++++++++++ index.html | 11 -- index.php | 53 ++++++++ pages/global/login.php | 56 +++++++++ pages/home/domov.html | 5 + pages/home/info.html | 1 + templates/404.html | 6 + templates/account.html | 0 templates/login.html | 5 + templates/nav.html | 8 ++ templates/skeleton.html | 15 +++ 12 files changed, 295 insertions(+), 11 deletions(-) rename res/wrapper.png => assets/images/city.png (100%) create mode 100644 assets/style.css delete mode 100644 index.html create mode 100644 index.php create mode 100644 pages/global/login.php create mode 100644 pages/home/domov.html create mode 100644 pages/home/info.html create mode 100644 templates/404.html create mode 100644 templates/account.html create mode 100644 templates/login.html create mode 100644 templates/nav.html create mode 100644 templates/skeleton.html diff --git a/res/wrapper.png b/assets/images/city.png similarity index 100% rename from res/wrapper.png rename to assets/images/city.png diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 0000000..87a8382 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,146 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap'); + +:root { + --primary-bg: rgb(27, 21, 41); + --secondary-bg: #1a1a1a; + --primary-text: #d2d6e5; + --error: rgb(255, 55, 0); + --primary: #2a9dd6; + --primary-hover: #2489bb; +} + +body { + background: linear-gradient(127deg, var(--secondary-bg), var(--primary-bg)); + background-repeat: no-repeat; + background-attachment: fixed; + background-size: cover; + height: 100%; + width: 100%; + font-family: 'Poppins', sans-serif; + color: var(--primary-text); + margin: 0; + padding: 0; +} + +nav { + display: flex; + flex-direction: row; + justify-content: space-between; + padding: 1.2rem 1rem; + background-color: rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0px 20px 28px 0px rgba(0,0,0,0.2); + -moz-box-shadow: 0px 20px 28px 0px rgba(0,0,0,0.2); + box-shadow: 0px 20px 28px 0px rgba(0,0,0,0.2); +} + +nav #login { + color: var(--primary-text); + text-decoration: none; + background-color: #2a9dd6; + padding: 0.35rem 0.65rem; + transition: all 0.3s ease; + border-radius: 15px; +} + +nav #login:hover, nav #login.active{ + transition: all 0.3s ease; + background-color: var(--primary-hover); + color: var(--primary-text); +} + +nav #login:hover::after, nav #login.active::after { + width: 0; +} + +ul { + display: flex; + flex-direction: row; + gap: 2rem; +} + +li { + list-style: none; +} + +li a { + position: relative; + padding-bottom: 0.45rem; + color: var(--primary-text); + text-decoration: none; + transition: all 0.3s ease; +} + +li a::after { + content: ""; + position: absolute; + height: 4px; + width: 0; + bottom: 0; + left: 0; + background-color: var(--primary); + transition: all 0.3s ease; + border-radius: 15px; +} + +li a:hover::after { + width: 85%; +} + +li a:hover, li a.active { + color: var(--primary); + transition: all 0.3s ease; +} + +.wrapper-404 { + text-align: center; +} + +.wrapper-404 h1 { + font-size: 10rem; + margin: 0; +} + +.wrapper-404 .error { + color: var(--error); +} + +.wrapper-404 h3 { + margin-bottom: 2rem; +} + +.error-code { + color: var(--primary); +} + +.back { + color: var(--primary-text); + text-decoration: none; + background-color: #2a9dd6; + padding: 0.35rem 0.65rem; + transition: all 0.3s ease; + border-radius: 15px; +} + +.back:hover { + transition: all 0.3s ease; + background-color: var(--primary-hover); +} + +header { + width: 100%; + align-items: center; + text-align: center; +} +header h1 { + margin: 0; + padding: 0; +} +header a { + color: var(--primary); +} + +header hr { + border-color: var(--primary); + opacity: 0.5; + width: 30%; +} \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index 672cf3a..0000000 --- a/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - Adlerka - - - - \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..a76d0ca --- /dev/null +++ b/index.php @@ -0,0 +1,53 @@ + \ No newline at end of file diff --git a/pages/global/login.php b/pages/global/login.php new file mode 100644 index 0000000..dd6e9e2 --- /dev/null +++ b/pages/global/login.php @@ -0,0 +1,56 @@ +prepare("SELECT ID, PSWD, IGN, ISADMIN FROM Users where EMAIL = ?"); + $stmt->bind_param("s", $email); + $stmt->execute(); + /* bind variables to prepared statement */ + $stmt->bind_result($idcko, $hash, $ign, $isadmin); + + $found = false; + /* fetch values */ + while ($stmt->fetch()) { + if (password_verify($pass, $hash)){ + $_SESSION["ID"] = $idcko; + $_SESSION["email"] = $email; + $_SESSION["ign"] = $ign; + $_SESSION["isadmin"] = $isadmin; + $found = true; + break; + } + else{ + $_SESSION["ID"] = 0; + $_SESSION["email"] = ""; + $_SESSION["ign"] = ""; + $_SESSION["isadmin"] = 0; + $found = false; + } + break; + } + if($found){ + echo "Login successful"; + } + else{ + echo "Login failed"; + } + } +} +if ($_SESSION["ID"] > 0){ + $account_template = file_get_contents($template_dir . "account.html"); + echo $account_template; +} +else{ + $login_template = file_get_contents($template_dir . "login.html"); + echo $login_template; +} + +return ob_get_clean(); + +?> \ No newline at end of file diff --git a/pages/home/domov.html b/pages/home/domov.html new file mode 100644 index 0000000..24e5675 --- /dev/null +++ b/pages/home/domov.html @@ -0,0 +1,5 @@ +
+

Adlerka Memes

+

Skoro ako r/adlerka - ale lepšie.

+
+
\ No newline at end of file diff --git a/pages/home/info.html b/pages/home/info.html new file mode 100644 index 0000000..94278cd --- /dev/null +++ b/pages/home/info.html @@ -0,0 +1 @@ +

Vitaj na oficiálnej stránke Memeov o AdlerkaSMP

\ No newline at end of file diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..eaafdd1 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,6 @@ +
+

TY KÁR KAM TO DEŠ

+

404

+

Nenašli sme stránku ktorú hladáš: __TEMPLATE_PAGE_NAME__.

+ SPÄŤ DOMOV +
\ No newline at end of file diff --git a/templates/account.html b/templates/account.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..de16d28 --- /dev/null +++ b/templates/login.html @@ -0,0 +1,5 @@ +
+ + + +
\ No newline at end of file diff --git a/templates/nav.html b/templates/nav.html new file mode 100644 index 0000000..06cc4ac --- /dev/null +++ b/templates/nav.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/templates/skeleton.html b/templates/skeleton.html new file mode 100644 index 0000000..64612c6 --- /dev/null +++ b/templates/skeleton.html @@ -0,0 +1,15 @@ + + + + + + + + + Adlerka __TEMPLATE_PAGE_NAME__ + + + __TEMPLATE__NAV__ + __TEMPLATE__PAGE__ + + \ No newline at end of file