diff --git a/public/assetsStatic/LogoBigBlack.png b/public/assetsStatic/LogoBigBlack.png new file mode 100644 index 0000000..8ac3d99 Binary files /dev/null and b/public/assetsStatic/LogoBigBlack.png differ diff --git a/public/assetsStatic/LogoBigBlack.svg b/public/assetsStatic/LogoBigBlack.svg new file mode 100644 index 0000000..c944f47 --- /dev/null +++ b/public/assetsStatic/LogoBigBlack.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/public/assetsStatic/splashBg.png b/public/assetsStatic/splashBg.png new file mode 100644 index 0000000..d1e1047 Binary files /dev/null and b/public/assetsStatic/splashBg.png differ diff --git a/public/installerSideBarImage.bmp b/public/installerSideBarImage.bmp index 0a3a00b..3da9922 100644 Binary files a/public/installerSideBarImage.bmp and b/public/installerSideBarImage.bmp differ diff --git a/public/splash.html b/public/splash.html index a02cb91..0376674 100644 --- a/public/splash.html +++ b/public/splash.html @@ -12,7 +12,7 @@
- +
@@ -37,9 +37,9 @@ transform: translate(-50%, -50%); width: calc(100vw + 5em); height: calc(100vh + 5em); - background-image: url("./assetsStatic/meshbackground.png"); + background-image: url("./assetsStatic/splashBg.png"); background-size: cover; - filter: brightness(0.3); + background-position: center; } main { @@ -56,7 +56,7 @@ } img { - width: 100%; + width: 75%; object-fit: contain; } @@ -67,17 +67,17 @@ width: 100vw; background: hsla(255, 100%, 4%, 0.5); z-index: 1; - height: 14px; + height: 8px; overflow: hidden; + backdrop-filter: blur(5px); } .indicator { background: hsl(337, 96%, 56%); width: 100%; height: 100%; - /* transform: scaleX(0.5); */ transform-origin: left; - animation: loading 1s infinite; + animation: loading 0.8s infinite ease-in-out; } @keyframes loading { diff --git a/src/components/carouselSlide/index.jsx b/src/components/carouselSlide/index.jsx index e76130e..c3b363b 100644 --- a/src/components/carouselSlide/index.jsx +++ b/src/components/carouselSlide/index.jsx @@ -26,6 +26,9 @@ import LikeButton from "../buttons/likeButton"; import MarkPlayedButton from "../buttons/markPlayedButton"; import { useCarouselStore } from "../../utils/store/carousel"; import PlayButton from "../buttons/playButton"; +import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client"; + +const availableSpecialRoutes = [BaseItemKind.Series, BaseItemKind.BoxSet]; /** * @typedef {Object} Props @@ -49,6 +52,16 @@ const CarouselSlide = ({ item }) => { networkMode: "always", }); + const handleMoreInfo = () => { + if (availableSpecialRoutes.includes(item.Type)) { + navigate(`/${item.Type.toLocaleLowerCase()}/${item.Id}`); + } else if (!!item.Role) { + navigate(`/person/${item.Id}`); + } else { + navigate(`/item/${item.Id}`); + } + }; + const [animationDirection] = useCarouselStore((state) => [ state.direction, ]); @@ -272,7 +285,7 @@ const CarouselSlide = ({ item }) => { color="white" variant="outlined" endIcon={} - onClick={() => navigate(`/item/${item.Id}`)} + onClick={handleMoreInfo} > More info diff --git a/src/routes/person/index.jsx b/src/routes/person/index.jsx index 79a878e..7fc446d 100644 --- a/src/routes/person/index.jsx +++ b/src/routes/person/index.jsx @@ -71,6 +71,7 @@ import { usePlaybackStore } from "../../utils/store/playback"; import { Tooltip } from "@mui/material"; import { useBackdropStore } from "../../utils/store/backdrop"; import { ActorCard } from "../../components/card/actorCards"; + function TabPanel(props) { const { children, value, index, ...other } = props; @@ -83,7 +84,7 @@ function TabPanel(props) { {...other} style={{ marginTop: "1em" }} > - {value === index && {children}} + {value === index &&
{children}
}
); } @@ -103,9 +104,6 @@ function a11yProps(index) { const PersonTitlePage = () => { const { id } = useParams(); - const navigate = useNavigate(); - const [primageImageLoaded, setPrimaryImageLoaded] = useState(false); - const [backdropImageLoaded, setBackdropImageLoaded] = useState(false); const user = useQuery({ queryKey: ["user"], @@ -131,104 +129,6 @@ const PersonTitlePage = () => { refetchOnWindowFocus: true, }); - const similarItems = useQuery({ - queryKey: ["item", id, "similarItem"], - queryFn: async () => { - let result; - if (item.data.Type == "Movie") { - result = await getLibraryApi(window.api).getSimilarMovies({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } else if (item.data.Type == "Series") { - result = await getLibraryApi(window.api).getSimilarShows({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } else if (item.data.Type == "MusicAlbum") { - result = await getLibraryApi(window.api).getSimilarAlbums({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } else if (item.data.Type == "MusicArtist") { - result = await getLibraryApi(window.api).getSimilarArtists({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } else { - result = await getLibraryApi(window.api).getSimilarItems({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } - return result.data; - }, - enabled: item.isSuccess, - networkMode: "always", - refetchOnWindowFocus: true, - }); - - const seasons = useQuery({ - queryKey: ["item", id, "seasons"], - queryFn: async () => { - const result = await getTvShowsApi(window.api).getSeasons({ - seriesId: item.data.Id, - isSpecialSeason: false, - }); - return result.data; - }, - enabled: item.isSuccess && item.data.Type == "Series", - networkMode: "always", - refetchOnWindowFocus: true, - }); - - const nextUpEpisode = useQuery({ - queryKey: ["item", id, "nextUp"], - queryFn: async () => { - const result = await getTvShowsApi(window.api).getNextUp({ - userId: user.data.Id, - limit: 1, - parentId: item.data.Id, - disableFirstEpisode: true, - }); - return result.data; - }, - enabled: item.isSuccess && item.data.Type == "Series", - networkMode: "always", - refetchOnWindowFocus: true, - }); - - const [currentSeason, setCurrentSeason] = useState(0); - const episodes = useQuery({ - queryKey: ["item", id, `season ${currentSeason + 1}`, "episodes"], - queryFn: async () => { - const result = await getItemsApi(window.api).getItems({ - userId: user.data.Id, - parentId: seasons.data.Items[currentSeason].Id, - fields: [ItemFields.SeasonUserData, "Overview"], - excludeLocationTypes: [LocationType.Virtual], - }); - return result.data; - }, - enabled: seasons.isSuccess, - networkMode: "always", - refetchOnWindowFocus: true, - }); - - const upcomingEpisodes = useQuery({ - queryKey: ["item", id, "episode", "upcomingEpisodes"], - queryFn: async () => { - const result = await getItemsApi(window.api).getItems({ - userId: user.data.Id, - parentId: item.data.ParentId, - startIndex: item.data.IndexNumber, - }); - return result.data; - }, - enabled: item.isSuccess && item.data.Type == BaseItemKind.Episode, - networkMode: "always", - }); - const personMovies = useQuery({ queryKey: ["item", id, "personMovies"], queryFn: async () => { @@ -239,6 +139,7 @@ const PersonTitlePage = () => { recursive: true, sortBy: ["PremiereDate", "ProductionYear", "SortName"], sortOrder: ["Descending"], + excludeLocationTypes: [LocationType.Virtual], }); return result.data; }, @@ -255,6 +156,7 @@ const PersonTitlePage = () => { recursive: true, sortBy: ["PremiereDate", "ProductionYear", "SortName"], sortOrder: ["Descending"], + excludeLocationTypes: [LocationType.Virtual], }); return result.data; }, @@ -272,6 +174,7 @@ const PersonTitlePage = () => { recursive: true, sortBy: ["PremiereDate", "ProductionYear", "SortName"], sortOrder: ["Descending"], + excludeLocationTypes: [LocationType.Virtual], }); return result.data; }, @@ -287,6 +190,7 @@ const PersonTitlePage = () => { includeItemTypes: [BaseItemKind.Photo], recursive: true, sortBy: ["PremiereDate", "ProductionYear", "SortName"], + excludeLocationTypes: [LocationType.Virtual], }); return result.data; }, @@ -303,6 +207,7 @@ const PersonTitlePage = () => { recursive: true, fields: ["SeasonUserData", "Overview"], sortBy: ["PremiereDate", "ProductionYear", "SortName"], + excludeLocationTypes: [LocationType.Virtual], }); return result.data; }, @@ -310,123 +215,35 @@ const PersonTitlePage = () => { networkMode: "always", }); - const musicTracks = useQuery({ - queryKey: ["item", id, "musicTracks"], - queryFn: async () => { - const result = await getItemsApi(window.api).getItems({ - userId: user.data.Id, - parentId: item.data.Id, - }); - return result.data; - }, - enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicAlbum, - networkMode: "always", - }); - - const artistDiscography = useQuery({ - queryKey: ["item", id, "artist", "discography"], - queryFn: async () => { - const result = await getItemsApi(window.api).getItems({ - albumArtistIds: [item.data.Id], - sortBy: ["PremiereDate", "ProductionYear", "SortName"], - sortOrder: [SortOrder.Descending], - recursive: true, - includeItemTypes: [BaseItemKind.MusicAlbum], - userId: user.data.Id, - fields: [ItemFields.Overview], - }); - return result.data; - }, - enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist, - networkMode: "always", - }); - - const artistSongs = useQuery({ - queryKey: ["item", id, "artist", "songs"], - queryFn: async () => { - const result = await getItemsApi(window.api).getItems({ - artistIds: [item.data.Id], - sortBy: ["PremiereDate", "ProductionYear", "SortName"], - sortOrder: [SortOrder.Descending], - recursive: true, - includeItemTypes: [BaseItemKind.Audio], - userId: user.data.Id, - fields: [ItemFields.Overview], - }); - return result.data; - }, - enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist, - networkMode: "always", - }); - - const artistAppearances = useQuery({ - queryKey: ["item", id, "artist", "appearences"], - queryFn: async () => { - const result = await getItemsApi(window.api).getItems({ - contributingArtistIds: [item.data.Id], - excludeItemIds: [item.data.Id], - sortBy: ["PremiereDate", "ProductionYear", "SortName"], - sortOrder: [SortOrder.Descending], - recursive: true, - includeItemTypes: [BaseItemKind.MusicAlbum], - userId: user.data.Id, - }); - return result.data; - }, - enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist, - networkMode: "always", - }); - - const handleMarkPlayedOrunPlayed = async () => { - let result; - if (!item.data.UserData.Played) { - result = await getPlaystateApi(window.api).markPlayedItem({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } else if (item.data.UserData.Played) { - result = await getPlaystateApi(window.api).markUnplayedItem({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } - item.refetch(); - }; - const handleLiking = async () => { - let result; - if (item.data.UserData.IsFavorite) { - result = await getUserLibraryApi(window.api).unmarkFavoriteItem({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } else if (!item.data.UserData.IsFavorite) { - result = await getUserLibraryApi(window.api).markFavoriteItem({ - userId: user.data.Id, - itemId: item.data.Id, - }); - } - item.refetch(); - }; - const handleLikingTrack = async (track) => { - let result; - if (track.UserData.IsFavorite) { - result = await getUserLibraryApi(window.api).unmarkFavoriteItem({ - userId: user.data.Id, - itemId: track.Id, - }); - } else if (!track.UserData.IsFavorite) { - result = await getUserLibraryApi(window.api).markFavoriteItem({ - userId: user.data.Id, - itemId: track.Id, - }); - } - item.refetch(); - musicTracks.refetch(); - }; - const [activePersonTab, setActivePersonTab] = useState(0); - const personTabs = ["Movies", "TV Shows", "Books", "Photos", "Episodes"]; + const personTabs = [ + { + title: "Movies", + data: personMovies, + queryKey: ["item", id, "personMovies"], + }, + { + title: "TV Shows", + data: personShows, + queryKey: ["item", id, "personShows"], + }, + { + title: "Books", + data: personBooks, + queryKey: ["item", id, "personBooks"], + }, + { + title: "Photos", + data: personPhotos, + queryKey: ["item", id, "personPhotos"], + }, + { + title: "Episodes", + data: personEpisodes, + queryKey: ["item", id, "personEpisodes"], + }, + ]; useEffect(() => { if ( @@ -436,15 +253,15 @@ const PersonTitlePage = () => { personPhotos.isSuccess && personEpisodes.isSuccess ) { - if (personMovies.data.Items.length != 0) { + if (personMovies.data.TotalRecordCount != 0) { setActivePersonTab(0); - } else if (personShows.data.Items.length != 0) { + } else if (personShows.data.TotalRecordCount != 0) { setActivePersonTab(1); - } else if (personBooks.data.Items.length != 0) { + } else if (personBooks.data.TotalRecordCount != 0) { setActivePersonTab(2); - } else if (personPhotos.data.Items.length != 0) { + } else if (personPhotos.data.TotalRecordCount != 0) { setActivePersonTab(3); - } else if (personEpisodes.data.Items.length != 0) { + } else if (personEpisodes.data.TotalRecordCount != 0) { setActivePersonTab(4); } } @@ -455,97 +272,10 @@ const PersonTitlePage = () => { personPhotos.isLoading, personEpisodes.isLoading, ]); - - const artistTabs = ["Discography", "Songs", "Appearances"]; - const [activeArtistTab, setActiveArtistTab] = useState(0); - - useEffect(() => { - if ( - artistDiscography.isSuccess && - artistSongs.isSuccess && - artistAppearances.isSuccess - ) { - if (artistDiscography.data.TotalRecordCount != 0) { - setActivePersonTab(0); - } else if (artistSongs.data.TotalRecordCount != 0) { - setActivePersonTab(1); - } else if (artistAppearances.data.TotalRecordCount != 0) { - setActivePersonTab(2); - } - } - }, [ - artistDiscography.isLoading, - artistSongs.isLoading, - artistAppearances.isLoading, - ]); - - const [videoTracks, setVideoTracks] = useState([]); - const [audioTracks, setAudioTracks] = useState([]); - const [subtitleTracks, setSubtitleTracks] = useState([]); - - const [currentVideoTrack, setCurrentVideoTrack] = useState(""); - const [currentAudioTrack, setCurrentAudioTrack] = useState(""); - const [currentSubTrack, setCurrentSubTrack] = useState(""); - - const filterMediaStreamVideo = (source) => { - if (source.Type == MediaStreamType.Video) { - return true; - } - return false; - }; - const filterMediaStreamAudio = (source) => { - if (source.Type == MediaStreamType.Audio) { - return true; - } - return false; - }; - const filterMediaStreamSubtitle = (source) => { - if (source.Type == MediaStreamType.Subtitle) { - return true; - } - return false; - }; - - useEffect(() => { - if (item.isSuccess && !!item.data.MediaStreams) { - let videos = item.data.MediaStreams.filter( - filterMediaStreamVideo, - ); - let audios = item.data.MediaStreams.filter( - filterMediaStreamAudio, - ); - let subs = item.data.MediaStreams.filter( - filterMediaStreamSubtitle, - ); - - setVideoTracks(videos); - setAudioTracks(audios); - setSubtitleTracks(subs); - } - }, [item.isSuccess]); - - const [ - setUrl, - setPosition, - setDuration, - setItemId, - setItemName, - setSubtitleTracksStore, - setSelectedSubtitleTrack, - ] = usePlaybackStore((state) => [ - state.setUrl, - state.setPosition, - state.setDuration, - state.setItemId, - state.setItemName, - state.setSubtitleTracks, - state.setSelectedSubtitleTrack, - ]); - const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]); - const [directors, setDirectors] = useState([]); - const [writers, setWriters] = useState([]); + const [animationDirection, setAnimationDirection] = useState("forward"); + useEffect(() => { if (item.isSuccess) { setAppBackdrop( @@ -555,18 +285,10 @@ const PersonTitlePage = () => { : `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`, item.data.Id, ); - let direTp = item.data.People.filter( - (itm) => itm.Type == "Director", - ); - setDirectors(direTp); - let writeTp = item.data.People.filter( - (itm) => itm.Type == "Writer", - ); - setWriters(writeTp); } }, [item.isSuccess]); - if (item.isLoading || similarItems.isLoading) { + if (item.isLoading) { return ( { ); } - if (item.isSuccess && similarItems.isSuccess) { + if (item.isSuccess) { return (
{ disableLikeButton disableMarkAsPlayedButton /> +
+
+ { + if (newVal > activePersonTab) { + setAnimationDirection("forward"); + } else if (newVal < activePersonTab) { + setAnimationDirection("backwards"); + } + setActivePersonTab(newVal); + }} + > + {personTabs.map((tab, index) => { + return ( + + ); + })} + + +
+ + {personTabs.map((tab, index) => { + return ( + + + {tab.data.isSuccess && + tab.data.data.Items.map( + ( + tabitem, + index, + ) => { + return ( + + ); + }, + )} + + + ); + })} + +
); } - if (item.isError || similarItems.isError) { + if (item.isError) { return ; } }; diff --git a/src/routes/person/person.module.scss b/src/routes/person/person.module.scss index e69de29..768f83b 100644 --- a/src/routes/person/person.module.scss +++ b/src/routes/person/person.module.scss @@ -0,0 +1,22 @@ +/** @format */ + +.item-detail-person { + &-container { + position: relative; + width: 100%; + } + &-header { + width: 100%; + } + &-cards { + display: grid; + align-items: start; + } +} + +.col-8 { + grid-template-columns: repeat(8, minmax(0, 1fr)); +} +.col-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); +}