chore(web): add new person page #243
This commit is contained in:
6 files changed
+223
-54
No files matched your search
+1
-1
@@ -436,7 +436,7 @@ function AppReady() {
|
|||||||
{/* <SideMenu /> */}
|
{/* <SideMenu /> */}
|
||||||
<AppBar />
|
<AppBar />
|
||||||
<AudioPlayer key={audioPlayerVisible} />
|
<AudioPlayer key={audioPlayerVisible} />
|
||||||
<ErrorBoundary FallbackComponent={ErrorNotice}>
|
<ErrorBoundary FallbackComponent={ErrorNotice} key={location.key}>
|
||||||
<Routes location={location}>
|
<Routes location={location}>
|
||||||
{/* <Route
|
{/* <Route
|
||||||
// key={location.key}
|
// key={location.key}
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ import CardActionArea from "@mui/material/CardActionArea";
|
|||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
|
||||||
import { Blurhash } from "react-blurhash";
|
import { Blurhash } from "react-blurhash";
|
||||||
|
|
||||||
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
|
||||||
|
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
import "./card.module.scss";
|
import "./card.module.scss";
|
||||||
|
|
||||||
|
|||||||
@@ -48,27 +48,6 @@ export const ErrorNotice = ({ error, resetErrorBoundary }) => {
|
|||||||
>
|
>
|
||||||
{error.message}
|
{error.message}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button
|
|
||||||
size="large"
|
|
||||||
variant="contained"
|
|
||||||
onClick={resetErrorBoundary ? resetErrorBoundary : () => {}}
|
|
||||||
style={{
|
|
||||||
marginTop: "1em",
|
|
||||||
}}
|
|
||||||
color="info"
|
|
||||||
>
|
|
||||||
Close
|
|
||||||
</Button>
|
|
||||||
<Typography
|
|
||||||
variant="subitle1"
|
|
||||||
fontWeight={300}
|
|
||||||
style={{
|
|
||||||
marginTop: "1em",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Note: You need to click on CLOSE button if you change the page in order
|
|
||||||
to close this error message
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
+82
-29
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
@@ -25,9 +25,14 @@ import { useQuery } from "@tanstack/react-query";
|
|||||||
import { Card } from "../../components/card/card";
|
import { Card } from "../../components/card/card";
|
||||||
import Hero from "../../components/layouts/item/hero";
|
import Hero from "../../components/layouts/item/hero";
|
||||||
|
|
||||||
|
import { Blurhash } from "react-blurhash";
|
||||||
|
|
||||||
|
import LikeButton from "../../components/buttons/likeButton";
|
||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { setBackdrop } from "../../utils/store/backdrop";
|
||||||
|
|
||||||
|
import meshBg from "../../assets/herobg.png";
|
||||||
import "./person.module.scss";
|
import "./person.module.scss";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
@@ -206,7 +211,7 @@ const PersonTitlePage = () => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
useEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (
|
if (
|
||||||
personMovies.isSuccess &&
|
personMovies.isSuccess &&
|
||||||
personShows.isSuccess &&
|
personShows.isSuccess &&
|
||||||
@@ -226,23 +231,11 @@ const PersonTitlePage = () => {
|
|||||||
setActivePersonTab(4);
|
setActivePersonTab(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
setBackdrop("", "");
|
||||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
}, []);
|
||||||
|
|
||||||
const [animationDirection, setAnimationDirection] = useState("forward");
|
const [animationDirection, setAnimationDirection] = useState("forward");
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (item.isSuccess) {
|
|
||||||
setAppBackdrop(
|
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
|
||||||
item.data.Type === BaseItemKind.Episode
|
|
||||||
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
|
||||||
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
|
||||||
item.data.Id,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (item.isPending) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -273,22 +266,82 @@ const PersonTitlePage = () => {
|
|||||||
duration: 0.25,
|
duration: 0.25,
|
||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="scrollY"
|
className="scrollY padded-top"
|
||||||
|
>
|
||||||
|
<div className="item-hero flex flex-row">
|
||||||
|
<div className="item-hero-backdrop-container">
|
||||||
|
<img
|
||||||
|
alt={item.data.Name}
|
||||||
|
src={meshBg}
|
||||||
|
className="item-hero-backdrop"
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.currentTarget.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="item-hero-image-container"
|
||||||
style={{
|
style={{
|
||||||
padding: "5em 2em 2em 1em",
|
aspectRatio: item.data.PrimaryImageAspectRatio ?? 1,
|
||||||
display: "flex",
|
|
||||||
flexDirection: "column",
|
|
||||||
gap: "0.5em",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Hero
|
{Object.keys(item.data.ImageTags).includes("Primary") ? (
|
||||||
item={item.data}
|
<>
|
||||||
userId={user.data.Id}
|
<Blurhash
|
||||||
queryKey={["item", id]}
|
hash={
|
||||||
disableInfoStrip
|
item.data.ImageBlurHashes.Primary[
|
||||||
disablePlayButton
|
item.data.ImageTags.Primary
|
||||||
disableMarkAsPlayedButton
|
]
|
||||||
|
}
|
||||||
|
className="item-hero-image-blurhash"
|
||||||
/>
|
/>
|
||||||
|
<img
|
||||||
|
alt={item.data.Name}
|
||||||
|
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||||
|
quality: 90,
|
||||||
|
tag: item.data.ImageTags.Primary,
|
||||||
|
})}
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.currentTarget.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
className="item-hero-image"
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="item-hero-detail flex flex-column">
|
||||||
|
{Object.keys(item.data.ImageTags).includes("Logo") ? (
|
||||||
|
<img
|
||||||
|
alt={item.data.Name}
|
||||||
|
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||||
|
quality: 90,
|
||||||
|
fillWidth: 592,
|
||||||
|
fillHeight: 592,
|
||||||
|
})}
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.currentTarget.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
className="item-hero-logo"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Typography variant="h3">{item.data.Name}</Typography>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<LikeButton
|
||||||
|
itemName={item.data.Name}
|
||||||
|
itemId={item.data.Id}
|
||||||
|
queryKey={["item", id]}
|
||||||
|
isFavorite={item.data.UserData.IsFavorite}
|
||||||
|
userId={user.data.Id}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Typography variant="subtitle1" mx={1}>
|
||||||
|
{item.data.Overview ?? ""}
|
||||||
|
</Typography>
|
||||||
|
|
||||||
<div className="item-detail-person-container">
|
<div className="item-detail-person-container">
|
||||||
<div className="item-detail-person-header">
|
<div className="item-detail-person-header">
|
||||||
<Tabs
|
<Tabs
|
||||||
|
|||||||
@@ -19,3 +19,142 @@
|
|||||||
.col-4 {
|
.col-4 {
|
||||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
gap: 1em;
|
||||||
|
&-hero {
|
||||||
|
height: 50vh;
|
||||||
|
gap: 2em;
|
||||||
|
position: relative;
|
||||||
|
align-items: center;
|
||||||
|
&-image {
|
||||||
|
opacity: 0;
|
||||||
|
width: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
transition: opacity $transition-time-default;
|
||||||
|
&-container {
|
||||||
|
height: fit-content;
|
||||||
|
max-height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
box-shadow: $shadow-card;
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-shrink: 0;
|
||||||
|
position: relative;
|
||||||
|
width: 18% !important;
|
||||||
|
}
|
||||||
|
&-blurhash {
|
||||||
|
position: absolute !important;
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-logo {
|
||||||
|
max-width: 42rem;
|
||||||
|
max-height: 10rem;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity $transition-time-default;
|
||||||
|
object-position: bottom;
|
||||||
|
}
|
||||||
|
&-detail {
|
||||||
|
width: 100%;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 1em;
|
||||||
|
justify-content: end;
|
||||||
|
}
|
||||||
|
&-buttons {
|
||||||
|
&-container {
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-backdrop {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
object-position: top;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity $transition-time-default;
|
||||||
|
&-container {
|
||||||
|
filter: brightness(0.8);
|
||||||
|
position: absolute;
|
||||||
|
top: -4.4em;
|
||||||
|
left: -1.6em;
|
||||||
|
width: 100vw;
|
||||||
|
height: calc(50vh + 4.4em);
|
||||||
|
z-index: -1;
|
||||||
|
mask-image: linear-gradient(to top, transparent, black);
|
||||||
|
-webkit-mask-image: linear-gradient(
|
||||||
|
to top,
|
||||||
|
transparent,
|
||||||
|
black
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-detail {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 5px 35%;
|
||||||
|
justify-items: center;
|
||||||
|
align-items: start;
|
||||||
|
gap: 1em;
|
||||||
|
|
||||||
|
&-cast {
|
||||||
|
&-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1em;
|
||||||
|
}
|
||||||
|
&-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||||
|
gap: 1em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
&-card {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 6em 1fr;
|
||||||
|
gap: 0.5em;
|
||||||
|
align-items: center;
|
||||||
|
color: white !important;
|
||||||
|
text-decoration: none;
|
||||||
|
padding: 0.5em;
|
||||||
|
background: rgb(255 255 255 / 0);
|
||||||
|
transition: background $transition-time-default;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
&:hover {
|
||||||
|
background: rgb(255 255 255 / 0.1);
|
||||||
|
}
|
||||||
|
&-image,
|
||||||
|
&-icon {
|
||||||
|
width: 6em;
|
||||||
|
height: 6em;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius: 100%;
|
||||||
|
box-shadow: $shadow-card-image;
|
||||||
|
}
|
||||||
|
&-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 1em;
|
||||||
|
background: rgb(255 255 255 / 0.1);
|
||||||
|
.material-symbols-rounded {
|
||||||
|
font-size: 3em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-link {
|
||||||
|
color: white;
|
||||||
|
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||||
|
&:hover {
|
||||||
|
text-decoration-color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -36,5 +36,6 @@ export default defineConfig({
|
|||||||
minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
|
minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
|
||||||
// produce sourcemaps for debug builds
|
// produce sourcemaps for debug builds
|
||||||
sourcemap: !!process.env.TAURI_DEBUG,
|
sourcemap: !!process.env.TAURI_DEBUG,
|
||||||
|
cssCodeSplit: true
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user