Fiche : retour de la grande image de scène (annule dd92878, demande mal comprise)
deploy / deploy (push) Successful in 47s
deploy / deploy (push) Successful in 47s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
2 files changed
+33
-3
No files matched your search
@@ -12,6 +12,7 @@ import { useEscape } from '../../lib/escape'
|
|||||||
import { episodeCap, seasonPosition } from '../../lib/franchise'
|
import { episodeCap, seasonPosition } from '../../lib/franchise'
|
||||||
import { episodesPatch } from '../../lib/progress'
|
import { episodesPatch } from '../../lib/progress'
|
||||||
import { useScrollLock } from '../../lib/scrollLock'
|
import { useScrollLock } from '../../lib/scrollLock'
|
||||||
|
import { backdropSrcSet, tmdbSized } from '../../lib/tmdbImage'
|
||||||
import { cx, formatDate, formatDuration, formatRating, todayISO } from '../../lib/utils'
|
import { cx, formatDate, formatDuration, formatRating, todayISO } from '../../lib/utils'
|
||||||
import { GuestError, useMedia } from '../../store'
|
import { GuestError, useMedia } from '../../store'
|
||||||
import { allTags, cleanTag } from '../../lib/bulk'
|
import { allTags, cleanTag } from '../../lib/bulk'
|
||||||
@@ -92,6 +93,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
|||||||
const episodic = TYPE_BY_VALUE[type].episodic
|
const episodic = TYPE_BY_VALUE[type].episodic
|
||||||
const externalId = item?.externalId ?? seed?.externalId
|
const externalId = item?.externalId ?? seed?.externalId
|
||||||
const poster = item?.poster ?? seed?.posterUrl
|
const poster = item?.poster ?? seed?.posterUrl
|
||||||
|
const backdrop = item?.backdrop ?? data.backdrop
|
||||||
|
|
||||||
// Note moyenne, casting… (en ligne)
|
// Note moyenne, casting… (en ligne)
|
||||||
const [extras, setExtras] = useState<TitleExtras>()
|
const [extras, setExtras] = useState<TitleExtras>()
|
||||||
@@ -323,6 +325,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const heroImage = backdrop ?? extras?.backdrop
|
||||||
const average = extras?.average ?? data.publicRating
|
const average = extras?.average ?? data.publicRating
|
||||||
const source = externalId?.startsWith('anilist:') ? 'AniList' : externalId ? 'TMDB' : undefined
|
const source = externalId?.startsWith('anilist:') ? 'AniList' : externalId ? 'TMDB' : undefined
|
||||||
const runtime = type === 'film' ? (data.duration ?? extras?.runtime) : undefined
|
const runtime = type === 'film' ? (data.duration ?? extras?.runtime) : undefined
|
||||||
@@ -355,9 +358,20 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
|||||||
<div className="sheet-scroll">
|
<div className="sheet-scroll">
|
||||||
{/* Grande marge en bas : rien ne reste caché sous une barre des tâches ou la barre d'accueil du téléphone */}
|
{/* Grande marge en bas : rien ne reste caché sous une barre des tâches ou la barre d'accueil du téléphone */}
|
||||||
<div className="mx-auto max-w-2xl pb-[calc(10rem+env(safe-area-inset-bottom))] lg:max-w-none">
|
<div className="mx-auto max-w-2xl pb-[calc(10rem+env(safe-area-inset-bottom))] lg:max-w-none">
|
||||||
{/* En-tête sobre pour tous les titres : l'affiche et le titre côte à côte (la grande image de scène reste pour l'accueil) */}
|
{/* Image de scène en grand (nette sur tous les écrans), qui se fond dans le fond, avec l'affiche et le titre posés dessus */}
|
||||||
<div className="h-6" />
|
{heroImage ? (
|
||||||
<div className="relative flex items-end gap-4 px-4 lg:gap-8 lg:px-10">
|
<img
|
||||||
|
src={tmdbSized(heroImage, 'w1280')}
|
||||||
|
srcSet={backdropSrcSet(heroImage)}
|
||||||
|
sizes="100vw"
|
||||||
|
alt=""
|
||||||
|
// Téléphone : l'image garde son format 16/9 (avant, recadrée dans un cadre plus haut, elle était agrandie et floue)
|
||||||
|
className="hero-fade aspect-video w-full object-cover object-[center_25%] lg:aspect-auto lg:h-[72vh] lg:max-h-[48rem]"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<div className="h-6" />
|
||||||
|
)}
|
||||||
|
<div className={cx('relative flex items-end gap-4 px-4 lg:gap-8 lg:px-10', heroImage && '-mt-28 lg:-mt-64')}>
|
||||||
<div className="w-28 shrink-0 lg:w-52">
|
<div className="w-28 shrink-0 lg:w-52">
|
||||||
<Poster src={poster} title={title} />
|
<Poster src={poster} title={title} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -291,3 +291,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Grande image de fond d'une fiche (façon Letterboxd / TV Time) : elle se fond dans le fond du thème
|
||||||
|
* en bas (et sur les côtés sur ordinateur) grâce à un masque de transparence, sans couleur ajoutée.
|
||||||
|
*/
|
||||||
|
.hero-fade {
|
||||||
|
-webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
|
||||||
|
mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
|
||||||
|
}
|
||||||
|
@media (min-width: 64rem) {
|
||||||
|
.hero-fade {
|
||||||
|
-webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%), linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
|
||||||
|
-webkit-mask-composite: source-in;
|
||||||
|
mask-image: linear-gradient(to bottom, #000 40%, transparent 100%), linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
|
||||||
|
mask-composite: intersect;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user