Improve hero carousel backdrop sys #136 [3/-]

This commit is contained in:
Prayag Prajapati committed 2023-08-14 13:50:29 +05:30
1 parent 2d78d95ca9
commit c568cf2be4
2 files changed
+326 -420

No files matched your search

+288 -283
View File
File diff suppressed because it is too large. Load diff
+38 -137
View File
@@ -212,60 +212,6 @@ const Home = () => {
position: "relative", position: "relative",
}} }}
> >
{/* <Carousel
indicators={false}
animation="fade"
autoPlay={false}
className="home-background-container"
>
{latestMedia.isSuccess &&
latestMedia.data.length != 0 &&
latestMedia.data.map((item, index) => {
return (
<ErrorBoundary
fallback={() => {
console.log(
"error with home backdrop",
item.Name,
);
}}
>
<Paper
sx={{
background: "red",
width: "100vw",
height: "100vh",
}}
key={index}
className="home-backdrop-container"
>
{item.BackdropImageTags
.length != 0 && (
<Blurhash
hash={
item
.ImageBlurHashes
.Backdrop[
Object.keys(
item
.ImageBlurHashes
.Backdrop,
)[0]
]
}
width="1080"
height="720"
resolutionX={64}
resolutionY={96}
punch={1}
className="home-backdrop"
/>
)}
</Paper>
</ErrorBoundary>
);
})}
</Carousel> */}
<Carousel <Carousel
className="hero-carousel" className="hero-carousel"
autoPlay={false} autoPlay={false}
@@ -325,92 +271,47 @@ const Home = () => {
key={index} key={index}
> >
<div className="hero-carousel-background-container"> <div className="hero-carousel-background-container">
{item.Type == {Object.keys(
BaseItemKind.MusicAlbum ? ( item.ImageBlurHashes
!!item.ParentBackdropItemId && ( .Backdrop,
<> ).length != 0 && (
<Blurhash <Blurhash
hash={ hash={
item
.ImageBlurHashes
.Backdrop[
Object.keys(
item item
.ImageBlurHashes .ImageBlurHashes
.Backdrop[ .Backdrop,
item )[0]
.ParentBackdropImageTags[0] ]
] }
} // hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj" width="1080"
width="1080" height="720"
height="720" resolutionX={
resolutionX={ 64
64 }
} resolutionY={
resolutionY={ 96
96 }
} className="hero-carousel-background-blurhash"
className="hero-carousel-background-blurhash" punch={1}
punch={ />
1
}
/>
<div
className="hero-carousel-background-image"
style={{
backgroundImage: `url(${window.api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop)`,
}}
></div>
</>
)
) : item.ImageBlurHashes
.Backdrop ? (
<>
{item
.BackdropImageTags
.length !=
0 && (
<Blurhash
hash={
item
.ImageBlurHashes
.Backdrop[
Object.keys(
item
.ImageBlurHashes
.Backdrop,
)[0]
]
}
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
width="1080"
height="720"
resolutionX={
64
}
resolutionY={
96
}
className="hero-carousel-background-blurhash"
punch={
1
}
/>
)}
<div
className="hero-carousel-background-image"
style={{
backgroundImage: `url(${
window
.api
.basePath +
"/Items/" +
item.Id +
"/Images/Backdrop"
})`,
}}
></div>
</>
) : (
<div className="hero-carousel-background-image empty"></div>
)} )}
<div
className="hero-carousel-background-image"
style={{
backgroundImage: `url(${
window.api
.basePath +
"/Items/" +
item.Id +
"/Images/Backdrop"
})`,
}}
></div>
<div className="hero-carousel-background-icon-container"> <div className="hero-carousel-background-icon-container">
{ {
MediaTypeIconCollection[ MediaTypeIconCollection[