[feature] info pages redesign (#306)

* feat(skin-info): initial page redesign

* feat(skin-info): improve page header & colors

* feat(skin-info): optimize splash loading

* feat(skin-info): add product schema

* feat(skin-info): add faq section

* feat(champ-info): full page redesign

* fix: remove unused splash_color

* feat(icon-info): full page redesign

* feat(skin-info): convert RP to EUR in skin schema

* fix: prevent error on missing element
This commit is contained in:
Rico
2025-05-16 15:13:53 +02:00
committed by GitHub
parent 9745765875
commit 84da1cc6d2
10 changed files with 1534 additions and 415 deletions

View File

@@ -15,9 +15,9 @@ class ChampionController extends Controller
{
$eightHoursInSeconds = 60 * 60 * 8;
$champions = Cache::remember('championsListAllCache', $eightHoursInSeconds, static fn () => Champion::orderBy('name')->get());
$champions = Cache::remember('championsListAllCache', $eightHoursInSeconds, static fn() => Champion::orderBy('name')->get());
$roles = Cache::remember('championsRolesCache', $eightHoursInSeconds, static fn () => ChampionRoles::orderBy('champion_name')->get());
$roles = Cache::remember('championsRolesCache', $eightHoursInSeconds, static fn() => ChampionRoles::orderBy('champion_name')->get());
return view('champions.index', ['champions' => $champions, 'roles' => $roles]);
}
@@ -28,20 +28,11 @@ class ChampionController extends Controller
public function show(Champion $champion)
{
$threeDaysInSeconds = 60 * 60 * 24 * 3;
$sixMonthsInSeconds = 60 * 60 * 24 * 30 * 6;
$champion = Cache::remember('championShowCache'.$champion->slug, $threeDaysInSeconds, static fn () => $champion->load('streamers', 'skins', 'lanes'));
$champion = Cache::remember('championShowCache' . $champion->slug, $threeDaysInSeconds, static fn() => $champion->load('streamers', 'skins', 'lanes'));
$streamers = $champion->load('streamers')->streamers;
$splashColor = Cache::remember(
'championSplashColorCache'.$champion->slug,
$sixMonthsInSeconds,
static fn () => getAverageColorFromImageUrl('https://wsrv.nl/?url='.$champion->getChampionImageAttribute(true))
);
$champion->splash_color = $splashColor;
return view('champions.show', ['champion' => $champion, 'streamers' => $streamers]);
}
}

View File

@@ -63,14 +63,6 @@ class ChampionSkinController extends Controller
static fn () => $championSkin->load('champion', 'chromas')
);
$splashColor = Cache::remember(
'championSkinSplashColorCache'.$championSkin->slug,
60 * 60 * 120,
static fn () => getAverageColorFromImageUrl('https://wsrv.nl/?url='.$championSkin->getSkinImageAttribute(true))
);
$skin->splash_color = $splashColor;
return view('skins.show', ['skin' => $skin]);
}

View File

@@ -11,7 +11,7 @@ class SummonerIconController extends Controller
public function index()
{
$icons = QueryBuilder::for(SummonerIcon::class)
->allowedFilters('title')
->allowedFilters(['title', 'esports_team', 'release_year'])
->defaultSort('-icon_id')
->paginate(72)
->appends(request()->query());