forked from sashaastiadi/www_mycelium_net
refactor: update navigation and section IDs with smoother scroll behavior
This commit is contained in:
@@ -5,7 +5,7 @@ import { motion, useInView } from 'framer-motion'
|
|||||||
|
|
||||||
export function AnimatedSection({ children }: { children: React.ReactNode }) {
|
export function AnimatedSection({ children }: { children: React.ReactNode }) {
|
||||||
const ref = useRef(null)
|
const ref = useRef(null)
|
||||||
const isInView = useInView(ref, { once: false, margin: '-50% 0px -50% 0px' })
|
const isInView = useInView(ref, { once: true, margin: '-20% 0px -20% 0px' })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<motion.section
|
<motion.section
|
||||||
|
@@ -28,7 +28,7 @@ const features = [
|
|||||||
|
|
||||||
export function Benefits() {
|
export function Benefits() {
|
||||||
return (
|
return (
|
||||||
<section id="benefits" className="bg-white py-24 sm:py-32 dark:bg-gray-900">
|
<section id="howitworks" className="bg-white py-24 sm:py-32 dark:bg-gray-900">
|
||||||
<div className="mx-auto max-w-7xl px-6 lg:px-8">
|
<div className="mx-auto max-w-7xl px-6 lg:px-8">
|
||||||
<div className="mx-auto max-w-5xl lg:mx-0">
|
<div className="mx-auto max-w-5xl lg:mx-0">
|
||||||
<h2 className="text-3xl font-medium tracking-tight text-gray-900">
|
<h2 className="text-3xl font-medium tracking-tight text-gray-900">
|
||||||
|
@@ -10,9 +10,9 @@ export function NavLinks() {
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
['About', '/#about'],
|
['About', '/#about'],
|
||||||
['Benefits', '/#benefits'],
|
|
||||||
['Features', '/#features'],
|
['Features', '/#features'],
|
||||||
['Use Cases', '/#usecases'],
|
['How it Works', '/#howitworks'],
|
||||||
|
['Coming Soon', '/#comingsoon'],
|
||||||
['FAQs', '/#faqs'],
|
['FAQs', '/#faqs'],
|
||||||
].map(([label, href], index) => (
|
].map(([label, href], index) => (
|
||||||
<Link
|
<Link
|
||||||
@@ -28,7 +28,15 @@ export function NavLinks() {
|
|||||||
onMouseLeave={() => {
|
onMouseLeave={() => {
|
||||||
timeoutRef.current = window.setTimeout(() => {
|
timeoutRef.current = window.setTimeout(() => {
|
||||||
setHoveredIndex(null)
|
setHoveredIndex(null)
|
||||||
}, 200)
|
}, 50)
|
||||||
|
}}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
const targetId = href.substring(2)
|
||||||
|
const targetElement = document.getElementById(targetId)
|
||||||
|
if (targetElement) {
|
||||||
|
targetElement.scrollIntoView({ behavior: 'smooth' })
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
|
@@ -570,7 +570,7 @@ function FeaturesMobile() {
|
|||||||
export function PrimaryFeatures() {
|
export function PrimaryFeatures() {
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
id="features"
|
id="howitworks"
|
||||||
aria-label="Features for investing all your money"
|
aria-label="Features for investing all your money"
|
||||||
className="bg-gray-900 py-20 sm:py-32"
|
className="bg-gray-900 py-20 sm:py-32"
|
||||||
>
|
>
|
||||||
|
@@ -189,7 +189,7 @@ function DeviceChartIcon(props: React.ComponentPropsWithoutRef<'svg'>) {
|
|||||||
export function SecondaryFeatures() {
|
export function SecondaryFeatures() {
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
id="secondary-features"
|
id="comingsoon"
|
||||||
aria-label="Features for building a portfolio"
|
aria-label="Features for building a portfolio"
|
||||||
className="py-20 sm:py-32"
|
className="py-20 sm:py-32"
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user