Page sections / Heroes

Full-Bleed Video Statement Hero

Full-viewport nature video/photo (bees in a green meadow) with a light 48px headline and small body copy anchored left, a light 5px frosted blur layer and a darkened scrim for legibility.

Rebuilt from seed.com/sustainability in the Verdant Lab Editorial style.

npx shadcn@latest add https://justyoink.it/r/verdant-lab-editorial/blocks/full-bleed-statement-hero.json

Looks exactly like seed.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Images2 in this component. Swap any for a library image or one of your own.All images in this style →

Choose an image

Image

Loading…

Usage

Props: headline (array of lines), body, imageSrc (defaults to a stock leaf photo), filters (sub-nav labels). Renders standalone with no props; the photo slowly zooms behind a 5px frosted layer and side scrim.

components/full-bleed-statement-hero.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
export default function FullBleedStatementHero(props: {
  headline?: string[];
  body?: string;
  imageSrc?: string;
  filters?: string[];
}) {
  const {
    headline = ["Small things", "shape the whole."],
    body = "Tiny pollinators guide us toward a closer look at the quiet, shared systems that keep every garden alive.",
    imageSrc = "https://yoink-app.fly.dev/stock/nature-2.jpg",
    filters = ["Overview", "Habitat", "Research", "Field notes"],
  } = props;

  return (
    <section className="relative isolate flex min-h-[640px] h-screen w-full flex-col overflow-hidden bg-ink font-sans text-canvas">
      <KenBurns src={imageSrc} alt="Macro view of green leaves with water drops" duration={28} zoom={1.12} pan="left" className="absolute inset-0 -z-10" />
      <div aria-hidden className="absolute inset-0 -z-10 bg-hero-side-scrim" />
      <div aria-hidden className="absolute inset-0 -z-10 bg-scrim/20 backdrop-blur-[5px]" />
      <div aria-hidden className="absolute inset-x-0 top-0 -z-10 h-40 bg-top-scrim" />

      <nav aria-label="Sections" className="relative z-10 px-6 pt-24 md:px-12">
        <ul className="flex flex-wrap gap-x-6 gap-y-2">
          {filters.map((f, i) => (
            <li key={f} className="opacity-80 transition-opacity duration-500 ease-in hover:opacity-100">
              <a href="#" className={"text-label focus-visible:outline focus-visible:outline-2 focus-visible:outline-canvas " + (i === 0 ? "border-b border-canvas pb-1" : "")}>
                {f}
              </a>
            </li>
          ))}
        </ul>
      </nav>

      <div className="relative z-10 mt-auto px-6 pb-28 md:px-12 md:pb-36">
        <h1 className="max-w-xl text-[40px] font-light leading-[1.25] tracking-[-0.01em] md:text-[48px]">
          {headline.map((l) => (
            <span key={l} className="block">{l}</span>
          ))}
        </h1>
        <p className="mt-6 max-w-[22rem] text-body font-normal leading-relaxed">{body}</p>
        <Stagger step={90} from="up" distance={20} duration={250} className="mt-8 flex flex-wrap gap-3">
          {["Pollination", "Soil life", "Biodiversity"].map((c) => (
            <span key={c} className="rounded-pill bg-frost-glass px-4 py-2 text-label text-ink backdrop-blur-md">{c}</span>
          ))}
        </Stagger>
      </div>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): Stagger, KenBurns ----

const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)";

const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;

function ykReducedMotion(): boolean {
  return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
}

// "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance.
// Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed,
// and there is a box to watch), and a safety net reveals anything on screen that is still hidden.
type YkRevealState = "idle" | "hidden" | "shown";

function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState {
  const [state, setState] = useState<YkRevealState>("idle");
  useYkLayoutEffect(() => {
    const el = ref.current;
    if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return;
    // watch the element's own box, or its children when it has none (display: contents)
    const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]);
    const onScreen = (t: Element) => {
      const r = t.getBoundingClientRect();
      return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth;
    };
    if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible
    let shown = false;
    const show = (v: boolean) => {
      if (v !== shown) (shown = v), setState(v ? "shown" : "hidden");
    };
    setState("hidden");
    const inView = new Set<Element>();
    const io = new IntersectionObserver((entries) => {
      for (const e of entries) {
        if (e.isIntersecting) inView.add(e.target);
        else inView.delete(e.target);
      }
      if (inView.size) {
        show(true);
        if (once) io.disconnect();
      } else if (!once) show(false);
    });
    const watched = new Set<Element>();
    const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t)));
    watch();
    // safety net: styles that land after mount (display: contents) get watched too, and nothing
    // stays hidden for more than a moment while it is actually on screen
    const start = Date.now();
    const net = setInterval(() => {
      if (shown) return once && clearInterval(net);
      watch();
      if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true);
    }, 600);
    return () => {
      io.disconnect();
      clearInterval(net);
    };
  }, [once]);
  return state;
}

/** Reveals each direct child one after another when the group scrolls into view. */
function Stagger({
  children,
  step = 90,
  from = "up",
  distance = 20,
  duration = 650,
  delay = 0,
  once = true,
  as = "div",
  className,
  style,
}: {
  children?: ReactNode;
  step?: number;
  from?: "up" | "down" | "left" | "right" | "scale" | "fade";
  distance?: number;
  duration?: number;
  delay?: number;
  once?: boolean;
  as?: ElementType;
  className?: string;
  style?: CSSProperties;
}) {
  const Tag = as;
  const ref = useRef<HTMLElement>(null);
  const state = useYkReveal(ref, once);
  useYkLayoutEffect(() => {
    const items = Array.from(ref.current?.children ?? []) as HTMLElement[];
    if (state === "idle") return;
    const offset = {
      up: `translate3d(0, ${distance}px, 0)`,
      down: `translate3d(0, ${-distance}px, 0)`,
      left: `translate3d(${-distance}px, 0, 0)`,
      right: `translate3d(${distance}px, 0, 0)`,
      scale: "scale(0.92)",
      fade: "none",
    }[from];
    if (state === "hidden") {
      for (const el of items) Object.assign(el.style, { transition: "none", opacity: "0", transform: offset });
      return;
    }
    items.forEach((el, i) => {
      const t = `${duration}ms ${YK_EASE} ${delay + i * step}ms`;
      Object.assign(el.style, { transition: `opacity ${t}, transform ${t}`, opacity: "", transform: "" });
    });
    // hand the children their own transitions back once everything has landed
    const done = setTimeout(() => items.forEach((el) => (el.style.transition = "")), delay + items.length * step + duration + 50);
    return () => clearTimeout(done);
  }, [state]);
  return (
    <Tag ref={ref} className={className} style={style}>
      {children}
    </Tag>
  );
}

const YK_KENBURNS_CSS = `@keyframes yk-kenburns{from{transform:scale(1.04) translate3d(0,0,0)}to{transform:scale(var(--yk-zoom)) translate3d(var(--yk-pan-x),var(--yk-pan-y),0)}}
@media (prefers-reduced-motion:reduce){[data-yk-kenburns]{animation:none!important}}`;

/** A slow zoom-and-pan on a still photo: a calm stand-in for a background video. */
function KenBurns({
  src = "https://yoink-app.fly.dev/stock/landscape-1.jpg",
  alt = "",
  duration = 24,
  zoom = 1.18,
  pan = "left",
  className,
  style,
}: {
  src?: string;
  alt?: string;
  /** seconds for one drift (it then drifts back) */
  duration?: number;
  zoom?: number;
  pan?: "left" | "right" | "up" | "down";
  className?: string;
  style?: CSSProperties;
}) {
  const [x, y] = { left: ["-3%", "-1%"], right: ["3%", "1%"], up: ["0%", "-3%"], down: ["0%", "3%"] }[pan];
  return (
    <div className={className} style={{ overflow: "hidden", ...style }}>
      <style>{YK_KENBURNS_CSS}</style>
      <img
        src={src}
        alt={alt}
        decoding="async"
        data-yk-kenburns=""
        style={{
          display: "block",
          width: "100%",
          height: "100%",
          objectFit: "cover",
          transform: "scale(1.04)",
          animation: `yk-kenburns ${duration}s ease-in-out infinite alternate`,
          ...({ "--yk-zoom": zoom, "--yk-pan-x": x, "--yk-pan-y": y } as CSSProperties),
        }}
      />
    </div>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Verdant Lab Editorial

The whole style →

Center-Focus Video Story Carousel

Carousels

Hairline Plus Accordion

Accordions

Frosted Glass Photo Hero

Heroes

Offer Popup Dialog

Dialogs & modals

Timeline Benefit Tiles

Feature sections

Glass Panel Annotated Capsule

Feature sections