diff --git a/public/image.png b/public/image.png deleted file mode 100644 index d9dcfbc..0000000 Binary files a/public/image.png and /dev/null differ diff --git a/public/lava.jpg b/public/lava.jpg new file mode 100644 index 0000000..a7a2bb2 Binary files /dev/null and b/public/lava.jpg differ diff --git a/public/lava_flows.jpg b/public/lava_flows.jpg new file mode 100644 index 0000000..c685c66 Binary files /dev/null and b/public/lava_flows.jpg differ diff --git a/src/app/page.tsx b/src/app/page.tsx index 5ee2c09..a1a2321 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,13 +1,13 @@ import Image from "next/image"; -import Navbar from "@/components/tabbar"; +import Navbar from "@/components/tabbar_dd"; export default function Home() { return ( -
+
-
+
- Background Image + Background Image
diff --git a/src/components/tabbar.tsx b/src/components/tabbar.tsx index 4e5502a..6981de0 100644 --- a/src/components/tabbar.tsx +++ b/src/components/tabbar.tsx @@ -5,9 +5,11 @@ export default function Navbar(){

Logo

- + + - + +
@@ -15,4 +17,4 @@ export default function Navbar(){
) -} \ No newline at end of file +} diff --git a/src/components/tabbar_dd.tsx b/src/components/tabbar_dd.tsx new file mode 100644 index 0000000..f29ab70 --- /dev/null +++ b/src/components/tabbar_dd.tsx @@ -0,0 +1,70 @@ +"use client" + +import { useState, useEffect, useRef} from "react"; + +export default function Navbar() { + const [isDropdownOpen, setIsDropdownOpen] = useState(false); + const dropdownRef = useRef(null); + + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if ( + dropdownRef.current && + !dropdownRef.current.contains(event.target as Node) + ) { + setIsDropdownOpen(false); + } + }; + + const handleEscapeKey = (event: KeyboardEvent) => { + if (event.key === "Escape") { + setIsDropdownOpen(false); + } + }; + + document.addEventListener("mousedown", handleClickOutside); + document.addEventListener("keydown", handleEscapeKey); + + return () => { + document.removeEventListener("mousedown", handleClickOutside); + document.removeEventListener("keydown", handleEscapeKey); + }; + }, []); + + return ( +
+
+

Logo

+
+
+ + + + + +
+ + + {isDropdownOpen && ( +
+
    +
  • Our Mission
  • +
  • The Team
  • +
  • Contact Us
  • +
+
+ )} +
+
+
+
+

User

+
+
+ ); +}