Page sections / Calls to action

Scrimmed Event Banner

Rounded 6px full-width photo panel of a conference stage with a dark violet scrim, a large white light-weight headline and a white button with purple text. A small wordmark sits at the bottom right.

Rebuilt from stripe.com in the Iridescent Ledger style.

npx shadcn@latest add https://justyoink.it/r/iridescent-ledger/blocks/story-photo-banner.json

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

ImagesSwap it for a library image or one of your own.All images in this style →

Choose an image

Image

Loading…

Usage

Props: headline, ctaLabel, href, wordmark, wordmarkSuffix, imageSrc (defaults to a stock stage photo). Renders standalone; the photo fades in on load and zooms slightly on hover while the chevron slides.

components/story-photo-banner.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
import { useState } from "react";

export default function ScrimmedEventBanner({
  headline = "Designing the settlement layer for a world of autonomous software",
  ctaLabel = "Reserve a seat",
  href = "#",
  wordmark = "Kitefield",
  wordmarkSuffix = "summit",
  imageSrc = "https://yoink-app.fly.dev/stock/event-2.jpg",
}: {
  headline?: string;
  ctaLabel?: string;
  href?: string;
  wordmark?: string;
  wordmarkSuffix?: string;
  imageSrc?: string;
}) {
  const [hover, setHover] = useState(false);
  return (
    <section className="bg-canvas px-4 py-12 sm:py-20">
      <div
        className="relative mx-auto min-h-[360px] max-w-[1232px] overflow-hidden rounded-[6px] bg-night sm:aspect-[3.08/1]"
        onMouseEnter={() => setHover(true)}
        onMouseLeave={() => setHover(false)}
      >
        <div className="absolute inset-0 animate-[fadeIn_1200ms_cubic-bezier(0.65,0,0.35,1)_both]">
          <style>{`@keyframes fadeIn{from{opacity:0}to{opacity:1}}`}</style>
          <img
            src={imageSrc}
            alt="Conference stage with a large crowd under violet light"
            width={1600}
            height={1067}
            className={`h-full w-full object-cover transition-transform duration-[1200ms] ease-smooth ${hover ? "scale-[1.05]" : "scale-100"}`}
          />
          <div className="absolute inset-0 bg-[linear-gradient(90deg,color-mix(in_oklab,var(--color-night)_92%,transparent)_0%,color-mix(in_oklab,var(--color-accent)_45%,transparent)_45%,transparent_80%)]" />
          <div className="absolute inset-0 bg-gradient-to-t from-night/60 via-transparent to-night/30" />
        </div>
        <div className="relative z-10 flex h-full min-h-[360px] flex-col items-start p-6 sm:p-8">
          <Reveal from="up">
            <h2 className="max-w-[34rem] font-display text-4xl font-light leading-[1.05] tracking-[-0.02em] text-white sm:text-5xl">
              {headline}
            </h2>
          </Reveal>
          <a
            href={href}
            className="group mt-8 inline-flex h-12 items-center gap-2 rounded-[4px] bg-white px-6 text-ui font-medium text-accent transition-colors duration-link ease-link hover:bg-accent-wash focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
          >
            {ctaLabel}
            <svg width="8" height="12" viewBox="0 0 8 12" fill="none" aria-hidden="true" className="transition-transform duration-smooth ease-smooth group-hover:translate-x-[3px]">
              <path d="M2 2l4 4-4 4" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
          </a>
          <div className="mt-auto flex w-full items-center justify-end gap-2 pt-10 text-white">
            <span className="flex items-center gap-2 text-2xl tracking-[-0.02em]">
              <svg width="22" height="22" viewBox="0 0 22 22" aria-hidden="true"><path d="M2 20L11 2l9 18z" fill="currentColor" /></svg>
              <span className="font-semibold">{wordmark}</span>
              <span className="font-light">{wordmarkSuffix}</span>
            </span>
          </div>
        </div>
      </div>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): Reveal ----

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>
  );
}

Quality checks

Automated, in a real browser · 5d ago
—

More from Iridescent Ledger

The whole style →

Checklist Feature Columns

Feature sections

Iridescent Ribbon Hero

Heroes

Dated Article Row

Blog & articles

Saturated Highlight Card Strip

Carousels

Frosted Hairline Header

Headers & nav bars

Sticky Pill Sub-Navigation

Tab bars