Changes & Menus, enabled Gitea Workflow
Some checks failed
Deploy NPM app / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
Antoni Nuñez Romeu
2026-03-19 17:29:05 +01:00
parent 3c1ae1643b
commit 7b0164dfc6
9 changed files with 108 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { motion } from "framer-motion";
import { motion, AnimatePresence } from "framer-motion";
import { Menu, X } from "lucide-react";
import { NAV_LINKS } from "@/data/event-data";
import Logo from "@/assets/logo.png";
@@ -18,17 +18,26 @@ const Navbar = () => {
return () => window.removeEventListener("scroll", onScroll);
}, []);
useEffect(() => {
if (menuOpen) {
document.body.style.overflow = "hidden";
} else {
document.body.style.overflow = "unset";
}
return () => { document.body.style.overflow = "unset"; };
}, [menuOpen]);
return (
<nav
className={`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${
scrolled
? "bg-background/95 backdrop-blur-md shadow-card"
: "bg-white/30"
? "bg-background shadow-card"
: "bg-background"
}`}
>
<div className="container mx-auto flex items-center justify-between px-4 py-3">
<div className="container mx-auto flex items-center justify-between px-4 py-3 relative z-50">
{/* Logo */}
<a href="#" className="font-display text-xl font-bold text-gradient">
<a href="#" className="font-display text-xl font-bold text-gradient" onClick={() => setMenuOpen(false)}>
<img src={Logo} alt="ZLB Logo" className="h-8 w-auto" />
</a>
@@ -47,33 +56,41 @@ const Navbar = () => {
{/* Mobile toggle */}
<button
className="md:hidden text-foreground"
className="md:hidden text-foreground hover:text-primary transition-colors focus:outline-none"
onClick={() => setMenuOpen(!menuOpen)}
aria-label="Toggle menu"
>
{menuOpen ? <X size={24} /> : <Menu size={24} />}
{menuOpen ? <X size={28} /> : <Menu size={28} />}
</button>
</div>
{/* Mobile menu */}
{menuOpen && (
<motion.div
initial={{ opacity: 0, y: -10 }}
animate={{ opacity: 1, y: 0 }}
className="md:hidden bg-background/98 backdrop-blur-md border-t border-border px-4 pb-4"
>
{NAV_LINKS.map((link) => (
<a
key={link.href}
href={link.href}
onClick={() => setMenuOpen(false)}
className="block py-3 text-sm font-medium text-foreground/80 hover:text-primary transition-colors border-b border-border/50"
>
{link.label}
</a>
))}
</motion.div>
)}
{/* Mobile menu (Full Screen) */}
<AnimatePresence>
{menuOpen && (
<motion.div
initial={{ opacity: 0, y: "-100%" }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: "-100%" }}
transition={{ type: "spring", damping: 25, stiffness: 200 }}
className="md:hidden fixed inset-0 z-40 bg-background flex flex-col items-center justify-center gap-8"
>
{NAV_LINKS.map((link, i) => (
<motion.a
key={link.href}
href={link.href}
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 30 }}
transition={{ delay: 0.1 * i }}
onClick={() => setMenuOpen(false)}
className="text-3xl font-display font-medium text-foreground hover:text-primary transition-colors"
>
{link.label}
</motion.a>
))}
</motion.div>
)}
</AnimatePresence>
</nav>
);
};