feat(web): Add new About page #258
This commit is contained in:
34 files changed
+1749
-758
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
- # v0.0.5-dev
|
||||||
|
> **Note** : This is an unstable release
|
||||||
|
- feat(web): Add new About page (#258) by @prayag17
|
||||||
+16
-15
@@ -17,20 +17,21 @@
|
|||||||
"@fontsource-variable/jetbrains-mono": "^5.0.19",
|
"@fontsource-variable/jetbrains-mono": "^5.0.19",
|
||||||
"@fontsource/noto-sans": "^5.0.18",
|
"@fontsource/noto-sans": "^5.0.18",
|
||||||
"@jellyfin/sdk": "0.8.2",
|
"@jellyfin/sdk": "0.8.2",
|
||||||
"@mui/lab": "5.0.0-alpha.162",
|
"@mui/lab": "5.0.0-alpha.165",
|
||||||
"@mui/material": "^5.15.6",
|
"@mui/material": "^5.15.10",
|
||||||
"@tanstack/react-query": "^5.17.19",
|
"@tanstack/react-query": "^5.21.2",
|
||||||
"@tanstack/react-query-devtools": "^5.17.21",
|
"@tanstack/react-query-devtools": "^5.21.3",
|
||||||
"@tauri-apps/api": "^1.5.3",
|
"@tauri-apps/api": "^1.5.3",
|
||||||
"@types/node": "^20.11.5",
|
"@types/node": "^20.11.19",
|
||||||
"@types/react": "^18.2.48",
|
"@types/react": "^18.2.56",
|
||||||
"@types/react-dom": "^18.2.18",
|
"@types/react-dom": "^18.2.19",
|
||||||
"axios": "^1.6.5",
|
"axios": "^1.6.7",
|
||||||
"axios-tauri-api-adapter": "^0.2.1",
|
"axios-tauri-api-adapter": "^0.2.1",
|
||||||
"blurhash": "^2.0.5",
|
"blurhash": "^2.0.5",
|
||||||
"events": "^3.3.0",
|
"events": "^3.3.0",
|
||||||
"framer-motion": "^11.0.2",
|
"framer-motion": "^11.0.5",
|
||||||
"material-symbols": "^0.14.5",
|
"material-symbols": "^0.15.0",
|
||||||
|
"million": "^3.0.3",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-blurhash": "^0.3.0",
|
"react-blurhash": "^0.3.0",
|
||||||
@@ -39,15 +40,15 @@
|
|||||||
"react-markdown": "^9.0.1",
|
"react-markdown": "^9.0.1",
|
||||||
"react-multi-carousel": "^2.8.4",
|
"react-multi-carousel": "^2.8.4",
|
||||||
"react-player": "^2.14.1",
|
"react-player": "^2.14.1",
|
||||||
"react-router-dom": "^6.21.3",
|
"react-router-dom": "^6.22.1",
|
||||||
"react-use-konami": "^1.1.0",
|
"react-use-konami": "^1.1.0",
|
||||||
"remark-gfm": "^4.0.0",
|
"remark-gfm": "^4.0.0",
|
||||||
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1",
|
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1",
|
||||||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"vite-plugin-svgr": "^4.2.0",
|
"vite-plugin-svgr": "^4.2.0",
|
||||||
"wavesurfer.js": "^7.6.5",
|
"wavesurfer.js": "^7.7.3",
|
||||||
"zustand": "^4.5.0"
|
"zustand": "^4.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^1.5.3",
|
"@biomejs/biome": "^1.5.3",
|
||||||
@@ -57,8 +58,8 @@
|
|||||||
"eslint-plugin-react": "^7.33.2",
|
"eslint-plugin-react": "^7.33.2",
|
||||||
"eslint-plugin-react-refresh": "^0.4.5",
|
"eslint-plugin-react-refresh": "^0.4.5",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"sass": "^1.70.0",
|
"sass": "^1.71.0",
|
||||||
"vite": "^5.0.12",
|
"vite": "^5.1.3",
|
||||||
"vite-plugin-compression": "^0.5.1"
|
"vite-plugin-compression": "^0.5.1"
|
||||||
},
|
},
|
||||||
"license": "GPL-3.0-only"
|
"license": "GPL-3.0-only"
|
||||||
|
|||||||
Generated
+703
-622
File diff suppressed because it is too large.
Load diff
+8
-13
@@ -5,6 +5,7 @@ import { AnimatePresence, motion } from "framer-motion";
|
|||||||
import { SnackbarProvider } from "notistack";
|
import { SnackbarProvider } from "notistack";
|
||||||
import {
|
import {
|
||||||
Navigate,
|
Navigate,
|
||||||
|
Outlet,
|
||||||
Route,
|
Route,
|
||||||
Routes,
|
Routes,
|
||||||
useLocation,
|
useLocation,
|
||||||
@@ -60,7 +61,6 @@ import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
|||||||
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
||||||
import SearchPage from "./routes/search";
|
import SearchPage from "./routes/search";
|
||||||
import SeriesTitlePage from "./routes/series/index.jsx";
|
import SeriesTitlePage from "./routes/series/index.jsx";
|
||||||
import Settings from "./routes/settings";
|
|
||||||
import { ServerSetup } from "./routes/setup/server";
|
import { ServerSetup } from "./routes/setup/server";
|
||||||
import ServerList from "./routes/setup/serverList/index.jsx";
|
import ServerList from "./routes/setup/serverList/index.jsx";
|
||||||
|
|
||||||
@@ -108,6 +108,7 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import { ErrorBoundary } from "react-error-boundary";
|
import { ErrorBoundary } from "react-error-boundary";
|
||||||
|
|
||||||
|
import Settings from "./components/settings";
|
||||||
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
||||||
import { handleRelaunch } from "./utils/misc/relaunch";
|
import { handleRelaunch } from "./utils/misc/relaunch";
|
||||||
import {
|
import {
|
||||||
@@ -240,10 +241,6 @@ function AppReady() {
|
|||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
window.scrollTo(0, 0);
|
|
||||||
}, [location.key]);
|
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
async function checkForUpdates() {
|
async function checkForUpdates() {
|
||||||
try {
|
try {
|
||||||
@@ -280,6 +277,8 @@ function AppReady() {
|
|||||||
return (
|
return (
|
||||||
<SnackbarProvider maxSnack={5}>
|
<SnackbarProvider maxSnack={5}>
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
|
<CssBaseline />
|
||||||
|
|
||||||
{playbackDataLoading && (
|
{playbackDataLoading && (
|
||||||
<LinearProgress
|
<LinearProgress
|
||||||
sx={{
|
sx={{
|
||||||
@@ -392,6 +391,8 @@ function AppReady() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
|
<Settings />
|
||||||
<EasterEgg />
|
<EasterEgg />
|
||||||
|
|
||||||
{/* Show Dialog if server not reachable */}
|
{/* Show Dialog if server not reachable */}
|
||||||
@@ -437,16 +438,11 @@ function AppReady() {
|
|||||||
transition: "padding 250ms",
|
transition: "padding 250ms",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CssBaseline />
|
|
||||||
{/* <SideMenu /> */}
|
{/* <SideMenu /> */}
|
||||||
<AppBar />
|
<AppBar />
|
||||||
{audioPlayerVisible && <AudioPlayer />}
|
{audioPlayerVisible && <AudioPlayer />}
|
||||||
<ErrorBoundary FallbackComponent={ErrorNotice} key={location.key}>
|
<ErrorBoundary FallbackComponent={ErrorNotice} key={location.key}>
|
||||||
<Routes location={location}>
|
<Routes location={location}>
|
||||||
{/* <Route
|
|
||||||
// key={location.key}
|
|
||||||
element={<AnimationWrapper />}
|
|
||||||
> */}
|
|
||||||
<Route path="/" element={<Navigate to={initialRoute} />} />
|
<Route path="/" element={<Navigate to={initialRoute} />} />
|
||||||
<Route
|
<Route
|
||||||
path="/error"
|
path="/error"
|
||||||
@@ -503,14 +499,13 @@ function AppReady() {
|
|||||||
<Route path="/series/:id" element={<SeriesTitlePage />} />
|
<Route path="/series/:id" element={<SeriesTitlePage />} />
|
||||||
<Route path="/search" element={<SearchPage />} />
|
<Route path="/search" element={<SearchPage />} />
|
||||||
<Route path="/favorite" element={<FavoritePage />} />
|
<Route path="/favorite" element={<FavoritePage />} />
|
||||||
<Route path="/settings" element={<Settings />} />
|
|
||||||
<Route path="/about" element={<About />} />
|
<Route path="/about" element={<About />} />
|
||||||
<Route path="/player" element={<VideoPlayer />} />
|
<Route path="/player" element={<VideoPlayer />} />
|
||||||
{/* </Route> */}
|
|
||||||
</Routes>
|
</Routes>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
</div>
|
</div>
|
||||||
<ReactQueryDevtools buttonPosition="top-left" />
|
|
||||||
|
<ReactQueryDevtools buttonPosition="bottom-right" />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</SnackbarProvider>
|
</SnackbarProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
}
|
}
|
||||||
&-avatar {
|
&-avatar {
|
||||||
background: $clr-gradient-dark;
|
background: rgb(255 255 255 / 0.1) !important;
|
||||||
&-icon {
|
&-icon {
|
||||||
fill: url(#clr-gradient-default) !important;
|
color: white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-text {
|
&-text {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import useScrollTrigger from "@mui/material/useScrollTrigger";
|
|||||||
|
|
||||||
import { red } from "@mui/material/colors";
|
import { red } from "@mui/material/colors";
|
||||||
|
|
||||||
import { NavLink, useLocation, useNavigate } from "react-router-dom";
|
import { Link, NavLink, useLocation, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||||
@@ -33,9 +33,13 @@ import "./appBar.module.scss";
|
|||||||
import { EventEmitter as event } from "../../eventEmitter";
|
import { EventEmitter as event } from "../../eventEmitter";
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
import { getTypeIcon } from "../../components/utils/iconsCollection";
|
import { getTypeIcon } from "../utils/iconsCollection";
|
||||||
|
|
||||||
import logo from "../../assets/icon.svg";
|
import logo from "../../assets/icon.svg";
|
||||||
|
import {
|
||||||
|
setSettingsDialogOpen,
|
||||||
|
setSettingsTabValue,
|
||||||
|
} from "../../utils/store/settings";
|
||||||
|
|
||||||
const forwardRefNavLink = React.forwardRef({
|
const forwardRefNavLink = React.forwardRef({
|
||||||
displayName: "NavLink",
|
displayName: "NavLink",
|
||||||
@@ -380,13 +384,23 @@ export const AppBar = () => {
|
|||||||
sx={{ mt: 2 }}
|
sx={{ mt: 2 }}
|
||||||
disableScrollLock
|
disableScrollLock
|
||||||
>
|
>
|
||||||
<MenuItem onClick={() => navigate("/settings")} disabled>
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
setSettingsDialogOpen(true);
|
||||||
|
setSettingsTabValue(1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<div className="material-symbols-rounded">settings</div>
|
<div className="material-symbols-rounded">settings</div>
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
Settings
|
Settings
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem onClick={() => navigate("/about")}>
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
setSettingsDialogOpen(true);
|
||||||
|
setSettingsTabValue(10);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<div className="material-symbols-rounded">info</div>
|
<div className="material-symbols-rounded">info</div>
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
&-icon {
|
&-icon {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
background: $clr-gradient-dark;
|
background: rgb(255 255 255 / 0.1);
|
||||||
fill: url(#clr-gradient-default) !important;
|
color: white;
|
||||||
font-size: 7em !important;
|
font-size: 7em !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,12 +30,21 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: auto;
|
height: auto;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
&.thumb{
|
||||||
|
aspect-ratio: 1.777777;
|
||||||
}
|
}
|
||||||
|
&.portrait{
|
||||||
|
aspect-ratio: 0.666666;
|
||||||
|
}
|
||||||
|
&.square {
|
||||||
|
aspect-ratio: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&-icon {
|
&-icon {
|
||||||
font-size: 5.4em !important;
|
font-size: 5.4em !important;
|
||||||
fill: url(#clr-gradient-default) !important;
|
|
||||||
&-container {
|
&-container {
|
||||||
background: rgb(255 255 255 / 0.1);
|
background: linear-gradient(45deg, rgb(255 255 255 / 0.05), rgb(255 255 255 / 0.1));
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ import Typography from "@mui/material/Typography";
|
|||||||
import { getTypeIcon } from "../utils/iconsCollection";
|
import { getTypeIcon } from "../utils/iconsCollection";
|
||||||
import "./card.module.scss";
|
import "./card.module.scss";
|
||||||
|
|
||||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemDto, BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
import LikeButton from "../buttons/likeButton";
|
import LikeButton from "../buttons/likeButton";
|
||||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||||
@@ -29,43 +29,32 @@ const availableSpecialRoutes = [
|
|||||||
BaseItemKind.Playlist,
|
BaseItemKind.Playlist,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} Props
|
|
||||||
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
|
||||||
* @property {string} cardTitle
|
|
||||||
* @property {string | number} cardCaption
|
|
||||||
* @property {string} imageType
|
|
||||||
* @property {string} imageBlurhash
|
|
||||||
* @property {'thumb' | 'portrait' | 'square'} cardType
|
|
||||||
* @property {Array} queryKey
|
|
||||||
* @property {string} userId
|
|
||||||
* @property {string} seriesId
|
|
||||||
* @property {boolean} hideText
|
|
||||||
* @property {() => {}} onClick
|
|
||||||
* @property {boolean} disableOverlay
|
|
||||||
* @property {boolean} disablePadding
|
|
||||||
* @property {any} overrideIcon
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description Hero section for item pages
|
|
||||||
* @param {Props}
|
|
||||||
* @returns {React.Component}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const Card = ({
|
export const Card = ({
|
||||||
item,
|
item,
|
||||||
cardTitle,
|
cardTitle,
|
||||||
cardCaption,
|
cardCaption,
|
||||||
imageType = "Primary",
|
imageType = "Primary",
|
||||||
cardType,
|
cardType = "square",
|
||||||
queryKey,
|
queryKey,
|
||||||
userId,
|
userId,
|
||||||
seriesId,
|
seriesId,
|
||||||
hideText,
|
hideText = false,
|
||||||
onClick,
|
onClick,
|
||||||
disableOverlay = false,
|
disableOverlay = false,
|
||||||
overrideIcon,
|
overrideIcon,
|
||||||
|
}: {
|
||||||
|
item: BaseItemDto;
|
||||||
|
cardTitle: string | null;
|
||||||
|
cardCaption: string | null;
|
||||||
|
imageType: string;
|
||||||
|
cardType: string;
|
||||||
|
queryKey: [];
|
||||||
|
userId: string;
|
||||||
|
seriesId: string | null;
|
||||||
|
hideText: boolean;
|
||||||
|
onClick: Function | null;
|
||||||
|
disableOverlay: boolean;
|
||||||
|
overrideIcon: React.Component | null;
|
||||||
}) => {
|
}) => {
|
||||||
const [api] = useApi((state) => [state.api]);
|
const [api] = useApi((state) => [state.api]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -80,18 +69,14 @@ export const Card = ({
|
|||||||
navigate(`/item/${item.Id}`);
|
navigate(`/item/${item.Id}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="card"
|
className="card"
|
||||||
elevation={0}
|
elevation={0}
|
||||||
onClick={onClick ? onClick : defaultOnClick}
|
onClick={onClick ? onClick : defaultOnClick}
|
||||||
>
|
>
|
||||||
<div
|
<div className={`card-image-container ${cardType}`}>
|
||||||
className="card-image-container"
|
|
||||||
style={{
|
|
||||||
aspectRatio: cardImageAspectRatios[cardType],
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ErrorBoundary fallback>
|
<ErrorBoundary fallback>
|
||||||
<div
|
<div
|
||||||
className="card-indicator check"
|
className="card-indicator check"
|
||||||
@@ -157,8 +142,9 @@ export const Card = ({
|
|||||||
}}
|
}}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.target.style.opacity = 1;
|
e.currentTarget.style.setProperty("opacity", "1");
|
||||||
}}
|
}}
|
||||||
|
onLoadStart={(e) => console.log(e)}
|
||||||
className="card-image"
|
className="card-image"
|
||||||
/>
|
/>
|
||||||
<div className="card-overlay">
|
<div className="card-overlay">
|
||||||
@@ -0,0 +1,524 @@
|
|||||||
|
import {
|
||||||
|
Chip,
|
||||||
|
Dialog,
|
||||||
|
FormControlLabel,
|
||||||
|
Link,
|
||||||
|
Skeleton,
|
||||||
|
Switch,
|
||||||
|
Tab,
|
||||||
|
Tabs,
|
||||||
|
Typography,
|
||||||
|
styled,
|
||||||
|
withStyles,
|
||||||
|
} from "@mui/material";
|
||||||
|
import { AnimatePresence, motion, transform } from "framer-motion";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import useSettingsStore, {
|
||||||
|
setSettingsDialogOpen,
|
||||||
|
setSettingsTabValue,
|
||||||
|
} from "../../utils/store/settings";
|
||||||
|
|
||||||
|
import logo from "../../assets/logoBlack.png";
|
||||||
|
|
||||||
|
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
import { useCentralStore } from "../../utils/store/central";
|
||||||
|
import "./settings.module.scss";
|
||||||
|
|
||||||
|
import { LoadingButton } from "@mui/lab";
|
||||||
|
import { relaunch } from "@tauri-apps/api/process";
|
||||||
|
import { checkUpdate, installUpdate } from "@tauri-apps/api/updater";
|
||||||
|
import { enqueueSnackbar, useSnackbar } from "notistack";
|
||||||
|
|
||||||
|
const motionConfig = {
|
||||||
|
forward: {
|
||||||
|
opacity: 0,
|
||||||
|
transform: "translateY(-20px)",
|
||||||
|
},
|
||||||
|
visible: {
|
||||||
|
opacity: 1,
|
||||||
|
transform: "translateY(0px)",
|
||||||
|
},
|
||||||
|
backward: {
|
||||||
|
opacity: 0,
|
||||||
|
transform: "translateY(20px)",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const Settings = () => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
const systemInfo = useQuery({
|
||||||
|
queryKey: ["about", "systemInfo"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getSystemApi(api).getSystemInfo();
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
enabled: Boolean(api),
|
||||||
|
});
|
||||||
|
|
||||||
|
const updateInfo = useQuery({
|
||||||
|
queryKey: ["about", "updater"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await checkUpdate();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
|
const [open, tabValue] = useSettingsStore((state) => [
|
||||||
|
state.dialogOpen,
|
||||||
|
state.tabValue,
|
||||||
|
]);
|
||||||
|
|
||||||
|
const [applicationVersion] = useCentralStore((state) => [
|
||||||
|
state.clientVersion,
|
||||||
|
]);
|
||||||
|
|
||||||
|
const [updating, setUpdating] = useState(false);
|
||||||
|
const [animDirection, setAnimDirection] = useState("forward");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog
|
||||||
|
open={open}
|
||||||
|
fullWidth
|
||||||
|
maxWidth="md"
|
||||||
|
PaperProps={{
|
||||||
|
className: "settings",
|
||||||
|
}}
|
||||||
|
onClose={() => setSettingsDialogOpen(false)}
|
||||||
|
>
|
||||||
|
<Tabs
|
||||||
|
orientation="vertical"
|
||||||
|
value={tabValue}
|
||||||
|
onChange={(e, newValue) => {
|
||||||
|
if (newValue > tabValue) {
|
||||||
|
setAnimDirection("backward");
|
||||||
|
} else {
|
||||||
|
setAnimDirection("forward");
|
||||||
|
}
|
||||||
|
setSettingsTabValue(newValue);
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
borderRight: "1.2px solid rgb(255 255 255 / 0.1)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Tab
|
||||||
|
icon={<span className="material-symbols-rounded">settings</span>}
|
||||||
|
iconPosition="start"
|
||||||
|
value={1}
|
||||||
|
label="General"
|
||||||
|
className="settings-tab"
|
||||||
|
sx={{
|
||||||
|
minHeight: "48px",
|
||||||
|
height: "48px",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Tab
|
||||||
|
icon={<span className="material-symbols-rounded">info</span>}
|
||||||
|
iconPosition="start"
|
||||||
|
value={10}
|
||||||
|
label="About"
|
||||||
|
className="settings-tab"
|
||||||
|
sx={{
|
||||||
|
minHeight: "48px",
|
||||||
|
height: "48px",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
<AnimatePresence mode="wait">
|
||||||
|
<motion.div
|
||||||
|
variants={motionConfig}
|
||||||
|
initial={animDirection === "backward" ? "backward" : "forward"}
|
||||||
|
animate="visible"
|
||||||
|
exit={animDirection === "backward" ? "backward" : "forward"}
|
||||||
|
key={tabValue}
|
||||||
|
transition={{
|
||||||
|
duration: 0.1,
|
||||||
|
}}
|
||||||
|
className="settings-scroll "
|
||||||
|
>
|
||||||
|
{/* About */}
|
||||||
|
{tabValue === 10 && (
|
||||||
|
<div className="settings-container settings-about">
|
||||||
|
<img src={logo} className="settings-logo" alt="JellyPlayer" />
|
||||||
|
<div className="settings-grid">
|
||||||
|
<div className="settings-info-container">
|
||||||
|
<div className="settings-info">
|
||||||
|
<Typography>Client Version:</Typography>
|
||||||
|
<Chip
|
||||||
|
icon={
|
||||||
|
<span className="material-symbols-rounded">
|
||||||
|
{updateInfo.data?.shouldUpdate
|
||||||
|
? "update"
|
||||||
|
: "update_disabled"}
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
label={
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
{applicationVersion}
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
|
color={
|
||||||
|
updateInfo.data?.shouldUpdate ? "error" : "success"
|
||||||
|
}
|
||||||
|
size="medium"
|
||||||
|
style={{
|
||||||
|
width: "fit-content !important",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="settings-info">
|
||||||
|
<Typography>Update Available:</Typography>
|
||||||
|
<Typography>
|
||||||
|
{updateInfo.isFetching
|
||||||
|
? "Checking for new updates..."
|
||||||
|
: updateInfo.data?.shouldUpdate
|
||||||
|
? updateInfo.data.manifest?.version
|
||||||
|
: "No update found."}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
<LoadingButton
|
||||||
|
style={{
|
||||||
|
marginTop: "auto",
|
||||||
|
}}
|
||||||
|
loading={updateInfo.isFetching || updating}
|
||||||
|
variant="contained"
|
||||||
|
disabled={!updateInfo.data?.shouldUpdate}
|
||||||
|
loadingPosition="start"
|
||||||
|
onClick={async () => {
|
||||||
|
if (updateInfo.data?.shouldUpdate) {
|
||||||
|
setUpdating(true);
|
||||||
|
await installUpdate();
|
||||||
|
enqueueSnackbar(
|
||||||
|
"Update has been installed! You need to relaunch JellyPlayer.",
|
||||||
|
{
|
||||||
|
variant: "success",
|
||||||
|
},
|
||||||
|
);
|
||||||
|
await relaunch();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{updateInfo.isFetching
|
||||||
|
? "Checking for Update..."
|
||||||
|
: updateInfo.data?.shouldUpdate
|
||||||
|
? "Update"
|
||||||
|
: "No Update Found"}
|
||||||
|
</LoadingButton>
|
||||||
|
</div>
|
||||||
|
{systemInfo.isSuccess ? (
|
||||||
|
<div className="settings-info-container">
|
||||||
|
<div className="settings-info">
|
||||||
|
<Typography>Server:</Typography>
|
||||||
|
<Typography>{systemInfo.data?.ServerName}</Typography>
|
||||||
|
</div>
|
||||||
|
<div className="settings-info">
|
||||||
|
<Typography>Jellyfin Version:</Typography>
|
||||||
|
<Typography>{systemInfo.data?.Version}</Typography>
|
||||||
|
</div>
|
||||||
|
<div className="settings-info">
|
||||||
|
<Typography>Operating System:</Typography>
|
||||||
|
<Typography>
|
||||||
|
{systemInfo.data?.OperatingSystemDisplayName}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
<div className="settings-info">
|
||||||
|
<Typography>Server Architecture:</Typography>
|
||||||
|
<Typography>
|
||||||
|
{systemInfo.data?.SystemArchitecture}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<Skeleton
|
||||||
|
variant="rectangular"
|
||||||
|
sx={{
|
||||||
|
height: "100%",
|
||||||
|
borderRadius: "10px",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
marginTop: "1em",
|
||||||
|
background: "rgb(0 0 0 / 0.3)",
|
||||||
|
padding: "1em",
|
||||||
|
borderRadius: "10px",
|
||||||
|
border: "1px solid rgb(255 255 255 / 0.1)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography variant="h6" fontWeight={300} mb={1}>
|
||||||
|
Links:
|
||||||
|
</Typography>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
alignItems: "flex-start",
|
||||||
|
gap: "0.1em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Link href="https://github.com/prayag17/JellyPlayer">
|
||||||
|
https://github.com/prayag17/JellyPlayer
|
||||||
|
</Link>
|
||||||
|
<Link href="https://jellyfin.org">https://jellyfin.org</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* General */}
|
||||||
|
{tabValue === 1 && (
|
||||||
|
<div className="settings-container">
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="start"
|
||||||
|
control={<Switch color="primary" />}
|
||||||
|
label={
|
||||||
|
<div className="settings-option-info">
|
||||||
|
<Typography variant="h6" fontWeight={400}>
|
||||||
|
Enable DiscordRPC
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" fontWeight={200}>
|
||||||
|
this a test
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
labelPlacement="start"
|
||||||
|
className="settings-option"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Settings;
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
.settings{
|
||||||
|
display: grid !important;
|
||||||
|
grid-template-columns: 20% 1fr;
|
||||||
|
height: 60vh;
|
||||||
|
overflow: hidden !important;
|
||||||
|
|
||||||
|
&-container{
|
||||||
|
margin: 14px 0em 14px 14px;
|
||||||
|
}
|
||||||
|
&-tab{
|
||||||
|
display: grid !important;
|
||||||
|
grid-template-columns: 2em 1fr;
|
||||||
|
align-items: center;
|
||||||
|
justify-items: start !important;
|
||||||
|
gap:1em;
|
||||||
|
& .material-symbols-rounded{
|
||||||
|
justify-self: center !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
&-scroll{
|
||||||
|
overflow-y: auto;
|
||||||
|
mask-image: linear-gradient(to top, transparent, black 15px calc(100% - 15px), transparent);
|
||||||
|
// Magic scrollbar
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
&-thumb {
|
||||||
|
height: 150px;
|
||||||
|
max-height: 33%;
|
||||||
|
}
|
||||||
|
&-track {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// About page
|
||||||
|
&-grid{
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||||
|
gap:1em;
|
||||||
|
}
|
||||||
|
&-logo{
|
||||||
|
width: 100%;
|
||||||
|
background: rgb(255 255 255 / 1);
|
||||||
|
padding: 2em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
}
|
||||||
|
&-info{
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 40% 1fr;
|
||||||
|
gap: 1em;
|
||||||
|
justify-items: start;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&-container{
|
||||||
|
background: rgb(0 0 0 / 0.3);
|
||||||
|
border: 1px solid rgb(255 255 255 / 0.1);
|
||||||
|
padding: 1em;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap:0.4em;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//settings
|
||||||
|
&-option{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 0 0.4em 0!important;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.Mui-selected .material-symbols-rounded{
|
||||||
|
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
import { Divider, LinearProgress, Skeleton } from "@mui/material";
|
||||||
|
|
||||||
|
const ItemSkeleton = () => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="item item-default scrollY padded-top flex flex-column"
|
||||||
|
style={{
|
||||||
|
width: "100vw",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<LinearProgress
|
||||||
|
sx={{
|
||||||
|
position: "fixed",
|
||||||
|
top: "0",
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="item-hero flex flex-row"
|
||||||
|
style={{
|
||||||
|
height: "50vh",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="item-hero-image-container"
|
||||||
|
style={{
|
||||||
|
aspectRatio: 0.6666,
|
||||||
|
boxShadow: "0 0 black",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Skeleton
|
||||||
|
variant="rounded"
|
||||||
|
style={{
|
||||||
|
height: "50vh",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="item-hero-detail flex flex-column"
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
// width: "50vw",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Skeleton variant="text" sx={{ fontSize: "4rem" }} width="50%" />
|
||||||
|
{/* </Typography> */}
|
||||||
|
|
||||||
|
<div
|
||||||
|
className="item-hero-buttons-container flex flex-row"
|
||||||
|
style={{
|
||||||
|
width: "70%",
|
||||||
|
gap: "1em",
|
||||||
|
justifyContent: "flex-start",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Skeleton
|
||||||
|
width="10rem"
|
||||||
|
height="3rem"
|
||||||
|
sx={{
|
||||||
|
fontSize: "3rem",
|
||||||
|
borderRadius: "3em",
|
||||||
|
transform: "scale(1)",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||||
|
<Skeleton
|
||||||
|
width="3rem"
|
||||||
|
height="3rem"
|
||||||
|
sx={{
|
||||||
|
fontSize: "3rem",
|
||||||
|
borderRadius: "3em",
|
||||||
|
transform: "scale(1)",
|
||||||
|
aspectRatio: "1",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Skeleton
|
||||||
|
width="3rem"
|
||||||
|
height="3rem"
|
||||||
|
sx={{
|
||||||
|
fontSize: "3rem",
|
||||||
|
borderRadius: "3em",
|
||||||
|
transform: "scale(1)",
|
||||||
|
aspectRatio: "1",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="item-detail">
|
||||||
|
<div style={{ width: "100%" }}>
|
||||||
|
<Skeleton variant="text" />
|
||||||
|
<Skeleton variant="text" />
|
||||||
|
<Skeleton variant="text" />
|
||||||
|
</div>
|
||||||
|
<Divider flexItem orientation="vertical" />
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: "100%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Skeleton
|
||||||
|
variant="rounded"
|
||||||
|
sx={{
|
||||||
|
fontSize: "2.4rem",
|
||||||
|
mb: 1,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Skeleton
|
||||||
|
variant="rounded"
|
||||||
|
sx={{
|
||||||
|
fontSize: "2.4rem",
|
||||||
|
mb: 1,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Skeleton
|
||||||
|
variant="rounded"
|
||||||
|
sx={{
|
||||||
|
fontSize: "2.4rem",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ItemSkeleton;
|
||||||
@@ -157,8 +157,8 @@ $border-radius: 20px;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-backdrop {
|
&-backdrop {
|
||||||
width: 100%;
|
width: 100vw;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: top;
|
object-position: top;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
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 Box from "@mui/material/Box";
|
||||||
import Chip from "@mui/material/Chip";
|
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 { 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 {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
@@ -170,6 +171,13 @@ const MusicAlbumTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [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) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -200,11 +208,12 @@ const MusicAlbumTitlePage = () => {
|
|||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="scrollY padded-top item item-album"
|
className="scrollY padded-top item item-album"
|
||||||
|
ref={pageRef}
|
||||||
>
|
>
|
||||||
<div className="item-hero flex flex-row">
|
<div className="item-hero flex flex-row">
|
||||||
<div className="item-hero-backdrop-container">
|
<div className="item-hero-backdrop-container">
|
||||||
{item.data.BackdropImageTags ? (
|
{item.data.BackdropImageTags ? (
|
||||||
<img
|
<motion.img
|
||||||
alt={item.data.Name}
|
alt={item.data.Name}
|
||||||
src={api.getItemImageUrl(
|
src={api.getItemImageUrl(
|
||||||
item.data.ParentBackdropItemId,
|
item.data.ParentBackdropItemId,
|
||||||
@@ -217,6 +226,9 @@ const MusicAlbumTitlePage = () => {
|
|||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.currentTarget.style.opacity = 1;
|
e.currentTarget.style.opacity = 1;
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
y: parallax,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
|
|||||||
@@ -49,8 +49,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-backdrop {
|
&-backdrop {
|
||||||
width: 100%;
|
width: 100vw;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: top;
|
object-position: top;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
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 Box from "@mui/material/Box";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
@@ -8,7 +8,8 @@ import Tab from "@mui/material/Tab";
|
|||||||
import Tabs from "@mui/material/Tabs";
|
import Tabs from "@mui/material/Tabs";
|
||||||
import Typography from "@mui/material/Typography";
|
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";
|
import { Link, useParams } from "react-router-dom";
|
||||||
|
|
||||||
@@ -176,6 +177,13 @@ const ArtistTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
|
const pageRef = useRef(null);
|
||||||
|
const { scrollYProgress } = useScroll({
|
||||||
|
target: pageRef,
|
||||||
|
offset: ["start start", "60vh start"],
|
||||||
|
});
|
||||||
|
const parallax = useParallax(scrollYProgress, 50);
|
||||||
|
|
||||||
if (item.isPending) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -206,10 +214,11 @@ const ArtistTitlePage = () => {
|
|||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="scrollY item item-artist"
|
className="scrollY item item-artist"
|
||||||
|
ref={pageRef}
|
||||||
>
|
>
|
||||||
<div className="item-hero flex flex-row">
|
<div className="item-hero flex flex-row">
|
||||||
<div className="item-hero-backdrop-container">
|
<div className="item-hero-backdrop-container">
|
||||||
<img
|
<motion.img
|
||||||
alt={item.data.Name}
|
alt={item.data.Name}
|
||||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||||
tag: item.data.BackdropImageTags[0],
|
tag: item.data.BackdropImageTags[0],
|
||||||
@@ -218,6 +227,9 @@ const ArtistTitlePage = () => {
|
|||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.currentTarget.style.opacity = 1;
|
e.currentTarget.style.opacity = 1;
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
y: parallax,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -49,8 +49,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-backdrop {
|
&-backdrop {
|
||||||
width: 100%;
|
width: 100vw;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: top;
|
object-position: top;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
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 Box from "@mui/material/Box";
|
||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
@@ -9,7 +9,8 @@ import Stack from "@mui/material/Stack";
|
|||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { Link, useNavigate, useParams } from "react-router-dom";
|
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 {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
@@ -128,6 +129,13 @@ const BoxSetTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [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) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -158,17 +166,21 @@ const BoxSetTitlePage = () => {
|
|||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="scrollY item item-boxset padded-top"
|
className="scrollY item item-boxset padded-top"
|
||||||
|
ref={pageRef}
|
||||||
>
|
>
|
||||||
<div className="item-hero flex flex-row">
|
<div className="item-hero flex flex-row">
|
||||||
<div className="item-hero-backdrop-container">
|
<div className="item-hero-backdrop-container">
|
||||||
{item.data.BackdropImageTags ? (
|
{item.data.BackdropImageTags ? (
|
||||||
<img
|
<motion.img
|
||||||
alt={item.data.Name}
|
alt={item.data.Name}
|
||||||
src={meshBg}
|
src={meshBg}
|
||||||
className="item-hero-backdrop"
|
className="item-hero-backdrop"
|
||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.currentTarget.style.opacity = 1;
|
e.currentTarget.style.opacity = 1;
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
y: parallax,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
|
|||||||
@@ -52,8 +52,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-backdrop {
|
&-backdrop {
|
||||||
width: 100%;
|
width: 100vw;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: top;
|
object-position: top;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
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 Box from "@mui/material/Box";
|
||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
@@ -16,7 +16,8 @@ import { Blurhash } from "react-blurhash";
|
|||||||
|
|
||||||
import { Link, NavLink, useParams } from "react-router-dom";
|
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 {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
@@ -219,6 +220,9 @@ const EpisodeTitlePage = () => {
|
|||||||
) {
|
) {
|
||||||
return "Dolby Digital+";
|
return "Dolby Digital+";
|
||||||
}
|
}
|
||||||
|
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("dd")) {
|
||||||
|
return "Dolby Digital";
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -233,6 +237,13 @@ const EpisodeTitlePage = () => {
|
|||||||
return "2.0";
|
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) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -263,11 +274,12 @@ const EpisodeTitlePage = () => {
|
|||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="scrollY padded-top flex flex-column item item-episode"
|
className="scrollY padded-top flex flex-column item item-episode"
|
||||||
|
ref={pageRef}
|
||||||
>
|
>
|
||||||
<div className="item-hero flex flex-row">
|
<div className="item-hero flex flex-row">
|
||||||
<div className="item-hero-backdrop-container">
|
<div className="item-hero-backdrop-container">
|
||||||
{item.data.BackdropImageTags ? (
|
{item.data.BackdropImageTags ? (
|
||||||
<img
|
<motion.img
|
||||||
alt={item.data.Name}
|
alt={item.data.Name}
|
||||||
src={api.getItemImageUrl(
|
src={api.getItemImageUrl(
|
||||||
item.data.ParentBackdropItemId,
|
item.data.ParentBackdropItemId,
|
||||||
@@ -280,6 +292,9 @@ const EpisodeTitlePage = () => {
|
|||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.currentTarget.style.opacity = 1;
|
e.currentTarget.style.opacity = 1;
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
y: parallax,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
|
|||||||
@@ -421,4 +421,4 @@ const Home = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Home;
|
export default React.memo(Home);
|
||||||
+33
-14
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
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 Box from "@mui/material/Box";
|
||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
@@ -16,7 +16,8 @@ import { Blurhash } from "react-blurhash";
|
|||||||
|
|
||||||
import { Link, NavLink, useParams } from "react-router-dom";
|
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 {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
@@ -47,6 +48,8 @@ import { endsAt, getRuntime } from "../../utils/date/time";
|
|||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
|
||||||
|
import ItemSkeleton from "../../components/skeleton/item";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -245,6 +248,9 @@ const ItemDetail = () => {
|
|||||||
) {
|
) {
|
||||||
return "Dolby Digital+";
|
return "Dolby Digital+";
|
||||||
}
|
}
|
||||||
|
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("dd")) {
|
||||||
|
return "Dolby Digital";
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -258,19 +264,28 @@ const ItemDetail = () => {
|
|||||||
return "2.0";
|
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) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
// <Box
|
||||||
sx={{
|
// sx={{
|
||||||
width: "100%",
|
// width: "100%",
|
||||||
height: "100vh",
|
// height: "100vh",
|
||||||
display: "flex",
|
// display: "flex",
|
||||||
alignItems: "center",
|
// alignItems: "center",
|
||||||
justifyContent: "center",
|
// justifyContent: "center",
|
||||||
}}
|
// }}
|
||||||
>
|
// >
|
||||||
<CircularProgress />
|
// <CircularProgress />
|
||||||
</Box>
|
// </Box>
|
||||||
|
<ItemSkeleton />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,11 +304,12 @@ const ItemDetail = () => {
|
|||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="scrollY padded-top flex flex-column item item-default"
|
className="scrollY padded-top flex flex-column item item-default"
|
||||||
|
ref={pageRef}
|
||||||
>
|
>
|
||||||
<div className="item-hero flex flex-row">
|
<div className="item-hero flex flex-row">
|
||||||
<div className="item-hero-backdrop-container">
|
<div className="item-hero-backdrop-container">
|
||||||
{item.data.BackdropImageTags ? (
|
{item.data.BackdropImageTags ? (
|
||||||
<img
|
<motion.img
|
||||||
alt={item.data.Name}
|
alt={item.data.Name}
|
||||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||||
tag: item.data.BackdropImageTags[0],
|
tag: item.data.BackdropImageTags[0],
|
||||||
@@ -302,6 +318,9 @@ const ItemDetail = () => {
|
|||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.currentTarget.style.opacity = 1;
|
e.currentTarget.style.opacity = 1;
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
y: parallax,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
|
|||||||
@@ -49,8 +49,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-backdrop {
|
&-backdrop {
|
||||||
width: 100%;
|
width: 100vw;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: top;
|
object-position: top;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import { useSnackbar } from "notistack";
|
|||||||
|
|
||||||
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
|
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
|
||||||
import { AvatarImage } from "../../components/avatar/avatar.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 { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
|
||||||
import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-api";
|
import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-api";
|
||||||
@@ -117,7 +117,14 @@ export const LoginWithImage = () => {
|
|||||||
);
|
);
|
||||||
return auth;
|
return auth;
|
||||||
} catch (error) {
|
} 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);
|
setLoading(false);
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
@@ -175,12 +182,22 @@ export const LoginWithImage = () => {
|
|||||||
elevation={2}
|
elevation={2}
|
||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
textAlign="left"
|
textAlign="center"
|
||||||
variant="h5"
|
variant="h5"
|
||||||
sx={{ opacity: 0.8 }}
|
sx={{ opacity: 0.8 }}
|
||||||
mb={2}
|
mb={2}
|
||||||
>
|
>
|
||||||
Login as {userName}:
|
Login as{" "}
|
||||||
|
<Typography
|
||||||
|
variant="h5"
|
||||||
|
style={{
|
||||||
|
display: "inline",
|
||||||
|
}}
|
||||||
|
fontWeight={700}
|
||||||
|
className="gradient-text"
|
||||||
|
>
|
||||||
|
{userName}
|
||||||
|
</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
<FormGroup
|
<FormGroup
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
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 Box from "@mui/material/Box";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
@@ -8,7 +8,8 @@ import Tab from "@mui/material/Tab";
|
|||||||
import Tabs from "@mui/material/Tabs";
|
import Tabs from "@mui/material/Tabs";
|
||||||
import Typography from "@mui/material/Typography";
|
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";
|
import { Link, useParams } from "react-router-dom";
|
||||||
|
|
||||||
@@ -242,6 +243,13 @@ const PersonTitlePage = () => {
|
|||||||
|
|
||||||
const [animationDirection, setAnimationDirection] = useState("forward");
|
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) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -273,16 +281,20 @@ const PersonTitlePage = () => {
|
|||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="scrollY padded-top item item-person flex flex-column"
|
className="scrollY padded-top item item-person flex flex-column"
|
||||||
|
ref={pageRef}
|
||||||
>
|
>
|
||||||
<div className="item-hero flex flex-row">
|
<div className="item-hero flex flex-row">
|
||||||
<div className="item-hero-backdrop-container">
|
<div className="item-hero-backdrop-container">
|
||||||
<img
|
<motion.img
|
||||||
alt={item.data.Name}
|
alt={item.data.Name}
|
||||||
src={meshBg}
|
src={meshBg}
|
||||||
className="item-hero-backdrop"
|
className="item-hero-backdrop"
|
||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.currentTarget.style.opacity = 1;
|
e.currentTarget.style.opacity = 1;
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
y: parallax,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -71,8 +71,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-backdrop {
|
&-backdrop {
|
||||||
width: 100%;
|
width: 100vw;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: top;
|
object-position: top;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
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 Box from "@mui/material/Box";
|
||||||
import MuiCard from "@mui/material/Card";
|
import MuiCard from "@mui/material/Card";
|
||||||
@@ -16,7 +16,8 @@ import TextField from "@mui/material/TextField";
|
|||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { green, red, yellow } from "@mui/material/colors";
|
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";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
@@ -240,6 +241,13 @@ const SeriesTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [seasons.isSuccess]);
|
}, [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) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -271,11 +279,12 @@ const SeriesTitlePage = () => {
|
|||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="scrollY padded-top flex flex-column item item-series"
|
className="scrollY padded-top flex flex-column item item-series"
|
||||||
|
ref={pageRef}
|
||||||
>
|
>
|
||||||
<div className="item-hero flex flex-row">
|
<div className="item-hero flex flex-row">
|
||||||
<div className="item-hero-backdrop-container">
|
<div className="item-hero-backdrop-container">
|
||||||
{item.data.BackdropImageTags ? (
|
{item.data.BackdropImageTags ? (
|
||||||
<img
|
<motion.img
|
||||||
alt={item.data.Name}
|
alt={item.data.Name}
|
||||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||||
tag: item.data.BackdropImageTags[0],
|
tag: item.data.BackdropImageTags[0],
|
||||||
@@ -284,6 +293,9 @@ const SeriesTitlePage = () => {
|
|||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.currentTarget.style.opacity = 1;
|
e.currentTarget.style.opacity = 1;
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
y: parallax,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
|
|||||||
@@ -50,8 +50,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-backdrop {
|
&-backdrop {
|
||||||
width: 100%;
|
width: 100vw;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: top;
|
object-position: top;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
const Settings = () => {
|
|
||||||
return <h1>WIP Settings</h1>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Settings;
|
|
||||||
@@ -231,3 +231,10 @@ h1 {
|
|||||||
opacity: 0.1;
|
opacity: 0.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gradient-text{
|
||||||
|
background: $clr-gradient-default;
|
||||||
|
color: transparent;
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
background-clip: text;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { MotionValue, useTransform } from "framer-motion";
|
||||||
|
|
||||||
|
export default function useParallax(
|
||||||
|
value: MotionValue<number>,
|
||||||
|
distance: number,
|
||||||
|
) {
|
||||||
|
return useTransform(value, [0, 1], [-distance, distance]);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { matchPath, useLocation } from "react-router-dom";
|
||||||
|
|
||||||
|
function useRouteMatch(patterns: readonly string[]) {
|
||||||
|
const { pathname } = useLocation();
|
||||||
|
|
||||||
|
for (let i = 0; i < patterns.length; i += 1) {
|
||||||
|
const pattern = patterns[i];
|
||||||
|
const possibleMatch = matchPath(pattern, pathname);
|
||||||
|
if (possibleMatch !== null) {
|
||||||
|
return possibleMatch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
export default useRouteMatch;
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { create } from "zustand";
|
||||||
|
|
||||||
|
const useSettingsStore = create(() => ({
|
||||||
|
dialogOpen: false,
|
||||||
|
tabValue: 0,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const setDialogOpen = (dialog: boolean) =>
|
||||||
|
useSettingsStore.setState((state) => ({ ...state, dialogOpen: dialog }));
|
||||||
|
|
||||||
|
const setTabValue = (value: number) => {
|
||||||
|
useSettingsStore.setState((state) => ({ ...state, tabValue: value }));
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useSettingsStore;
|
||||||
|
export {
|
||||||
|
setDialogOpen as setSettingsDialogOpen,
|
||||||
|
setTabValue as setSettingsTabValue,
|
||||||
|
};
|
||||||
+12
-7
@@ -1,11 +1,19 @@
|
|||||||
|
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import svgr from "vite-plugin-svgr";
|
import svgr from "vite-plugin-svgr";
|
||||||
|
import million from "million/compiler";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), svgr()],
|
plugins: [
|
||||||
|
react(),
|
||||||
|
svgr(),
|
||||||
|
// million.vite({
|
||||||
|
// auto: {
|
||||||
|
// skip: [/ReactQueryDevtools/g],
|
||||||
|
// },
|
||||||
|
// }),
|
||||||
|
],
|
||||||
css: {
|
css: {
|
||||||
modules: {
|
modules: {
|
||||||
scopeBehaviour: "global",
|
scopeBehaviour: "global",
|
||||||
@@ -28,14 +36,11 @@ export default defineConfig({
|
|||||||
envPrefix: ["VITE_", "TAURI_"],
|
envPrefix: ["VITE_", "TAURI_"],
|
||||||
build: {
|
build: {
|
||||||
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
|
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
|
||||||
target:
|
target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13",
|
||||||
process.env.TAURI_PLATFORM == "windows"
|
|
||||||
? "chrome105"
|
|
||||||
: "safari13",
|
|
||||||
// don't minify for debug builds
|
// don't minify for debug builds
|
||||||
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
|
cssCodeSplit: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user