Cards & content / Lists

Circular Topic Thumbnail Strip

Row of seven touching 175px circular photos (community science, CO2, methane, coral, soil, honey bees, plastics) each with an underlined 14px label beneath, below a large lead paragraph.

Rebuilt from seed.com/seedlabs in the Verdant Lab Editorial style.

npx shadcn@latest add https://justyoink.it/r/verdant-lab-editorial/blocks/topic-circle-strip.json

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

Images7 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

Props: title, lead (paragraph text), and topics (array of {label, href, src, alt}). Each circle links to its href anchor and zooms slightly on hover; renders standalone with defaults.

components/topic-circle-strip.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Topic = { label: string; href: string; src: string; alt: string };

const defaultTopics: Topic[] = [
  { label: "Water Quality", href: "#water", src: "https://yoink-app.fly.dev/stock/texture-2.jpg", alt: "Water droplets on a blue-grey surface" },
  { label: "Deep Ocean", href: "#ocean", src: "https://yoink-app.fly.dev/stock/texture-1.jpg", alt: "Deep blue ocean surface" },
  { label: "Dunes", href: "#dunes", src: "https://yoink-app.fly.dev/stock/landscape-6.jpg", alt: "Golden sand dune ridge" },
  { label: "Leaves", href: "#leaves", src: "https://yoink-app.fly.dev/stock/nature-2.jpg", alt: "Green leaf with water drops" },
  { label: "Forest", href: "#forest", src: "https://yoink-app.fly.dev/stock/nature-1.jpg", alt: "Sunlight through tall forest trees" },
  { label: "Blossoms", href: "#blossoms", src: "https://yoink-app.fly.dev/stock/nature-3.jpg", alt: "White water lily on dark water" },
  { label: "Coastline", href: "#coast", src: "https://yoink-app.fly.dev/stock/landscape-4.jpg", alt: "Aerial fjord with deep blue water" },
];

export default function CircularTopicThumbnailStrip({
  title = "FieldWorks",
  lead = "FieldWorks is the ecological research arm of Northwind Group. Guided by the idea that thriving people and thriving habitats depend on each other, we develop new field methods and living-systems tools to restore landscapes affected by human activity and meet some of the toughest challenges of a warming world.",
  topics = defaultTopics,
}: {
  title?: string;
  lead?: string;
  topics?: Topic[];
}) {
  return (
    <section className="bg-pure-white text-ink font-sans px-6 py-16 md:px-12">
      <div className="mx-auto max-w-[1280px]">
        <div className="grid gap-8 md:grid-cols-[minmax(0,438px)_1fr]">
          <Reveal from="up">
            <h2 className="text-h1 text-[40px] leading-tight font-light">{title}</h2>
          </Reveal>
          <Reveal from="up" delay={100}>
            <p className="max-w-[780px] text-[28px] leading-[40px] font-light">{lead}</p>
          </Reveal>
        </div>

        <Stagger
          step={80}
          from="up"
          className="mt-20 flex flex-wrap justify-center"
        >
          {topics.map((t) => (
            <a
              key={t.label}
              href={t.href}
              className="group flex w-[175px] flex-col items-center gap-5 rounded-pill focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ink"
            >
              <span className="block h-[175px] w-[175px] overflow-hidden rounded-full bg-surface-foam">
                <img
                  src={t.src}
                  alt={t.alt}
                  width={175}
                  height={175}
                  loading="lazy"
                  className="h-full w-full object-cover transition-transform duration-ui-hover ease-ui-hover group-hover:scale-110"
                />
              </span>
              <span className="text-[14px] font-semibold underline underline-offset-2">
                {t.label}
              </span>
            </a>
          ))}
        </Stagger>
      </div>
    </section>
  );
}

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

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

/** Reveals each direct child one after another when the group scrolls into view. */
function Stagger({
  children,
  step = 90,
  from = "up",
  distance = 20,
  duration = 650,
  delay = 0,
  once = true,
  as = "div",
  className,
  style,
}: {
  children?: ReactNode;
  step?: number;
  from?: "up" | "down" | "left" | "right" | "scale" | "fade";
  distance?: number;
  duration?: number;
  delay?: number;
  once?: boolean;
  as?: ElementType;
  className?: string;
  style?: CSSProperties;
}) {
  const Tag = as;
  const ref = useRef<HTMLElement>(null);
  const state = useYkReveal(ref, once);
  useYkLayoutEffect(() => {
    const items = Array.from(ref.current?.children ?? []) as HTMLElement[];
    if (state === "idle") return;
    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.92)",
      fade: "none",
    }[from];
    if (state === "hidden") {
      for (const el of items) Object.assign(el.style, { transition: "none", opacity: "0", transform: offset });
      return;
    }
    items.forEach((el, i) => {
      const t = `${duration}ms ${YK_EASE} ${delay + i * step}ms`;
      Object.assign(el.style, { transition: `opacity ${t}, transform ${t}`, opacity: "", transform: "" });
    });
    // hand the children their own transitions back once everything has landed
    const done = setTimeout(() => items.forEach((el) => (el.style.transition = "")), delay + items.length * step + duration + 50);
    return () => clearTimeout(done);
  }, [state]);
  return (
    <Tag ref={ref} className={className} style={style}>
      {children}
    </Tag>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Verdant Lab Editorial

The whole style →

Center-Focus Video Story Carousel

Carousels

Hairline Plus Accordion

Accordions

Frosted Glass Photo Hero

Heroes

Offer Popup Dialog

Dialogs & modals

Timeline Benefit Tiles

Feature sections

Glass Panel Annotated Capsule

Feature sections