feat(hero): pick the best Jellyfin artwork for the home hero
Jellyfin stores several images per item. Ask /Items/{id}/Images for their real
sizes and use the biggest wide image (Backdrop, then Thumb) for the 16:9 hero.
Poster-only items are no longer stretched: the poster is blurred into an ambient
background with the sharp poster displayed beside the text. The slide element is
kept mounted across changes so the previous artwork stays until the next loads.
This commit is contained in:
1 parent
3131c1f905
commit
4c9dd86962
4 files changed
+235
-33
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import { motion } from "motion/react";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import type { Api } from "@jellyfin/sdk";
|
||||
|
||||
@@ -116,15 +115,9 @@ const Carousel = ({
|
||||
onMouseEnter={() => setIsPaused(true)}
|
||||
onMouseLeave={() => setIsPaused(false)}
|
||||
>
|
||||
<motion.div
|
||||
key={content[currentSlide].Id}
|
||||
className="hero-carousel-slide-wrapper"
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: 0.35, ease: "easeInOut" }}
|
||||
>
|
||||
<div className="hero-carousel-slide-wrapper">
|
||||
<MemoizedCarouselSlide item={content[currentSlide]} />
|
||||
</motion.div>
|
||||
</div>
|
||||
<div className="carousel-sidebar" ref={sidebarRef}>
|
||||
{content.map((item, index) => (
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user