Forms & inputs / Forms

Blue Glass Agent Config Card

Large rounded glass card with deep blue radial wash holding a title, instruction textarea and an 'All actions' select. Paired left with an icon eyebrow, gradient headline and gray copy.

Rebuilt from resend.com/products/inboxes in the Obsidian Serif Glow style.

npx shadcn@latest add https://justyoink.it/r/obsidian-serif-glow/blocks/agent-config-glass-card.json

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

Usage

Props: eyebrow, headline, copy, cardTitle, cardCopy, initialInstructions, options (select items). The textarea is editable and the select opens a scale-up-fade popover; all props have defaults.

components/agent-config-glass-card.tsx
"use client";

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

export default function BlueGlassAgentConfigCard({
  eyebrow = "Smart routines",
  headline = "Let your queue run itself",
  copy = "Write plain instructions and let helpers handle repeat tasks triggered by events, while your team keeps the final say.",
  cardTitle = "Helper",
  cardCopy = "Describe how a helper should sort your requests, automate chores, and draft replies sooner.",
  initialInstructions = "Keep my queue tidy: tag and prioritize",
  options = ["All actions", "Tag only", "Draft replies", "Archive"],
}: {
  eyebrow?: string;
  headline?: string;
  copy?: string;
  cardTitle?: string;
  cardCopy?: string;
  initialInstructions?: string;
  options?: string[];
}) {
  const [text, setText] = useState(initialInstructions);
  const [open, setOpen] = useState(false);
  const [value, setValue] = useState(options[0]);

  return (
    <section className="relative isolate overflow-hidden bg-background px-6 py-16 md:px-12 lg:px-[200px]">
      <div className="mx-auto grid max-w-6xl items-center gap-12 lg:grid-cols-2">
        <Reveal from="up">
          <div className="flex items-center gap-2 text-ui text-primary">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.2" aria-hidden="true">
              <rect x="1.5" y="1.5" width="6" height="6" rx="2" />
              <rect x="8.5" y="8.5" width="6" height="6" rx="2" />
            </svg>
            <span>{eyebrow}</span>
          </div>
          <h2 className="mt-4 max-w-md bg-silver-text bg-clip-text text-5xl font-medium leading-[1.05] tracking-[-0.04em] text-transparent md:text-6xl">
            {headline}
          </h2>
          <p className="mt-5 max-w-md text-lead text-secondary">{copy}</p>
        </Reveal>

        <div className="relative lg:justify-self-end">
          <div className="relative w-full max-w-[460px] rounded-[40px] bg-gradient-to-br from-white/10 to-transparent p-4">
            <div className="relative rounded-[32px] border border-hairline-soft bg-surface p-8 backdrop-blur">
              <div className="pointer-events-none absolute inset-0 overflow-hidden rounded-[32px]">
                <div className="absolute -bottom-20 -right-20 h-64 w-64 rounded-full bg-[#0090ff] opacity-60 blur-[120px]" />
                <div className="absolute bottom-10 right-0 h-64 w-64 rounded-full bg-[#0077ff]/45 blur-[120px]" />
                <div className="absolute inset-0 bg-[radial-gradient(141%_141%_at_100%_0%,rgba(255,255,255,0.08),transparent)]" />
              </div>
              <div className="relative">
                <h3 className="text-base font-semibold text-primary">{cardTitle}</h3>
                <p className="mt-2 text-ui text-secondary">{cardCopy}</p>
                <label htmlFor="agent-instructions" className="mt-8 block text-ui text-secondary">Instructions</label>
                <textarea
                  id="agent-instructions"
                  value={text}
                  onChange={(e) => setText(e.target.value)}
                  className="mt-2 h-24 w-full resize-none rounded-xl border border-hairline bg-white/5 p-4 text-ui text-primary outline-none focus-visible:ring-1 focus-visible:ring-accent-blue"
                />
                <span className="mt-6 block text-ui text-secondary">Available actions</span>
                <div className="relative mt-2">
                  <button
                    type="button"
                    aria-haspopup="listbox"
                    aria-expanded={open}
                    onClick={() => setOpen(!open)}
                    className="flex h-10 w-full items-center justify-between rounded-xl border border-hairline bg-white/5 px-4 text-ui text-primary focus-visible:outline focus-visible:outline-1 focus-visible:outline-accent-blue"
                  >
                    {value}
                    <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" strokeWidth="1.3" aria-hidden="true">
                      <path d="M2 4l4 4 4-4" />
                    </svg>
                  </button>
                  {open && (
                    <ul role="listbox" className="animate-open-scale-up-fade absolute bottom-full left-0 z-10 mb-2 w-full origin-bottom rounded-xl border border-hairline bg-surface-raised p-1 shadow-card-soft">
                      {options.map((o) => (
                        <li key={o} role="option" aria-selected={o === value}>
                          <button
                            type="button"
                            onClick={() => { setValue(o); setOpen(false); }}
                            className="w-full rounded-lg px-3 py-2 text-left text-ui text-secondary hover:bg-surface-high hover:text-primary"
                          >
                            {o}
                          </button>
                        </li>
                      ))}
                    </ul>
                  )}
                </div>
              </div>
            </div>
          </div>
        </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 Obsidian Serif Glow

The whole style →

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

Test Mode and Webhook Dual Cards

Feature sections