feat(portfolio): image d'arrière-plan pour la galerie animée
All checks were successful
Deploy / Deploy to Production (push) Successful in 18s
All checks were successful
Deploy / Deploy to Production (push) Successful in 18s
related to #20 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b455cbb82e
commit
8829817e48
4 changed files with 15 additions and 5 deletions
|
|
@ -55,13 +55,15 @@ columns:
|
|||
fields:
|
||||
imagesGallery:
|
||||
width: 2/3
|
||||
label: Galerie d'image
|
||||
label: Galerie d'images
|
||||
type: files
|
||||
layout: cards
|
||||
size: small
|
||||
min: 6
|
||||
accept: image/*
|
||||
translate: false
|
||||
image:
|
||||
back: #ffffff
|
||||
uploads:
|
||||
template: image
|
||||
help: "Une animation sera générée à partir des images de ce champ. Minimum optimal d'images : 6"
|
||||
|
|
@ -76,6 +78,7 @@ columns:
|
|||
translate: false
|
||||
image:
|
||||
ratio: 1/1
|
||||
back: #ffffff
|
||||
uploads:
|
||||
template: image
|
||||
help: Écran de jeu mis en situation sur un appareil
|
||||
|
|
@ -104,6 +107,11 @@ columns:
|
|||
label: Couleur d'arrière-plan de la galerie animée
|
||||
type: color
|
||||
alpha: false
|
||||
galleryBackgroundImage:
|
||||
label: Image d'arrière-plan
|
||||
type: files
|
||||
multiple: false
|
||||
help: L'ajout d'une image d'arrière-plan masquera la couleur d'arrière-plan.
|
||||
keywords:
|
||||
label: Mots clés
|
||||
type: structure
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ $specificData = [
|
|||
'mockupSrcset' => $project->mockup()->toFile()?->srcset('mockup'),
|
||||
'mockupWebp' => $project->mockup()->toFile()?->srcset('mockup-webp'),
|
||||
'galleryBackgroundColor' => $project->galleryBackgroundColor()->value(),
|
||||
'galleryBackgroundImage' => $project->galleryBackgroundImage()->isNotEmpty() ? $project->galleryBackgroundImage()->toFile()->url() : null,
|
||||
'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, backgroundColor = null } = $props()
|
||||
let { images = [], secondsPerImage = 8, backgroundColor = null, backgroundImage = 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{backgroundColor ? `; --background-color: ${backgroundColor}` : ''}"
|
||||
style="--gallery-duration: {columns[0]?.duration ?? 24}s{backgroundColor ? `; --background-color: ${backgroundColor}` : ''}{backgroundImage ? `; --background-image: url(${backgroundImage})` : ''}"
|
||||
>
|
||||
{#each columns as col}
|
||||
<div class="gallery-animation__column">
|
||||
|
|
@ -66,6 +66,7 @@
|
|||
height: 100%;
|
||||
overflow: hidden;
|
||||
background-color: var(--background-color, transparent);
|
||||
background-image: var(--background-image);
|
||||
}
|
||||
|
||||
/* Vertical mode (Portfolio) */
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@
|
|||
</script>
|
||||
|
||||
<div class="portfolio-gallery mobile-only" aria-hidden="true">
|
||||
<GalleryAnimation images={currentProject.imagesGallery} backgroundColor={currentProject.galleryBackgroundColor} />
|
||||
<GalleryAnimation images={currentProject.imagesGallery} backgroundColor={currentProject.galleryBackgroundColor} backgroundImage={currentProject.galleryBackgroundImage} />
|
||||
</div>
|
||||
|
||||
<section
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
{#if currentProject}
|
||||
<!-- Galerie animation (gauche desktop / plein écran mobile) -->
|
||||
<div class="portfolio-gallery desktop-only" aria-hidden="true">
|
||||
<GalleryAnimation images={currentProject.imagesGallery} backgroundColor={currentProject.galleryBackgroundColor} />
|
||||
<GalleryAnimation images={currentProject.imagesGallery} backgroundColor={currentProject.galleryBackgroundColor} backgroundImage={currentProject.galleryBackgroundImage} />
|
||||
</div>
|
||||
|
||||
<!-- Mockup device (centre) -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue