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