diff --git a/src/App.jsx b/src/App.jsx index e7b7f10..48ff2ee 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -359,33 +359,34 @@ function App() { - + + + +
- - - diff --git a/src/components/menu/sidemenu.jsx b/src/components/menu/sidemenu.jsx index aa7a282..ad1488a 100644 --- a/src/components/menu/sidemenu.jsx +++ b/src/components/menu/sidemenu.jsx @@ -129,8 +129,10 @@ export const SideMenu = ({}) => { }, }} sx={{ + zIndex: 1, width: `calc(${theme.spacing(7)} + 10px)`, - background: theme.palette.background.paper, + background: + "linear-gradient(to right, rgb(0 0 0 / 0.35) , transparent) !important ", }} > { justifyContent: "center", }} > - {libraries.isLoading ? ( <> { )} - { return (
diff --git a/src/routes/home/home.module.scss b/src/routes/home/home.module.scss index efab4e3..b821b79 100644 --- a/src/routes/home/home.module.scss +++ b/src/routes/home/home.module.scss @@ -43,12 +43,16 @@ right: 0; bottom: 0; opacity: 0.8; - mask-image: linear-gradient(to bottom, black, transparent); + mask-image: linear-gradient(to bottom, black 40%, transparent), + linear-gradient(to left, black 40%, transparent); -webkit-mask-image: linear-gradient( - to bottom, - black, - transparent - ); + to bottom, + black 40%, + transparent + ), + linear-gradient(to left, black 40%, transparent); + mask-composite: source-in; + -webkit-mask-composite: source-in; } &-image { position: absolute; diff --git a/src/routes/home/index.jsx b/src/routes/home/index.jsx index f9a32dd..3ab7294 100644 --- a/src/routes/home/index.jsx +++ b/src/routes/home/index.jsx @@ -215,316 +215,277 @@ const Home = () => { position: "relative", }} > -
- } - activeIndicatorIconButtonProps={{ - style: { - background: "rgb(255 255 255)", - }, - }} - indicatorIconButtonProps={{ - style: { - background: "rgb(255 255 255 / 0.3)", - borderRadius: "2px", - width: "100%", - flexShrink: "1", - }, - }} - indicatorContainerProps={{ - className: "hero-carousel-indicator-container", - style: { - position: "absolute", - display: "flex", - gap: "1em", - zIndex: 1, - }, - }} - sx={{ - marginBottom: "1.5em", - }} - onChange={(now) => { - console.log(latestMedia.data[now]); - setAppBackdrop( - `${window.api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`, - latestMedia.data[now].Id, - ); - }} - duration={400} - interval={10000} - > - {latestMedia.isLoading ? ( - - ) : ( - // <> - latestMedia.data.length != 0 && - latestMedia.data.map((item, index) => { - return ( - - } - > - + ) : ( +
+ } + activeIndicatorIconButtonProps={{ + style: { + background: "rgb(255 255 255)", + }, + }} + indicatorIconButtonProps={{ + style: { + background: "rgb(255 255 255 / 0.3)", + borderRadius: "2px", + width: "100%", + flexShrink: "1", + }, + }} + indicatorContainerProps={{ + className: + "hero-carousel-indicator-container", + style: { + position: "absolute", + display: "flex", + gap: "1em", + zIndex: 1, + }, + }} + sx={{ + marginBottom: "1.5em", + }} + onChange={(now) => { + if (latestMedia.isSuccess) { + setAppBackdrop( + `${window.api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`, + latestMedia.data[now].Id, + ); + } + }} + changeOnFirstRender={true} + duration={400} + interval={10000} + > + {latestMedia.data.length != 0 && + latestMedia.data.map((item, index) => { + return ( + + } > -
- {Object.keys( - item.ImageBlurHashes - .Backdrop, - ).length != 0 && ( - - )} -
-
- { - MediaTypeIconCollection[ - item.Type - ] - } -
-
- - - {!item.ImageTags - .Logo ? ( - item.Name - ) : ( - +
+ {Object.keys( + item + .ImageBlurHashes + .Backdrop, + ).length != 0 && ( + + )} +
+
+ { + MediaTypeIconCollection[ item - .ImageTags - .Logo + .Type + ] + } +
+
+ + + {!item + .ImageTags + .Logo ? ( + item.Name + ) : ( + + )} + + + } + className="hero-carousel-info" + > + + {!!item.ProductionYear + ? item.ProductionYear + : "Unknown"} + + - )} -
- - } - className="hero-carousel-info" - > - - {!!item.ProductionYear - ? item.ProductionYear - : "Unknown"} - - - - {!!item.CommunityRating ? ( - <> - + className="hero-carousel-info-rating" + > + {!!item.CommunityRating ? ( + <> + + + {Math.round( + item.CommunityRating * + 10, + ) / + 10} + + + ) : ( - {Math.round( - item.CommunityRating * - 10, - ) / - 10} + No + Community + Rating - - ) : ( + )} + + {!!item.RunTimeTicks && ( - No - Community - Rating + {getRuntime( + item.RunTimeTicks, + )} )} -
- {!!item.RunTimeTicks && ( - - {getRuntime( - item.RunTimeTicks, - )} - - )} - {!!item.RunTimeTicks && ( - - {endsAt( - item.RunTimeTicks, - )} - - )} - - - {item.Overview} - - - {item.UserData - .PlaybackPositionTicks > - 0 && ( - + {endsAt( + item.RunTimeTicks, + )} + + )} + + { }} transition={{ duration: 0.25, - delay: 0.3, + delay: 0.2, }} whileInView={{ y: 0, @@ -544,99 +505,144 @@ const Home = () => { y: 10, opacity: 0, }} - direction="row" - gap="1em" - mt={2} - width="50%" - alignItems="center" - justifyContent="center" + variant="subtitle1" + className="hero-carousel-text" + sx={{ + display: "-webkit-box", + maxWidth: + "70%", + maxHeight: + "30%", + textOverflow: + "ellipsis", + overflow: + "hidden", + WebkitLineClamp: + "4", + WebkitBoxOrient: + "vertical", + opacity: 0.7, + }} > - + + {item.UserData + .PlaybackPositionTicks > + 0 && ( + - {getRuntime( - item.RunTimeTicks - + + {getRuntime( + item.RunTimeTicks - + item + .UserData + .PlaybackPositionTicks, + )}{" "} + + - + + )} + {/* TODO Link PLay and More info buttons in carousel */} + + + - + variant="outlined" + endIcon={ + + } + onClick={() => + navigate( + `/item/${item.Id}`, + ) + } + > + More info + + - - -
- ); - }) - )} - + + + ); + })} + + )} { state.setSelectedSubtitleTrack, ]); + const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]); + const [directors, setDirectors] = useState([]); const [writers, setWriters] = useState([]); useEffect(() => { if (item.isSuccess) { + setAppBackdrop( + item.data.Type === BaseItemKind.MusicAlbum || + item.data.Type === BaseItemKind.Episode + ? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop` + : `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`, + item.data.Id, + ); let direTp = item.data.People.filter( (itm) => itm.Type == "Director", ); @@ -566,46 +576,6 @@ const ItemDetail = () => { if (item.isSuccess && similarItems.isSuccess) { return ( <> - - {item.data.BackdropImageTags.length != 0 && ( - - )} - {!!item.data.ParentBackdropImageTags && - item.data.ParentBackdropImageTags.length != 0 && ( - - )} -