From 9957a1df4bafa4b05ad9365c9c775f8ad13b81f9 Mon Sep 17 00:00:00 2001 From: JordanViknar <74505993+JordanViknar@users.noreply.github.com> Date: Wed, 27 Mar 2024 11:54:13 +0100 Subject: [PATCH] feat: Add dynamic main view --- public/css/about.css | 0 public/css/error.css | 4 ++ public/css/home.css | 0 public/css/homepage.css | 42 ------------------- resources/views/about.blade.php | 2 + resources/views/application.blade.php | 5 ++- resources/views/error.blade.php | 2 + ...{home_content.blade.php => home.blade.php} | 0 routes/web.php | 6 +-- 9 files changed, 15 insertions(+), 46 deletions(-) create mode 100644 public/css/about.css create mode 100644 public/css/error.css create mode 100644 public/css/home.css delete mode 100644 public/css/homepage.css create mode 100644 resources/views/about.blade.php create mode 100644 resources/views/error.blade.php rename resources/views/{home_content.blade.php => home.blade.php} (100%) diff --git a/public/css/about.css b/public/css/about.css new file mode 100644 index 0000000..e69de29 diff --git a/public/css/error.css b/public/css/error.css new file mode 100644 index 0000000..8e33ffc --- /dev/null +++ b/public/css/error.css @@ -0,0 +1,4 @@ +main i { + font-size: 1em; + color: rgb(255, 0, 0); +} \ No newline at end of file diff --git a/public/css/home.css b/public/css/home.css new file mode 100644 index 0000000..e69de29 diff --git a/public/css/homepage.css b/public/css/homepage.css deleted file mode 100644 index 09f1680..0000000 --- a/public/css/homepage.css +++ /dev/null @@ -1,42 +0,0 @@ -body { - margin: 0; /* Prevents the browser from putting a white zone around the page */ - font-family: 'Arial', sans-serif; - overflow: auto; -} - -header { - background-color: green; -} -header img { - max-width: 5%; - max-height: 5%; - margin: 1%; -} - -div.container { - display: flex; -} -nav { - background-color: gray; - width: 10% -} - -main { - background-color: rgb(82, 27, 0); -} - -footer { - background-color: rgb(49, 49, 58); - width: 100%; - padding: 1%; - - display: flex; - - align-items: center; - justify-content: center; -} - -footer p { - color: rgb(214, 214, 214); - width: max-content; -} \ No newline at end of file diff --git a/resources/views/about.blade.php b/resources/views/about.blade.php new file mode 100644 index 0000000..989ccbe --- /dev/null +++ b/resources/views/about.blade.php @@ -0,0 +1,2 @@ +

A propos de HurrShop...

+

Je n'ai pas été assez imaginatif pour placer un placeholder drole ici, donc prenez ce message.

\ No newline at end of file diff --git a/resources/views/application.blade.php b/resources/views/application.blade.php index 7e325f3..88617f7 100644 --- a/resources/views/application.blade.php +++ b/resources/views/application.blade.php @@ -6,6 +6,9 @@ + + + @@ -43,7 +46,7 @@
- @include('home_content') + @include($page_to_load ?? "error")
diff --git a/resources/views/error.blade.php b/resources/views/error.blade.php new file mode 100644 index 0000000..ae57d01 --- /dev/null +++ b/resources/views/error.blade.php @@ -0,0 +1,2 @@ +

Erreur !

+

Hurr. Huh. Pin ! Puh ! Puh ! Pwuh !

\ No newline at end of file diff --git a/resources/views/home_content.blade.php b/resources/views/home.blade.php similarity index 100% rename from resources/views/home_content.blade.php rename to resources/views/home.blade.php diff --git a/routes/web.php b/routes/web.php index bb385e3..06aaa62 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,9 +16,9 @@ | */ -Route::get('/', function () { - return view('application'); -}); +Route::get('/', function () {return view('application', ["page_to_load" => "home"]);}); +Route::get('/about', function () {return view('application', ["page_to_load" => "about"]);}); +Route::get('/404_test', function () {return view('application');}); Route::post("/auth/login", [AuthController::class, "login"]); Route::post("/auth/logout", [AuthController::class, "logout"]);