Start working on new titlePage #160
This commit is contained in:
16 files changed
+137
-2825
No files matched your search
+25
@@ -470,6 +470,31 @@ function App() {
|
|||||||
path="/item/:id"
|
path="/item/:id"
|
||||||
element={<ItemDetail />}
|
element={<ItemDetail />}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
exact
|
||||||
|
path="/album/:id"
|
||||||
|
element={<ItemDetail />}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
exact
|
||||||
|
path="/artist/:id"
|
||||||
|
element={<ItemDetail />}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
exact
|
||||||
|
path="/collection/:id"
|
||||||
|
element={<ItemDetail />}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
exact
|
||||||
|
path="/person/:id"
|
||||||
|
element={<ItemDetail />}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
exact
|
||||||
|
path="/series/:id"
|
||||||
|
element={<ItemDetail />}
|
||||||
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/favourite"
|
path="/favourite"
|
||||||
element={<FavouritePage />}
|
element={<FavouritePage />}
|
||||||
|
|||||||
@@ -84,12 +84,13 @@ const LikeButton = ({ itemId, isFavorite, queryKey, userId, itemName }) => {
|
|||||||
queryClient.setQueryData(queryKey, context.previousData);
|
queryClient.setQueryData(queryKey, context.previousData);
|
||||||
console.error(error);
|
console.error(error);
|
||||||
setIsError(true);
|
setIsError(true);
|
||||||
setIsLoading(false);
|
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
console.log("Successfully updated", itemId);
|
console.log("Successfully updated", itemId);
|
||||||
queryClient.invalidateQueries(queryKey);
|
queryClient.invalidateQueries(queryKey);
|
||||||
setIsSuccess(true);
|
setIsSuccess(true);
|
||||||
|
},
|
||||||
|
onSettled: () => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -82,12 +82,13 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
|||||||
queryClient.setQueryData(queryKey, context.previousData);
|
queryClient.setQueryData(queryKey, context.previousData);
|
||||||
console.error(error);
|
console.error(error);
|
||||||
setIsError(true);
|
setIsError(true);
|
||||||
setIsLoading(false);
|
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
console.log("Successfully updated", itemId);
|
console.log("Successfully updated", itemId);
|
||||||
queryClient.invalidateQueries(queryKey);
|
queryClient.invalidateQueries(queryKey);
|
||||||
setIsSuccess(true);
|
setIsSuccess(true);
|
||||||
|
},
|
||||||
|
onSettled: () => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import Fab from "@mui/material/Fab";
|
||||||
import LinearProgress from "@mui/material/LinearProgress";
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
import { MdiPlayOutline } from "../icons/mdiPlayOutline";
|
import { MdiPlayOutline } from "../icons/mdiPlayOutline";
|
||||||
import {
|
import {
|
||||||
@@ -115,14 +115,16 @@ const PlayButton = ({
|
|||||||
};
|
};
|
||||||
if (iconOnly) {
|
if (iconOnly) {
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<Fab
|
||||||
|
color="primary"
|
||||||
|
aria-label="Play"
|
||||||
className={className}
|
className={className}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
sx={sx}
|
sx={sx}
|
||||||
{...buttonProps}
|
{...buttonProps}
|
||||||
>
|
>
|
||||||
<MdiPlayOutline {...iconProps} />
|
<MdiPlayOutline {...iconProps} />
|
||||||
</IconButton>
|
</Fab>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ export const Card = ({
|
|||||||
cardType,
|
cardType,
|
||||||
queryKey,
|
queryKey,
|
||||||
userId,
|
userId,
|
||||||
availableImagesTypes,
|
|
||||||
seriesId,
|
seriesId,
|
||||||
|
hideText,
|
||||||
onClick,
|
onClick,
|
||||||
disableOverlay = false,
|
disableOverlay = false,
|
||||||
|
disablePadding,
|
||||||
}) => {
|
}) => {
|
||||||
const ref = useRef();
|
const ref = useRef();
|
||||||
const isVisible = useIntersecting(ref);
|
const isVisible = useIntersecting(ref);
|
||||||
@@ -63,7 +63,7 @@ export const Card = ({
|
|||||||
const defaultOnClick = () => navigate(`/item/${item.Id}`);
|
const defaultOnClick = () => navigate(`/item/${item.Id}`);
|
||||||
return (
|
return (
|
||||||
<CardActionArea
|
<CardActionArea
|
||||||
sx={{ padding: 1, borderRadius: "10px" }}
|
sx={{ padding: disablePadding ? 0 : 1, borderRadius: "10px" }}
|
||||||
className="card-container"
|
className="card-container"
|
||||||
onClick={!!onClick ? onClick : defaultOnClick}
|
onClick={!!onClick ? onClick : defaultOnClick}
|
||||||
>
|
>
|
||||||
@@ -204,7 +204,7 @@ export const Card = ({
|
|||||||
currentVideoTrack={0}
|
currentVideoTrack={0}
|
||||||
className="card-play-button"
|
className="card-play-button"
|
||||||
iconProps={{
|
iconProps={{
|
||||||
sx: { fontSize: "1.5em" },
|
sx: { fontSize: "2.5em" },
|
||||||
}}
|
}}
|
||||||
iconOnly
|
iconOnly
|
||||||
/>
|
/>
|
||||||
@@ -245,7 +245,11 @@ export const Card = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Box className="card-text-container" height="15%">
|
<Box
|
||||||
|
className="card-text-container"
|
||||||
|
height="15%"
|
||||||
|
style={{ display: hideText ? "none" : "block" }}
|
||||||
|
>
|
||||||
<Typography
|
<Typography
|
||||||
variant="subtitle1"
|
variant="subtitle1"
|
||||||
fontWeight={500}
|
fontWeight={500}
|
||||||
@@ -271,4 +275,18 @@ export const Card = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Card.propTypes = {};
|
Card.propTypes = {
|
||||||
|
item: PropTypes.any.isRequired,
|
||||||
|
cardTitle: PropTypes.string,
|
||||||
|
cardCaption: PropTypes.string,
|
||||||
|
imageType: PropTypes.string,
|
||||||
|
imageBlurhash: PropTypes.string,
|
||||||
|
cardType: PropTypes.string,
|
||||||
|
queryKey: PropTypes.any,
|
||||||
|
userId: PropTypes.string.isRequired,
|
||||||
|
seriesId: PropTypes.string,
|
||||||
|
hideText: PropTypes.bool,
|
||||||
|
onClick: PropTypes.func,
|
||||||
|
disableOverlay: PropTypes.bool,
|
||||||
|
disablePadding: PropTypes.bool,
|
||||||
|
};
|
||||||
@@ -27,8 +27,10 @@
|
|||||||
background: $clr-gradient-dark;
|
background: $clr-gradient-dark;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: absolute;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-blurhash {
|
&-blurhash {
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
import { CardScroller } from "../../cardScroller/cardScroller";
|
||||||
import { Card } from "../../components/card/card";
|
import { Card } from "../../card/card";
|
||||||
import { CardsSkeleton } from "../skeleton/cards";
|
import { CardsSkeleton } from "../../skeleton/cards";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { Card } from "../../card/card";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
|
||||||
|
const Hero = ({ item, queryKey, userId }) => {
|
||||||
|
return (
|
||||||
|
<div className="item-detail-hero">
|
||||||
|
<div className="item-detail-primaryImage">
|
||||||
|
<Card
|
||||||
|
item={item}
|
||||||
|
seriesId={item.SeriesId}
|
||||||
|
imageType={"Primary"}
|
||||||
|
cardType={
|
||||||
|
item.Type == BaseItemKind.MusicAlbum ||
|
||||||
|
item.Type == BaseItemKind.Audio
|
||||||
|
? "square"
|
||||||
|
: "portrait"
|
||||||
|
}
|
||||||
|
queryKey={queryKey}
|
||||||
|
userId={userId}
|
||||||
|
imageBlurhash={
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
hideText
|
||||||
|
disablePadding
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="item-detail-hero-info-container">
|
||||||
|
<div className="item-name">
|
||||||
|
<Typography
|
||||||
|
variant="h3"
|
||||||
|
noWrap={true}
|
||||||
|
fontWeight={600}
|
||||||
|
>
|
||||||
|
{item.Name}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
marginTop: "1em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
variant="subtitle1"
|
||||||
|
style={{ opacity: "0.7" }}
|
||||||
|
>
|
||||||
|
{item.Overview}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Hero;
|
||||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -17,16 +17,10 @@ import Carousel from "../../components/carousel";
|
|||||||
// Custom Components
|
// Custom Components
|
||||||
import { Card } from "../../components/card/card";
|
import { Card } from "../../components/card/card";
|
||||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||||
import { LatestMediaSection } from "../../components/homeSection/latestMediaSection";
|
import { LatestMediaSection } from "../../components/layouts/homeSection/latestMediaSection";
|
||||||
import { CarouselSkeleton } from "../../components/skeleton/carousel";
|
import { CarouselSkeleton } from "../../components/skeleton/carousel";
|
||||||
import { CardsSkeleton } from "../../components/skeleton/cards";
|
import { CardsSkeleton } from "../../components/skeleton/cards";
|
||||||
|
|
||||||
// Icons
|
|
||||||
import { MediaTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
|
|
||||||
import { MdiStar } from "../../components/icons/mdiStar";
|
|
||||||
import { MdiPlayOutline } from "../../components/icons/mdiPlayOutline";
|
|
||||||
import { MdiChevronRight } from "../../components/icons/mdiChevronRight";
|
|
||||||
|
|
||||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
@@ -39,6 +33,7 @@ import { useBackdropStore } from "../../utils/store/backdrop";
|
|||||||
|
|
||||||
import CarouselSlide from "../../components/carouselSlide";
|
import CarouselSlide from "../../components/carouselSlide";
|
||||||
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
const authUser = useQuery({
|
const authUser = useQuery({
|
||||||
queryKey: ["home", "authenticateUser"],
|
queryKey: ["home", "authenticateUser"],
|
||||||
|
|||||||
+8
-2728
File diff suppressed because it is too large.
Load diff
@@ -1,84 +1,13 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
.item-detail {
|
.item-detail {
|
||||||
&-heading {
|
&-hero {
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
&-backdrop {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: inherit;
|
|
||||||
height: 100%;
|
|
||||||
z-index: -2;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
&-header {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1em;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: flex-end;
|
|
||||||
position: relative;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
&-backdrop {
|
|
||||||
position: absolute;
|
|
||||||
width: 100vw;
|
|
||||||
height: 80vh;
|
|
||||||
top: -88px;
|
|
||||||
width: 100vw;
|
|
||||||
right: 0;
|
|
||||||
left: -24px;
|
|
||||||
z-index: -2;
|
|
||||||
filter: brightness(0.6);
|
|
||||||
mask-image: linear-gradient(0deg, transparent, black 75%);
|
|
||||||
-webkit-mask-image: linear-gradient(
|
|
||||||
0deg,
|
|
||||||
transparent,
|
|
||||||
black 75%
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-image {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
gap: 2em;
|
||||||
object-fit: cover;
|
|
||||||
object-position: top;
|
|
||||||
transition: opacity $transition-time-default;
|
|
||||||
&-blurhash {
|
|
||||||
z-index: -1;
|
|
||||||
}
|
}
|
||||||
&-container {
|
&-primaryImage {
|
||||||
width: 15%;
|
width: 26%;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
position: relative;
|
|
||||||
border-radius: $border-radius-default;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 0 0 15px rgb(0 0 0 / 0.4);
|
|
||||||
&.Episode {
|
|
||||||
flex-shrink: 0;
|
|
||||||
flex-grow: 0.25;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-icon-container {
|
|
||||||
background: $clr-gradient-dark;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: -2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-title-logo {
|
|
||||||
filter: drop-shadow(0 0 10px rgb(0 0 0 /0.2));
|
|
||||||
height: 100%;
|
|
||||||
max-height: 5em;
|
|
||||||
width: 45%;
|
|
||||||
object-fit: contain;
|
|
||||||
object-position: bottom;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Whitespace-only changes.
Whitespace-only changes.
Reference in new issue
Block a user