Add full app backdrop
This commit is contained in:
7 files changed
+54
-69
No files matched your search
+8
-7
@@ -359,13 +359,7 @@ function App() {
|
|||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
<AnimatePresence>
|
<AnimatePresence wait>
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: "flex",
|
|
||||||
width: "calc(100vw - 14px)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box className="app-backdrop-container">
|
<Box className="app-backdrop-container">
|
||||||
<motion.img
|
<motion.img
|
||||||
key={backdropId}
|
key={backdropId}
|
||||||
@@ -384,8 +378,15 @@ function App() {
|
|||||||
transition={{
|
transition={{
|
||||||
duration: 1,
|
duration: 1,
|
||||||
}}
|
}}
|
||||||
|
loading="eager"
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
width: "calc(100vw - 14px)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
<SideMenu />
|
<SideMenu />
|
||||||
<AppBar />
|
<AppBar />
|
||||||
|
|||||||
@@ -129,8 +129,10 @@ export const SideMenu = ({}) => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
|
zIndex: 1,
|
||||||
width: `calc(${theme.spacing(7)} + 10px)`,
|
width: `calc(${theme.spacing(7)} + 10px)`,
|
||||||
background: theme.palette.background.paper,
|
background:
|
||||||
|
"linear-gradient(to right, rgb(0 0 0 / 0.35) , transparent) !important ",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DrawerHeader
|
<DrawerHeader
|
||||||
@@ -139,7 +141,6 @@ export const SideMenu = ({}) => {
|
|||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
></DrawerHeader>
|
></DrawerHeader>
|
||||||
<Divider />
|
|
||||||
{libraries.isLoading ? (
|
{libraries.isLoading ? (
|
||||||
<>
|
<>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
@@ -207,7 +208,6 @@ export const SideMenu = ({}) => {
|
|||||||
)}
|
)}
|
||||||
</List>
|
</List>
|
||||||
<List sx={{ marginTop: "auto" }}>
|
<List sx={{ marginTop: "auto" }}>
|
||||||
<Divider />
|
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title="Home"
|
title="Home"
|
||||||
placement="right"
|
placement="right"
|
||||||
|
|||||||
@@ -7,9 +7,13 @@ import { theme } from "../../theme";
|
|||||||
export const CarouselSkeleton = () => {
|
export const CarouselSkeleton = () => {
|
||||||
return (
|
return (
|
||||||
<Paper
|
<Paper
|
||||||
className="hero-carousel-slide"
|
className="hero-carousel-skeleton"
|
||||||
|
elevation={0}
|
||||||
sx={{
|
sx={{
|
||||||
|
height: "100vh",
|
||||||
|
position: "relative",
|
||||||
background: theme.palette.primary.background.main,
|
background: theme.palette.primary.background.main,
|
||||||
|
borderRadius: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="hero-carousel-background">
|
<div className="hero-carousel-background">
|
||||||
|
|||||||
@@ -43,12 +43,16 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
mask-image: linear-gradient(to bottom, black, 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,
|
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;
|
||||||
|
|||||||
+19
-13
@@ -215,6 +215,9 @@ const Home = () => {
|
|||||||
position: "relative",
|
position: "relative",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{latestMedia.isLoading ? (
|
||||||
|
<CarouselSkeleton />
|
||||||
|
) : (
|
||||||
<Carousel
|
<Carousel
|
||||||
className="hero-carousel"
|
className="hero-carousel"
|
||||||
autoPlay={false}
|
autoPlay={false}
|
||||||
@@ -237,7 +240,8 @@ const Home = () => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
indicatorContainerProps={{
|
indicatorContainerProps={{
|
||||||
className: "hero-carousel-indicator-container",
|
className:
|
||||||
|
"hero-carousel-indicator-container",
|
||||||
style: {
|
style: {
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -249,20 +253,18 @@ const Home = () => {
|
|||||||
marginBottom: "1.5em",
|
marginBottom: "1.5em",
|
||||||
}}
|
}}
|
||||||
onChange={(now) => {
|
onChange={(now) => {
|
||||||
console.log(latestMedia.data[now]);
|
if (latestMedia.isSuccess) {
|
||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
`${window.api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`,
|
`${window.api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`,
|
||||||
latestMedia.data[now].Id,
|
latestMedia.data[now].Id,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
|
changeOnFirstRender={true}
|
||||||
duration={400}
|
duration={400}
|
||||||
interval={10000}
|
interval={10000}
|
||||||
>
|
>
|
||||||
{latestMedia.isLoading ? (
|
{latestMedia.data.length != 0 &&
|
||||||
<CarouselSkeleton />
|
|
||||||
) : (
|
|
||||||
// <></>
|
|
||||||
latestMedia.data.length != 0 &&
|
|
||||||
latestMedia.data.map((item, index) => {
|
latestMedia.data.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary
|
<ErrorBoundary
|
||||||
@@ -282,7 +284,8 @@ const Home = () => {
|
|||||||
>
|
>
|
||||||
<div className="hero-carousel-background-container">
|
<div className="hero-carousel-background-container">
|
||||||
{Object.keys(
|
{Object.keys(
|
||||||
item.ImageBlurHashes
|
item
|
||||||
|
.ImageBlurHashes
|
||||||
.Backdrop,
|
.Backdrop,
|
||||||
).length != 0 && (
|
).length != 0 && (
|
||||||
<Blurhash
|
<Blurhash
|
||||||
@@ -314,7 +317,8 @@ const Home = () => {
|
|||||||
className="hero-carousel-background-image"
|
className="hero-carousel-background-image"
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${
|
backgroundImage: `url(${
|
||||||
window.api
|
window
|
||||||
|
.api
|
||||||
.basePath +
|
.basePath +
|
||||||
"/Items/" +
|
"/Items/" +
|
||||||
item.Id +
|
item.Id +
|
||||||
@@ -325,7 +329,8 @@ const Home = () => {
|
|||||||
<div className="hero-carousel-background-icon-container">
|
<div className="hero-carousel-background-icon-container">
|
||||||
{
|
{
|
||||||
MediaTypeIconCollection[
|
MediaTypeIconCollection[
|
||||||
item.Type
|
item
|
||||||
|
.Type
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -357,7 +362,8 @@ const Home = () => {
|
|||||||
opacity: 1,
|
opacity: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{!item.ImageTags
|
{!item
|
||||||
|
.ImageTags
|
||||||
.Logo ? (
|
.Logo ? (
|
||||||
item.Name
|
item.Name
|
||||||
) : (
|
) : (
|
||||||
@@ -634,9 +640,9 @@ const Home = () => {
|
|||||||
</Paper>
|
</Paper>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
);
|
);
|
||||||
})
|
})}
|
||||||
)}
|
|
||||||
</Carousel>
|
</Carousel>
|
||||||
|
)}
|
||||||
<Box
|
<Box
|
||||||
className="padded-container"
|
className="padded-container"
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
+10
-40
@@ -68,6 +68,7 @@ import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
|||||||
import { MdiMusic } from "../../components/icons/mdiMusic";
|
import { MdiMusic } from "../../components/icons/mdiMusic";
|
||||||
import { usePlaybackStore } from "../../utils/store/playback";
|
import { usePlaybackStore } from "../../utils/store/playback";
|
||||||
import { Tooltip } from "@mui/material";
|
import { Tooltip } from "@mui/material";
|
||||||
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -533,10 +534,19 @@ const ItemDetail = () => {
|
|||||||
state.setSelectedSubtitleTrack,
|
state.setSelectedSubtitleTrack,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||||
|
|
||||||
const [directors, setDirectors] = useState([]);
|
const [directors, setDirectors] = useState([]);
|
||||||
const [writers, setWriters] = useState([]);
|
const [writers, setWriters] = useState([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (item.isSuccess) {
|
if (item.isSuccess) {
|
||||||
|
setAppBackdrop(
|
||||||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
|
item.data.Type === BaseItemKind.Episode
|
||||||
|
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
|
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
|
item.data.Id,
|
||||||
|
);
|
||||||
let direTp = item.data.People.filter(
|
let direTp = item.data.People.filter(
|
||||||
(itm) => itm.Type == "Director",
|
(itm) => itm.Type == "Director",
|
||||||
);
|
);
|
||||||
@@ -566,46 +576,6 @@ const ItemDetail = () => {
|
|||||||
if (item.isSuccess && similarItems.isSuccess) {
|
if (item.isSuccess && similarItems.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box className="item-detail-backdrop">
|
|
||||||
{item.data.BackdropImageTags.length != 0 && (
|
|
||||||
<Blurhash
|
|
||||||
hash={
|
|
||||||
item.data.ImageBlurHashes.Backdrop[
|
|
||||||
item.data.BackdropImageTags[0]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
width="100%"
|
|
||||||
height="100%"
|
|
||||||
resolutionX={14}
|
|
||||||
resolutionY={22}
|
|
||||||
style={{
|
|
||||||
aspectRatio: "0.666",
|
|
||||||
}}
|
|
||||||
punch={1}
|
|
||||||
className="item-detail-image-blurhash"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{!!item.data.ParentBackdropImageTags &&
|
|
||||||
item.data.ParentBackdropImageTags.length != 0 && (
|
|
||||||
<Blurhash
|
|
||||||
hash={
|
|
||||||
item.data.ImageBlurHashes.Backdrop[
|
|
||||||
item.data
|
|
||||||
.ParentBackdropImageTags[0]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
width="100%"
|
|
||||||
height="100%"
|
|
||||||
resolutionX={14}
|
|
||||||
resolutionY={22}
|
|
||||||
style={{
|
|
||||||
aspectRatio: "0.666",
|
|
||||||
}}
|
|
||||||
punch={1}
|
|
||||||
className="item-detail-image-blurhash"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
<Box
|
<Box
|
||||||
recomponent="main"
|
recomponent="main"
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ body {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
filter: blur(50px);
|
z-index: -1;
|
||||||
|
filter: blur(80px);
|
||||||
&-container {
|
&-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
|||||||
Reference in new issue
Block a user