Page sections / Feature sections

Giant Numeral Capability Chapters

Oversized serif numerals 1–4 with parenthetical category tag, hairline-separated sub-lists with muted descriptions, a quoted 'Try asking' prompt, and a right column with serif heading plus a framed demo panel containing a paper-colored document.

Rebuilt from silico.ai in the Moonlit Atelier style.

npx shadcn@latest add https://yoink-app.fly.dev/r/moonlit-atelier/blocks/numbered-feature-chapters.json

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

Usage

All copy is overridable via props: tag, heading, prompt, intro, ctaLabel and chapters (n, tag, items). Renders standalone with defaults.

components/numbered-feature-chapters.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
export default function GiantNumeralCapabilityChapters(props: {
  tag?: string;
  heading?: string;
  prompt?: string;
  chapters?: { n: string; tag: string; items: { title: string; desc: string }[] }[];
  ctaLabel?: string;
  intro?: string;
}) {
  const {
    tag = "(Chapter one)",
    heading = "Plan the trip, book the rest, and keep every detail in one calm place.",
    prompt = "Try asking: “Map a four-day coastal route with quiet stops.”",
    ctaLabel = "Start planning",
    intro = "Thoughtful itineraries, carried through to departure day.",
    chapters = [
      {
        n: "1",
        tag: "(Itineraries)",
        items: [
          { title: "Routes and stops", desc: "Balanced days with sensible travel times between each place." },
          { title: "Local picks", desc: "Small cafés, galleries and trails worth the detour." },
        ],
      },
      {
        n: "2",
        tag: "(Bookings)",
        items: [
          { title: "Stays and tickets", desc: "Options compared side by side, then reserved for you." },
          { title: "Changes", desc: "Plans adjusted automatically when something shifts." },
        ],
      },
    ],
  } = props;

  return (
    <section className="bg-canvas text-primary font-sans px-6 py-20 md:px-10">
      <div className="mx-auto max-w-[1360px]">
        <div className="flex items-start justify-between gap-6 text-caption">
          <span>{tag}</span>
          <p className="hidden max-w-[280px] md:block">{intro}</p>
          <a href="#" className="border-b border-primary transition-opacity duration-[180ms] ease-ui-hover hover:opacity-65 focus-visible:outline focus-visible:outline-1">{ctaLabel}</a>
        </div>

        <div className="mt-20 grid gap-16 lg:grid-cols-2">
          <div className="space-y-16">
            {chapters.map((c) => (
              <Reveal key={c.n} from="up" distance={37}>
                <div className="flex items-start gap-6">
                  <span className="block font-serif text-[120px] leading-none md:text-[180px]">{c.n}</span>
                  <div className="flex-1 pt-4">
                    <span className="text-caption text-muted">{c.tag}</span>
                    <dl className="mt-4">
                      {c.items.map((i) => (
                        <div key={i.title} className="border-t border-hairline py-4">
                          <dt className="text-body">{i.title}</dt>
                          <dd className="mt-1 text-caption text-muted">{i.desc}</dd>
                        </div>
                      ))}
                    </dl>
                  </div>
                </div>
              </Reveal>
            ))}
            <Reveal from="up" distance={11}>
              <p className="border-t border-hairline pt-4 font-serif text-lead text-secondary">{prompt}</p>
            </Reveal>
          </div>

          <div>
            <Reveal from="up" distance={23}>
              <h3 className="max-w-[600px] font-serif text-h2">{heading}</h3>
            </Reveal>
            <Reveal from="up" distance={12} delay={100}>
              <div className="mt-10 rounded-xl border border-hairline bg-canvas-warm p-6 shadow-float-window">
                <div className="mb-4 flex gap-1.5">
                  <i className="h-2.5 w-2.5 rounded-pill bg-hairline-strong" />
                  <i className="h-2.5 w-2.5 rounded-pill bg-hairline-strong" />
                  <i className="h-2.5 w-2.5 rounded-pill bg-hairline-strong" />
                </div>
                <div className="rounded-md bg-paper p-8 text-[#1a1a1a]">
                  <p className="font-serif text-h3">Coastal route, day one</p>
                  <div className="mt-4 space-y-2">
                    <div className="h-2 w-full rounded-pill bg-black/10" />
                    <div className="h-2 w-5/6 rounded-pill bg-black/10" />
                    <div className="h-2 w-2/3 rounded-pill bg-black/10" />
                  </div>
                  <div className="mt-6 grid grid-cols-2 gap-3 text-caption">
                    <span className="rounded-sm bg-black/5 p-3">Depart 09:00</span>
                    <span className="rounded-sm bg-black/5 p-3">Harbour lunch</span>
                  </div>
                </div>
              </div>
            </Reveal>
          </div>
        </div>
      </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