-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d592888
commit e2d0e3c
Showing
4 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Navbar from "@/components/layout/navbar"; | ||
|
||
export default function LandingLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<> | ||
<Navbar /> | ||
{children} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use client"; | ||
import { useState, useEffect } from "react"; | ||
|
||
const Navbar = ({}: {}) => { | ||
const [scroll, setScroll] = useState(0); | ||
|
||
useEffect(() => { | ||
const handleScroll = () => { | ||
setScroll(window.scrollY); | ||
}; | ||
window.addEventListener("scroll", handleScroll); | ||
return () => window.removeEventListener("scroll", handleScroll); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<nav | ||
className={`fixed top-0 left-0 right-0 h-14 z-50 bg-slate-50 transition duration-300 ${scroll < 50 ? "bg-opacity-0" : "bg-opacity-70 border-b backdrop-blur-md duration-500"}`} | ||
/> | ||
<nav className="fixed left-0 right-0 top-0 z-50 mx-auto flex h-14 items-center w-full max-w-screen-xl justify-between px-2"> | ||
<h1 className="text-3xl font-semibold">CallMap</h1> | ||
</nav> | ||
</> | ||
); | ||
}; | ||
|
||
export default Navbar; |