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:
@@ -1,208 +1,100 @@
|
||||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useReveal } from "@/hooks/use-reveal";
|
||||
|
||||
const word = "MONO";
|
||||
|
||||
const sideImages = [
|
||||
{
|
||||
src: "/images/hero-side-1.png",
|
||||
alt: "Modern architecture with corten steel",
|
||||
position: "left",
|
||||
span: 1,
|
||||
},
|
||||
{
|
||||
src: "/images/hero-side-2.png",
|
||||
alt: "Aerial view of modern home",
|
||||
position: "left",
|
||||
span: 1,
|
||||
},
|
||||
{
|
||||
src: "/images/hero-side-3.png",
|
||||
alt: "Interior view with landscape",
|
||||
position: "right",
|
||||
span: 1,
|
||||
},
|
||||
{
|
||||
src: "/images/hero-side-4.png",
|
||||
alt: "Modern architecture at night",
|
||||
position: "right",
|
||||
span: 1,
|
||||
},
|
||||
const STATS = [
|
||||
["20", "marknader täckta"],
|
||||
["Per fält", "härkomst & konfidens"],
|
||||
["50/50", "start & godkänt"],
|
||||
["GDPR", "native, med DPA"],
|
||||
];
|
||||
|
||||
// Data-native hero artifact: a miniature company table that "is" the product.
|
||||
const ROWS: [string, string, string, 0 | 1 | 2 | 3][] = [
|
||||
["556016-0680", "Volvo Group", "GLEIF", 3],
|
||||
["915933149", "Equinor ASA", "Brreg", 3],
|
||||
["25052943", "Maersk A/S", "CVR", 2],
|
||||
["0112038-9", "Nokia Oyj", "PRH", 2],
|
||||
["—", "E-post (FI)", "licens", 0],
|
||||
];
|
||||
const PROV = ["var(--prov-0)", "var(--prov-1)", "var(--prov-2)", "var(--prov-3)"];
|
||||
|
||||
export function HeroSection() {
|
||||
const sectionRef = useRef<HTMLElement>(null);
|
||||
const [scrollProgress, setScrollProgress] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
if (!sectionRef.current) return;
|
||||
|
||||
const rect = sectionRef.current.getBoundingClientRect();
|
||||
const scrollableHeight = window.innerHeight * 2;
|
||||
const scrolled = -rect.top;
|
||||
const progress = Math.max(0, Math.min(1, scrolled / scrollableHeight));
|
||||
|
||||
setScrollProgress(progress);
|
||||
};
|
||||
|
||||
window.addEventListener("scroll", handleScroll, { passive: true });
|
||||
handleScroll();
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("scroll", handleScroll);
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Text fades out first (0 to 0.2)
|
||||
const textOpacity = Math.max(0, 1 - (scrollProgress / 0.2));
|
||||
|
||||
// Image transforms start after text fades (0.2 to 1)
|
||||
const imageProgress = Math.max(0, Math.min(1, (scrollProgress - 0.2) / 0.8));
|
||||
|
||||
// Smooth interpolations - More balanced distribution
|
||||
const centerWidth = 100 - (imageProgress * 80); // 100% to 20% (same as each side image)
|
||||
const centerHeight = 100; // Always 100% height
|
||||
const sideWidth = imageProgress * 40; // 0% to 40% (20% per image, 2 images = 40%)
|
||||
const sideOpacity = imageProgress;
|
||||
const sideTranslateLeft = -100 + (imageProgress * 100); // -100% to 0%
|
||||
const sideTranslateRight = 100 - (imageProgress * 100); // 100% to 0%
|
||||
const borderRadius = 0; // No border radius
|
||||
const gap = imageProgress * 8; // 0px to 8px
|
||||
|
||||
// Vertical offset for side columns to move them up on mobile
|
||||
const sideTranslateY = -(imageProgress * 15); // Move up by 15% when fully expanded
|
||||
const ref = useReveal<HTMLElement>();
|
||||
|
||||
return (
|
||||
<section ref={sectionRef} className="relative bg-background">
|
||||
{/* Sticky container for scroll animation */}
|
||||
<div className="sticky top-0 h-screen overflow-hidden">
|
||||
<div className="flex h-full w-full items-center justify-center">
|
||||
{/* Bento Grid Container */}
|
||||
<div
|
||||
className="relative flex h-full w-full items-stretch justify-center"
|
||||
style={{ gap: `${gap}px` }}
|
||||
>
|
||||
|
||||
{/* Left Column */}
|
||||
<div
|
||||
className="flex h-full flex-row will-change-transform"
|
||||
style={{
|
||||
width: `${sideWidth}%`,
|
||||
gap: `${gap}px`,
|
||||
transform: `translateX(${sideTranslateLeft}%) translateY(${sideTranslateY}%)`,
|
||||
opacity: sideOpacity,
|
||||
}}
|
||||
>
|
||||
{sideImages.filter(img => img.position === "left").map((img, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="relative h-full overflow-hidden will-change-transform"
|
||||
style={{
|
||||
flex: img.span,
|
||||
borderRadius: `${borderRadius}px`,
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
src={img.src || "/placeholder.svg"}
|
||||
alt={img.alt}
|
||||
fill
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<section ref={ref} className="grain-overlay relative overflow-hidden border-b border-border bg-background">
|
||||
{/* faint oversized wordmark */}
|
||||
<div aria-hidden className="pointer-events-none absolute -right-10 top-1/2 -translate-y-1/2 select-none">
|
||||
<span className="text-[34vw] font-semibold leading-none tracking-tighter text-border/60 md:text-[22vw]">0pt</span>
|
||||
</div>
|
||||
<span aria-hidden className="animate-float pointer-events-none absolute right-[8%] top-[22%] inline-block h-3 w-3" style={{ backgroundColor: "var(--accent-red)" }} />
|
||||
|
||||
{/* Main Hero Image - Center */}
|
||||
<div
|
||||
className="relative overflow-hidden will-change-transform"
|
||||
style={{
|
||||
width: `${centerWidth}%`,
|
||||
height: `${centerHeight}%`,
|
||||
flex: "0 0 auto",
|
||||
borderRadius: `${borderRadius}px`,
|
||||
}}
|
||||
<div className="relative mx-auto grid max-w-[80rem] grid-cols-1 gap-12 px-6 py-24 lg:grid-cols-[1.1fr_0.9fr] lg:py-32">
|
||||
<div className="flex flex-col justify-center">
|
||||
<p className="reveal delay-1 font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">
|
||||
00 — Datatjänster på beställning · Norden & EU
|
||||
</p>
|
||||
<h1 className="reveal delay-2 mt-5 text-[clamp(2.6rem,7vw,6rem)] font-medium leading-[0.95] tracking-[-0.025em]">
|
||||
Beställ exakt den data du behöver.
|
||||
<br />
|
||||
<span style={{ color: "var(--accent-red)" }}>Validera varje fält.</span>
|
||||
</h1>
|
||||
<p className="reveal delay-3 mt-6 max-w-[54ch] text-lg text-muted-foreground">
|
||||
Sätt ihop ditt eget datajobb. Betala 50 % för att starta. Följ produktionen i realtid. Godkänn
|
||||
resultatet med full insyn i var varje uppgift kommer ifrån — och hur säker den är.
|
||||
</p>
|
||||
<div className="reveal delay-4 mt-8 flex flex-wrap gap-3">
|
||||
<Link
|
||||
href="/bestall"
|
||||
className="bg-foreground px-6 py-3.5 font-mono text-[12px] uppercase tracking-[0.1em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
>
|
||||
{/* Text Behind - Fades out first */}
|
||||
<div
|
||||
className="absolute inset-0 z-0 flex items-center justify-center"
|
||||
style={{ opacity: textOpacity, transform: 'translateY(-200px)' }}
|
||||
>
|
||||
<h1 className="whitespace-nowrap text-[35vw] font-bold leading-[0.8] tracking-tighter text-black">
|
||||
{word.split("").map((letter, index) => (
|
||||
<span
|
||||
key={index}
|
||||
className="inline-block animate-[slideUp_0.8s_ease-out_forwards] opacity-0"
|
||||
style={{
|
||||
animationDelay: `${index * 0.08}s`,
|
||||
transition: 'all 1.5s',
|
||||
transitionTimingFunction: 'cubic-bezier(0.86, 0, 0.07, 1)',
|
||||
}}
|
||||
>
|
||||
{letter}
|
||||
</span>
|
||||
))}
|
||||
</h1>
|
||||
Bygg en beställning
|
||||
</Link>
|
||||
<Link
|
||||
href="/order/SX-4471/validera"
|
||||
className="border border-foreground px-6 py-3.5 font-mono text-[12px] uppercase tracking-[0.1em] transition-colors hover:bg-foreground hover:text-background"
|
||||
>
|
||||
Se ett levererat dataset
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="reveal delay-5 mt-12 grid grid-cols-2 gap-px border border-border bg-border sm:grid-cols-4">
|
||||
{STATS.map(([n, l]) => (
|
||||
<div key={l} className="bg-background p-4">
|
||||
<p className="text-2xl font-semibold tracking-[-0.02em]">{n}</p>
|
||||
<p className="mt-1 font-mono text-[10px] uppercase tracking-[0.08em] text-muted-foreground">{l}</p>
|
||||
</div>
|
||||
|
||||
<Image
|
||||
src="/images/hero-mono.png"
|
||||
alt="Modern architectural structure with reflection"
|
||||
fill
|
||||
className="absolute inset-0 z-10 object-cover"
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right Column */}
|
||||
<div
|
||||
className="flex h-full flex-row will-change-transform"
|
||||
style={{
|
||||
width: `${sideWidth}%`,
|
||||
gap: `${gap}px`,
|
||||
transform: `translateX(${sideTranslateRight}%) translateY(${sideTranslateY}%)`,
|
||||
opacity: sideOpacity,
|
||||
}}
|
||||
>
|
||||
{sideImages.filter(img => img.position === "right").map((img, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="relative h-full overflow-hidden will-change-transform"
|
||||
style={{
|
||||
flex: img.span,
|
||||
borderRadius: `${borderRadius}px`,
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
src={img.src || "/placeholder.svg"}
|
||||
alt={img.alt}
|
||||
fill
|
||||
className="object-cover"
|
||||
/>
|
||||
{/* the artifact */}
|
||||
<div className="reveal-fade flex items-center">
|
||||
<div className="w-full border border-border bg-background">
|
||||
<div className="flex items-center justify-between border-b border-border px-4 py-2">
|
||||
<span className="font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground">dim_company · exempel</span>
|
||||
<span className="font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground">härkomst</span>
|
||||
</div>
|
||||
{ROWS.map((r, i) => (
|
||||
<div key={i} className={`reveal delay-${i + 1} flex items-center justify-between border-b border-border px-4 py-3 last:border-b-0`}>
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-sm">{r[1]}</p>
|
||||
<p className="font-mono text-[10.5px] text-muted-foreground">{r[0]}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<span className="ml-3 inline-flex items-center gap-1.5 border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground">
|
||||
<span
|
||||
className="inline-block h-[7px] w-[7px]"
|
||||
style={{ backgroundColor: r[3] === 0 ? "transparent" : PROV[r[3]], border: r[3] === 0 ? `1px solid ${PROV[0]}` : "none" }}
|
||||
/>
|
||||
{r[2]}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Tagline Section - Fixed at bottom */}
|
||||
<div
|
||||
className="pointer-events-none fixed bottom-0 left-0 right-0 z-10 px-6 pb-12 md:px-12 md:pb-16 lg:px-20 lg:pb-20"
|
||||
style={{ opacity: textOpacity }}
|
||||
>
|
||||
<p className="mx-auto max-w-2xl text-center text-2xl leading-relaxed text-white md:text-3xl lg:text-[2.5rem] lg:leading-snug">
|
||||
Lightweight, durable
|
||||
<br />
|
||||
and adventure-ready.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Scroll space to enable animation */}
|
||||
<div className="h-[200vh]" />
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user