Start working on new titlePage #160
This commit is contained in:
16 files changed
+143
-2831
No files matched your search
+25
@@ -470,6 +470,31 @@ function App() {
|
||||
path="/item/:id"
|
||||
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
|
||||
path="/favourite"
|
||||
element={<FavouritePage />}
|
||||
|
||||
@@ -84,12 +84,13 @@ const LikeButton = ({ itemId, isFavorite, queryKey, userId, itemName }) => {
|
||||
queryClient.setQueryData(queryKey, context.previousData);
|
||||
console.error(error);
|
||||
setIsError(true);
|
||||
setIsLoading(false);
|
||||
},
|
||||
onSuccess: () => {
|
||||
console.log("Successfully updated", itemId);
|
||||
queryClient.invalidateQueries(queryKey);
|
||||
setIsSuccess(true);
|
||||
},
|
||||
onSettled: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -82,12 +82,13 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
||||
queryClient.setQueryData(queryKey, context.previousData);
|
||||
console.error(error);
|
||||
setIsError(true);
|
||||
setIsLoading(false);
|
||||
},
|
||||
onSuccess: () => {
|
||||
console.log("Successfully updated", itemId);
|
||||
queryClient.invalidateQueries(queryKey);
|
||||
setIsSuccess(true);
|
||||
},
|
||||
onSettled: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
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 { MdiPlayOutline } from "../icons/mdiPlayOutline";
|
||||
import {
|
||||
@@ -115,14 +115,16 @@ const PlayButton = ({
|
||||
};
|
||||
if (iconOnly) {
|
||||
return (
|
||||
<IconButton
|
||||
<Fab
|
||||
color="primary"
|
||||
aria-label="Play"
|
||||
className={className}
|
||||
onClick={handleClick}
|
||||
sx={sx}
|
||||
{...buttonProps}
|
||||
>
|
||||
<MdiPlayOutline {...iconProps} />
|
||||
</IconButton>
|
||||
</Fab>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
|
||||
@@ -51,11 +51,11 @@ export const Card = ({
|
||||
cardType,
|
||||
queryKey,
|
||||
userId,
|
||||
availableImagesTypes,
|
||||
seriesId,
|
||||
|
||||
hideText,
|
||||
onClick,
|
||||
disableOverlay = false,
|
||||
disablePadding,
|
||||
}) => {
|
||||
const ref = useRef();
|
||||
const isVisible = useIntersecting(ref);
|
||||
@@ -63,7 +63,7 @@ export const Card = ({
|
||||
const defaultOnClick = () => navigate(`/item/${item.Id}`);
|
||||
return (
|
||||
<CardActionArea
|
||||
sx={{ padding: 1, borderRadius: "10px" }}
|
||||
sx={{ padding: disablePadding ? 0 : 1, borderRadius: "10px" }}
|
||||
className="card-container"
|
||||
onClick={!!onClick ? onClick : defaultOnClick}
|
||||
>
|
||||
@@ -204,7 +204,7 @@ export const Card = ({
|
||||
currentVideoTrack={0}
|
||||
className="card-play-button"
|
||||
iconProps={{
|
||||
sx: { fontSize: "1.5em" },
|
||||
sx: { fontSize: "2.5em" },
|
||||
}}
|
||||
iconOnly
|
||||
/>
|
||||
@@ -245,7 +245,11 @@ export const Card = ({
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
<Box className="card-text-container" height="15%">
|
||||
<Box
|
||||
className="card-text-container"
|
||||
height="15%"
|
||||
style={{ display: hideText ? "none" : "block" }}
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
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;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
&-blurhash {
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
/** @format */
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||
import { Card } from "../../components/card/card";
|
||||
import { CardsSkeleton } from "../skeleton/cards";
|
||||
import { CardScroller } from "../../cardScroller/cardScroller";
|
||||
import { Card } from "../../card/card";
|
||||
import { CardsSkeleton } from "../../skeleton/cards";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-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
|
||||
import { Card } from "../../components/card/card";
|
||||
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 { 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 { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-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 { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||
|
||||
const Home = () => {
|
||||
const authUser = useQuery({
|
||||
queryKey: ["home", "authenticateUser"],
|
||||
|
||||
+13
-2733
File diff suppressed because it is too large.
Load diff
@@ -1,84 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
.item-detail {
|
||||
&-heading {
|
||||
opacity: 0.85;
|
||||
}
|
||||
&-backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: inherit;
|
||||
height: 100%;
|
||||
z-index: -2;
|
||||
opacity: 0.2;
|
||||
}
|
||||
&-header {
|
||||
&-hero {
|
||||
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%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
transition: opacity $transition-time-default;
|
||||
&-blurhash {
|
||||
z-index: -1;
|
||||
}
|
||||
&-container {
|
||||
width: 15%;
|
||||
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;
|
||||
}
|
||||
gap: 2em;
|
||||
}
|
||||
&-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;
|
||||
&-primaryImage {
|
||||
width: 26%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
Whitespace-only changes.
Reference in new issue
Block a user