Update homepage carousel and add support for MD in updater
This commit is contained in:
10 files changed
+869
-114
No files matched your search
@@ -33,6 +33,7 @@
|
|||||||
"react-blurhash": "^0.3.0",
|
"react-blurhash": "^0.3.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-error-boundary": "^4.0.11",
|
"react-error-boundary": "^4.0.11",
|
||||||
|
"react-markdown": "^9.0.1",
|
||||||
"react-multi-carousel": "^2.8.4",
|
"react-multi-carousel": "^2.8.4",
|
||||||
"react-player": "^2.13.0",
|
"react-player": "^2.13.0",
|
||||||
"react-router-dom": "^6.20.1",
|
"react-router-dom": "^6.20.1",
|
||||||
|
|||||||
Generated
+675
-63
File diff suppressed because it is too large.
Load diff
@@ -58,6 +58,7 @@ import About from "./routes/about";
|
|||||||
import SearchPage from "./routes/search";
|
import SearchPage from "./routes/search";
|
||||||
|
|
||||||
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
||||||
|
import Markdown from "react-markdown";
|
||||||
|
|
||||||
import { SideMenu } from "./components/menu/sidemenu.jsx";
|
import { SideMenu } from "./components/menu/sidemenu.jsx";
|
||||||
import { AppBar } from "./components/appBar/appBar.jsx";
|
import { AppBar } from "./components/appBar/appBar.jsx";
|
||||||
@@ -315,7 +316,9 @@ function App() {
|
|||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<DialogContentText>
|
<DialogContentText>
|
||||||
|
<Markdown>
|
||||||
{updateInfo.body}
|
{updateInfo.body}
|
||||||
|
</Markdown>
|
||||||
</DialogContentText>
|
</DialogContentText>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions
|
<DialogActions
|
||||||
|
|||||||
@@ -200,23 +200,30 @@ export const AppBar = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<NavLink to="/home" className="appBar-text">
|
<NavLink to="/home" className="appBar-text">
|
||||||
<Typography variant="subtitle1">
|
<Typography
|
||||||
|
variant="subtitle1"
|
||||||
|
fontWeight={600}
|
||||||
|
>
|
||||||
Home
|
Home
|
||||||
</Typography>
|
</Typography>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<Typography
|
<Typography
|
||||||
ref={librariesText}
|
ref={librariesText}
|
||||||
variant="subtitle1"
|
variant="subtitle1"
|
||||||
|
fontWeight={600}
|
||||||
|
onMouseEnter={popoverEnter}
|
||||||
|
onFocus={popoverEnter}
|
||||||
|
tabIndex={0}
|
||||||
className={
|
className={
|
||||||
isBrowsingLibrary
|
isBrowsingLibrary
|
||||||
? "appBar-text active"
|
? "appBar-text active"
|
||||||
: "appBar-text"
|
: "appBar-text"
|
||||||
}
|
}
|
||||||
onMouseEnter={popoverEnter}
|
|
||||||
// onMouseLeave={popoverLeave}
|
// onMouseLeave={popoverLeave}
|
||||||
>
|
>
|
||||||
Libraries
|
Libraries
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Menu
|
<Menu
|
||||||
open={Boolean(librariesPopover)}
|
open={Boolean(librariesPopover)}
|
||||||
anchorEl={librariesPopover}
|
anchorEl={librariesPopover}
|
||||||
@@ -237,6 +244,7 @@ export const AppBar = () => {
|
|||||||
onMouseLeave: popoverLeave,
|
onMouseLeave: popoverLeave,
|
||||||
}}
|
}}
|
||||||
disableScrollLock
|
disableScrollLock
|
||||||
|
hideBackdrop
|
||||||
>
|
>
|
||||||
{libraries.isPending
|
{libraries.isPending
|
||||||
? "loading..."
|
? "loading..."
|
||||||
@@ -254,6 +262,7 @@ export const AppBar = () => {
|
|||||||
// `/library/${library.Id}`,
|
// `/library/${library.Id}`,
|
||||||
// )
|
// )
|
||||||
// }
|
// }
|
||||||
|
tabIndex={0}
|
||||||
className="appBar-library"
|
className="appBar-library"
|
||||||
>
|
>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
.carousel {
|
.carousel {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100vh;
|
height: 80vh;
|
||||||
&-button {
|
&-button {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
right: 0.5em;
|
right: 0.5em;
|
||||||
}
|
}
|
||||||
&.left {
|
&.left {
|
||||||
left: 0;
|
left: 0.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-indicator {
|
&-indicator {
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1em;
|
bottom: 1em;
|
||||||
width: calc(100vw - 8em);
|
width: calc(100vw - 3em);
|
||||||
left: 1em;
|
left: 1em;
|
||||||
right: 1em;
|
right: 1em;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ const Carousel = ({ content, onChange }) => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
height: "100vh",
|
height: "100%",
|
||||||
width: "100vw",
|
width: "100vw",
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { MediaTypeIconCollection, getTypeIcon } from "../utils/iconsCollection";
|
import { MediaTypeIconCollection, getTypeIcon } from "../utils/iconsCollection";
|
||||||
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import { red } from "@mui/material/colors";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import LikeButton from "../buttons/likeButton";
|
import LikeButton from "../buttons/likeButton";
|
||||||
@@ -97,8 +98,8 @@ const CarouselSlide = ({ item }) => {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
|
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
|
||||||
width="1080"
|
width="108"
|
||||||
height="720"
|
height="72"
|
||||||
resolutionX={64}
|
resolutionX={64}
|
||||||
resolutionY={96}
|
resolutionY={96}
|
||||||
className="hero-carousel-background-blurhash"
|
className="hero-carousel-background-blurhash"
|
||||||
@@ -127,6 +128,33 @@ const CarouselSlide = ({ item }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<motion.div
|
<motion.div
|
||||||
|
// initial={{
|
||||||
|
// transform:
|
||||||
|
// animationDirection == "right"
|
||||||
|
// ? "translateX(60px)"
|
||||||
|
// : "translateX(-60px)",
|
||||||
|
// opacity: 0,
|
||||||
|
// }}
|
||||||
|
// animate={{
|
||||||
|
// transform: "translateX(0px)",
|
||||||
|
// opacity: 1,
|
||||||
|
// }}
|
||||||
|
// exit={{
|
||||||
|
// transform:
|
||||||
|
// animationDirection == "right"
|
||||||
|
// ? "translateX(-60px)"
|
||||||
|
// : "translateX(60px)",
|
||||||
|
|
||||||
|
// opacity: 0,
|
||||||
|
// }}
|
||||||
|
// transition={{
|
||||||
|
// duration: 0.25,
|
||||||
|
// ease: "easeInOut",
|
||||||
|
// }}
|
||||||
|
className="hero-carousel-detail"
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
component={motion.div}
|
||||||
initial={{
|
initial={{
|
||||||
transform:
|
transform:
|
||||||
animationDirection == "right"
|
animationDirection == "right"
|
||||||
@@ -150,9 +178,6 @@ const CarouselSlide = ({ item }) => {
|
|||||||
duration: 0.25,
|
duration: 0.25,
|
||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="hero-carousel-detail"
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
variant="h2"
|
variant="h2"
|
||||||
className="hero-carousel-text"
|
className="hero-carousel-text"
|
||||||
@@ -184,23 +209,41 @@ const CarouselSlide = ({ item }) => {
|
|||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
component={motion.div}
|
||||||
gap={1}
|
initial={{
|
||||||
divider={
|
transform:
|
||||||
<div
|
animationDirection == "right"
|
||||||
style={{
|
? "translateX(20px)"
|
||||||
width: "4px",
|
: "translateX(-20px)",
|
||||||
height: "4px",
|
opacity: 0,
|
||||||
background: "white",
|
|
||||||
alignSelf: "center",
|
|
||||||
aspectRatio: 1,
|
|
||||||
borderRadius: "10px",
|
|
||||||
}}
|
}}
|
||||||
></div>
|
animate={{
|
||||||
}
|
transform: "translateX(0px)",
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
exit={{
|
||||||
|
transform:
|
||||||
|
animationDirection == "right"
|
||||||
|
? "translateX(-20px)"
|
||||||
|
: "translateX(20px)",
|
||||||
|
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
|
direction="row"
|
||||||
|
gap={2}
|
||||||
className="hero-carousel-info"
|
className="hero-carousel-info"
|
||||||
|
mt={1}
|
||||||
|
justifyItems="flex-start"
|
||||||
|
alignItems="center"
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
style={{ opacity: "0.8" }}
|
||||||
|
variant="subtitle1"
|
||||||
>
|
>
|
||||||
<Typography variant="subtitle1">
|
|
||||||
{item.ProductionYear
|
{item.ProductionYear
|
||||||
? item.ProductionYear
|
? item.ProductionYear
|
||||||
: "Unknown"}
|
: "Unknown"}
|
||||||
@@ -209,6 +252,7 @@ const CarouselSlide = ({ item }) => {
|
|||||||
variant="filled"
|
variant="filled"
|
||||||
label={item.OfficialRating ?? "Not Rated"}
|
label={item.OfficialRating ?? "Not Rated"}
|
||||||
/>
|
/>
|
||||||
|
<ErrorBoundary fallback={<></>}>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -217,38 +261,101 @@ const CarouselSlide = ({ item }) => {
|
|||||||
}}
|
}}
|
||||||
className="hero-carousel-info-rating"
|
className="hero-carousel-info-rating"
|
||||||
>
|
>
|
||||||
{item.CommunityRating ? (
|
<div
|
||||||
<>
|
className="material-symbols-rounded "
|
||||||
<MdiStar
|
style={{
|
||||||
sx={{
|
// fontSize: "2.2em",
|
||||||
color: yellow[700],
|
color: yellow[400],
|
||||||
|
fontVariationSettings:
|
||||||
|
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Typography variant="subtitle1">
|
star
|
||||||
|
</div>
|
||||||
|
<Typography
|
||||||
|
style={{
|
||||||
|
opacity: "0.8",
|
||||||
|
}}
|
||||||
|
variant="subtitle1"
|
||||||
|
>
|
||||||
{Math.round(
|
{Math.round(
|
||||||
item.CommunityRating *
|
item.CommunityRating * 10,
|
||||||
10,
|
|
||||||
) / 10}
|
) / 10}
|
||||||
</Typography>
|
</Typography>
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<Typography variant="subtitle1">
|
|
||||||
No Community Rating
|
|
||||||
</Typography>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
</ErrorBoundary>
|
||||||
|
{Boolean(item.CriticRating) && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
gap: "0.25em",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
className="hero-carousel-info-rating"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="material-symbols-rounded "
|
||||||
|
style={{
|
||||||
|
color: red[400],
|
||||||
|
fontVariationSettings:
|
||||||
|
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
thumb_up
|
||||||
|
</div>
|
||||||
|
<Typography
|
||||||
|
style={{
|
||||||
|
opacity: "0.8",
|
||||||
|
}}
|
||||||
|
variant="subtitle1"
|
||||||
|
>
|
||||||
|
{item.CriticRating}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{!!item.RunTimeTicks && (
|
{!!item.RunTimeTicks && (
|
||||||
<Typography variant="subtitle1">
|
<Typography
|
||||||
|
style={{ opacity: "0.8" }}
|
||||||
|
variant="subtitle1"
|
||||||
|
>
|
||||||
{getRuntime(item.RunTimeTicks)}
|
{getRuntime(item.RunTimeTicks)}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
{!!item.RunTimeTicks && (
|
{!!item.RunTimeTicks && (
|
||||||
<Typography variant="subtitle1">
|
<Typography
|
||||||
|
style={{ opacity: "0.8" }}
|
||||||
|
variant="subtitle1"
|
||||||
|
>
|
||||||
{endsAt(item.RunTimeTicks)}
|
{endsAt(item.RunTimeTicks)}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
<Typography
|
<Typography
|
||||||
|
component={motion.div}
|
||||||
|
initial={{
|
||||||
|
transform:
|
||||||
|
animationDirection == "right"
|
||||||
|
? "translateX(20px)"
|
||||||
|
: "translateX(-20px)",
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
transform: "translateX(0px)",
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
exit={{
|
||||||
|
transform:
|
||||||
|
animationDirection == "right"
|
||||||
|
? "translateX(-20px)"
|
||||||
|
: "translateX(20px)",
|
||||||
|
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
variant="subtitle1"
|
variant="subtitle1"
|
||||||
className="hero-carousel-text"
|
className="hero-carousel-text"
|
||||||
sx={{
|
sx={{
|
||||||
@@ -265,6 +372,30 @@ const CarouselSlide = ({ item }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Stack
|
<Stack
|
||||||
|
component={motion.div}
|
||||||
|
initial={{
|
||||||
|
transform:
|
||||||
|
animationDirection == "right"
|
||||||
|
? "translateX(20px)"
|
||||||
|
: "translateX(-20px)",
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
transform: "translateX(0px)",
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
exit={{
|
||||||
|
transform:
|
||||||
|
animationDirection == "right"
|
||||||
|
? "translateX(-20px)"
|
||||||
|
: "translateX(20px)",
|
||||||
|
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
mt={3}
|
mt={3}
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={3}
|
gap={3}
|
||||||
|
|||||||
@@ -42,17 +42,13 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
opacity: 0.8;
|
filter: brightness(0.5);
|
||||||
mask-image: linear-gradient(to bottom, black 40%, transparent),
|
mask-image: linear-gradient(to bottom, black 40%, transparent);
|
||||||
linear-gradient(to left, black 40%, transparent);
|
|
||||||
-webkit-mask-image: linear-gradient(
|
-webkit-mask-image: linear-gradient(
|
||||||
to bottom,
|
to bottom,
|
||||||
black 40%,
|
black 40%,
|
||||||
transparent
|
transparent
|
||||||
),
|
);
|
||||||
linear-gradient(to left, black 40%, transparent);
|
|
||||||
mask-composite: source-in;
|
|
||||||
-webkit-mask-composite: source-in;
|
|
||||||
}
|
}
|
||||||
&-image {
|
&-image {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -213,8 +213,10 @@ const Home = () => {
|
|||||||
<div
|
<div
|
||||||
className="padded-container"
|
className="padded-container"
|
||||||
style={{
|
style={{
|
||||||
padding: "1em",
|
padding: "0 1.6em 1.6em",
|
||||||
|
scrollPadding: "4.4em",
|
||||||
}}
|
}}
|
||||||
|
id="libraries"
|
||||||
>
|
>
|
||||||
<ErrorBoundary
|
<ErrorBoundary
|
||||||
fallback={
|
fallback={
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ body {
|
|||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
filter: brightness(0.4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +123,7 @@ h1 {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 0 1.2em;
|
padding: 0 1.6em;
|
||||||
&.padded-top {
|
&.padded-top {
|
||||||
padding-top: 4.4em;
|
padding-top: 4.4em;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user