feat(web): Add new About page #258

This commit is contained in:
Prayag Prajapati committed 2024-02-17 16:56:58 +05:30
1 parent bf89f35ddd
commit b155daa83b
34 files changed
+1749 -758

No files matched your search

+2 -2
View File
@@ -157,8 +157,8 @@ $border-radius: 20px;
}
}
&-backdrop {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
+15 -3
View File
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import React, { useEffect, useLayoutEffect } from "react";
import React, { useEffect, useLayoutEffect, useRef } from "react";
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
@@ -11,7 +11,8 @@ import Typography from "@mui/material/Typography";
import { Link, NavLink, useParams } from "react-router-dom";
import { motion } from "framer-motion";
import { motion, useScroll } from "framer-motion";
import useParallax from "../../utils/hooks/useParallax";
import {
BaseItemKind,
@@ -170,6 +171,13 @@ const MusicAlbumTitlePage = () => {
}
}, [item.isSuccess]);
const pageRef = useRef(null);
const { scrollYProgress } = useScroll({
target: pageRef,
offset: ["start start", "60vh start"],
});
const parallax = useParallax(scrollYProgress, 50);
if (item.isPending || similarItems.isPending) {
return (
<Box
@@ -200,11 +208,12 @@ const MusicAlbumTitlePage = () => {
ease: "easeInOut",
}}
className="scrollY padded-top item item-album"
ref={pageRef}
>
<div className="item-hero flex flex-row">
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
<motion.img
alt={item.data.Name}
src={api.getItemImageUrl(
item.data.ParentBackdropItemId,
@@ -217,6 +226,9 @@ const MusicAlbumTitlePage = () => {
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
style={{
y: parallax,
}}
/>
) : (
<></>
+2 -2
View File
@@ -49,8 +49,8 @@
}
}
&-backdrop {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
+15 -3
View File
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import React, { useState, useEffect, useLayoutEffect } from "react";
import React, { useState, useEffect, useLayoutEffect, useRef } from "react";
import Box from "@mui/material/Box";
import CircularProgress from "@mui/material/CircularProgress";
@@ -8,7 +8,8 @@ import Tab from "@mui/material/Tab";
import Tabs from "@mui/material/Tabs";
import Typography from "@mui/material/Typography";
import { AnimatePresence, motion } from "framer-motion";
import { AnimatePresence, motion, useScroll } from "framer-motion";
import useParallax from "../../utils/hooks/useParallax";
import { Link, useParams } from "react-router-dom";
@@ -176,6 +177,13 @@ const ArtistTitlePage = () => {
}
}, [item.isSuccess]);
const pageRef = useRef(null);
const { scrollYProgress } = useScroll({
target: pageRef,
offset: ["start start", "60vh start"],
});
const parallax = useParallax(scrollYProgress, 50);
if (item.isPending) {
return (
<Box
@@ -206,10 +214,11 @@ const ArtistTitlePage = () => {
ease: "easeInOut",
}}
className="scrollY item item-artist"
ref={pageRef}
>
<div className="item-hero flex flex-row">
<div className="item-hero-backdrop-container">
<img
<motion.img
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
tag: item.data.BackdropImageTags[0],
@@ -218,6 +227,9 @@ const ArtistTitlePage = () => {
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
style={{
y: parallax,
}}
/>
</div>
<div
+2 -2
View File
@@ -49,8 +49,8 @@
}
}
&-backdrop {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
+15 -3
View File
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import React, { useState, useEffect, useLayoutEffect } from "react";
import React, { useState, useEffect, useLayoutEffect, useRef } from "react";
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
@@ -9,7 +9,8 @@ import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { Link, useNavigate, useParams } from "react-router-dom";
import { motion } from "framer-motion";
import { motion, useScroll } from "framer-motion";
import useParallax from "../../utils/hooks/useParallax";
import {
BaseItemKind,
@@ -128,6 +129,13 @@ const BoxSetTitlePage = () => {
}
}, [item.isSuccess]);
const pageRef = useRef(null);
const { scrollYProgress } = useScroll({
target: pageRef,
offset: ["start start", "60vh start"],
});
const parallax = useParallax(scrollYProgress, 50);
if (item.isPending || similarItems.isPending) {
return (
<Box
@@ -158,17 +166,21 @@ const BoxSetTitlePage = () => {
ease: "easeInOut",
}}
className="scrollY item item-boxset padded-top"
ref={pageRef}
>
<div className="item-hero flex flex-row">
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
<motion.img
alt={item.data.Name}
src={meshBg}
className="item-hero-backdrop"
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
style={{
y: parallax,
}}
/>
) : (
<></>
+2 -2
View File
@@ -52,8 +52,8 @@
}
}
&-backdrop {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
+18 -3
View File
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import React, { useState, useLayoutEffect } from "react";
import React, { useState, useLayoutEffect, useRef } from "react";
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
@@ -16,7 +16,8 @@ import { Blurhash } from "react-blurhash";
import { Link, NavLink, useParams } from "react-router-dom";
import { motion } from "framer-motion";
import { motion, useScroll } from "framer-motion";
import useParallax from "../../utils/hooks/useParallax";
import {
BaseItemKind,
@@ -219,6 +220,9 @@ const EpisodeTitlePage = () => {
) {
return "Dolby Digital+";
}
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("dd")) {
return "Dolby Digital";
}
return "";
};
@@ -233,6 +237,13 @@ const EpisodeTitlePage = () => {
return "2.0";
};
const pageRef = useRef(null);
const { scrollYProgress } = useScroll({
target: pageRef,
offset: ["start start", "60vh start"],
});
const parallax = useParallax(scrollYProgress, 50);
if (item.isPending) {
return (
<Box
@@ -263,11 +274,12 @@ const EpisodeTitlePage = () => {
ease: "easeInOut",
}}
className="scrollY padded-top flex flex-column item item-episode"
ref={pageRef}
>
<div className="item-hero flex flex-row">
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
<motion.img
alt={item.data.Name}
src={api.getItemImageUrl(
item.data.ParentBackdropItemId,
@@ -280,6 +292,9 @@ const EpisodeTitlePage = () => {
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
style={{
y: parallax,
}}
/>
) : (
<></>
+1 -1
View File
@@ -421,4 +421,4 @@ const Home = () => {
);
};
export default Home;
export default React.memo(Home);
+33 -14
View File
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import React, { useState, useLayoutEffect } from "react";
import React, { useState, useLayoutEffect, useRef } from "react";
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
@@ -16,7 +16,8 @@ import { Blurhash } from "react-blurhash";
import { Link, NavLink, useParams } from "react-router-dom";
import { motion } from "framer-motion";
import { motion, useScroll } from "framer-motion";
import useParallax from "../../utils/hooks/useParallax";
import {
BaseItemKind,
@@ -47,6 +48,8 @@ import { endsAt, getRuntime } from "../../utils/date/time";
import { useApi } from "../../utils/store/api";
import { useBackdropStore } from "../../utils/store/backdrop";
import ItemSkeleton from "../../components/skeleton/item";
function TabPanel(props) {
const { children, value, index, ...other } = props;
@@ -245,6 +248,9 @@ const ItemDetail = () => {
) {
return "Dolby Digital+";
}
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("dd")) {
return "Dolby Digital";
}
return "";
};
@@ -258,19 +264,28 @@ const ItemDetail = () => {
return "2.0";
};
const pageRef = useRef(null);
const { scrollYProgress } = useScroll({
layoutEffect: false,
target: pageRef,
offset: ["start start", "60vh start"],
});
const parallax = useParallax(scrollYProgress, 50);
if (item.isPending || similarItems.isPending) {
return (
<Box
sx={{
width: "100%",
height: "100vh",
display: "flex",
alignItems: "center",
justifyContent: "center",
}}
>
<CircularProgress />
</Box>
// <Box
// sx={{
// width: "100%",
// height: "100vh",
// display: "flex",
// alignItems: "center",
// justifyContent: "center",
// }}
// >
// <CircularProgress />
// </Box>
<ItemSkeleton />
);
}
@@ -289,11 +304,12 @@ const ItemDetail = () => {
ease: "easeInOut",
}}
className="scrollY padded-top flex flex-column item item-default"
ref={pageRef}
>
<div className="item-hero flex flex-row">
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
<motion.img
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
tag: item.data.BackdropImageTags[0],
@@ -302,6 +318,9 @@ const ItemDetail = () => {
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
style={{
y: parallax,
}}
/>
) : (
<></>
+2 -2
View File
@@ -49,8 +49,8 @@
}
}
&-backdrop {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
+21 -4
View File
@@ -33,7 +33,7 @@ import { useSnackbar } from "notistack";
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
import { AvatarImage } from "../../components/avatar/avatar.jsx";
import { Card } from "../../components/card/card.jsx";
import { Card } from "../../components/card/card";
import { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-api";
@@ -117,7 +117,14 @@ export const LoginWithImage = () => {
);
return auth;
} catch (error) {
enqueueSnackbar("Incorrect Password!", { variant: "error" });
if (error.response.status === 500) {
enqueueSnackbar(
"Unable to connect to server. Please try again after some time.",
{ variant: "error" },
);
} else {
enqueueSnackbar("Incorrect Password.", { variant: "error" });
}
setLoading(false);
console.error(error);
}
@@ -175,12 +182,22 @@ export const LoginWithImage = () => {
elevation={2}
>
<Typography
textAlign="left"
textAlign="center"
variant="h5"
sx={{ opacity: 0.8 }}
mb={2}
>
Login as {userName}:
Login as{" "}
<Typography
variant="h5"
style={{
display: "inline",
}}
fontWeight={700}
className="gradient-text"
>
{userName}
</Typography>
</Typography>
<FormGroup
sx={{
+15 -3
View File
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import React, { useState, useEffect, useLayoutEffect } from "react";
import React, { useState, useEffect, useLayoutEffect, useRef } from "react";
import Box from "@mui/material/Box";
import CircularProgress from "@mui/material/CircularProgress";
@@ -8,7 +8,8 @@ import Tab from "@mui/material/Tab";
import Tabs from "@mui/material/Tabs";
import Typography from "@mui/material/Typography";
import { AnimatePresence, motion } from "framer-motion";
import { AnimatePresence, motion, useScroll } from "framer-motion";
import useParallax from "../../utils/hooks/useParallax";
import { Link, useParams } from "react-router-dom";
@@ -242,6 +243,13 @@ const PersonTitlePage = () => {
const [animationDirection, setAnimationDirection] = useState("forward");
const pageRef = useRef(null);
const { scrollYProgress } = useScroll({
target: pageRef,
offset: ["start start", "60vh start"],
});
const parallax = useParallax(scrollYProgress, 50);
if (item.isPending) {
return (
<Box
@@ -273,16 +281,20 @@ const PersonTitlePage = () => {
ease: "easeInOut",
}}
className="scrollY padded-top item item-person flex flex-column"
ref={pageRef}
>
<div className="item-hero flex flex-row">
<div className="item-hero-backdrop-container">
<img
<motion.img
alt={item.data.Name}
src={meshBg}
className="item-hero-backdrop"
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
style={{
y: parallax,
}}
/>
</div>
<div
+2 -2
View File
@@ -71,8 +71,8 @@
}
}
&-backdrop {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
+15 -3
View File
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import React, { useState, useEffect, useLayoutEffect } from "react";
import React, { useState, useEffect, useLayoutEffect, useRef } from "react";
import Box from "@mui/material/Box";
import MuiCard from "@mui/material/Card";
@@ -16,7 +16,8 @@ import TextField from "@mui/material/TextField";
import Typography from "@mui/material/Typography";
import { green, red, yellow } from "@mui/material/colors";
import { motion } from "framer-motion";
import { motion, useScroll } from "framer-motion";
import useParallax from "../../utils/hooks/useParallax";
import { useParams } from "react-router-dom";
@@ -240,6 +241,13 @@ const SeriesTitlePage = () => {
}
}, [seasons.isSuccess]);
const pageRef = useRef(null);
const { scrollYProgress } = useScroll({
target: pageRef,
offset: ["start start", "60vh start"],
});
const parallax = useParallax(scrollYProgress, 50);
if (item.isPending || similarItems.isPending) {
return (
<Box
@@ -271,11 +279,12 @@ const SeriesTitlePage = () => {
ease: "easeInOut",
}}
className="scrollY padded-top flex flex-column item item-series"
ref={pageRef}
>
<div className="item-hero flex flex-row">
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
<motion.img
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
tag: item.data.BackdropImageTags[0],
@@ -284,6 +293,9 @@ const SeriesTitlePage = () => {
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
style={{
y: parallax,
}}
/>
) : (
<></>
+2 -2
View File
@@ -50,8 +50,8 @@
}
}
&-backdrop {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
-5
View File
@@ -1,5 +0,0 @@
const Settings = () => {
return <h1>WIP Settings</h1>;
};
export default Settings;