Start adding new Item Page #243
This commit is contained in:
12 files changed
+1248
-239
No files matched your search
@@ -217,9 +217,9 @@ export const AppBar = () => {
|
||||
textTransform: "none",
|
||||
}}
|
||||
size="large"
|
||||
className="appBar-text active"
|
||||
>
|
||||
<Typography
|
||||
className="appBar-text active"
|
||||
variant="subtitle1"
|
||||
fontWeight={600}
|
||||
>
|
||||
@@ -231,12 +231,11 @@ export const AppBar = () => {
|
||||
style={{
|
||||
textTransform: "none",
|
||||
}}
|
||||
// className="appBar-text "
|
||||
|
||||
className="appBar-text"
|
||||
size="large"
|
||||
color="white"
|
||||
>
|
||||
<Typography
|
||||
className="appBar-text "
|
||||
variant="subtitle1"
|
||||
fontWeight={600}
|
||||
>
|
||||
@@ -257,17 +256,15 @@ export const AppBar = () => {
|
||||
color={
|
||||
isBrowsingLibrary ? "primary" : "white"
|
||||
}
|
||||
|
||||
// ref={librariesText}
|
||||
className={
|
||||
isBrowsingLibrary
|
||||
? "appBar-text active"
|
||||
: "appBar-text"
|
||||
}
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={600}
|
||||
className={
|
||||
isBrowsingLibrary
|
||||
? "appBar-text active"
|
||||
: "appBar-text"
|
||||
}
|
||||
>
|
||||
Libraries
|
||||
</Typography>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
background: white;
|
||||
opacity: 0.7;
|
||||
position: absolute;
|
||||
bottom: -2.6px;
|
||||
bottom: 4.6px;
|
||||
left: 0;
|
||||
transform: scaleX(0);
|
||||
transition: transform $transition-time-fast,
|
||||
@@ -37,7 +37,7 @@
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
&::after {
|
||||
transform: scaleX(0.5);
|
||||
transform: scaleX(0.25);
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
opacity: 1;
|
||||
color: $clr-accent-default;
|
||||
&::after {
|
||||
transform: scaleX(0.75);
|
||||
transform: scaleX(0.5);
|
||||
opacity: 1;
|
||||
background: $clr-accent-default;
|
||||
}
|
||||
@@ -115,6 +115,7 @@
|
||||
&::-webkit-scrollbar {
|
||||
&-thumb {
|
||||
width: 150px;
|
||||
max-width: 33%;
|
||||
}
|
||||
&-track {
|
||||
margin-left: 25px;
|
||||
|
||||
@@ -15,14 +15,7 @@ import CircularProgress from "@mui/material/CircularProgress";
|
||||
|
||||
import { useApi } from "../../utils/store/api";
|
||||
|
||||
const LikeButton = ({
|
||||
itemId,
|
||||
isFavorite,
|
||||
queryKey,
|
||||
userId,
|
||||
itemName,
|
||||
color = "white",
|
||||
}) => {
|
||||
const LikeButton = ({ itemId, isFavorite, queryKey, userId, itemName }) => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
const queryClient = useQueryClient();
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
@@ -36,7 +36,6 @@ const PlayButton = ({
|
||||
currentVideoTrack,
|
||||
className,
|
||||
sx,
|
||||
iconProps,
|
||||
buttonProps,
|
||||
iconOnly,
|
||||
audio = false,
|
||||
|
||||
+881
-21
@@ -3,11 +3,21 @@ import React, { useState, useEffect } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import { red, green, yellow } from "@mui/material/colors";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import {
|
||||
BaseItemKind,
|
||||
@@ -31,6 +41,14 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import { ActorCard } from "../../components/card/actorCards";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||
import PlayButton from "../../components/buttons/playButton";
|
||||
import LikeButton from "../../components/buttons/likeButton";
|
||||
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
|
||||
import TextLink from "../../components/textLink";
|
||||
import { getTypeIcon } from "../../components/utils/iconsCollection";
|
||||
import { NavLink } from "react-router-dom";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -146,6 +164,10 @@ const ItemDetail = () => {
|
||||
return false;
|
||||
};
|
||||
|
||||
const [selectedVideoTrack, setSelectedVideoTrack] = useState(null);
|
||||
const [selectedAudioTrack, setSelectedAudioTrack] = useState(null);
|
||||
const [selectedSubtitleTrack, setSelectedSubtitleTrack] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (item.isSuccess && !!item.data.MediaStreams) {
|
||||
let videos = item.data.MediaStreams.filter(
|
||||
@@ -158,6 +180,10 @@ const ItemDetail = () => {
|
||||
filterMediaStreamSubtitle,
|
||||
);
|
||||
|
||||
setSelectedVideoTrack(videos[0]?.Index ?? null);
|
||||
setSelectedAudioTrack(audios[0]?.Index ?? null);
|
||||
setSelectedSubtitleTrack(subs[0]?.Index ?? null);
|
||||
|
||||
setVideoTracks(videos);
|
||||
setAudioTracks(audios);
|
||||
setSubtitleTracks(subs);
|
||||
@@ -168,6 +194,8 @@ const ItemDetail = () => {
|
||||
|
||||
const [directors, setDirectors] = useState([]);
|
||||
const [writers, setWriters] = useState([]);
|
||||
const [actors, setActors] = useState([]);
|
||||
const [producers, setProducers] = useState([]);
|
||||
useEffect(() => {
|
||||
if (item.isSuccess) {
|
||||
setAppBackdrop(
|
||||
@@ -185,9 +213,74 @@ const ItemDetail = () => {
|
||||
(itm) => itm.Type == "Writer",
|
||||
);
|
||||
setWriters(writeTp);
|
||||
let producerTp = item.data.People.filter(
|
||||
(itm) => itm.Type == "Producer",
|
||||
);
|
||||
setProducers(producerTp);
|
||||
let actorTp = item.data.People.filter(
|
||||
(itm) => itm.Type == "Actor",
|
||||
);
|
||||
setActors(actorTp);
|
||||
}
|
||||
}, [item.isSuccess]);
|
||||
|
||||
const qualityLabel = () => {
|
||||
if (
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"2160p",
|
||||
) ||
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k")
|
||||
) {
|
||||
return "4K";
|
||||
} else if (
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"1080p",
|
||||
) ||
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd")
|
||||
) {
|
||||
return "HD";
|
||||
} else {
|
||||
return "SD";
|
||||
}
|
||||
};
|
||||
|
||||
const atmosLabel = () => {
|
||||
if (
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"atmos",
|
||||
) &&
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"truehd",
|
||||
)
|
||||
) {
|
||||
return "TrueHD | Atmos";
|
||||
} else if (
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"atmos",
|
||||
)
|
||||
) {
|
||||
return "Atmos";
|
||||
} else if (
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"truehd",
|
||||
)
|
||||
) {
|
||||
return "TrueHD";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
const surroundSoundLabel = () => {
|
||||
if (audioTracks[0]?.DisplayTitle.includes("7.1")) {
|
||||
return "7.1";
|
||||
} else if (audioTracks[0]?.DisplayTitle.includes("5.1")) {
|
||||
return "5.1";
|
||||
} else {
|
||||
return "2.0";
|
||||
}
|
||||
};
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -218,26 +311,793 @@ const ItemDetail = () => {
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY"
|
||||
style={{
|
||||
padding: "5em 2em 2em 1em",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: "0.5em",
|
||||
}}
|
||||
className="scrollY padded-top flex flex-column item"
|
||||
>
|
||||
<Hero
|
||||
item={item.data}
|
||||
userId={user.data.Id}
|
||||
queryKey={["item", id]}
|
||||
writers={writers}
|
||||
directors={directors}
|
||||
videoTracks={videoTracks}
|
||||
audioTracks={audioTracks}
|
||||
subtitleTracks={subtitleTracks}
|
||||
enableVideoInfoStrip
|
||||
/>
|
||||
{item.data.People.length > 0 && (
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.BackdropImageTags ? (
|
||||
<img
|
||||
src={api.getItemImageUrl(
|
||||
item.data.Id,
|
||||
"Backdrop",
|
||||
{
|
||||
quality: 90,
|
||||
},
|
||||
)}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) =>
|
||||
(e.currentTarget.style.opacity = 1)
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
className="item-hero-image-container"
|
||||
style={{
|
||||
aspectRatio:
|
||||
item.data.PrimaryImageAspectRatio ?? 1,
|
||||
}}
|
||||
>
|
||||
{Object.keys(item.data.ImageTags).includes(
|
||||
"Primary",
|
||||
) ? (
|
||||
<>
|
||||
<Blurhash
|
||||
hash={
|
||||
item.data.ImageBlurHashes
|
||||
.Primary[
|
||||
item.data.ImageTags[
|
||||
"Primary"
|
||||
]
|
||||
]
|
||||
}
|
||||
className="item-hero-image-blurhash"
|
||||
/>
|
||||
<img
|
||||
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
|
||||
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>
|
||||
)}
|
||||
<Stack direction="row" gap={1}>
|
||||
{!!qualityLabel() && (
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={
|
||||
<Typography
|
||||
variant="caption"
|
||||
fontWeight={600}
|
||||
// fontFamily="JetBrains Mono Variable"
|
||||
>
|
||||
{qualityLabel()}
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{!!surroundSoundLabel() && (
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={
|
||||
<Typography
|
||||
variant="caption"
|
||||
fontWeight={600}
|
||||
fontFamily="JetBrains Mono Variable"
|
||||
>
|
||||
{surroundSoundLabel()}
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{!!videoTracks[0]?.VideoRangeType && (
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={
|
||||
<Typography
|
||||
variant="caption"
|
||||
fontWeight={600}
|
||||
fontFamily="JetBrains Mono Variable"
|
||||
>
|
||||
{
|
||||
videoTracks[0]
|
||||
.VideoRangeType
|
||||
}
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{!!atmosLabel() && (
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={
|
||||
<Typography
|
||||
variant="caption"
|
||||
fontWeight={600}
|
||||
fontFamily="JetBrains Mono Variable"
|
||||
>
|
||||
{atmosLabel()}
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{!!subtitleTracks.length > 0 && (
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={
|
||||
<Typography
|
||||
variant="caption"
|
||||
fontWeight={600}
|
||||
fontFamily="JetBrains Mono Variable"
|
||||
>
|
||||
CC
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Stack>
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={2}
|
||||
justifyItems="flex-start"
|
||||
alignItems="center"
|
||||
>
|
||||
<Typography
|
||||
style={{ opacity: "0.8" }}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{item.data.ProductionYear ?? ""}
|
||||
</Typography>
|
||||
{item.data.OfficialRating && (
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={item.data.OfficialRating}
|
||||
/>
|
||||
)}
|
||||
|
||||
{item.data.CommunityRating && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.25em",
|
||||
alignItems: "center",
|
||||
}}
|
||||
className="hero-carousel-info-rating"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
style={{
|
||||
// fontSize: "2.2em",
|
||||
color: yellow[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
star
|
||||
</div>
|
||||
<Typography
|
||||
style={{
|
||||
opacity: "0.8",
|
||||
}}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{Math.round(
|
||||
item.data
|
||||
.CommunityRating *
|
||||
10,
|
||||
) / 10}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
{item.data.CriticRating && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.25em",
|
||||
alignItems: "center",
|
||||
}}
|
||||
className="hero-carousel-info-rating"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
style={{
|
||||
color:
|
||||
item.data
|
||||
.CriticRating >
|
||||
50
|
||||
? green[400]
|
||||
: red[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
{item.data.CriticRating > 50
|
||||
? "thumb_up"
|
||||
: "thumb_down"}
|
||||
</div>
|
||||
<Typography
|
||||
style={{
|
||||
opacity: "0.8",
|
||||
}}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{item.data.CriticRating}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{item.data.RunTimeTicks && (
|
||||
<Typography
|
||||
style={{ opacity: "0.8" }}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{getRuntime(
|
||||
item.data.RunTimeTicks,
|
||||
)}
|
||||
</Typography>
|
||||
)}
|
||||
{item.data.RunTimeTicks && (
|
||||
<Typography
|
||||
style={{ opacity: "0.8" }}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{endsAt(
|
||||
item.data.RunTimeTicks -
|
||||
item.data.UserData
|
||||
.PlaybackPositionTicks,
|
||||
)}
|
||||
</Typography>
|
||||
)}
|
||||
</Stack>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
style={{ opacity: 0.8 }}
|
||||
>
|
||||
{item.data.Genres.join(", ")}
|
||||
</Typography>
|
||||
|
||||
<div className="item-hero-buttons-container flex flex-row">
|
||||
<div className="flex flex-row">
|
||||
<PlayButton
|
||||
itemId={item.data.Id}
|
||||
itemType={item.data.Type}
|
||||
itemUserData={item.data.UserData}
|
||||
currentAudioTrack={0}
|
||||
currentVideoTrack={0}
|
||||
currentSubTrack={0}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="flex flex-row"
|
||||
style={{ gap: "1em" }}
|
||||
>
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isFavorite={
|
||||
item.data.UserData.IsFavorite
|
||||
}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isPlayed={
|
||||
item.data.UserData.Played
|
||||
}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-detail">
|
||||
<div style={{ width: "100%" }}>
|
||||
{100 >
|
||||
item.data.UserData.PlayedPercentage >
|
||||
0 && (
|
||||
<div
|
||||
style={{
|
||||
width: "40%",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
>
|
||||
<Typography>
|
||||
{getRuntime(
|
||||
item.data.RunTimeTicks -
|
||||
item.data.UserData
|
||||
.PlaybackPositionTicks,
|
||||
)}{" "}
|
||||
left
|
||||
</Typography>
|
||||
<LinearProgress
|
||||
color="white"
|
||||
variant="determinate"
|
||||
value={
|
||||
item.data.UserData
|
||||
.PlayedPercentage
|
||||
}
|
||||
style={{
|
||||
borderRadius: "10px",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<Typography
|
||||
variant="h5"
|
||||
fontStyle="italic"
|
||||
mb={1}
|
||||
>
|
||||
{item.data.Taglines[0] ?? ""}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{item.data.Overview ?? ""}
|
||||
</Typography>
|
||||
{writers.length > 0 && (
|
||||
<div className="hero-grid">
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
style={{
|
||||
opacity: 0.6,
|
||||
}}
|
||||
noWrap
|
||||
>
|
||||
Written by
|
||||
</Typography>
|
||||
<div className="hero-text-container">
|
||||
{writers.map((writer, index) => (
|
||||
<>
|
||||
<TextLink
|
||||
key={writer.Id}
|
||||
variant={
|
||||
"subtitle1"
|
||||
}
|
||||
location={`/person/${writer.Id}`}
|
||||
>
|
||||
{writer.Name}
|
||||
</TextLink>
|
||||
{index !=
|
||||
writers.length -
|
||||
1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace:
|
||||
"pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{directors.length > 0 && (
|
||||
<div className="hero-grid">
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
style={{
|
||||
opacity: 0.6,
|
||||
}}
|
||||
noWrap
|
||||
>
|
||||
Directed by
|
||||
</Typography>
|
||||
<div className="hero-text-container">
|
||||
{directors.map(
|
||||
(director, index) => (
|
||||
<>
|
||||
<TextLink
|
||||
key={
|
||||
director.Id
|
||||
}
|
||||
variant={
|
||||
"subtitle1"
|
||||
}
|
||||
location={`/person/${director.Id}`}
|
||||
>
|
||||
{director.Name}
|
||||
</TextLink>
|
||||
{index !=
|
||||
directors.length -
|
||||
1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace:
|
||||
"pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<Divider flexItem orientation="vertical" />
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
{videoTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Video"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedVideoTrack}
|
||||
onChange={(e) =>
|
||||
setSelectedVideoTrack(
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
>
|
||||
{videoTracks.map((track) => (
|
||||
<MenuItem
|
||||
key={track.Index}
|
||||
value={track.Index}
|
||||
>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
{audioTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Audio"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedAudioTrack}
|
||||
onChange={(e) =>
|
||||
setSelectedAudioTrack(
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
>
|
||||
{audioTracks.map((track) => (
|
||||
<MenuItem
|
||||
key={track.Index}
|
||||
value={track.Index}
|
||||
>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
{subtitleTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Subtitle"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
value={selectedSubtitleTrack}
|
||||
onChange={(e) =>
|
||||
setSelectedSubtitleTrack(
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
>
|
||||
{subtitleTracks.map((track) => (
|
||||
<MenuItem
|
||||
key={track.Index}
|
||||
value={track.Index}
|
||||
>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "end",
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-detail-cast">
|
||||
<Typography variant="h5" mb={2}>
|
||||
Cast & Crew
|
||||
</Typography>
|
||||
{actors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Actors</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{actors.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
src={api.getItemImageUrl(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon(
|
||||
"Person",
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{writers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Writers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{writers.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
src={api.getItemImageUrl(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon(
|
||||
"Person",
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{directors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">
|
||||
Directors
|
||||
</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{directors.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
to={`/person/${actor.Id}`}
|
||||
key={actor.Id}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
src={api.getItemImageUrl(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon(
|
||||
"Person",
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{producers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">
|
||||
Producers
|
||||
</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{producers.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
src={api.getItemImageUrl(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon(
|
||||
"Person",
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{/* {item.data.People.length > 0 && (
|
||||
<CardScroller
|
||||
title="Cast & Crew"
|
||||
displayCards={8}
|
||||
@@ -262,7 +1122,7 @@ const ItemDetail = () => {
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
)} */}
|
||||
{similarItems.data.TotalRecordCount > 0 && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
|
||||
@@ -1 +1,138 @@
|
||||
/** @format */
|
||||
.item {
|
||||
gap: 1em;
|
||||
&-hero {
|
||||
height: 50vh;
|
||||
gap: 2em;
|
||||
position: relative;
|
||||
&-image {
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
transition: opacity $transition-time-default;
|
||||
&-container {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: $border-radius-default;
|
||||
width: fit-content;
|
||||
box-shadow: $shadow-card;
|
||||
flex-grow: 1;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
max-width: 26%;
|
||||
}
|
||||
&-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, 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
width: 4.5em;
|
||||
height: 4.5em;
|
||||
aspect-ratio: 1;
|
||||
border-radius: $border-radius-intensity-1;
|
||||
border-radius: $border-radius_04;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 7px rgb(0 0 0 / 0.2);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@ div::-webkit-scrollbar {
|
||||
}
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: $clr-secondary-default;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Noto Sans";
|
||||
background: $clr-background-default;
|
||||
@@ -208,6 +212,9 @@ h1 {
|
||||
&-row {
|
||||
flex-direction: row;
|
||||
}
|
||||
&-column {
|
||||
flex-direction: column;
|
||||
}
|
||||
&-center {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -22,8 +22,11 @@ $clr-gradient-dark: linear-gradient(
|
||||
$clr-secondary-dark
|
||||
);
|
||||
|
||||
$border-radius-default: 6px;
|
||||
$border-radius-intensity-1: 4px;
|
||||
$border-radius-default: 10px;
|
||||
$border-radius_04: 4px;
|
||||
|
||||
$transition-time-default: 250ms;
|
||||
$transition-time-fast: 150ms;
|
||||
|
||||
$shadow-card: 0 4px 12px rgb(0 0 0 / 0.4);
|
||||
$shadow-card-image: 0 2px 8px rgb(0 0 0 / 0.25);
|
||||
@@ -64,6 +64,9 @@ export const theme = createTheme({
|
||||
// border: "1.8px solid hsl(273, 100%, 36%)",
|
||||
},
|
||||
},
|
||||
defaultProps: {
|
||||
disableScrollLock: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user