Feat: page Jouer renommée Play + vue implémentée
All checks were successful
Deploy / Deploy to Production (push) Successful in 20s
All checks were successful
Deploy / Deploy to Production (push) Successful in 20s
Renommage jouer → play (blueprint, template, txt, vue) API play.json.php : title, lettering, description, thumbnail, background_image, play_links par jeu enfant listed() Vue Play.svelte : - Fond image avec crossfade (transition opacity sur .play-bg) - Section principale (.play-featured) : glissé/fondu au changement de jeu via --slide-dir CSS var + classes is-out - Carrousel nav (ul > li > button) : thumbnail + titre, active bordure verte - Jeu sans play_links → bouton "Coming soon" désactivé - Layout golden-grid, mobile adapté Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3ce350d2d7
commit
6151dd5a31
7 changed files with 319 additions and 59 deletions
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
$specificData = [
|
||||
'intro' => [
|
||||
'title' => $page->intro_title()->value(),
|
||||
'text' => $page->intro_text()->value()
|
||||
],
|
||||
'games' => $page->children()->listed()->map(function($game) {
|
||||
$badgeValue = $game->badge()->value();
|
||||
$badgeLabel = 'none';
|
||||
if ($badgeValue === 'new') {
|
||||
$badgeLabel = 'NEW';
|
||||
} elseif ($badgeValue === 'coming_soon') {
|
||||
$badgeLabel = 'INCOMING';
|
||||
}
|
||||
|
||||
return [
|
||||
'title' => $game->title()->value(),
|
||||
'slug' => $game->slug(),
|
||||
'url' => $game->url(),
|
||||
'description' => $game->description()->value(),
|
||||
'cover' => $game->cover()->toFile()?->url(),
|
||||
'badge' => $badgeValue,
|
||||
'badge_label' => $badgeLabel,
|
||||
'game_status' => $game->game_status()->value()
|
||||
];
|
||||
})->values()
|
||||
];
|
||||
|
||||
$pageData = array_merge($genericData, $specificData);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($pageData);
|
||||
23
site/templates/play.json.php
Normal file
23
site/templates/play.json.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
$specificData = [
|
||||
'games' => $page->children()->listed()->map(function($game) {
|
||||
return [
|
||||
'title' => $game->title()->value(),
|
||||
'slug' => $game->slug(),
|
||||
'lettering' => $game->lettering()->toFile()?->url(),
|
||||
'description' => $game->description()->value(),
|
||||
'thumbnail' => $game->thumbnail()->toFile()?->url(),
|
||||
'background_image' => $game->background_image()->toFile()?->url(),
|
||||
'play_links' => $game->play_links()->toStructure()->map(fn($l) => [
|
||||
'label' => $l->label()->value(),
|
||||
'url' => $l->url()->value(),
|
||||
])->values(),
|
||||
];
|
||||
})->values()
|
||||
];
|
||||
|
||||
$pageData = array_merge($genericData, $specificData);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($pageData);
|
||||
Loading…
Add table
Add a link
Reference in a new issue