- Added NutriScan logo and updated badge versions for accuracy - Translated entire README from English to Portuguese for localization - Introduced new sections: mission, differentials, statistics, and visual demonstration - Restructured table of contents and expanded project description for better user engagement and clarity
140 lines
4.5 KiB
TypeScript
140 lines
4.5 KiB
TypeScript
"use client";
|
|
import { useState, useEffect } from "react";
|
|
import { useTheme } from "next-themes";
|
|
import { Sun, Moon, Menu, X } from "lucide-react";
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
export function Header() {
|
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
const [mounted, setMounted] = useState(false);
|
|
const { theme, setTheme } = useTheme();
|
|
|
|
useEffect(() => {
|
|
setMounted(true);
|
|
}, []);
|
|
|
|
const toggleTheme = () => {
|
|
setTheme(theme === "dark" ? "light" : "dark");
|
|
};
|
|
|
|
const toggleMenu = () => {
|
|
setIsMenuOpen(!isMenuOpen);
|
|
};
|
|
|
|
return (
|
|
<header className="sticky top-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-700">
|
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div className="flex items-center justify-between h-14 sm:h-16">
|
|
{/* Logo - compacto em mobile */}
|
|
<div className="flex items-center gap-2 sm:gap-3">
|
|
<img
|
|
src="/apple-touch-icon.png"
|
|
alt="NutriScan Logo"
|
|
className="w-8 h-8 sm:w-10 sm:h-10 rounded-xl"
|
|
/>
|
|
<div className="hidden sm:block">
|
|
<h1 className="text-xl font-bold text-gray-900 dark:text-white">
|
|
NutriScan
|
|
</h1>
|
|
<p className="text-xs text-gray-500 dark:text-gray-400">
|
|
Informações nutricionais
|
|
</p>
|
|
</div>
|
|
{/* Logo compacto para mobile */}
|
|
<div className="sm:hidden">
|
|
<h1 className="text-base font-bold text-gray-900 dark:text-white">
|
|
NutriScan
|
|
</h1>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Desktop Navigation */}
|
|
<nav className="hidden md:flex items-center gap-8">
|
|
<a
|
|
href="/"
|
|
className="text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
|
|
>
|
|
Como funciona
|
|
</a>
|
|
<a
|
|
href="/#recursos"
|
|
className="text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
|
|
>
|
|
Recursos
|
|
</a>
|
|
<a
|
|
href="#sobre"
|
|
className="text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
|
|
>
|
|
Sobre
|
|
</a>
|
|
</nav>
|
|
|
|
{/* Actions */}
|
|
<div className="flex items-center gap-4">
|
|
{/* Theme Toggle */}
|
|
{mounted && (
|
|
<Button
|
|
variant="ghost"
|
|
size="sm"
|
|
onClick={toggleTheme}
|
|
className="w-10 h-10 p-0"
|
|
suppressHydrationWarning
|
|
>
|
|
{theme === "dark" ? (
|
|
<Sun className="w-5 h-5" />
|
|
) : (
|
|
<Moon className="w-5 h-5" />
|
|
)}
|
|
</Button>
|
|
)}
|
|
|
|
{/* Mobile Menu Button */}
|
|
<Button
|
|
variant="ghost"
|
|
size="sm"
|
|
onClick={toggleMenu}
|
|
className="md:hidden w-10 h-10 p-0"
|
|
>
|
|
{isMenuOpen ? (
|
|
<X className="w-5 h-5" />
|
|
) : (
|
|
<Menu className="w-5 h-5" />
|
|
)}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Mobile Menu */}
|
|
{isMenuOpen && (
|
|
<div className="md:hidden border-t border-gray-200 dark:border-gray-700 py-4">
|
|
<nav className="flex flex-col gap-4">
|
|
<a
|
|
href="/"
|
|
className="text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors py-2"
|
|
onClick={() => setIsMenuOpen(false)}
|
|
>
|
|
Como funciona
|
|
</a>
|
|
<a
|
|
href="/#recursos"
|
|
className="text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors py-2"
|
|
onClick={() => setIsMenuOpen(false)}
|
|
>
|
|
Recursos
|
|
</a>
|
|
<a
|
|
href="#sobre"
|
|
className="text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors py-2"
|
|
onClick={() => setIsMenuOpen(false)}
|
|
>
|
|
Sobre
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
)}
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|