Cards & content / Carousels

Agent Window Strip

A horizontal row of tall dark agent chat windows with title bars (icon, name, model badge, minimize/expand/close icons), prompt bubbles and 'added to context' meta rows, masked to fade at left and right edges.

Rebuilt from linear.app in the Obsidian Precision style.

npx shadcn@latest add https://yoink-app.fly.dev/r/obsidian-precision-5cbef2/blocks/agent-window-carousel.json

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

Usage

Props: title, description, linkLabel, and windows (array of {name, badge, prompt, context, tag}). The window row auto-scrolls horizontally via Marquee, pauses on hover, and fades at its edges.

components/agent-window-carousel.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Win = { name: string; badge?: string; prompt: string; context: string; tag: string };

type Props = {
  title?: string;
  description?: string;
  linkLabel?: string;
  windows?: Win[];
};

const defaultWindows: Win[] = [
  { name: "Helper", prompt: "which are the most used reports this week? add them to the dashboard project", context: "added to context", tag: "Reports" },
  { name: "Builder", prompt: "add retry handling for failed file exports described in this ticket", context: "added to context", tag: "TASK-1204" },
  { name: "Planner", badge: "Model 4", prompt: "Review today's inbox and group the tasks by what should happen next", context: "added to context", tag: "Daily Inbox" },
  { name: "Writer", prompt: "review this ticket, draft acceptance criteria, and break the work into steps", context: "added to context", tag: "TASK-1311" },
  { name: "Analyst", badge: "Model 4", prompt: "summarize last month's support themes and flag anything urgent", context: "added to context", tag: "Support Digest" },
];

function Ico({ d }: { d: string }) {
  return (
    <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" strokeWidth="1.2" strokeLinecap="round" aria-hidden="true">
      <path d={d} />
    </svg>
  );
}

function Card({ w }: { w: Win }) {
  return (
    <article className="relative flex h-[560px] w-[400px] shrink-0 flex-col overflow-hidden rounded-lg border border-hairline bg-surface bg-panel-sheen">
      <div className="pointer-events-none absolute inset-0 bg-[radial-gradient(50%_35%_at_0%_0%,rgba(255,255,255,0.03),transparent)]" />
      <header className="flex items-center gap-2 px-5 pt-4 text-ui text-tertiary">
        <span className="h-3 w-3 rounded-sm bg-secondary/70" aria-hidden="true" />
        <span className="text-secondary">{w.name}</span>
        {w.badge && <span className="rounded-xs border border-hairline px-1 text-micro text-tertiary">{w.badge}</span>}
        <span className="ml-auto flex items-center gap-3 text-quaternary">
          <button aria-label="Minimize" className="focus-visible:outline focus-visible:outline-accent-indigo"><Ico d="M2 9h8" /></button>
          <button aria-label="Expand" className="focus-visible:outline focus-visible:outline-accent-indigo"><Ico d="M7 2h3v3M5 10H2V7" /></button>
          <button aria-label="Close" className="focus-visible:outline focus-visible:outline-accent-indigo"><Ico d="M2 2l8 8M10 2l-8 8" /></button>
        </span>
      </header>
      <div className="animate-conversation-in flex flex-col items-end gap-2 px-3 pt-8">
        <p className="w-[340px] rounded-md bg-surface-raised px-2.5 py-2 text-ui text-primary">{w.prompt}</p>
        <p className="flex items-center gap-1.5 pr-1 text-micro text-quaternary">
          <span className="h-3 w-3 rounded-full border border-tertiary" aria-hidden="true" />
          <span className="text-tertiary">{w.tag}</span>
          {w.context}
        </p>
      </div>
    </article>
  );
}

export default function AgentWindowStrip({
  title = "Agents and workflows",
  description = "Create assistants that work next to your team. Tackle complex work together or hand off entire tasks from start to finish.",
  linkLabel = "Learn more",
  windows = defaultWindows,
}: Props) {
  return (
    <section className="overflow-hidden bg-canvas py-24 font-sans text-primary">
      <div className="mx-auto grid max-w-[1280px] gap-8 px-5 md:grid-cols-2 md:px-20">
        <Reveal from="up"><h2 className="text-h1 max-w-[320px] text-primary">{title}</h2></Reveal>
        <Reveal from="up" delay={100}>
          <p className="text-lead max-w-[520px] text-secondary">{description}</p>
          <a href="#" className="mt-8 inline-block text-ui text-tertiary transition-colors duration-link-color hover:text-primary focus-visible:outline focus-visible:outline-accent-indigo">{linkLabel} →</a>
        </Reveal>
      </div>
      <div
        className="mt-24"
        style={{ maskImage: "linear-gradient(to right, transparent 0, #000 200px, #000 calc(100% - 60px), transparent)", WebkitMaskImage: "linear-gradient(to right, transparent 0, #000 200px, #000 calc(100% - 60px), transparent)" }}
      >
        <Marquee speed={25} gap={12} pauseOnHover fade={false}>
          {windows.map((w) => (
            <Card key={w.name} w={w} />
          ))}
        </Marquee>
      </div>
      <div className="mx-auto mt-10 grid max-w-[1280px] gap-6 px-5 text-ui text-tertiary md:grid-cols-2 md:px-20">
        <span className="text-quaternary">Features</span>
        <ul className="grid grid-cols-2 gap-y-2">
          {["Agent", "Triage", "Coding Agent", "MCP"].map((f) => (
            <li key={f} className="flex items-center gap-2">{f} <span aria-hidden="true">+</span></li>
          ))}
        </ul>
      </div>
    </section>
  );
}

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

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_MARQUEE_CSS = `@keyframes yk-marquee-x{to{transform:translate3d(calc(-1 * var(--yk-shift)),0,0)}}
@keyframes yk-marquee-y{to{transform:translate3d(0,calc(-1 * var(--yk-shift)),0)}}
[data-yk-marquee][data-pause]:hover [data-yk-track]{animation-play-state:paused}
@media (prefers-reduced-motion:reduce){[data-yk-track]{animation:none!important}}`;

/** An endless, seamless scrolling row (or column) of items: logos, quotes, tags. */
function Marquee({
  children,
  speed = 40,
  reverse = false,
  vertical = false,
  pauseOnHover = true,
  fade = true,
  gap = 48,
  className,
  style,
}: {
  children?: ReactNode;
  /** pixels per second */
  speed?: number;
  reverse?: boolean;
  vertical?: boolean;
  pauseOnHover?: boolean;
  fade?: boolean;
  gap?: number;
  className?: string;
  style?: CSSProperties;
}) {
  const box = useRef<HTMLDivElement>(null);
  const group = useRef<HTMLDivElement>(null);
  const [m, setM] = useState({ copies: 2, size: 0 });
  useEffect(() => {
    const measure = () => {
      const b = box.current, g = group.current;
      if (!b || !g) return;
      const size = vertical ? g.offsetHeight : g.offsetWidth;
      const room = vertical ? b.offsetHeight : b.offsetWidth;
      if (size > 0) setM({ size, copies: Math.max(2, Math.ceil(room / size) + 1) });
    };
    measure();
    const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null;
    if (box.current) ro?.observe(box.current);
    if (group.current) ro?.observe(group.current);
    return () => ro?.disconnect();
  }, [vertical]);
  // the copies are only there to fill the loop: hide them from screen readers and keyboards
  useEffect(() => {
    box.current?.querySelectorAll("[data-yk-copy]").forEach((el) => el.setAttribute("inert", ""));
  }, [m.copies]);
  const edge = vertical ? "to bottom" : "to right";
  const mask = fade ? `linear-gradient(${edge}, transparent, black 10%, black 90%, transparent)` : undefined;
  const dir = vertical ? "column" : "row";
  const items = (copy: number) => (
    <div
      key={copy}
      ref={copy === 0 ? group : undefined}
      data-yk-copy={copy > 0 ? "" : undefined}
      aria-hidden={copy > 0 || undefined}
      style={{ display: "flex", flexDirection: dir, flexShrink: 0, alignItems: "center", gap, [vertical ? "paddingBottom" : "paddingRight"]: gap }}
    >
      {children}
    </div>
  );
  return (
    <div
      ref={box}
      data-yk-marquee=""
      data-pause={pauseOnHover ? "" : undefined}
      className={className}
      style={{ overflow: "hidden", maskImage: mask, WebkitMaskImage: mask, ...style }}
    >
      <style>{YK_MARQUEE_CSS}</style>
      <div
        data-yk-track=""
        style={{
          display: "flex",
          flexDirection: dir,
          width: vertical ? "100%" : "max-content",
          ["--yk-shift" as string]: `${m.size}px`,
          animation: m.size ? `yk-marquee-${vertical ? "y" : "x"} ${m.size / Math.max(speed, 1)}s linear infinite${reverse ? " reverse" : ""}` : undefined,
        }}
      >
        {Array.from({ length: m.copies }, (_, i) => items(i))}
      </div>
    </div>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Obsidian Precision

The whole style →

Bold Colour Testimonial Cards

Testimonials

Mono Uppercase Feature Tab List with Document Preview

Tab bars

Nested Initiatives Table

Tables

Quarterly Roadmap Board

Cards

Blur-In Word Hero with Floating App Window

Heroes

Frosted Hairline Header

Headers & nav bars