Add criticsRating and improve icons and animations in itemPage
This commit is contained in:
12 files changed
+172
-52
No files matched your search
@@ -13,8 +13,7 @@ import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client/models/base-ite
|
|||||||
import { MediaStreamType } from "@jellyfin/sdk/lib/generated-client/models/media-stream-type";
|
import { MediaStreamType } from "@jellyfin/sdk/lib/generated-client/models/media-stream-type";
|
||||||
|
|
||||||
import { Card } from "../../card/card";
|
import { Card } from "../../card/card";
|
||||||
import { MdiStar } from "../../icons/mdiStar";
|
import { yellow, red } from "@mui/material/colors";
|
||||||
import { yellow } from "@mui/material/colors";
|
|
||||||
import { endsAt, getRuntime, getRuntimeFull } from "../../../utils/date/time";
|
import { endsAt, getRuntime, getRuntimeFull } from "../../../utils/date/time";
|
||||||
import LikeButton from "../../buttons/likeButton";
|
import LikeButton from "../../buttons/likeButton";
|
||||||
import MarkPlayedButton from "../../buttons/markPlayedButton";
|
import MarkPlayedButton from "../../buttons/markPlayedButton";
|
||||||
@@ -25,6 +24,7 @@ import { Blurhash } from "react-blurhash";
|
|||||||
import TextLink from "../../textLink";
|
import TextLink from "../../textLink";
|
||||||
|
|
||||||
import { useApi } from "../../../utils/store/api";
|
import { useApi } from "../../../utils/store/api";
|
||||||
|
import { ErrorBoundary } from "react-error-boundary";
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Props
|
* @typedef {Object} Props
|
||||||
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
||||||
@@ -418,6 +418,7 @@ const Hero = ({
|
|||||||
item.OfficialRating ?? "Not Rated"
|
item.OfficialRating ?? "Not Rated"
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<ErrorBoundary fallback={<></>}>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -426,13 +427,17 @@ const Hero = ({
|
|||||||
}}
|
}}
|
||||||
className="hero-carousel-info-rating"
|
className="hero-carousel-info-rating"
|
||||||
>
|
>
|
||||||
{item.CommunityRating ? (
|
<div
|
||||||
<>
|
className="material-symbols-rounded "
|
||||||
<MdiStar
|
style={{
|
||||||
sx={{
|
fontSize: "2.2em",
|
||||||
color: yellow[700],
|
color: yellow[700],
|
||||||
|
fontVariationSettings:
|
||||||
|
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
star
|
||||||
|
</div>
|
||||||
<Typography
|
<Typography
|
||||||
style={{
|
style={{
|
||||||
opacity: "0.8",
|
opacity: "0.8",
|
||||||
@@ -444,16 +449,38 @@ const Hero = ({
|
|||||||
10,
|
10,
|
||||||
) / 10}
|
) / 10}
|
||||||
</Typography>
|
</Typography>
|
||||||
</>
|
</div>
|
||||||
) : (
|
</ErrorBoundary>
|
||||||
|
<ErrorBoundary fallback={<></>}>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
gap: "0.25em",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
className="hero-carousel-info-rating"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="material-symbols-rounded "
|
||||||
|
style={{
|
||||||
|
color: red[400],
|
||||||
|
fontVariationSettings:
|
||||||
|
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
thumb_up
|
||||||
|
</div>
|
||||||
<Typography
|
<Typography
|
||||||
style={{ opacity: "0.8" }}
|
style={{
|
||||||
|
opacity: "0.8",
|
||||||
|
}}
|
||||||
variant="subtitle1"
|
variant="subtitle1"
|
||||||
>
|
>
|
||||||
No Community Rating
|
{item.CriticRating}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
</ErrorBoundary>
|
||||||
|
|
||||||
{!!item.RunTimeTicks && (
|
{!!item.RunTimeTicks && (
|
||||||
<Typography
|
<Typography
|
||||||
style={{ opacity: "0.8" }}
|
style={{ opacity: "0.8" }}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ $maskPercentage: 40%;
|
|||||||
|
|
||||||
&-name-logo {
|
&-name-logo {
|
||||||
width: 10.4em;
|
width: 10.4em;
|
||||||
height: 2.6em;
|
max-height: 2.6em;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
object-position: left;
|
object-position: left;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const EmptyNotice = () => {
|
|||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100vh",
|
height: "100%",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@@ -23,16 +23,14 @@ export const EmptyNotice = () => {
|
|||||||
style={{
|
style={{
|
||||||
fontSize: "10em",
|
fontSize: "10em",
|
||||||
color: yellow[800],
|
color: yellow[800],
|
||||||
"--clr": yellow[800],
|
fontVariationSettings:
|
||||||
|
'"FILL" 0, "wght" 100, "GRAD" 25, "opsz" 40',
|
||||||
|
"--clr": "rgb(249 168 37 / 30%)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
sentiment_dissatisfied
|
sentiment_dissatisfied
|
||||||
</div>
|
</div>
|
||||||
<Typography
|
<Typography variant="h3" fontWeight={100}>
|
||||||
variant="h3"
|
|
||||||
fontFamily="JetBrains Mono Variable"
|
|
||||||
fontWeight={100}
|
|
||||||
>
|
|
||||||
No results found
|
No results found
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -24,16 +24,14 @@ export const ErrorNotice = ({ error, resetErrorBoundary }) => {
|
|||||||
style={{
|
style={{
|
||||||
fontSize: "10em",
|
fontSize: "10em",
|
||||||
color: red[800],
|
color: red[800],
|
||||||
"--clr": red[800],
|
"--clr": "rgb(198 40 40 / 30%)",
|
||||||
|
fontVariationSettings:
|
||||||
|
'"FILL" 0, "wght" 100, "GRAD" 25, "opsz" 40',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
error
|
error
|
||||||
</div>
|
</div>
|
||||||
<Typography
|
<Typography variant="h3" fontWeight={100}>
|
||||||
variant="h3"
|
|
||||||
fontFamily="JetBrains Mono Variable"
|
|
||||||
fontWeight={100}
|
|
||||||
>
|
|
||||||
Something went wrong
|
Something went wrong
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
@@ -59,9 +57,20 @@ export const ErrorNotice = ({ error, resetErrorBoundary }) => {
|
|||||||
style={{
|
style={{
|
||||||
marginTop: "1em",
|
marginTop: "1em",
|
||||||
}}
|
}}
|
||||||
|
color="info"
|
||||||
>
|
>
|
||||||
Retry
|
Close
|
||||||
</Button>
|
</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>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -9,6 +9,8 @@ import Paper from "@mui/material/Paper";
|
|||||||
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
ItemFields,
|
ItemFields,
|
||||||
@@ -34,6 +36,7 @@ import { useBackdropStore } from "../../utils/store/backdrop";
|
|||||||
import LikeButton from "../../components/buttons/likeButton";
|
import LikeButton from "../../components/buttons/likeButton";
|
||||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -179,7 +182,18 @@ const MusicAlbumTitlePage = () => {
|
|||||||
}
|
}
|
||||||
if (item.isSuccess && similarItems.isSuccess) {
|
if (item.isSuccess && similarItems.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<div
|
<motion.div
|
||||||
|
key={id}
|
||||||
|
initial={{
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
style={{
|
style={{
|
||||||
padding: "5em 2em 2em 1em",
|
padding: "5em 2em 2em 1em",
|
||||||
@@ -418,7 +432,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
})}
|
})}
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
</div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isError || similarItems.isError) {
|
if (item.isError || similarItems.isError) {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
|||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import MusicTrack from "../../components/musicTrack";
|
import MusicTrack from "../../components/musicTrack";
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -197,7 +198,18 @@ const ArtistTitlePage = () => {
|
|||||||
}
|
}
|
||||||
if (item.isSuccess) {
|
if (item.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<div
|
<motion.div
|
||||||
|
key={id}
|
||||||
|
initial={{
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
style={{
|
style={{
|
||||||
padding: "5em 2em 2em 1em",
|
padding: "5em 2em 2em 1em",
|
||||||
@@ -401,7 +413,7 @@ const ArtistTitlePage = () => {
|
|||||||
</TabPanel>
|
</TabPanel>
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isError) {
|
if (item.isError) {
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import Box from "@mui/material/Box";
|
|||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
import { useParams, useNavigate } from "react-router-dom";
|
import { useParams, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
ItemFields,
|
ItemFields,
|
||||||
@@ -149,7 +151,18 @@ const BoxSetTitlePage = () => {
|
|||||||
}
|
}
|
||||||
if (item.isSuccess && similarItems.isSuccess) {
|
if (item.isSuccess && similarItems.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<div
|
<motion.div
|
||||||
|
key={id}
|
||||||
|
initial={{
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
style={{
|
style={{
|
||||||
padding: "5em 2em 2em 1em",
|
padding: "5em 2em 2em 1em",
|
||||||
@@ -312,7 +325,7 @@ const BoxSetTitlePage = () => {
|
|||||||
})}
|
})}
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
</div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isError || similarItems.isError) {
|
if (item.isError || similarItems.isError) {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import CircularProgress from "@mui/material/CircularProgress";
|
|||||||
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
ItemFields,
|
ItemFields,
|
||||||
@@ -27,6 +29,7 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
|||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import { ActorCard } from "../../components/card/actorCards";
|
import { ActorCard } from "../../components/card/actorCards";
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -175,7 +178,18 @@ const EpisodeTitlePage = () => {
|
|||||||
}
|
}
|
||||||
if (item.isSuccess) {
|
if (item.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<div
|
<motion.div
|
||||||
|
key={id}
|
||||||
|
initial={{
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
className="scrollY episode"
|
className="scrollY episode"
|
||||||
style={{
|
style={{
|
||||||
padding: "5em 2em 2em 1em",
|
padding: "5em 2em 2em 1em",
|
||||||
@@ -270,7 +284,7 @@ const EpisodeTitlePage = () => {
|
|||||||
)}
|
)}
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
</div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isError) {
|
if (item.isError) {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import CircularProgress from "@mui/material/CircularProgress";
|
|||||||
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
|
import { motion, AnimatePresence } from "framer-motion";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
ItemFields,
|
ItemFields,
|
||||||
@@ -29,6 +31,7 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
|||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import { ActorCard } from "../../components/card/actorCards";
|
import { ActorCard } from "../../components/card/actorCards";
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -200,9 +203,21 @@ const ItemDetail = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isSuccess && similarItems.isSuccess) {
|
if (item.isSuccess && similarItems.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<div
|
<motion.div
|
||||||
|
key={id}
|
||||||
|
initial={{
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
style={{
|
style={{
|
||||||
padding: "5em 2em 2em 1em",
|
padding: "5em 2em 2em 1em",
|
||||||
@@ -320,7 +335,7 @@ const ItemDetail = () => {
|
|||||||
})}
|
})}
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
</div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isError || similarItems.isError) {
|
if (item.isError || similarItems.isError) {
|
||||||
|
|||||||
@@ -267,7 +267,18 @@ const PersonTitlePage = () => {
|
|||||||
}
|
}
|
||||||
if (item.isSuccess) {
|
if (item.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<div
|
<motion.div
|
||||||
|
key={id}
|
||||||
|
initial={{
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
style={{
|
style={{
|
||||||
padding: "5em 2em 2em 1em",
|
padding: "5em 2em 2em 1em",
|
||||||
@@ -446,7 +457,7 @@ const PersonTitlePage = () => {
|
|||||||
})}
|
})}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isError) {
|
if (item.isError) {
|
||||||
|
|||||||
@@ -228,7 +228,18 @@ const SeriesTitlePage = () => {
|
|||||||
}
|
}
|
||||||
if (item.isSuccess && similarItems.isSuccess) {
|
if (item.isSuccess && similarItems.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<div
|
<motion.div
|
||||||
|
key={id}
|
||||||
|
initial={{
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
style={{
|
style={{
|
||||||
padding: "5em 2em 2em 1em",
|
padding: "5em 2em 2em 1em",
|
||||||
@@ -633,7 +644,7 @@ const SeriesTitlePage = () => {
|
|||||||
})}
|
})}
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
</div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isError || similarItems.isError) {
|
if (item.isError || similarItems.isError) {
|
||||||
|
|||||||
+7
-11
@@ -181,22 +181,18 @@ h1 {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
// filter: blur(10px);
|
||||||
filter: blur(10px);
|
animation: iconAnimation ease-out 1s infinite;
|
||||||
animation: iconAnimation cubic-bezier(0.175, 0.885, 0.32, 1.275) 3s
|
background: var(--clr);
|
||||||
infinite;
|
z-index: -1;
|
||||||
background: radial-gradient(transparent, var(--clr));
|
// background: radial-gradient(transparent, var(--clr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes iconAnimation {
|
@keyframes iconAnimation {
|
||||||
0% {
|
0% {
|
||||||
opacity: 0;
|
opacity: 1;
|
||||||
transform: translate(-50%, -50%) scale(1);
|
transform: translate(-50%, -50%) scale(0);
|
||||||
}
|
|
||||||
60% {
|
|
||||||
opacity: 0.1;
|
|
||||||
transform: translate(-50%, -50%) scale(4);
|
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
Reference in new issue
Block a user