|
1 |
| -import React from "react"; |
| 1 | +import React, { useEffect } from "react"; |
2 | 2 | import styles from "./Footer.module.css";
|
3 | 3 | import FooterLayout from "@theme-original/Footer";
|
4 |
| -import { useLocation } from "@docusaurus/router"; |
| 4 | +import { useLocation } from "@docusaurus/router"; |
5 | 5 |
|
6 | 6 | const Footer = () => {
|
7 | 7 | const location = useLocation();
|
8 | 8 | const isHomePage = location.pathname === "/";
|
| 9 | + |
| 10 | + useEffect(() => { |
| 11 | + import("@dotlottie/player-component"); |
| 12 | + }, []); |
| 13 | + |
| 14 | + useEffect(() => { |
| 15 | + const navbar = document.querySelector(".navbar"); |
| 16 | + const footer = document.querySelector(".footerContainer"); |
| 17 | + |
| 18 | + if (!navbar || !footer || !isHomePage) return; |
| 19 | + |
| 20 | + const observer = new IntersectionObserver( |
| 21 | + (entries) => { |
| 22 | + if (entries[0].isIntersecting) { |
| 23 | + navbar.style.backgroundColor = "#61AE9D"; |
| 24 | + } else { |
| 25 | + navbar.style.backgroundColor = ""; |
| 26 | + } |
| 27 | + }, |
| 28 | + { threshold: 1 } |
| 29 | + ); |
| 30 | + |
| 31 | + observer.observe(footer); |
| 32 | + |
| 33 | + return () => observer.disconnect(); |
| 34 | + }, []); |
| 35 | + |
9 | 36 | return (
|
10 |
| - <div> |
| 37 | + <div className={`footerContainer ${ isHomePage ? styles.footerContainer : ""}`}> |
11 | 38 | <FooterLayout />
|
12 | 39 | {isHomePage && (
|
13 |
| - <div className={styles.animatedFooterContainer}> |
14 |
| - <div className={styles.footer_bg}> |
15 |
| - <div className={styles.footer_bg_one}></div> |
16 |
| - <div className={styles.footer_bg_two}></div> |
17 |
| - </div> |
| 40 | + <div className={styles.lottieContainer}> |
| 41 | + <dotlottie-player |
| 42 | + src="https://lottie.host/f466ad48-fde8-452a-aca8-2d153e8969ff/l92UT8AOsP.lottie" |
| 43 | + background="transparent" |
| 44 | + speed="1" |
| 45 | + loop |
| 46 | + autoplay |
| 47 | + ></dotlottie-player> |
18 | 48 | </div>
|
19 | 49 | )}
|
20 | 50 | </div>
|
|
0 commit comments