Cards & content / Cards

Duotone Platform Download Cards

Three equal square cards with halftone-grained periwinkle-blue artwork backgrounds, centred mono eyebrow (MACOS 12+), large light condensed OS name and a pale icon button, with small underlined fallback links below.

Rebuilt from hermes-agent.nousresearch.com in the Electric Ultramarine Engraving style.

npx shadcn@latest add https://justyoink.it/r/electric-ultramarine-engraving/blocks/duotone-platform-cards.json

Looks exactly like hermes-agent.nousresearch.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Images3 in this component. Swap any for a library image or one of your own.All images in this style →

Choose an image

Image

Loading…

Usage

Pass title, subtitle and a platforms array (eyebrow, name, cta, icon: apple|grid|term, optional links, image URL); renders standalone with defaults.

components/duotone-platform-cards.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Platform = {
  eyebrow: string;
  name: string;
  cta: string;
  icon: "apple" | "grid" | "term";
  links?: string[];
  image: string;
};

const defaults: Platform[] = [
  { eyebrow: "MACOS 13+", name: "Apple", cta: "Get the installer", icon: "apple", image: "https://yoink-app.fly.dev/stock/nature-3.jpg" },
  { eyebrow: "WINDOWS 10/11", name: "Windows", cta: "Open the store", icon: "grid", links: ["Grab the .msi instead", "Open store in browser"], image: "https://yoink-app.fly.dev/stock/texture-2.jpg" },
  { eyebrow: "ANY DISTRO", name: "Linux", cta: "Run in terminal", icon: "term", image: "https://yoink-app.fly.dev/stock/abstract-6.jpg" },
];

function Icon({ type }: { type: Platform["icon"] }) {
  const c = "h-4 w-4";
  if (type === "grid")
    return (<svg className={c} viewBox="0 0 16 16" fill="currentColor" aria-hidden><rect x="1" y="1" width="6.5" height="6.5"/><rect x="8.5" y="1" width="6.5" height="6.5"/><rect x="1" y="8.5" width="6.5" height="6.5"/><rect x="8.5" y="8.5" width="6.5" height="6.5"/></svg>);
  if (type === "term")
    return (<svg className={c} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden><rect x="1.5" y="2.5" width="13" height="11"/><path d="M4 6l2 2-2 2M8 10h4"/></svg>);
  return (<svg className={c} viewBox="0 0 16 16" fill="currentColor" aria-hidden><circle cx="8" cy="9" r="5"/><rect x="7.4" y="1" width="1.4" height="3"/></svg>);
}

export default function DuotonePlatformDownloadCards({
  title = "Desktop Client",
  subtitle = "Runs on every machine you own.",
  platforms = defaults,
}: {
  title?: string;
  subtitle?: string;
  platforms?: Platform[];
}) {
  return (
    <section className="bg-cobalt px-4 py-20 text-paper">
      <div className="mx-auto max-w-[1080px]">
        <Reveal className="text-center">
          <h2 className="font-display text-display font-light">{title}</h2>
          <p className="mt-2 text-body">{subtitle}</p>
        </Reveal>
        <div className="mt-10 grid gap-[30px] md:grid-cols-3">
          {platforms.map((p) => (
            <article key={p.name} className="relative isolate flex aspect-square flex-col items-center justify-center overflow-hidden bg-cobalt text-center">
              <img src={p.image} alt="" width={800} height={600} loading="lazy" className="absolute inset-0 -z-10 h-full w-full object-cover opacity-60 mix-blend-screen grayscale contrast-150" />
              <div className="absolute inset-0 -z-10 bg-[#4a4aff]/60 mix-blend-multiply" />
              <p className="font-mono text-micro uppercase">{p.eyebrow}</p>
              <h3 className="mt-6 font-display text-h1 font-light">{p.name}</h3>
              <a href="#" className="group relative mt-4 inline-flex items-center gap-2 overflow-hidden rounded-sm bg-paper-tint px-3 py-2 font-mono text-button uppercase text-cobalt-deep focus-visible:outline focus-visible:outline-2 focus-visible:outline-paper">
                <span className="absolute inset-0 -translate-x-full bg-paper transition-transform duration-300 group-hover:translate-x-0" />
                <span className="relative flex items-center gap-2"><Icon type={p.icon} />{p.cta}</span>
              </a>
              {p.links?.map((l) => (
                <a key={l} href="#" className="mt-3 text-caption underline decoration-paper/60 underline-offset-4 transition-colors duration-link-underline hover:decoration-paper">{l}</a>
              ))}
            </article>
          ))}
        </div>
      </div>
    </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 Electric Ultramarine Engraving

The whole style →

Numbered Engraving Feature Grid

Feature sections

Weathered Texture Compare Hero

Heroes

Cobalt Engraving Hero

Heroes

Spaced Mono Navigation Bar

Headers & nav bars

Install Command Tabs

Code blocks

Condensed Uppercase Button Pair

Buttons