Fix carousel breaking homePage

This commit is contained in:
prayag17 committed 2023-05-01 19:37:27 +05:30
1 parent fbe31a190a
commit 2570c96f31
4 files changed
+138 -10

No files matched your search

+2 -2
View File
@@ -84,7 +84,7 @@
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
margin-bottom: 0.5em; margin-bottom: 0.5em;
&-logo { &-logo {
max-width: 6em; max-width: 10em;
height: 2em; height: 2em;
object-fit: contain; object-fit: contain;
object-position: bottom; object-position: bottom;
@@ -96,7 +96,7 @@
display: flex; display: flex;
height: 70vh; height: 70vh;
width: 70%; width: 70%;
padding: 0 2em 2em 2em; padding: 2em;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: flex-start; align-items: flex-start;
+38 -3
View File
@@ -47,6 +47,7 @@ import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { endsAt, getRuntime } from "../../utils/date/time"; import { endsAt, getRuntime } from "../../utils/date/time";
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
const Home = () => { const Home = () => {
const authUser = useQuery({ const authUser = useQuery({
@@ -94,7 +95,7 @@ const Home = () => {
const media = await getUserLibraryApi(window.api).getLatestMedia( const media = await getUserLibraryApi(window.api).getLatestMedia(
{ {
userId: user.data.Id, userId: user.data.Id,
fields: "Overview", fields: [ItemFields.Overview, ItemFields.ParentId],
enableUserData: true, enableUserData: true,
}, },
); );
@@ -252,8 +253,42 @@ const Home = () => {
key={index} key={index}
> >
<div className="hero-carousel-background-container"> <div className="hero-carousel-background-container">
{item.ImageBlurHashes {item.Type ==
.Backdrop ? ( BaseItemKind.MusicAlbum ? (
item
.ParentBackdropImageTags
.length != 0 && (
<>
<Blurhash
hash={
item
.ImageBlurHashes
.Backdrop[
item
.ParentBackdropImageTags[0]
]
}
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
width="1080"
height="720"
resolutionX={
64
}
resolutionY={
96
}
className="hero-carousel-background-blurhash"
/>
<div
className="hero-carousel-background-image"
style={{
backgroundImage: `url(${window.api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop)`,
}}
></div>
</>
)
) : item.ImageBlurHashes
.Backdrop ? (
<> <>
<Blurhash <Blurhash
hash={ hash={
+94 -4
View File
@@ -1563,6 +1563,24 @@ const ItemDetail = () => {
md={ md={
1 1
} }
component={
motion.div
}
initial={{
y: 30,
opacity: 0,
}}
animate={{
y: 0,
opacity: 1,
}}
transition={{
duration: 0.35,
ease: "easeInOut",
delay:
mindex *
0.05,
}}
> >
<Card <Card
itemName={ itemName={
@@ -1677,6 +1695,24 @@ const ItemDetail = () => {
md={ md={
1 1
} }
component={
motion.div
}
initial={{
y: 30,
opacity: 0,
}}
animate={{
y: 0,
opacity: 1,
}}
transition={{
duration: 0.35,
ease: "easeInOut",
delay:
mindex *
0.05,
}}
> >
<Card <Card
itemName={ itemName={
@@ -1791,6 +1827,24 @@ const ItemDetail = () => {
md={ md={
1 1
} }
component={
motion.div
}
initial={{
y: 30,
opacity: 0,
}}
animate={{
y: 0,
opacity: 1,
}}
transition={{
duration: 0.35,
ease: "easeInOut",
delay:
mindex *
0.05,
}}
> >
<Card <Card
itemName={ itemName={
@@ -1905,6 +1959,24 @@ const ItemDetail = () => {
md={ md={
1 1
} }
component={
motion.div
}
initial={{
y: 30,
opacity: 0,
}}
animate={{
y: 0,
opacity: 1,
}}
transition={{
duration: 0.35,
ease: "easeInOut",
delay:
mindex *
0.05,
}}
> >
<Card <Card
itemName={ itemName={
@@ -2019,6 +2091,24 @@ const ItemDetail = () => {
md={ md={
1 1
} }
component={
motion.div
}
initial={{
y: 30,
opacity: 0,
}}
animate={{
y: 0,
opacity: 1,
}}
transition={{
duration: 0.35,
ease: "easeInOut",
delay:
mindex *
0.05,
}}
> >
<EpisodeCard <EpisodeCard
itemId={ itemId={
@@ -2243,13 +2333,13 @@ const ItemDetail = () => {
(mitem, mindex) => { (mitem, mindex) => {
return ( return (
<Grid2 <Grid2
component={
motion.div
}
key={mitem.Id} key={mitem.Id}
xs={1} xs={1}
sm={1} sm={1}
md={1} md={1}
component={
motion.div
}
initial={{ initial={{
y: 30, y: 30,
opacity: 0, opacity: 0,
@@ -2259,7 +2349,7 @@ const ItemDetail = () => {
opacity: 1, opacity: 1,
}} }}
transition={{ transition={{
duration: 0.45, duration: 0.35,
ease: "easeInOut", ease: "easeInOut",
delay: delay:
mindex * mindex *
+4 -1
View File
@@ -930,11 +930,11 @@ const LibraryView = () => {
{items.data.Items.map((item, index) => { {items.data.Items.map((item, index) => {
return ( return (
<Grid2 <Grid2
component={motion.div}
key={item.Id} key={item.Id}
xs={1} xs={1}
sm={1} sm={1}
md={1} md={1}
component={motion.div}
initial={{ initial={{
scale: 0.8, scale: 0.8,
opacity: 0, opacity: 0,
@@ -1005,6 +1005,9 @@ const LibraryView = () => {
: "" : ""
} }
currentUser={user.data} currentUser={user.data}
favourite={
item.UserData.IsFavorite
}
></Card> ></Card>
</Grid2> </Grid2>
); );