Fix carousel breaking homePage
This commit is contained in:
4 files changed
+138
-10
No files matched your search
@@ -84,7 +84,7 @@
|
||||
-webkit-line-clamp: 2;
|
||||
margin-bottom: 0.5em;
|
||||
&-logo {
|
||||
max-width: 6em;
|
||||
max-width: 10em;
|
||||
height: 2em;
|
||||
object-fit: contain;
|
||||
object-position: bottom;
|
||||
@@ -96,7 +96,7 @@
|
||||
display: flex;
|
||||
height: 70vh;
|
||||
width: 70%;
|
||||
padding: 0 2em 2em 2em;
|
||||
padding: 2em;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
@@ -47,6 +47,7 @@ import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||
|
||||
const Home = () => {
|
||||
const authUser = useQuery({
|
||||
@@ -94,7 +95,7 @@ const Home = () => {
|
||||
const media = await getUserLibraryApi(window.api).getLatestMedia(
|
||||
{
|
||||
userId: user.data.Id,
|
||||
fields: "Overview",
|
||||
fields: [ItemFields.Overview, ItemFields.ParentId],
|
||||
enableUserData: true,
|
||||
},
|
||||
);
|
||||
@@ -252,8 +253,42 @@ const Home = () => {
|
||||
key={index}
|
||||
>
|
||||
<div className="hero-carousel-background-container">
|
||||
{item.ImageBlurHashes
|
||||
.Backdrop ? (
|
||||
{item.Type ==
|
||||
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
|
||||
hash={
|
||||
|
||||
@@ -1563,6 +1563,24 @@ const ItemDetail = () => {
|
||||
md={
|
||||
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
|
||||
itemName={
|
||||
@@ -1677,6 +1695,24 @@ const ItemDetail = () => {
|
||||
md={
|
||||
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
|
||||
itemName={
|
||||
@@ -1791,6 +1827,24 @@ const ItemDetail = () => {
|
||||
md={
|
||||
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
|
||||
itemName={
|
||||
@@ -1905,6 +1959,24 @@ const ItemDetail = () => {
|
||||
md={
|
||||
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
|
||||
itemName={
|
||||
@@ -2019,6 +2091,24 @@ const ItemDetail = () => {
|
||||
md={
|
||||
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
|
||||
itemId={
|
||||
@@ -2243,13 +2333,13 @@ const ItemDetail = () => {
|
||||
(mitem, mindex) => {
|
||||
return (
|
||||
<Grid2
|
||||
component={
|
||||
motion.div
|
||||
}
|
||||
key={mitem.Id}
|
||||
xs={1}
|
||||
sm={1}
|
||||
md={1}
|
||||
component={
|
||||
motion.div
|
||||
}
|
||||
initial={{
|
||||
y: 30,
|
||||
opacity: 0,
|
||||
@@ -2259,7 +2349,7 @@ const ItemDetail = () => {
|
||||
opacity: 1,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.45,
|
||||
duration: 0.35,
|
||||
ease: "easeInOut",
|
||||
delay:
|
||||
mindex *
|
||||
|
||||
@@ -930,11 +930,11 @@ const LibraryView = () => {
|
||||
{items.data.Items.map((item, index) => {
|
||||
return (
|
||||
<Grid2
|
||||
component={motion.div}
|
||||
key={item.Id}
|
||||
xs={1}
|
||||
sm={1}
|
||||
md={1}
|
||||
component={motion.div}
|
||||
initial={{
|
||||
scale: 0.8,
|
||||
opacity: 0,
|
||||
@@ -1005,6 +1005,9 @@ const LibraryView = () => {
|
||||
: ""
|
||||
}
|
||||
currentUser={user.data}
|
||||
favourite={
|
||||
item.UserData.IsFavorite
|
||||
}
|
||||
></Card>
|
||||
</Grid2>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user