diff --git a/src/assets/images/12.png b/src/assets/images/12.png new file mode 100644 index 0000000..39f00b5 Binary files /dev/null and b/src/assets/images/12.png differ diff --git a/src/assets/images/page-bg-1.png b/src/assets/images/page-bg-1.png new file mode 100644 index 0000000..8086dff Binary files /dev/null and b/src/assets/images/page-bg-1.png differ diff --git a/src/utils/scroll.js b/src/utils/scroll.js index d38d44b..fe952c4 100644 --- a/src/utils/scroll.js +++ b/src/utils/scroll.js @@ -90,8 +90,8 @@ class scroll { linearFormula = (currentScroll, position1, position2, scroll1, scroll2) => { const alpha = (currentScroll - scroll1) / (scroll2 - scroll1); const deltaPosition = position2 - position1; - const currectPosition = position1 + deltaPosition * alpha; - return currectPosition; + const currentPosition = position1 + deltaPosition * alpha; + return currentPosition; }; videoLinearFormula = (currentScroll) => { diff --git a/src/views/Home/Page1/Header/index.js b/src/views/Home/Page1/Header/index.js index 9d7b4cd..0202527 100644 --- a/src/views/Home/Page1/Header/index.js +++ b/src/views/Home/Page1/Header/index.js @@ -25,8 +25,8 @@ const Light = ({ degree }) => { draggable={false} src={lightIcon} alt="" - className={_.join(["absolute z-50 light-animation"], " ")} - style={{ transform: `scale(6) translateY(24%)` }} + className={_.join(["absolute z-50 light-animation opacity-50"], " ")} + style={{ transform: `scale(6) translateY(24%)`, pointerEvents : 'none' }} /> ); diff --git a/src/views/Home/Page1/Header/index.scss b/src/views/Home/Page1/Header/index.scss index c3a0033..f9246dd 100644 --- a/src/views/Home/Page1/Header/index.scss +++ b/src/views/Home/Page1/Header/index.scss @@ -6,42 +6,42 @@ @keyframes light-animation { 0% { - opacity: 1; + opacity: 0.5; } 3% { opacity: 0; } 6% { - opacity: 1; + opacity: 0.5; } 9% { opacity: 0; } 30% { - opacity: 1; + opacity: 0.5; } 33% { opacity: 0; } 36% { - opacity: 1; + opacity: 0.5; } 39% { opacity: 0; } 60% { - opacity: 1; + opacity: 0.5; } 63% { opacity: 0; } 66% { - opacity: 1; + opacity: 0.5; } 69% { opacity: 0; } 100% { - opacity: 1; + opacity: 0.5; } } diff --git a/src/views/Home/Page2/Mobile/index.js b/src/views/Home/Page2/Mobile/index.js index e9eb1d3..154c457 100644 --- a/src/views/Home/Page2/Mobile/index.js +++ b/src/views/Home/Page2/Mobile/index.js @@ -10,7 +10,7 @@ function Mobile({ mobilePosition, videoPosition, autoPlay, selectedVideo, unit } return (
diff --git a/src/views/Home/Page2/index.js b/src/views/Home/Page2/index.js index c329f50..4167cee 100644 --- a/src/views/Home/Page2/index.js +++ b/src/views/Home/Page2/index.js @@ -3,11 +3,13 @@ import _ from "lodash"; import scroll from "../../../utils/scroll"; import Mobile from "./Mobile"; import qrImage from "../../../assets/images/qrImage.png"; -import leftBg from "../../../assets/images/page-bg.png"; +import rightBg from "../../../assets/images/page-bg.png"; +import leftBg from "../../../assets/images/page-bg-1.png"; export default function Page2({ list, page, autoPlay }) { const height = window.innerHeight; const [top, setTop] = useState(window.innerHeight); + const [scale, setScale] = useState(null); const [videoPosition, setVideoPosition] = useState(null); const [unit, setUnit] = useState(null); const [boxPosition, setBoxPosition] = useState({ @@ -28,6 +30,16 @@ export default function Page2({ list, page, autoPlay }) { 2.5 * height ) ); + + setScale( + scroll.linearFormula( + window.scrollY > height ? height : window.scrollY, + 0.8, + 1, + 0, + height + ) + ); if (window.scrollY > 3.5 * height && window.scrollY < 4 * height) { setVideoPosition( window.scrollY > 4 * height @@ -90,6 +102,7 @@ export default function Page2({ list, page, autoPlay }) { window.addEventListener("scroll", (e) => { const scrollY = window.scrollY; setTop(scroll.homeScrollHandler(page)); + setScale(scaleHandler(scrollY)); boxPositionHandler(scrollY); mobilePositionHandler(scrollY); if (window.scrollY > 2 * height && window.scrollY < 3.5 * height) { @@ -192,6 +205,24 @@ export default function Page2({ list, page, autoPlay }) { setUnit(4); } }; + + const scaleHandler = (scrollY) => { + if (scrollY === 0) { + setScale(0.8); + } else if (scrollY > 0 && scrollY <= height) { + setScale( + scroll.linearFormula( + scrollY, + 0.8, + 1, + 0, + height + ) + ); + } else { + setScale(1); + } + }; return (
e.stopPropagation()} @@ -207,12 +238,14 @@ export default function Page2({ list, page, autoPlay }) { ? 90 - (window.scrollY / height) * 90 : 0 : 90 - }deg)`, + }deg) scale(${scale})`, }} >
- -
- +
+ +
+ +
+
-
{/* mobile phone */} 0 ? "opacity-0 z-0" : "opacity-100 z-30", + top > 0 ? "opacity-0" : "opacity-100 z-10", ], " " )} diff --git a/src/views/Home/VideoTube/index.js b/src/views/Home/VideoTube/index.js index bbb6dc1..0f9048c 100644 --- a/src/views/Home/VideoTube/index.js +++ b/src/views/Home/VideoTube/index.js @@ -20,12 +20,12 @@ function VodTube({ page, selectedVideo, info, - bookSection, - loading, + // bookSection, + // loading, getInfo, - categories, - setVideoActive, - allBooks, + // categories, + // setVideoActive, + // allBooks, theme, }) { const [top, setTop] = useState(window.innerHeight); diff --git a/src/views/Home/index.js b/src/views/Home/index.js index 986acb5..3555d06 100644 --- a/src/views/Home/index.js +++ b/src/views/Home/index.js @@ -33,7 +33,7 @@ export default function Home() { return (