{
- e.target.style.opacity = 1;
+ e.currentTarget.style.setProperty("opacity", "1");
}}
+ onLoadStart={(e) => console.log(e)}
className="card-image"
/>
diff --git a/src/components/settings/index.tsx b/src/components/settings/index.tsx
new file mode 100644
index 0000000..5198849
--- /dev/null
+++ b/src/components/settings/index.tsx
@@ -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 (
+
+ );
+};
+
+export default Settings;
diff --git a/src/components/settings/settings.module.scss b/src/components/settings/settings.module.scss
new file mode 100644
index 0000000..d8547ba
--- /dev/null
+++ b/src/components/settings/settings.module.scss
@@ -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;
+
+}
\ No newline at end of file
diff --git a/src/components/skeleton/item.tsx b/src/components/skeleton/item.tsx
new file mode 100644
index 0000000..7450eff
--- /dev/null
+++ b/src/components/skeleton/item.tsx
@@ -0,0 +1,132 @@
+import React from "react";
+
+import { Divider, LinearProgress, Skeleton } from "@mui/material";
+
+const ItemSkeleton = () => {
+ return (
+
+ );
+};
+
+export default ItemSkeleton;
diff --git a/src/routes/album/album.module.scss b/src/routes/album/album.module.scss
index 3fcdc89..6d82645 100644
--- a/src/routes/album/album.module.scss
+++ b/src/routes/album/album.module.scss
@@ -157,8 +157,8 @@ $border-radius: 20px;
}
}
&-backdrop {
- width: 100%;
- height: 100%;
+ width: 100vw;
+ height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
diff --git a/src/routes/album/index.jsx b/src/routes/album/index.jsx
index 22b04f4..89356de 100644
--- a/src/routes/album/index.jsx
+++ b/src/routes/album/index.jsx
@@ -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 (
{
ease: "easeInOut",
}}
className="scrollY padded-top item item-album"
+ ref={pageRef}
>
{item.data.BackdropImageTags ? (
-

{
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
+ style={{
+ y: parallax,
+ }}
/>
) : (
<>>
diff --git a/src/routes/artist/artist.module.scss b/src/routes/artist/artist.module.scss
index 2a702d5..74b17e2 100644
--- a/src/routes/artist/artist.module.scss
+++ b/src/routes/artist/artist.module.scss
@@ -49,8 +49,8 @@
}
}
&-backdrop {
- width: 100%;
- height: 100%;
+ width: 100vw;
+ height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
diff --git a/src/routes/artist/index.jsx b/src/routes/artist/index.jsx
index b8a30aa..3795fb4 100644
--- a/src/routes/artist/index.jsx
+++ b/src/routes/artist/index.jsx
@@ -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 (
{
ease: "easeInOut",
}}
className="scrollY item item-artist"
+ ref={pageRef}
>
-

{
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
+ style={{
+ y: parallax,
+ }}
/>
{
}
}, [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 (
{
ease: "easeInOut",
}}
className="scrollY item item-boxset padded-top"
+ ref={pageRef}
>
{item.data.BackdropImageTags ? (
-

{
e.currentTarget.style.opacity = 1;
}}
+ style={{
+ y: parallax,
+ }}
/>
) : (
<>>
diff --git a/src/routes/episode/episode.module.scss b/src/routes/episode/episode.module.scss
index 27e1bf6..771f4b1 100644
--- a/src/routes/episode/episode.module.scss
+++ b/src/routes/episode/episode.module.scss
@@ -52,8 +52,8 @@
}
}
&-backdrop {
- width: 100%;
- height: 100%;
+ width: 100vw;
+ height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
diff --git a/src/routes/episode/index.jsx b/src/routes/episode/index.jsx
index 0cb363e..b27c91f 100644
--- a/src/routes/episode/index.jsx
+++ b/src/routes/episode/index.jsx
@@ -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 (
{
ease: "easeInOut",
}}
className="scrollY padded-top flex flex-column item item-episode"
+ ref={pageRef}
>
{item.data.BackdropImageTags ? (
-

{
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
+ style={{
+ y: parallax,
+ }}
/>
) : (
<>>
diff --git a/src/routes/home/index.jsx b/src/routes/home/index.jsx
index fd2ee73..343a615 100644
--- a/src/routes/home/index.jsx
+++ b/src/routes/home/index.jsx
@@ -421,4 +421,4 @@ const Home = () => {
);
};
-export default Home;
+export default React.memo(Home);
diff --git a/src/routes/item/index.jsx b/src/routes/item/index.jsx
index 235f6bc..27794f3 100644
--- a/src/routes/item/index.jsx
+++ b/src/routes/item/index.jsx
@@ -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 (
-
-
-
+ //
+ //
+ //
+
);
}
@@ -289,11 +304,12 @@ const ItemDetail = () => {
ease: "easeInOut",
}}
className="scrollY padded-top flex flex-column item item-default"
+ ref={pageRef}
>
{item.data.BackdropImageTags ? (
-

{
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
+ style={{
+ y: parallax,
+ }}
/>
) : (
<>>
diff --git a/src/routes/item/item.module.scss b/src/routes/item/item.module.scss
index 41f69a1..dbdc91d 100644
--- a/src/routes/item/item.module.scss
+++ b/src/routes/item/item.module.scss
@@ -49,8 +49,8 @@
}
}
&-backdrop {
- width: 100%;
- height: 100%;
+ width: 100vw;
+ height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
diff --git a/src/routes/login/index.jsx b/src/routes/login/index.jsx
index 644cd10..53ce9c4 100644
--- a/src/routes/login/index.jsx
+++ b/src/routes/login/index.jsx
@@ -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}
>
- Login as {userName}:
+ Login as{" "}
+
+ {userName}
+
{
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 (
{
ease: "easeInOut",
}}
className="scrollY padded-top item item-person flex flex-column"
+ ref={pageRef}
>
-

{
e.currentTarget.style.opacity = 1;
}}
+ style={{
+ y: parallax,
+ }}
/>
{
}
}, [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 (
{
ease: "easeInOut",
}}
className="scrollY padded-top flex flex-column item item-series"
+ ref={pageRef}
>
{item.data.BackdropImageTags ? (
-

{
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
+ style={{
+ y: parallax,
+ }}
/>
) : (
<>>
diff --git a/src/routes/series/series.module.scss b/src/routes/series/series.module.scss
index 25b03ab..1ae6f37 100644
--- a/src/routes/series/series.module.scss
+++ b/src/routes/series/series.module.scss
@@ -50,8 +50,8 @@
}
}
&-backdrop {
- width: 100%;
- height: 100%;
+ width: 100vw;
+ height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
diff --git a/src/routes/settings/index.jsx b/src/routes/settings/index.jsx
deleted file mode 100644
index 2245c5d..0000000
--- a/src/routes/settings/index.jsx
+++ /dev/null
@@ -1,5 +0,0 @@
-const Settings = () => {
- return
WIP Settings
;
-};
-
-export default Settings;
diff --git a/src/styles/global.scss b/src/styles/global.scss
index 16aca65..b942da3 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -231,3 +231,10 @@ h1 {
opacity: 0.1;
}
}
+
+.gradient-text{
+ background: $clr-gradient-default;
+ color: transparent;
+ -webkit-background-clip: text;
+ background-clip: text;
+}
\ No newline at end of file
diff --git a/src/utils/hooks/useParallax.tsx b/src/utils/hooks/useParallax.tsx
new file mode 100644
index 0000000..9c281c6
--- /dev/null
+++ b/src/utils/hooks/useParallax.tsx
@@ -0,0 +1,8 @@
+import { MotionValue, useTransform } from "framer-motion";
+
+export default function useParallax(
+ value: MotionValue
,
+ distance: number,
+) {
+ return useTransform(value, [0, 1], [-distance, distance]);
+}
diff --git a/src/utils/hooks/useRouteMatch.tsx b/src/utils/hooks/useRouteMatch.tsx
new file mode 100644
index 0000000..7eb3c0a
--- /dev/null
+++ b/src/utils/hooks/useRouteMatch.tsx
@@ -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;
diff --git a/src/utils/store/settings.tsx b/src/utils/store/settings.tsx
new file mode 100644
index 0000000..9e73f6e
--- /dev/null
+++ b/src/utils/store/settings.tsx
@@ -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,
+};
diff --git a/vite.config.js b/vite.config.js
index cf44eb8..21f87a8 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,11 +1,19 @@
-
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
+import million from "million/compiler";
// https://vitejs.dev/config/
export default defineConfig({
- plugins: [react(), svgr()],
+ plugins: [
+ react(),
+ svgr(),
+ // million.vite({
+ // auto: {
+ // skip: [/ReactQueryDevtools/g],
+ // },
+ // }),
+ ],
css: {
modules: {
scopeBehaviour: "global",
@@ -28,14 +36,11 @@ export default defineConfig({
envPrefix: ["VITE_", "TAURI_"],
build: {
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
- target:
- process.env.TAURI_PLATFORM == "windows"
- ? "chrome105"
- : "safari13",
+ target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13",
// don't minify for debug builds
minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
// produce sourcemaps for debug builds
sourcemap: !!process.env.TAURI_DEBUG,
- cssCodeSplit: true
+ cssCodeSplit: true,
},
});