Feat: couleur d'arrière-plan dynamique sur GalleryAnimation (galleryBackgroundColor)
All checks were successful
Deploy / Deploy to Production (push) Successful in 19s
All checks were successful
Deploy / Deploy to Production (push) Successful in 19s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
47be2b4662
commit
802a3ed5bf
4 changed files with 12 additions and 5 deletions
|
|
@ -99,6 +99,10 @@ columns:
|
|||
uploads:
|
||||
template: image
|
||||
help: Petite image carrée représentant le jeu
|
||||
galleryBackgroundColor:
|
||||
label: Couleur d'arrière-plan de la galerie animée
|
||||
type: color
|
||||
alpha: false
|
||||
keywords:
|
||||
label: Mots clés
|
||||
type: structure
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ $specificData = [
|
|||
'srcset' => $f->srcset('gallery'),
|
||||
'webp' => $f->srcset('gallery-webp'),
|
||||
])->values(),
|
||||
'mockup' => $project->mockup()->toFile()?->url(),
|
||||
'mockup' => $project->mockup()->toFile()?->url(),
|
||||
'gallery_background_color' => $project->galleryBackgroundColor()->value(),
|
||||
'keywords' => $project->keywords()->toStructure()->map(fn($i) => [
|
||||
'label' => $i->label()->value(),
|
||||
'text' => $i->text()->value(),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* @prop {Array<{src: string, srcset: string, webp: string}>} images
|
||||
* @prop {number} secondsPerImage — durée par image (défaut: 8s)
|
||||
*/
|
||||
let { images = [], secondsPerImage = 8 } = $props()
|
||||
let { images = [], secondsPerImage = 8, backgroundColor = null } = $props()
|
||||
|
||||
const columns = $derived.by(() => {
|
||||
const count = images.length
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<div
|
||||
class="gallery-animation gallery-animation--vertical"
|
||||
style="--gallery-duration: {columns[0]?.duration ?? 24}s"
|
||||
style="--gallery-duration: {columns[0]?.duration ?? 24}s{backgroundColor ? `; --background-color: ${backgroundColor}` : ''}"
|
||||
>
|
||||
{#each columns as col}
|
||||
<div class="gallery-animation__column">
|
||||
|
|
@ -65,13 +65,14 @@
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background-color: var(--background-color, transparent);
|
||||
}
|
||||
|
||||
/* Vertical mode (Portfolio) */
|
||||
.gallery-animation--vertical {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 8px;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.gallery-animation--vertical :global(.gallery-animation__column) {
|
||||
|
|
@ -84,6 +85,7 @@
|
|||
.gallery-animation--vertical :global(.gallery-animation__track) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 1rem;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
{#if currentProject}
|
||||
<!-- Galerie animation (gauche) -->
|
||||
<div class="portfolio-gallery" aria-hidden="true">
|
||||
<GalleryAnimation images={currentProject.images_gallery} />
|
||||
<GalleryAnimation images={currentProject.images_gallery} backgroundColor={currentProject.gallery_background_color} />
|
||||
</div>
|
||||
|
||||
<!-- Mockup device (centre) -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue