Page sections / Feature sections

Four-Step Numbered Columns

Large two-line serif headline over a moody storm landscape; below, four columns each topped by a hairline rule (first is bright), a tiny number, medium title and gray paragraph.

Rebuilt from silico.ai in the Moonlit Atelier style.

npx shadcn@latest add https://justyoink.it/r/moonlit-atelier/blocks/numbered-steps-over-painting.json

Looks exactly like silico.ai: 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, headlineSecond, steps (array of {title, body}), imageSrc (background photo). Renders standalone with defaults; the headline fades up 13px and the columns stagger in.

components/numbered-steps-over-painting.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Step = { title: string; body: string };

type Props = {
  headline?: string;
  headlineSecond?: string;
  steps?: Step[];
  imageSrc?: string;
};

const defaultSteps: Step[] = [
  { title: "Share your goal", body: "Write what you need in everyday words. Drop in reference files if useful. There is no special phrasing to learn and nothing to configure." },
  { title: "A plan takes shape", body: "A lead agent splits the work into stages, chooses the tools for each one and decides which parts can run in parallel." },
  { title: "Specialists get busy", body: "Focused agents gather sources, draft, build and test together, each one paired with the model that fits its task best." },
  { title: "Receive the deliverable", body: "Everything is reviewed, merged and delivered as a finished document, working app or completed action, ready to go." },
];

export default function FourStepNumberedColumns({
  headline = "Say what you want done.",
  headlineSecond = "Northwind handles the rest.",
  steps = defaultSteps,
  imageSrc = "https://yoink-app.fly.dev/stock/landscape-3.jpg",
}: Props) {
  return (
    <section className="relative isolate overflow-hidden bg-canvas text-primary">
      <img
        src={imageSrc}
        alt=""
        width={1600}
        height={1067}
        loading="lazy"
        className="absolute inset-0 -z-20 h-full w-full object-cover opacity-60"
        style={{ filter: "saturate(0.85)" }}
      />
      <div className="absolute inset-0 -z-10 bg-[linear-gradient(var(--color-canvas)_0%,transparent_30%,transparent_70%,var(--color-canvas)_100%)]" />
      <div className="absolute inset-0 -z-10 bg-scrim opacity-40" />
      <div className="mx-auto max-w-[1360px] px-6 pb-24 pt-24 md:px-10 md:pt-32">
        <Reveal from="up" distance={13} duration={720}>
          <h2 className="max-w-[820px] font-serif text-4xl leading-[1.1] tracking-[-0.02em] text-primary md:text-[56px]">
            {headline}
            <br />
            {headlineSecond}
          </h2>
        </Reveal>
        <Stagger step={100} from="up" distance={13} className="mt-16 grid gap-10 sm:grid-cols-2 lg:grid-cols-4 lg:gap-8 md:mt-20">
          {steps.map((s, i) => (
            <div key={s.title} className={`border-t pt-6 ${i === 0 ? "border-primary" : "border-hairline"}`}>
              <span className={`font-sans text-caption ${i === 0 ? "text-primary" : "text-faint"}`}>
                {String(i + 1).padStart(2, "0")}
              </span>
              <h3 className="mt-10 font-sans text-xl font-medium text-primary">{s.title}</h3>
              <p className="mt-3 max-w-[320px] font-sans text-[15px] leading-relaxed text-secondary">{s.body}</p>
            </div>
          ))}
        </Stagger>
      </div>
    </section>
  );
}

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

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

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

Quality checks

Automated, in a real browser · 4d ago
—

More from Moonlit Atelier

The whole style →

Inline Update Strip

Changelog

Hairline Capability Grid

Lists

Painted Landscape Hero

Heroes

Transparent Minimal Nav Bar

Headers & nav bars

Dark Prompt Composer

Prompt & chat inputs

Perspective Floating App Window

Media & mockups