feat: rebrand MONO->0pt (hero, header, layout) + add project docs/contract
Hero is now a data-native 0pt artifact (no photos, keeps grain/reveal/float); header is the 0pt wordmark with Swedish nav; layout is sv + loads JetBrains Mono + 0pt metadata; globals wires the loaded fonts. Adds CLAUDE.md + docs/01-09 as the build contract. next build green (5 routes). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+63
-95
@@ -1,126 +1,94 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import Link from "next/link";
|
||||
import { Menu, X } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const NAV = [
|
||||
{ label: "Katalog", href: "/#katalog" },
|
||||
{ label: "Så funkar det", href: "/#motorn" },
|
||||
{ label: "Källor", href: "/#tackning" },
|
||||
{ label: "Priser", href: "/#priser" },
|
||||
];
|
||||
|
||||
function Wordmark() {
|
||||
return (
|
||||
<Link href="/" className="flex items-center gap-2">
|
||||
<span className="text-xl font-semibold tracking-[-0.02em]">0pt</span>
|
||||
<span className="inline-block h-1 w-1" style={{ backgroundColor: "var(--accent-red)" }} />
|
||||
<span className="font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground">your data</span>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
export function Header() {
|
||||
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
||||
const [isScrolled, setIsScrolled] = useState(false);
|
||||
const [scrolled, setScrolled] = useState(false);
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
setIsScrolled(window.scrollY > 50);
|
||||
};
|
||||
|
||||
window.addEventListener("scroll", handleScroll, { passive: true });
|
||||
return () => window.removeEventListener("scroll", handleScroll);
|
||||
const onScroll = () => setScrolled(window.scrollY > 40);
|
||||
window.addEventListener("scroll", onScroll, { passive: true });
|
||||
onScroll();
|
||||
return () => window.removeEventListener("scroll", onScroll);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<header
|
||||
className={`fixed top-4 left-1/2 -translate-x-1/2 z-50 w-[90%] max-w-3xl transition-all duration-300 ${isScrolled ? "bg-background/80 backdrop-blur-md rounded-full" : "bg-transparent"}`}
|
||||
<header
|
||||
className="sticky top-0 z-50 border-b border-border transition-colors"
|
||||
style={{
|
||||
boxShadow: isScrolled ? "rgba(14, 63, 126, 0.04) 0px 0px 0px 1px, rgba(42, 51, 69, 0.04) 0px 1px 1px -0.5px, rgba(42, 51, 70, 0.04) 0px 3px 3px -1.5px, rgba(42, 51, 70, 0.04) 0px 6px 6px -3px, rgba(14, 63, 126, 0.04) 0px 12px 12px -6px, rgba(14, 63, 126, 0.04) 0px 24px 24px -12px" : "none"
|
||||
backgroundColor: scrolled ? "rgba(255,255,255,0.82)" : "var(--background)",
|
||||
backdropFilter: scrolled ? "blur(8px)" : "none",
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center justify-between transition-all duration-300 px-2 pl-5 py-2">
|
||||
{/* Logo */}
|
||||
<Link href="#hero" className="text-lg font-medium tracking-tight transition-colors duration-300 text-foreground">
|
||||
MONO
|
||||
</Link>
|
||||
<div className="mx-auto flex h-16 max-w-[80rem] items-center justify-between px-6">
|
||||
<Wordmark />
|
||||
|
||||
{/* Desktop Navigation */}
|
||||
<nav className="hidden items-center gap-10 md:flex">
|
||||
<Link
|
||||
href="#technology"
|
||||
className="text-sm transition-colors text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
Design
|
||||
</Link>
|
||||
<Link
|
||||
href="#gallery"
|
||||
className="text-sm transition-colors text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
Gallery
|
||||
</Link>
|
||||
<Link
|
||||
href="#accessories"
|
||||
className="text-sm transition-colors text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
Models
|
||||
</Link>
|
||||
<Link
|
||||
href="#about"
|
||||
className="text-sm transition-colors text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
About
|
||||
</Link>
|
||||
<nav className="hidden items-center gap-7 md:flex">
|
||||
{NAV.map((n) => (
|
||||
<Link
|
||||
key={n.label}
|
||||
href={n.href}
|
||||
className="font-mono text-[12px] uppercase tracking-[0.1em] text-muted-foreground transition-colors hover:text-foreground"
|
||||
>
|
||||
{n.label}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
|
||||
{/* CTA */}
|
||||
<div className="hidden items-center gap-6 md:flex">
|
||||
<div className="hidden items-center gap-5 md:flex">
|
||||
<Link href="/bestall" className="font-mono text-[12px] uppercase tracking-[0.1em] text-muted-foreground transition-colors hover:text-foreground">
|
||||
Logga in
|
||||
</Link>
|
||||
<Link
|
||||
href="#reserve"
|
||||
className="px-4 py-2 text-sm font-medium transition-all rounded-full bg-foreground text-background hover:opacity-80"
|
||||
href="/bestall"
|
||||
className="bg-foreground px-5 py-2.5 font-mono text-[12px] uppercase tracking-[0.1em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
>
|
||||
Contact
|
||||
Starta beställning
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Mobile Menu Button */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setIsMenuOpen(!isMenuOpen)}
|
||||
className="transition-colors md:hidden text-foreground"
|
||||
aria-label="Toggle menu"
|
||||
aria-label="Meny"
|
||||
onClick={() => setOpen((v) => !v)}
|
||||
className="flex h-9 w-9 items-center justify-center border border-border md:hidden"
|
||||
>
|
||||
{isMenuOpen ? <X size={24} /> : <Menu size={24} />}
|
||||
<span className="font-mono text-sm">{open ? "✕" : "≡"}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Mobile Menu */}
|
||||
{isMenuOpen && (
|
||||
<div className="border-t border-border bg-background px-6 py-8 md:hidden rounded-b-2xl">
|
||||
<nav className="flex flex-col gap-6">
|
||||
<Link
|
||||
href="#technology"
|
||||
className="text-lg text-foreground"
|
||||
onClick={() => setIsMenuOpen(false)}
|
||||
>
|
||||
Design
|
||||
{open ? (
|
||||
<div className="border-t border-border bg-background md:hidden">
|
||||
<div className="flex flex-col gap-1 px-6 py-4">
|
||||
{NAV.map((n) => (
|
||||
<Link key={n.label} href={n.href} onClick={() => setOpen(false)} className="py-2 font-mono text-[12px] uppercase tracking-[0.1em] text-muted-foreground">
|
||||
{n.label}
|
||||
</Link>
|
||||
))}
|
||||
<Link href="/bestall" onClick={() => setOpen(false)} className="mt-2 bg-foreground px-5 py-3 text-center font-mono text-[12px] uppercase tracking-[0.1em] text-background">
|
||||
Starta beställning
|
||||
</Link>
|
||||
<Link
|
||||
href="#gallery"
|
||||
className="text-lg text-foreground"
|
||||
onClick={() => setIsMenuOpen(false)}
|
||||
>
|
||||
Gallery
|
||||
</Link>
|
||||
<Link
|
||||
href="#accessories"
|
||||
className="text-lg text-foreground"
|
||||
onClick={() => setIsMenuOpen(false)}
|
||||
>
|
||||
Models
|
||||
</Link>
|
||||
<Link
|
||||
href="#about"
|
||||
className="text-lg text-foreground"
|
||||
onClick={() => setIsMenuOpen(false)}
|
||||
>
|
||||
About
|
||||
</Link>
|
||||
<Link
|
||||
href="#reserve"
|
||||
className="mt-4 bg-foreground px-5 py-3 text-center text-sm font-medium text-background rounded-full"
|
||||
onClick={() => setIsMenuOpen(false)}
|
||||
>
|
||||
Contact
|
||||
</Link>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
) : null}
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user