feat(web): Add new About page #258

This commit is contained in:
Prayag Prajapati committed 2024-02-17 16:56:58 +05:30
1 parent bf89f35ddd
commit b155daa83b
34 files changed
+1749 -758

No files matched your search

+2 -2
View File
@@ -52,8 +52,8 @@
}
}
&-backdrop {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: top;
opacity: 0;
+18 -3
View File
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import React, { useState, useLayoutEffect } from "react";
import React, { useState, useLayoutEffect, useRef } from "react";
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
@@ -16,7 +16,8 @@ import { Blurhash } from "react-blurhash";
import { Link, NavLink, useParams } from "react-router-dom";
import { motion } from "framer-motion";
import { motion, useScroll } from "framer-motion";
import useParallax from "../../utils/hooks/useParallax";
import {
BaseItemKind,
@@ -219,6 +220,9 @@ const EpisodeTitlePage = () => {
) {
return "Dolby Digital+";
}
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("dd")) {
return "Dolby Digital";
}
return "";
};
@@ -233,6 +237,13 @@ const EpisodeTitlePage = () => {
return "2.0";
};
const pageRef = useRef(null);
const { scrollYProgress } = useScroll({
target: pageRef,
offset: ["start start", "60vh start"],
});
const parallax = useParallax(scrollYProgress, 50);
if (item.isPending) {
return (
<Box
@@ -263,11 +274,12 @@ const EpisodeTitlePage = () => {
ease: "easeInOut",
}}
className="scrollY padded-top flex flex-column item item-episode"
ref={pageRef}
>
<div className="item-hero flex flex-row">
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
<motion.img
alt={item.data.Name}
src={api.getItemImageUrl(
item.data.ParentBackdropItemId,
@@ -280,6 +292,9 @@ const EpisodeTitlePage = () => {
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
style={{
y: parallax,
}}
/>
) : (
<></>