Page sections / Feature sections

Guided Demo Feature Section

Tiny index number, serif title and lead on the left, stacked body paragraphs and a hairline-separated 'Where to find it' meta block on the right. Below, a full-width framed app demo with a five-step progress timeline and illustrative caption.

Rebuilt from silico.ai/features in the Moonlit Atelier style.

npx shadcn@latest add https://justyoink.it/r/moonlit-atelier/blocks/guided-demo-feature-section.json

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

Usage

All copy is exposed as props (title, lead, paragraphs, steps, caption, etc.); stepDuration sets ms per step. The demo auto-advances through steps, moving the cursor and filling the progress rules; click a step to jump.

components/guided-demo-feature-section.tsx
"use client";

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

type Props = {
  index?: string;
  title?: string;
  lead?: string;
  paragraphs?: string[];
  findLabel?: string;
  findText?: string;
  knowLabel?: string;
  knowText?: string;
  steps?: string[];
  caption?: string;
  stepDuration?: number;
};

const Ico = ({ d }: { d: string }) => (
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d={d} /></svg>
);

export default function GuidedDemoFeatureSection({
  index = "02",
  title = "Workflows",
  lead = "Build repeatable routines with a name, a trigger and a clear owner. Run them on demand, or let them follow a schedule.",
  paragraphs = [
    "Begin with a template such as Digest, Intake, Review or Handoff, or draft one from a blank page. Every step remains editable.",
    "Attach an owner, an optional list of tools and a cap on how long each run may take. Runs halt at the cap and ask for your approval.",
    "Workflows can call one another and pass results along. In a shared thread, type / to pick which one starts.",
    "Open a workflow's history to see past runs, durations and the notes left behind.",
  ],
  findLabel = "Where to find it",
  findText = "The Workflows list in the left rail. Press Create.",
  knowLabel = "Good to know",
  knowText = "Each workflow holds 1 to 12 steps.",
  steps = [
    "Press Create in the Workflows list",
    "Choose a template, such as Digest",
    "Name it and set an owner and a time cap",
    "Run it from the thread. It can call other workflows",
    "Open History to see runs and durations",
  ],
  caption = "Illustrative demo of the Northwind app.",
  stepDuration = 4000,
}: Props) {
  const [active, setActive] = useState(0);
  const [shown, setShown] = useState(false);
  useEffect(() => {
    const t = setTimeout(() => setShown(true), 30);
    return () => clearTimeout(t);
  }, []);
  useEffect(() => {
    const t = setTimeout(() => setActive((a) => (a + 1) % steps.length), stepDuration);
    return () => clearTimeout(t);
  }, [active, steps.length, stepDuration]);

  const cursors = ["translate-x-[104px] translate-y-[190px]", "translate-x-[110px] translate-y-[100px]", "translate-x-[120px] translate-y-[30px]", "translate-x-[420px] translate-y-[400px]", "translate-x-[300px] translate-y-[10px]"];
  const rail = ["M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", "M2 4h7a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H2zM22 4h-7a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h8z", "M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM21 21l-5-5", "M4 6h16M4 12h16M4 18h10", "M3 7h18v10H3z"];

  return (
    <section className="bg-canvas text-primary font-sans px-5 py-20 md:px-10">
      <div className="mx-auto max-w-[1350px]">
        <div className="grid gap-10 md:grid-cols-2 md:gap-16">
          <Reveal from="up">
            <p className="text-caption text-muted">{index}</p>
            <h2 className="mt-4 font-serif text-h1 text-primary">{title}</h2>
            <p className="mt-6 max-w-[500px] text-lead text-secondary">{lead}</p>
          </Reveal>
          <Reveal from="up" delay={100}>
            <div className="space-y-4 text-body text-secondary">
              {paragraphs.map((p) => <p key={p}>{p}</p>)}
            </div>
            <div className="mt-8 grid gap-6 border-t border-hairline pt-6 sm:grid-cols-2">
              <div>
                <p className="text-caption text-muted">{findLabel}</p>
                <p className="mt-1 text-caption text-primary">{findText}</p>
              </div>
              <div>
                <p className="text-caption text-muted">{knowLabel}</p>
                <p className="mt-1 text-caption text-secondary">{knowText}</p>
              </div>
            </div>
          </Reveal>
        </div>

        <div
          role="img"
          aria-label="Demo of the workflows app"
          className={`relative mt-14 overflow-hidden rounded-xl border border-hairline bg-surface p-2.5 shadow-float-window transition-all duration-[550ms] ease-fade-rise ${shown ? "opacity-100 translate-y-0" : "opacity-0 translate-y-[9px]"}`}
        >
          <div className="flex h-[420px] overflow-hidden rounded-lg bg-canvas-warm md:h-[790px]">
            <div className="hidden w-14 flex-col items-center gap-6 pt-6 text-muted sm:flex">
              <span className="h-6 w-6 rounded-full border border-secondary" />
              {rail.map((d, i) => <Ico key={i} d={d} />)}
              <span className="mt-auto mb-4 flex h-8 w-8 items-center justify-center rounded-full bg-surface-raised text-caption">N</span>
            </div>
            <div className="hidden w-[300px] shrink-0 border-x border-hairline p-4 md:block">
              <div className="rounded-md border border-hairline bg-surface-raised px-4 py-2.5 text-caption text-primary">+ New thread</div>
              <p className="mt-6 px-2 text-caption text-muted">Workflows</p>
              <ul className="mt-2 space-y-1 text-caption">
                <li className="rounded-md bg-surface-raised px-3 py-2.5 text-primary">General</li>
                <li className="flex items-center gap-2 px-3 py-2.5 text-secondary"><span className="h-4 w-4 rounded-full bg-surface-high" />Digest</li>
                <li className={`rounded-md px-3 py-2.5 transition-colors duration-ui-hover ${active === 0 ? "bg-surface-raised text-primary" : "text-muted"}`}>+ Create</li>
              </ul>
              <p className="mt-6 px-2 text-caption text-muted">Today</p>
              <ul className="mt-2 space-y-3 px-2 text-caption text-secondary"><li>Weekly summary</li><li>Vendor check</li></ul>
            </div>
            <div className="flex flex-1 flex-col">
              <div className="border-b border-hairline px-6 py-4 text-caption text-primary">New thread</div>
              <div className="flex flex-1 items-center justify-center text-body text-muted">What should we build next?</div>
              <div className="m-4 rounded-xl bg-surface-high p-4">
                <p className="flex items-center text-body text-muted">Message Northwind<span className="ml-0.5 inline-block h-4 w-px bg-secondary animate-caret-blink" /></p>
                <div className="mt-6 flex items-center justify-between text-muted">
                  <span>+</span>
                  <button aria-label="Send" className="flex h-10 w-10 items-center justify-center rounded-pill bg-paper text-canvas focus-visible:outline focus-visible:outline-2"><Ico d="M12 19V5M5 12l7-7 7 7" /></button>
                </div>
              </div>
            </div>
          </div>
          <div className={`pointer-events-none absolute left-14 top-24 transition-all duration-[820ms] ease-fade-rise ${shown ? "opacity-100" : "opacity-0"} ${cursors[active % cursors.length]}`}>
            <svg width="18" height="22" viewBox="0 0 18 22" aria-hidden="true"><path d="M1 1v17l4.5-4 3 7 3-1.3-3-6.7H15z" fill="#fff" stroke="#000" strokeWidth="1" /></svg>
          </div>
        </div>

        <ol className="mt-5 grid gap-4 sm:grid-cols-2 lg:grid-cols-5">
          {steps.map((s, i) => (
            <li key={s}>
              <button onClick={() => setActive(i)} className="block w-full text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4">
                <span className="block h-px w-full overflow-hidden bg-hairline">
                  <span
                    key={active === i ? "a" + active : i}
                    className="block h-full origin-left bg-primary ease-linear"
                    style={{ transform: i < active ? "scaleX(1)" : "scaleX(0)", animation: i === active ? `demoFill ${stepDuration}ms linear forwards` : undefined }}
                  />
                </span>
                <span className={`mt-3 block text-caption transition-colors duration-ui-hover ${i === active ? "text-primary" : "text-faint"}`}>{i + 1}&nbsp; {s}</span>
              </button>
            </li>
          ))}
        </ol>
        <p className="mt-8 text-caption text-muted">{caption}</p>
      </div>
      <style>{`@keyframes demoFill{from{transform:scaleX(0)}to{transform:scaleX(1)}}`}</style>
    </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 · 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