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