This commit is contained in:
2025-09-17 15:45:33 +02:00
parent 8f997b2f86
commit 9e26dce717
5 changed files with 19 additions and 38 deletions

View File

@@ -8,6 +8,20 @@ export function NavLinks() {
let [hoveredIndex, setHoveredIndex] = useState<number | null>(null)
let timeoutRef = useRef<number | null>(null)
const handleClick = (e: React.MouseEvent<HTMLAnchorElement>, href: string) => {
if (href.startsWith('/#')) {
e.preventDefault();
const targetId = href.substring(2);
const targetElement = document.getElementById(targetId);
if (targetElement) {
targetElement.scrollIntoView({
behavior: 'smooth',
});
}
}
};
return [
['About', '/#about'],
['Network', '/#network'],
@@ -20,6 +34,7 @@ export function NavLinks() {
key={label}
href={href}
className="relative -mx-3 -my-2 rounded-lg px-3 py-2 text-sm text-white transition-colors delay-150 hover:text-gray-300 hover:delay-0"
onClick={(e) => handleClick(e, href)}
onMouseEnter={() => {
if (timeoutRef.current) {
window.clearTimeout(timeoutRef.current)