Page sections / Heroes

Cinematic Landscape Hero

Full-bleed 1440×900 misty-mountain image/video with top dark scrim and bottom edge fade, centered display headline, lead, and a frosted email capture pill with a primary button plus a glass secondary button. A glass disclaimer bar sits at the bottom.

Rebuilt from mercury.com in the Twilight Ledger style.

npx shadcn@latest add https://yoink-app.fly.dev/r/twilight-ledger-0e1ecf/blocks/cinematic-photo-hero.json

Looks exactly like mercury.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, lead, imageSrc (background photo, defaults to a stock mountain image), brand, disclaimer. Renders standalone; the background uses KenBurns in place of video, with the scrim and bottom fade layered over it.

components/cinematic-photo-hero.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Props = {
  headline?: string;
  lead?: string;
  imageSrc?: string;
  brand?: string;
  disclaimer?: string;
};

export default function CinematicLandscapeHero({
  headline = "Finance, made calmer",
  lead = "Get set up online in minutes and run your money with tools built for quiet focus.",
  imageSrc = "https://yoink-app.fly.dev/stock/landscape-2.jpg",
  brand = "NORTHWIND",
  disclaimer = "Northwind is a software company, not a bank. Accounts are offered through our licensed partner institutions.",
}: Props) {
  const nav = ["Business", "Personal", "Solutions", "Resources", "About", "Pricing"];
  return (
    <section className="relative isolate min-h-[900px] w-full overflow-hidden bg-canvas font-sans text-ink">
      <KenBurns src={imageSrc} alt="Misty mountain landscape at dawn" duration={28} zoom={1.12} pan="left" className="absolute inset-0 -z-10" />
      <div className="absolute inset-0 -z-10 bg-[linear-gradient(rgba(0,0,0,0.6)_0%,rgba(0,0,0,0.3)_40%,rgba(0,0,0,0)_100%)]" />
      <div className="absolute inset-x-0 bottom-0 -z-10 h-1/3 bg-gradient-to-t from-canvas/70 to-transparent" />

      <header className="flex items-center justify-between gap-4 px-6 py-5 lg:px-8">
        <a href="#" className="flex items-center gap-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">
          <svg width="32" height="32" viewBox="0 0 32 32" fill="none" stroke="currentColor" strokeWidth="1.2" aria-hidden="true">
            <circle cx="16" cy="16" r="14" /><circle cx="16" cy="16" r="8" /><path d="M16 2v28M2 16h28" />
          </svg>
          <span className="text-[18px] tracking-[0.2em]">{brand}</span>
        </a>
        <nav aria-label="Main" className="hidden items-center gap-2 lg:flex">
          {nav.map((n) => (
            <a key={n} href="#" className="rounded-pill px-4 py-2 text-[15px] text-ink transition-colors duration-hover-wash ease-hover-wash hover:bg-hover-wash focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">
              {n}{n !== "Personal" && n !== "Pricing" ? " ⌄" : ""}
            </a>
          ))}
        </nav>
        <div className="flex items-center gap-2">
          <a href="#" className="hidden px-3 text-[15px] sm:block">Log in</a>
          <a href="#" className="hidden rounded-pill border border-hairline bg-glass-fill px-4 py-2 text-[15px] backdrop-blur-md transition-colors hover:bg-hover-wash sm:block">Launch demo</a>
          <a href="#" className="rounded-pill bg-accent px-4 py-2 text-[15px] text-white transition hover:brightness-110">Open account</a>
        </div>
      </header>

      <div className="mx-auto mt-20 flex max-w-[640px] flex-col items-center px-6 text-center md:mt-24">
        <Reveal from="up" duration={1400}>
          <h1 className="font-display text-[44px] font-medium leading-[1.05] tracking-[-0.02em] md:text-[56px]">{headline}</h1>
          <p className="mx-auto mt-5 max-w-[560px] text-[20px] leading-[1.45] text-ink-muted">{lead}</p>
        </Reveal>
        <Reveal from="up" delay={200} duration={1000} className="mt-9 flex w-full flex-col items-center justify-center gap-3 sm:flex-row">
          <form className="flex w-full max-w-[411px] items-center rounded-pill border border-hairline bg-glass-fill p-1 backdrop-blur-[20px]" onSubmit={(e) => e.preventDefault()}>
            <label htmlFor="hero-email" className="sr-only">Email</label>
            <input id="hero-email" type="email" placeholder="Enter your email" className="min-w-0 flex-1 bg-transparent px-4 text-[16px] text-ink placeholder:text-ink-muted focus:outline-none" />
            <button type="submit" className="rounded-pill bg-accent px-5 py-2.5 text-[16px] text-white transition hover:brightness-110 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ink">Open account</button>
          </form>
          <a href="#" className="rounded-pill border border-hairline bg-glass-fill px-5 py-3 text-[16px] backdrop-blur-md transition-colors duration-hover-wash hover:bg-hover-wash focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">Contact sales</a>
        </Reveal>
      </div>

      <div className="absolute inset-x-4 bottom-8 mx-auto max-w-[950px] rounded-lg bg-canvas/80 px-6 py-3.5 text-center text-[12px] leading-snug text-ink backdrop-blur-md">
        {disclaimer}
      </div>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): Reveal, 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;
}

type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none";

/** Fades content in as it scrolls into view. */
function Reveal({
  children,
  from = "up",
  delay = 0,
  duration = 700,
  distance = 24,
  once = true,
  as = "div",
  className,
  style,
}: {
  children?: ReactNode;
  from?: YkRevealFrom;
  delay?: number;
  duration?: number;
  distance?: number;
  once?: boolean;
  as?: ElementType;
  className?: string;
  style?: CSSProperties;
}) {
  const Tag = as;
  const ref = useRef<HTMLElement>(null);
  const state = useYkReveal(ref, once);
  const hidden = state === "hidden";
  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.94)",
    blur: `translate3d(0, ${distance / 2}px, 0)`,
    none: "none",
  }[from];
  const t = `${duration}ms ${YK_EASE} ${delay}ms`;
  return (
    <Tag
      ref={ref}
      className={className}
      style={{
        ...style,
        ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }),
        ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }),
      }}
    >
      {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 Twilight Ledger

The whole style →

Light Release Notes Header

Changelog

Frosted Transparent Header

Headers & nav bars

Glass Email Capture Pill

Forms

Accordion Feature List with Product Mock

Feature sections

Dark Glass Account Panel Mockup

Media & mockups

Faded Logo Marquee

Marquees & tickers