diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Routes.php | 7 | ||||
-rw-r--r-- | app/controllers/upload.controller.php | 4 | ||||
-rw-r--r-- | app/model/Fortune.php | 14 | ||||
-rw-r--r-- | app/views/index.view.php | 4 | ||||
-rw-r--r-- | app/views/partials/footer.php | 2 | ||||
-rw-r--r-- | app/views/partials/head.css.php (renamed from app/views/snippets/stylesheets.php) | 2 | ||||
-rw-r--r-- | app/views/partials/head.discovery.php (renamed from app/views/snippets/rss.php) | 0 | ||||
-rw-r--r-- | app/views/partials/head.js.php | 1 | ||||
-rw-r--r-- | app/views/partials/head.manifests.php (renamed from app/views/snippets/favicons.php) | 0 | ||||
-rw-r--r-- | app/views/partials/head.meta.php | 11 | ||||
-rw-r--r-- | app/views/partials/header.error.php | 5 | ||||
-rw-r--r-- | app/views/partials/header.php | 19 | ||||
-rw-r--r-- | app/views/partials/header.posts.php | 7 | ||||
-rw-r--r-- | app/views/partials/header.resume.php | 22 | ||||
-rw-r--r-- | app/views/partials/header.upload.php | 18 | ||||
-rw-r--r-- | app/views/resume.view.php | 26 | ||||
-rw-r--r-- | app/views/upload.view.php | 23 |
17 files changed, 96 insertions, 69 deletions
diff --git a/app/Routes.php b/app/Routes.php index 28bcdc0..40320c7 100644 --- a/app/Routes.php +++ b/app/Routes.php @@ -1,7 +1,11 @@ <?php + +$router = new Router; + /** * Public routes */ + $router->get('', '../app/controllers/index.controller.php'); $router->get('contact', '../app/controllers/contact.controller.php'); $router->get('resume', '../app/controllers/resume.controller.php'); @@ -17,7 +21,8 @@ $router->post('upload', '../app/controllers/upload.controller.php'); $router->post('contact', '../app/controllers/contact.controller.php'); /** - * Api routes + * API routes */ + $router->post('api/v1/thumbnails', '../app/controllers/api/thumbnails.controller.php'); $router->post('api/v1/cache', '../app/controllers/api/cache.controller.php'); diff --git a/app/controllers/upload.controller.php b/app/controllers/upload.controller.php index 5a28370..c1b2b8f 100644 --- a/app/controllers/upload.controller.php +++ b/app/controllers/upload.controller.php @@ -7,9 +7,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($uploadedFile) { move_uploaded_file( $uploadedFile['tmp_name'], 'uploads/' - . uniqid() + . bin2hex(random_bytes(14)) . '-' - . $uploadedFile['name'] + . urlencode($uploadedFile['name']) ); } diff --git a/app/model/Fortune.php b/app/model/Fortune.php new file mode 100644 index 0000000..a073d98 --- /dev/null +++ b/app/model/Fortune.php @@ -0,0 +1,14 @@ +<?php + +class Fortune +{ + public function random(): string + { + return $this->quotes()[array_rand($this->quotes())]; + } + + public function quotes(): array + { + return include $_SERVER['DOCUMENT_ROOT'] . '/..' . '/generators/fortune/fortune.quotes'; + } +} diff --git a/app/views/index.view.php b/app/views/index.view.php index bef54f5..8bfa2c1 100644 --- a/app/views/index.view.php +++ b/app/views/index.view.php @@ -8,7 +8,7 @@ <home-page> <article> - <h1>Web <em>Developer </em></h1> + <h1>Web <em>Developer</em></h1> <h2>In it for the long haul</h2> @@ -30,7 +30,7 @@ <fortune-quote> <margin-note left> <b>Random Quote</b> - <?php echo shell_exec('fortune ' . dirname($_SERVER['DOCUMENT_ROOT']) . '/generators/fortune/quotes.fortune'); ?> + <?php echo (new Fortune)->random(); ?> </margin-note> </fortune-quote> diff --git a/app/views/partials/footer.php b/app/views/partials/footer.php index 0a7b37b..fe9d9d3 100644 --- a/app/views/partials/footer.php +++ b/app/views/partials/footer.php @@ -35,5 +35,3 @@ </p> </footer> - -<script src="/js/app.js"></script> diff --git a/app/views/snippets/stylesheets.php b/app/views/partials/head.css.php index 7eb1c06..62b2ad9 100644 --- a/app/views/snippets/stylesheets.php +++ b/app/views/partials/head.css.php @@ -8,7 +8,7 @@ <style> article-comments, [href="#isso-thread"], - article-meta-top aside:nth-child(2) svg:first-child { + article header aside:nth-child(2) svg:first-child { display: none; } </style> diff --git a/app/views/snippets/rss.php b/app/views/partials/head.discovery.php index a37df92..a37df92 100644 --- a/app/views/snippets/rss.php +++ b/app/views/partials/head.discovery.php diff --git a/app/views/partials/head.js.php b/app/views/partials/head.js.php new file mode 100644 index 0000000..f1ccc3a --- /dev/null +++ b/app/views/partials/head.js.php @@ -0,0 +1 @@ +<script src="/js/app.js"></script> diff --git a/app/views/snippets/favicons.php b/app/views/partials/head.manifests.php index f052ee5..f052ee5 100644 --- a/app/views/snippets/favicons.php +++ b/app/views/partials/head.manifests.php diff --git a/app/views/partials/head.meta.php b/app/views/partials/head.meta.php new file mode 100644 index 0000000..9f92e77 --- /dev/null +++ b/app/views/partials/head.meta.php @@ -0,0 +1,11 @@ +<title> + <?php echo $title = $title ?? 'Portfolio - '; ?> + Thedro Neely +</title> + +<meta charset="utf-8"> +<meta name="robots" content="index,follow"> +<meta name="author" content="Thedro Neely"> +<meta name="description" content="Thedro's Portfolio Website"> +<meta name="keywords" content="Thedro,Neely,Portfolio,Website"> +<meta name="viewport" content="width=device-width, initial-scale=1"> diff --git a/app/views/partials/header.error.php b/app/views/partials/header.error.php deleted file mode 100644 index 5e11869..0000000 --- a/app/views/partials/header.error.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/bootstrap/Bootstrap.php'; ?> - -<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/header.php'; ?> - -<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/navigator.php'; ?> diff --git a/app/views/partials/header.php b/app/views/partials/header.php index e5439be..c52ca19 100644 --- a/app/views/partials/header.php +++ b/app/views/partials/header.php @@ -1,9 +1,15 @@ <!DOCTYPE html> -<html lang="en-us" itemscope itemtype="http://schema.org/WebPage"> +<html + itemscope="" + itemtype="http://schema.org/WebPage" + lang="en-us" +> <head> -<title><?php echo $title = $title ?? 'Portfolio - '; ?>Thedro Neely</title> +<title> + <?php echo $title = $title ?? 'Portfolio - '; ?>Thedro Neely +</title> <meta charset="utf-8"> <meta name="robots" content="index,follow"> @@ -12,10 +18,9 @@ <meta name="keywords" content="Thedro,Neely,Portfolio,Website"> <meta name="viewport" content="width=device-width, initial-scale=1"> -<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/rss.php'; ?> - -<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/favicons.php'; ?> - -<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/stylesheets.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.discovery.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.manifests.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.css.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.js.php'; ?> </head> diff --git a/app/views/partials/header.posts.php b/app/views/partials/header.posts.php index d98d3c4..a473e24 100644 --- a/app/views/partials/header.posts.php +++ b/app/views/partials/header.posts.php @@ -1,6 +1,7 @@ <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/bootstrap/Bootstrap.php'; -require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/rss.php'; -require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/favicons.php'; -require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/stylesheets.php'; +require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.discovery.php'; +require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.manifests.php'; +require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.css.php'; +require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.js.php'; diff --git a/app/views/partials/header.resume.php b/app/views/partials/header.resume.php new file mode 100644 index 0000000..92c3a41 --- /dev/null +++ b/app/views/partials/header.resume.php @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html + data-page="resume" + lang="en-us" +> + +<head> + +<title>Resume - Thedro Neely</title> + +<meta charset="utf-8"> +<meta name="description" content="Thedro's Web Development Resume"> +<meta name="keywords" content="Thedro,Neely,Portfolio,Website,Resume"> +<meta name="author" content="Thedro Neely"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<meta name="robots" content="index,follow"> + +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.discovery.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.manifests.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.css.php'; ?> + +</head> diff --git a/app/views/partials/header.upload.php b/app/views/partials/header.upload.php new file mode 100644 index 0000000..3710280 --- /dev/null +++ b/app/views/partials/header.upload.php @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html + lang="en-us" + itemscope="" + itemtype="http://schema.org/WebPage" +> + +<head> + +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.meta.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.discovery.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.manifests.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.css.php'; ?> +<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/head.js.php'; ?> + +<script type="module" src="/js/upload.js"></script> + +</head> diff --git a/app/views/resume.view.php b/app/views/resume.view.php index dd3d3e8..ede40eb 100644 --- a/app/views/resume.view.php +++ b/app/views/resume.view.php @@ -1,28 +1,6 @@ -<!DOCTYPE html> -<html lang="en-us" style="scrollbar-width: none;"> +<?php require __DIR__ . '/partials/header.resume.php'; ?> -<head> - - <title>Resume - Thedro Neely</title> - - <meta charset="utf-8"> - <meta name="description" content="Thedro's Web Development Resume"> - <meta name="keywords" content="Thedro,Neely,Portfolio,Website,Resume"> - <meta name="author" content="Thedro Neely"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="robots" content="index,follow"> - - <style>html::-webkit-scrollbar { height: 0; width: 0; }</style> - - <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/rss.php'; ?> - - <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/favicons.php'; ?> - - <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/snippets/stylesheets.php'; ?> - -</head> - - <body data-resume> + <body data-page="resume"> <resume-page> diff --git a/app/views/upload.view.php b/app/views/upload.view.php index f504d5b..d4f913f 100644 --- a/app/views/upload.view.php +++ b/app/views/upload.view.php @@ -1,32 +1,11 @@ <?php $title = 'Upload Files - ' ?> -<?php require __DIR__ . '/partials/header.php';?> +<?php require __DIR__ . '/partials/header.upload.php';?> <body> <?php require __DIR__ . '/partials/navigator.php';?> - <main> - <article> - <upload-page> - <h1>Upload Files</h1> - <div id="file-upload-area"></div> - </upload-page> - </article> - </main> - - <link href="/css/uppy.min.css" rel="stylesheet"> - - <script src="/js/uppy.min.js"></script> - - <script> - var uppy = Uppy.Core() - .use(Uppy.Url, { companionUrl: 'https://www.thedroneely.com/' }) - .use(Uppy.Webcam, {}) - .use(Uppy.Dashboard, { inline: true, target: '#file-upload-area', plugins: ['Url', 'Webcam'] }) - .use(Uppy.XHRUpload, {endpoint: '/upload/', formdata: true, fieldName: 'upload' }) - </script> - <?php require __DIR__ . '/partials/footer.php';?> </body> |