diff --git a/v4/.htaccess b/v4/.htaccess deleted file mode 100644 index b9d3b28..0000000 --- a/v4/.htaccess +++ /dev/null @@ -1,9 +0,0 @@ -RewriteEngine On -Options -Indexes -RewriteBase / - -# index.php?page=neco => neco/ -RewriteCond %{REQUEST_FILENAME} !-d -RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^([^/]+)/?$ ?page=$1 - diff --git a/v4/components/footer.php b/v4/components/footer.php new file mode 100644 index 0000000..5ae7419 --- /dev/null +++ b/v4/components/footer.php @@ -0,0 +1 @@ +

(c) filiprojek.cz 2023

diff --git a/v4/components/header.php b/v4/components/header.php index e327299..aa1d069 100644 --- a/v4/components/header.php +++ b/v4/components/header.php @@ -7,5 +7,6 @@ Projekty Kontakt +

diff --git a/v4/css/home.css b/v4/css/home.css new file mode 100644 index 0000000..33c76a9 --- /dev/null +++ b/v4/css/home.css @@ -0,0 +1,36 @@ +.home { + font-family: 'Source Code Pro', monospace; + background: black; + color: white; + font-size: 1.2rem; + height: 100vh + max-height: -webkit-fill-available; + max-width: 100vw; + overflow: hidden; +} +.home section { + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + text-align: center; +} +.home a { + color: lightblue; + cursor: pointer; + text-decoration: underline; +} +#pgp { + cursor: pointer; +} +#pgpmobile { + display: none; +} +@media (max-width: 600px) { + #pgp { + display: none; + } + #pgpmobile { + display: inline-block; + } +} diff --git a/v4/css/style.css b/v4/css/style.css index 7d935e3..05975a4 100644 --- a/v4/css/style.css +++ b/v4/css/style.css @@ -4,9 +4,27 @@ box-sizing: border-box; } -.nav { +body { display: flex; - background: red; + flex-direction: column; + min-height: 100vh; } +.nav { + display: flex; + border: 1px solid red; + padding: 1rem; + justify-content: space-between; +} +.content { + border: 1px solid green; + padding: 2rem 5rem; +} + +footer { + display: flex; + justify-content: center; + align-items: center; + align-self: flex-end; +} diff --git a/v4/index.php b/v4/index.php index dc68704..46682e9 100644 --- a/v4/index.php +++ b/v4/index.php @@ -2,6 +2,8 @@ session_start(); $prod = false; +require_once("./libraries/router.php"); + // Display Errors ini_set('display_startup_errors', 1); ini_set('display_errors', 1); @@ -44,8 +46,8 @@ $canonical = "https://www.filiprojek.cz/"; - + @@ -60,33 +62,25 @@ $canonical = "https://www.filiprojek.cz/"; - 0) { - echo("

Upozornění

Nelze nahrát soubor v nadřazeném adresáři."); - } - elseif($file == "index" || $file == "/index") { - echo("

Upozornění

Index nemůže načíst sám sebe."); - } else { - require_once($file2); - } - } - else { - require_once("./pages/error_404.php"); - } -} -else { - require_once("./pages/home/home.php"); -} -?> + +
+ route('/', 'home'); + $R->route('/home', 'home'); + $R->route('/domu', 'home'); + + $R = null; + ?> +
+ diff --git a/v4/libraries/router.php b/v4/libraries/router.php new file mode 100644 index 0000000..460f731 --- /dev/null +++ b/v4/libraries/router.php @@ -0,0 +1,30 @@ +returned = true; + return; + } + } + } + + function __destruct() { + if($_SERVER['REQUEST_METHOD'] == 'GET') { + if(!$this->returned){ + $url = explode("/", $_SERVER['REQUEST_URI']); + $url = $url[count($url)-1]; + + if (file_exists("./pages/$url/$url.php")) { + require_once("./pages/$url/$url.php"); + } else { + require_once("./pages/errors/404.php"); + } + } + } + } +} + diff --git a/v4/pages/contact/contact.php b/v4/pages/contact/contact.php new file mode 100644 index 0000000..6651ce7 --- /dev/null +++ b/v4/pages/contact/contact.php @@ -0,0 +1 @@ +

Kontakt

diff --git a/v4/pages/errors/404.php b/v4/pages/errors/404.php new file mode 100644 index 0000000..1a54c9a --- /dev/null +++ b/v4/pages/errors/404.php @@ -0,0 +1,2 @@ +

Error 404 - not found

+ diff --git a/v4/pages/home/home.php b/v4/pages/home/home.php index 2f8b365..a75b7c1 100644 --- a/v4/pages/home/home.php +++ b/v4/pages/home/home.php @@ -1,3 +1,33 @@ -
-

lorem

+
+ +
+

Filip Rojek <filip(at)filiprojek.cz>

+
+

Backend nodejs & php developer @fofrweb,
Linux Void user, student and coffee enthusiast_

+
+

PGP: fc37b989787acf8cbce7c0c2a56a345efe321161

+
+

Github Telegram PGP

+
+ +
diff --git a/v4/pages/projects/projects.php b/v4/pages/projects/projects.php index c3edd3e..9c145a6 100644 --- a/v4/pages/projects/projects.php +++ b/v4/pages/projects/projects.php @@ -3,6 +3,35 @@
- +

Projekt

+

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

+

MM/YYYY

+ project screenshot +
+
+

Projekt

+

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

+

MM/YYYY

+ project screenshot +
+

Projekt

+

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

+

MM/YYYY

+ project screenshot +
+

Projekt

+

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

+

MM/YYYY

+ project screenshot +
+

Projekt

+

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

+

MM/YYYY

+ project screenshot +
+

Projekt

+

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

+

MM/YYYY

+ project screenshot