Skip to content

Commit

Permalink
update banner
Browse files Browse the repository at this point in the history
  • Loading branch information
stiemsdev committed Dec 24, 2024
1 parent 556f660 commit a326e97
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 19 deletions.
51 changes: 51 additions & 0 deletions src/common/handleFullScreenBanner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const handleFullScreenBanner = () => {
function noScroll() {
window.scrollTo(0, 0);
}

const banner = document.getElementById('home--Banner');
if (banner) {
banner.style.position = 'fixed';
banner.style.top = '0';
banner.style.width = '100%';
banner.style.zIndex = '10';
}

window.addEventListener('scroll', () => {
const scrollPosition = window.scrollY;
const pageHeight = document.documentElement.scrollHeight - window.innerHeight;
const scrollPercentage = (scrollPosition / pageHeight) * 100;

if (scrollPercentage >= 15) {
banner.style.display = 'none';
} else {
banner.style.display = 'block';
}
});

};

// const banner = document.getElementById('home--Banner');
// const homeHero = document.getElementById('home--Hero');

// if (banner && homeHero) {
// const observer = new IntersectionObserver(
// ([entry]) => {
// if (entry.isIntersecting) {
// banner.style.position = 'fixed';
// banner.style.top = '0';
// banner.style.width = '100%';
// banner.style.zIndex = '10';
// banner.style.display = 'block';
// } else {
// banner.style.display = 'none';
// }
// },
// { threshold: 0.1 }
// );

// observer.observe(homeHero);
// }
// };

export default handleFullScreenBanner;
37 changes: 19 additions & 18 deletions src/components/Home2023/Banner/index.jsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
import React from "react";
import Split from "../../Split";
import Link from 'next/link';
import handleFullScreenBanner from "../../../common/handleFullScreenBanner";

const Banner = () => {
// const Banner = () => {
const Banner = ({ theme, lr }) => {
React.useEffect(() => {
handleFullScreenBanner();
}, []);
return (
<section id="home--Banner" className="section-2023 pt-40">
<section id="home--Banner" className="section-2023 pt-60">
<div className="container">
{/* <div className="flex-box"> */}
{/* <div className="flex-box__right__mw"> */}
<div className="banner-container">
<Link href="https://apps.apple.com/us/app/lto-universal-wallet/id6448051682" target="_blank">
<a>
<img className="banner-link" src="/img/home-2023/apple-store500x300.png" alt="Download on the App Store"/>
</a>
</Link>
<Link href="https://play.google.com/store/apps/details?id=com2.ltonetwork.universal" target="_blank">
<a>
<img className="banner-link" src="/img/home-2023/play-store500x300.png" alt="Download on the Play Store"/>
</a>
</Link>
</div>
{/* </div> */}
{/* </div> */}
<div className="banner-container">
<Link href="https://apps.apple.com/us/app/lto-universal-wallet/id6448051682" target="_blank">
<a>
<img className="banner-link" src="/img/home-2023/apple-store500x300.png" alt="Download on the App Store"/>
</a>
</Link>
<Link href="https://play.google.com/store/apps/details?id=com2.ltonetwork.universal" target="_blank">
<a>
<img className="banner-link" src="/img/home-2023/play-store500x300.png" alt="Download on the Play Store"/>
</a>
</Link>
</div>
</div>
</section>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/HomeHero/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class HomeHero extends React.Component {

render() {
return (
<div className="hero" onMouseMove={heroMouseMove} onTouchMove={heroMouseMove}>
<div id="home--Hero" className="hero" onMouseMove={heroMouseMove} onTouchMove={heroMouseMove}>
<div className="hero__inner">
<div className="hero__image" data-x="0.05" data-y="0.05" data-scale="1.05"><img src="/img/hero/layer-sky.jpg"/></div>
<div className="hero__image hero__image--sun" data-x="0.065" data-y="0.065" data-scale="1.1"><img src="/img/hero/layer-sunNoSparkle.png"/></div>
Expand Down

0 comments on commit a326e97

Please sign in to comment.