forked from Adleraci/adlerka.top
update
This commit is contained in:
parent
e584aeb36a
commit
59f399c866
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.3 MiB |
146
assets/style.css
Normal file
146
assets/style.css
Normal file
@ -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%;
|
||||
}
|
11
index.html
11
index.html
@ -1,11 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>Adlerka</title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
53
index.php
Normal file
53
index.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
require "secrets/config.php";
|
||||
|
||||
session_start();
|
||||
|
||||
$default_page = "domov";
|
||||
|
||||
$template_dir = "templates/";
|
||||
|
||||
$page_dir = "pages/";
|
||||
|
||||
$dynamic_page_dir = "dynamic/";
|
||||
|
||||
$subdomain = basename(explode('.', $_SERVER['HTTP_HOST'])[0]);
|
||||
$page_name = basename($_SERVER["QUERY_STRING"]);;
|
||||
|
||||
$srvname = $_SERVER["SERVER_NAME"];
|
||||
|
||||
$dynamic_page_file = $page_dir . $subdomain . "/" . $page_name . ".php";
|
||||
$page_file = $page_dir . $subdomain . "/" . $page_name . ".html";
|
||||
|
||||
$dynamic_page_file_global = $page_dir . "global/" . $page_name . ".php";
|
||||
$page_file_global = $page_dir . "global/" . $page_name . ".html";
|
||||
|
||||
$skeleton = file_get_contents($template_dir . "skeleton.html");
|
||||
$nav = file_get_contents($template_dir . "nav.html");
|
||||
|
||||
if (file_exists($dynamic_page_file_global)){
|
||||
$page = include_once $dynamic_page_file_global;
|
||||
}
|
||||
elseif (file_exists($page_file_global)){
|
||||
$page = file_get_contents($page_file_global);
|
||||
}
|
||||
elseif (file_exists($dynamic_page_file)){
|
||||
$page = include_once $dynamic_page_file;
|
||||
}
|
||||
elseif (file_exists($page_file)){
|
||||
$page = file_get_contents($page_file);
|
||||
}
|
||||
else{
|
||||
$page = file_get_contents($template_dir . "404.html");
|
||||
}
|
||||
|
||||
$nav = str_replace("href=\"/$page_name\"", "href=\"/$page_name\" class=\"active\"", $nav);
|
||||
|
||||
$out = $skeleton;
|
||||
$out = str_replace("__TEMPLATE__NAV__", $nav, $out);
|
||||
$out = str_replace("__TEMPLATE__PAGE__", $page, $out);
|
||||
$out = str_replace("__TEMPLATE_PAGE_NAME__", $page_name, $out);
|
||||
|
||||
echo $out;
|
||||
|
||||
?>
|
56
pages/global/login.php
Normal file
56
pages/global/login.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
ob_start();
|
||||
|
||||
$template_dir = "templates/";
|
||||
|
||||
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
||||
if(!empty($_POST["email"]) && !empty($_POST["password"])){
|
||||
$email = $_POST["email"];
|
||||
$pass = $_POST["password"];
|
||||
/* prepare statement */
|
||||
$stmt = $mysqli->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();
|
||||
|
||||
?>
|
5
pages/home/domov.html
Normal file
5
pages/home/domov.html
Normal file
@ -0,0 +1,5 @@
|
||||
<header>
|
||||
<h1 class="title">Adlerka Memes</h1>
|
||||
<p>Skoro ako <a href="https://reddit.com/r/adlerka" target="_blank">r/adlerka</a> - ale lepšie.</p>
|
||||
<hr>
|
||||
</header>
|
1
pages/home/info.html
Normal file
1
pages/home/info.html
Normal file
@ -0,0 +1 @@
|
||||
<h1>Vitaj na oficiálnej stránke Memeov o AdlerkaSMP</h1>
|
6
templates/404.html
Normal file
6
templates/404.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="wrapper-404">
|
||||
<h2>TY KÁR KAM TO DEŠ</h2>
|
||||
<h1 class="error-code">404</h1>
|
||||
<h3><i class="fa-solid fa-circle-exclamation error"></i> Nenašli sme stránku ktorú hladáš: <span class="error">__TEMPLATE_PAGE_NAME__</span>. <i class="fa-solid fa-circle-exclamation error"></i></h3>
|
||||
<a href="/domov" class="back"><i class="fa-solid fa-arrow-left"></i> SPÄŤ DOMOV</a>
|
||||
</div>
|
0
templates/account.html
Normal file
0
templates/account.html
Normal file
5
templates/login.html
Normal file
5
templates/login.html
Normal file
@ -0,0 +1,5 @@
|
||||
<form method="post">
|
||||
<input type="email" name="email">
|
||||
<input type="password" name="password">
|
||||
<input type="submit">
|
||||
</form>
|
8
templates/nav.html
Normal file
8
templates/nav.html
Normal file
@ -0,0 +1,8 @@
|
||||
<nav>
|
||||
<div class="logo"><img class="standard-logo" src="http://www.adlerka.sk/wp-content/uploads/2021/09/Logo_text_Adlerka_modro_cerveno_biele-e1652431356820.png" title="Adlerka"></div>
|
||||
<ul>
|
||||
<li><a href="/domov">Domov</a></li>
|
||||
<li><a href="/info">Informácie</a></li>
|
||||
<li><a href="/login" id="login">Prihlásiť</a></li>
|
||||
</ul>
|
||||
</nav>
|
15
templates/skeleton.html
Normal file
15
templates/skeleton.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="sk">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="https://kit.fontawesome.com/e9016e1de1.js" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/remixicon/4.0.1/remixicon.min.css" integrity="sha512-dTsohxprpcruDm4sjU92K0/Gf1nTKVVskNHLOGMqxmokBSkfOAyCzYSB6+5Z9UlDafFRpy5xLhvpkOImeFbX6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<link rel="stylesheet" href="/assets/style.css">
|
||||
<title>Adlerka __TEMPLATE_PAGE_NAME__</title>
|
||||
</head>
|
||||
<body>
|
||||
__TEMPLATE__NAV__
|
||||
__TEMPLATE__PAGE__
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user