From 38247c71d9d69e1e66e3807056f81104e4cf044b Mon Sep 17 00:00:00 2001 From: Rico van Zelst Date: Wed, 8 Nov 2023 10:39:52 +0100 Subject: [PATCH] feat: champ info start --- app/Http/Controllers/ChampionController.php | 6 ++- app/Models/Champion.php | 5 ++ resources/css/app.css | 32 +++++++++++ resources/views/champions/show.blade.php | 53 +++++++++++++++++++ .../components/champions/grid_info.blade.php | 43 +++++++++++++++ routes/web.php | 1 + 6 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 resources/views/champions/show.blade.php create mode 100644 resources/views/components/champions/grid_info.blade.php diff --git a/app/Http/Controllers/ChampionController.php b/app/Http/Controllers/ChampionController.php index 4994d61..0a8c14c 100644 --- a/app/Http/Controllers/ChampionController.php +++ b/app/Http/Controllers/ChampionController.php @@ -47,7 +47,11 @@ class ChampionController extends Controller */ public function show(Champion $champion) { - // + $champion = Cache::remember('championShowCache' . $champion->slug, 60 * 60 * 8, function () use ($champion) { + return $champion->load('skins', 'lanes'); + }); + + return view('champions.show', compact('champion')); } /** diff --git a/app/Models/Champion.php b/app/Models/Champion.php index b4e7b7e..2c198aa 100644 --- a/app/Models/Champion.php +++ b/app/Models/Champion.php @@ -42,6 +42,11 @@ class Champion extends Model ]; } + public function getRouteKeyName(): string + { + return 'slug'; + } + public function skins(): HasMany { return $this->hasMany(ChampionSkin::class); diff --git a/resources/css/app.css b/resources/css/app.css index b5c61c9..18258ec 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,3 +1,35 @@ @tailwind base; @tailwind components; @tailwind utilities; + +.glow-shadow::before { + content: ""; + position: absolute; + inset: 0; + border-radius: 1rem; + background: linear-gradient(90deg, rgba(239, 148, 61, 0.7), rgba(245, 101, 35, 0.7)); + opacity: 0; + filter: blur(5px); + animation: glow 4s infinite; +} + +@keyframes glow { + 0% { + opacity: 0.5; + filter: blur(8px); + } + 50% { + opacity: 0.2; + filter: blur(13px); + } + 100% { + opacity: 0.5; + filter: blur(8px); + } +} + +@media (prefers-reduced-motion: reduce) { + .glow-shadow::before { + display: none; + } +} diff --git a/resources/views/champions/show.blade.php b/resources/views/champions/show.blade.php new file mode 100644 index 0000000..6bde8c2 --- /dev/null +++ b/resources/views/champions/show.blade.php @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + {{$champion->name}} • Heimerdinger.LoL + + + + + + + + + + + + + + + + + + + + + @vite('resources/css/app.css') + @vite('resources/js/app.js') + + + + + + + + + + + diff --git a/resources/views/components/champions/grid_info.blade.php b/resources/views/components/champions/grid_info.blade.php new file mode 100644 index 0000000..3dd437b --- /dev/null +++ b/resources/views/components/champions/grid_info.blade.php @@ -0,0 +1,43 @@ +
+

Heimerdinger Presents:

+

+ CHAMPION DETAILS

+

+ {{$champion->name}}

+

+ {{$champion->title}}

+ +
+
+
+
+
+ {{$champion->name}} Splash Art +
+
+ + +
+ 5
+
8 +
+
+ 9
+
+
+
diff --git a/routes/web.php b/routes/web.php index 70560a2..f02da4c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -18,3 +18,4 @@ use App\Http\Controllers\HomeController; Route::get('/', [HomeController::class, 'index']); Route::get('/champions', [ChampionController::class, 'index']); +Route::get('/champion/{champion}', [ChampionController::class, 'show']);