Cards & content / Media & mockups

Floating Dashboard Window on Silk

A frosted browser-window mockup with traffic-light dots and a URL pill on an orange-magenta silk background. Inside is a maroon sidebar and dashed skeleton placeholders, with a small code tooltip card floating over the lower left corner.

Rebuilt from stripe.com in the Iridescent Ledger style.

npx shadcn@latest add https://yoink-app.fly.dev/r/iridescent-ledger/blocks/platform-window-mockup.json

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

Usage

Props: url, brand, greeting, tooltipTitle, tooltipText, tooltipCode, nav (string array). Renders standalone; layers rise and scale in sequence once the graphic scrolls into view.

components/platform-window-mockup.tsx
"use client";

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

type Props = {
  url?: string;
  brand?: string;
  greeting?: string;
  tooltipTitle?: string;
  tooltipText?: string;
  tooltipCode?: string;
  nav?: string[];
};

export default function FloatingDashboardWindowOnSilk({
  url = "app.brightdesk.com",
  brand = "Brightdesk",
  greeting = "Hello, Harbor Pilates",
  tooltipTitle = "Invoices",
  tooltipText = "Show a table of invoices with filters, download, and void actions.",
  tooltipCode = "ledgerKit.mount('invoices');",
  nav = ["Home", "Invoices", "Insights", "Settings"],
}: Props) {
  const ref = useRef<HTMLDivElement>(null);
  const [shown, setShown] = useState(false);

  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    const io = new IntersectionObserver(
      ([e]) => {
        if (e.isIntersecting) {
          setShown(true);
          io.disconnect();
        }
      },
      { threshold: 0.2 }
    );
    io.observe(el);
    return () => io.disconnect();
  }, []);

  const layer = (delay: number, extra = "") =>
    `transition-all duration-[900ms] ease-[cubic-bezier(0.19,1,0.22,1)] motion-reduce:transition-none ${
      shown ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-[40px] scale-[0.94]"
    } ${extra}`;
  const d = (ms: number) => ({ transitionDelay: `${ms}ms` });

  return (
    <section className="bg-canvas px-4 py-10 sm:px-6">
      <Reveal from="up">
        <div
          ref={ref}
          className="relative mx-auto aspect-[4/3] w-full max-w-[1232px] overflow-hidden rounded-lg sm:aspect-[21/9] sm:min-h-[480px] md:aspect-auto md:h-[532px]"
          style={{
            background:
              "linear-gradient(115deg, #c9a6ff 0%, #f08cf5 18%, #ffb3a0 40%, #ff9f2e 65%, #ffb400 100%)",
          }}
        >
          <div
            aria-hidden
            className="absolute inset-0 opacity-50 mix-blend-soft-light"
            style={{
              background:
                "repeating-linear-gradient(60deg, rgba(255,255,255,0.35) 0 2px, transparent 2px 14px)",
            }}
          />
          <div
            aria-hidden
            className="absolute -left-20 top-0 h-full w-1/2 bg-[radial-gradient(60%_60%_at_30%_40%,rgba(160,120,255,0.55),transparent)]"
          />

          <div
            className={`absolute left-1/2 top-[54px] w-[min(800px,88%)] -translate-x-1/2 ${layer(0)}`}
            style={d(0)}
          >
            <div className="h-[520px] rounded-t-lg border border-white/40 bg-white/30 p-[7px] backdrop-blur-[12px]">
              <div className="relative flex h-7 items-center justify-center">
                <div className="absolute left-3 flex gap-1.5">
                  {[0, 1, 2].map((i) => (
                    <span key={i} className="h-2 w-2 rounded-pill bg-white/60" />
                  ))}
                </div>
                <div className="w-1/2 rounded-pill bg-white/40 px-3 py-1 text-center text-micro text-ink-muted">
                  {url}
                </div>
              </div>
              <div className="mt-1 flex h-full overflow-hidden rounded-t-md bg-surface">
                <div
                  className={`w-[26%] max-w-[130px] shrink-0 bg-[#5c0049] p-4 ${layer(150)}`}
                  style={d(150)}
                >
                  <div className="mb-6 flex items-center gap-2 text-ui text-white">
                    <span className="h-4 w-4 rounded-pill border border-signal-magenta bg-signal-magenta/40" />
                    {brand}
                  </div>
                  <ul className="space-y-3 text-micro text-white">
                    {nav.map((n, i) => (
                      <li key={n} className={i === 1 ? "text-signal-magenta" : ""}>
                        {n}
                      </li>
                    ))}
                  </ul>
                </div>
                <div className="flex-1 p-4">
                  <p className={`text-ui text-[#a0267f] ${layer(250)}`} style={d(250)}>
                    {greeting}
                  </p>
                  <div className="mt-5 space-y-3">
                    <div
                      className={`h-[58px] rounded-sm border border-dashed border-[#f6c3e6] bg-[#fff8fc] ${layer(350)}`}
                      style={d(350)}
                    />
                    <div className="grid grid-cols-[1fr_1.7fr] gap-3">
                      <div
                        className={`h-[116px] rounded-sm border border-dashed border-[#f6c3e6] bg-[#fff8fc] ${layer(450)}`}
                        style={d(450)}
                      />
                      <div
                        className={`h-[116px] rounded-sm border border-dashed border-[#f6c3e6] bg-[#fff8fc] ${layer(500)}`}
                        style={d(500)}
                      />
                    </div>
                    <div
                      className={`h-[200px] rounded-sm border border-dashed border-[#f6c3e6] bg-[#fff8fc] ${layer(600)}`}
                      style={d(600)}
                    />
                  </div>
                </div>
              </div>
            </div>
          </div>

          <div
            className={`absolute bottom-[50px] left-4 w-[min(356px,80%)] overflow-hidden rounded-md bg-white/90 shadow-floating backdrop-blur sm:left-[52px] ${layer(800)}`}
            style={d(800)}
          >
            <div className="p-3">
              <p className="font-mono text-micro text-ink-deep">{tooltipTitle}</p>
              <p className="mt-1 text-micro text-ink-muted">{tooltipText}</p>
            </div>
            <div className="border-t border-hairline px-3 py-3 font-mono text-micro text-ink">
              {tooltipCode}
            </div>
          </div>
        </div>
      </Reveal>
    </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