Page sections / Heroes

Circuit Dot-Matrix Product Hero

Centered serif headline with a glass CTA above a green radial glow stage: a photoreal metallic hardware tile in the center, flanked by a green equalizer bar waveform, dotted arrow rows and pixel corner marks over a faint dot grid.

Rebuilt from resend.com/features/forge in the Obsidian Serif Glow style.

npx shadcn@latest add https://justyoink.it/r/obsidian-serif-glow/blocks/circuit-glow-product-hero.json

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

Usage

Props: title, description, ctaLabel, tileLabel, tileText. Renders standalone with defaults; the arrow rows pulse automatically and the stage fades in on scroll.

components/circuit-glow-product-hero.tsx
"use client";

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

const BARS = [30,36,26,34,40,32,38,42,28,24,26,22,20,20,32,38,52,50,48,40,24,22,22,16,20,24,30,40,44,44,42,36,48,38,34,26,18,28,20,24,34,40,22,28,36,44,30,26];

function Arrows({ rows, className = "" }: { rows: number[]; className?: string }) {
  const [t, setT] = useState(0);
  useEffect(() => {
    if (typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
    const id = setInterval(() => setT((v) => v + 1), 180);
    return () => clearInterval(id);
  }, []);
  return (
    <div className={"flex flex-col gap-3 " + className} aria-hidden="true">
      {rows.map((n, r) => (
        <div key={r} className="flex gap-2 text-accent-green font-mono text-[10px] leading-none">
          {Array.from({ length: n }).map((_, i) => (
            <span key={i} style={{ opacity: (i + r + t) % 8 < 3 ? 1 : 0.3 }} className="transition-opacity duration-200">⇢</span>
          ))}
        </div>
      ))}
    </div>
  );
}

function Corner({ className = "" }: { className?: string }) {
  return (
    <svg aria-hidden="true" width="22" height="28" viewBox="0 0 22 28" className={"absolute text-accent-green " + className} fill="currentColor">
      <rect x="0" y="0" width="4" height="4" opacity=".5" />
      <rect x="8" y="8" width="6" height="14" />
      <rect x="18" y="0" width="4" height="4" opacity=".4" />
    </svg>
  );
}

export default function CircuitDotMatrixProductHero(props: { title?: string; description?: string; ctaLabel?: string; tileLabel?: string; tileText?: string }) {
  const { title = "Northwind Relay", description = "Our own delivery engine, sending from address ranges we own and run. Built for speed and reliability.", ctaLabel = "Enable Relay", tileLabel = "RELAY", tileText = "The engine built for fast delivery and high uptime" } = props;
  return (
    <section className="relative isolate overflow-hidden bg-background text-primary pb-24">
      <div className="mx-auto max-w-3xl px-6 pt-24 text-center animate-hero-text-slide-up-fade">
        <h1 className="font-serif text-5xl md:text-7xl tracking-[-0.03em] bg-silver-text bg-clip-text text-transparent">{title}</h1>
        <p className="mt-6 text-lead text-secondary">{description}</p>
        <button className="mt-10 inline-flex items-center gap-2 rounded-xl border border-hairline bg-surface px-5 py-3 text-ui font-medium text-primary backdrop-blur-[25px] transition-colors duration-hover-color ease-hover-color hover:bg-surface-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-green">
          {ctaLabel}<span aria-hidden="true" className="text-muted">›</span>
        </button>
      </div>

      <Reveal from="none" duration={600} className="relative mt-16 h-[620px] md:h-[700px]">
        <div className="absolute inset-0 bg-[radial-gradient(658px_363px_at_50%_50%,color-mix(in_oklab,var(--color-accent-green)_15%,transparent)_26%,transparent_100%)]" />
        <div className="absolute inset-0 text-muted"><GridPattern variant="dots" size={14} color="color-mix(in oklab, currentColor 25%, transparent)" fade="radial" /></div>
        <Corner className="left-6 top-3" />
        <Corner className="right-6 top-3" />
        <Corner className="left-6 bottom-0" />
        <Corner className="right-6 bottom-0" />
        <Arrows rows={[14]} className="absolute left-1/2 top-2 -translate-x-1/2" />
        <Arrows rows={[14]} className="absolute left-1/2 bottom-2 -translate-x-1/2" />

        <div aria-hidden="true" className="absolute inset-x-[5%] top-[44%] flex h-14 items-end gap-[3px]">
          {Array.from({ length: 120 }).map((_, i) => (
            <div key={i} className="flex-1 bg-accent-green/90" style={{ height: BARS[i % BARS.length] + "px" }} />
          ))}
        </div>

        <Arrows rows={[10, 8, 7, 5, 3]} className="absolute left-[16%] bottom-10 hidden md:flex" />
        <Arrows rows={[10, 8, 7, 5, 3]} className="absolute right-[16%] bottom-10 hidden md:flex items-start" />

        <div className="absolute left-1/2 top-[18%] h-[360px] w-[360px] md:h-[470px] md:w-[470px] -translate-x-1/2 rounded-[22px] border border-hairline bg-surface p-3 shadow-card-soft">
          <div className="relative grid h-full w-full grid-cols-5 grid-rows-5 gap-1.5 rounded-xl bg-background p-1.5">
            <div className="col-span-2 row-span-1 rounded-md bg-gradient-to-br from-secondary/60 to-muted/50" />
            <div className="col-span-3 row-span-2 rounded-md bg-surface-high" />
            <div className="col-span-2 row-span-2 rounded-md bg-secondary/50 p-3 shadow-inset-highlight">
              <div className="font-mono text-lg tracking-widest text-background">{tileLabel}</div>
              <p className="mt-1 text-[9px] leading-tight text-background/80">{tileText}</p>
            </div>
            <div className="col-span-3 row-span-2 flex items-center justify-center rounded-md bg-surface-raised">
              <div className="h-24 w-24 rounded-3xl border-4 border-hairline bg-background" />
            </div>
            <div className="col-span-2 row-span-1 rounded-md bg-surface-high" />
            <div className="col-span-5 row-span-1 rounded-md bg-surface" />
          </div>
        </div>
      </Reveal>
    </section>
  );
}

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

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;
}

// Background and overlay layers sit inside their parent: make sure it can hold them.
function ykPrepareParent(el: HTMLElement | null, isolate = false) {
  const p = el?.parentElement;
  if (!p) return;
  const cs = getComputedStyle(p);
  if (cs.position === "static") p.style.position = "relative";
  if (isolate && cs.isolation !== "isolate" && cs.zIndex === "auto") p.style.isolation = "isolate";
}

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_GRID_CSS = `@keyframes yk-grid-sweep{from{-webkit-mask-position:150% 0;mask-position:150% 0}to{-webkit-mask-position:-50% 0;mask-position:-50% 0}}
@media (prefers-reduced-motion:reduce){[data-yk-sweep]{display:none}}`;

/** A faint grid or dot pattern behind a section, fading out at the edges. */
function GridPattern({
  variant = "grid",
  size = 32,
  color = "color-mix(in oklab, currentColor 12%, transparent)",
  fade = "radial",
  shimmer = false,
  className,
  style,
}: {
  variant?: "grid" | "dots";
  size?: number;
  color?: string;
  fade?: "radial" | "top" | "bottom" | "none";
  shimmer?: boolean;
  className?: string;
  style?: CSSProperties;
}) {
  const ref = useRef<HTMLDivElement>(null);
  useYkLayoutEffect(() => ykPrepareParent(ref.current, true), []);
  const paint = (c: string) =>
    variant === "dots"
      ? { backgroundImage: `radial-gradient(circle at center, ${c} 1.2px, transparent 1.6px)`, backgroundSize: `${size}px ${size}px` }
      : { backgroundImage: `linear-gradient(to right, ${c} 1px, transparent 1px), linear-gradient(to bottom, ${c} 1px, transparent 1px)`, backgroundSize: `${size}px ${size}px` };
  const mask = {
    radial: "radial-gradient(ellipse at center, black 30%, transparent 75%)",
    top: "linear-gradient(to bottom, black, transparent 85%)",
    bottom: "linear-gradient(to top, black, transparent 85%)",
    none: undefined,
  }[fade];
  const sweep = "linear-gradient(110deg, transparent 40%, black 50%, transparent 60%)";
  return (
    <div
      ref={ref}
      aria-hidden="true"
      data-yk-grid=""
      className={className}
      style={{ position: "absolute", inset: 0, zIndex: -1, pointerEvents: "none", maskImage: mask, WebkitMaskImage: mask, ...style }}
    >
      <div style={{ position: "absolute", inset: 0, ...paint(color) }} />
      {shimmer && (
        <>
          <style>{YK_GRID_CSS}</style>
          <div
            data-yk-sweep=""
            style={{
              position: "absolute",
              inset: 0,
              ...paint(`color-mix(in oklab, ${color} 100%, currentColor 30%)`),
              maskImage: sweep,
              WebkitMaskImage: sweep,
              maskSize: "250% 100%",
              WebkitMaskSize: "250% 100%",
              animation: "yk-grid-sweep 7s ease-in-out infinite",
            }}
          />
        </>
      )}
    </div>
  );
}

Quality checks

Automated, in a real browser · 5d ago
—

More from Obsidian Serif Glow

The whole style →

Blue Glass Agent Config Card

Forms

Hairline Use-Case Grid

Feature sections

Serif Hero with Dark 3D Object

Heroes

Monochrome Logo Cloud

Logo clouds

Language Picker and Code Window

Code blocks

Glossy Icon Section Header

Feature sections