Cards & content / Cards

Community Link Cards

Two glass cards with brand glyph, title, mono member count, description and an arrow link, floating above a red ribbon backdrop at low opacity, followed by a horizontally scrolling row of video thumbnails with edge fades.

Rebuilt from raycast.com in the Obsidian Launcher style.

npx shadcn@latest add https://justyoink.it/r/obsidian-launcher/blocks/community-link-cards.json

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

Images5 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: heading, subheading, cards (title, meta, body, cta, glyph), videos (title, src, tone), footnote, channelLabel. All have defaults so it renders with no props; thumbnails scroll in a masked marquee.

components/community-link-cards.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Card = { title: string; meta: string; body: string; cta: string; glyph: "hash" | "cross" };
type Video = { title: string; src: string; tone: string };

export default function CommunityLinkCards({
  heading = "Never miss an update.",
  subheading = "Meet fellow makers and see how teams get more done with Lumen.",
  cards = [
    { title: "Chat Hub", meta: "12k members", body: "Early looks at upcoming releases and tips shared by fellow users every day.", cta: "Join", glyph: "hash" },
    { title: "Social Feed", meta: "48k followers", body: "Catch release notes, small improvements and handy shortcuts as they ship.", cta: "Follow", glyph: "cross" },
  ] as Card[],
  videos = [
    { title: "Five shortcuts to speed up your week", src: "https://yoink-app.fly.dev/stock/workspace-2.jpg", tone: "from-accent-red/30" },
    { title: "Our favourite add-ons for designers", src: "https://yoink-app.fly.dev/stock/workspace-7.jpg", tone: "from-accent-blue/30" },
    { title: "Meet the new Timer panel", src: "https://yoink-app.fly.dev/stock/abstract-3.jpg", tone: "from-accent-green/30" },
    { title: "Getting the most from snippets", src: "https://yoink-app.fly.dev/stock/product-4.jpg", tone: "from-accent-red/30" },
    { title: "A calmer way to take notes", src: "https://yoink-app.fly.dev/stock/workspace-6.jpg", tone: "from-accent-yellow/30" },
  ] as Video[],
  footnote = "Watch our channel for walkthroughs of tools you may not have discovered yet.",
  channelLabel = "Video channel",
}) {
  return (
    <section className="relative isolate overflow-hidden bg-canvas py-20 text-primary font-sans">
      <div aria-hidden className="pointer-events-none absolute left-1/2 top-24 -z-10 h-[657px] w-[818px] -translate-x-1/2 rotate-[8deg] opacity-45 blur-[2px]">
        <div className="absolute left-[20%] top-[40%] h-24 w-[70%] -rotate-[40deg] rounded-xl bg-accent-red/70 blur-xl" />
        <div className="absolute left-[30%] top-[55%] h-16 w-[60%] -rotate-[40deg] rounded-xl bg-accent-red/50 blur-xl" />
        <div className="absolute left-[10%] top-[25%] h-10 w-[50%] -rotate-[40deg] rounded-xl bg-accent-red/40 blur-lg" />
      </div>

      <Reveal className="mx-auto max-w-xl px-6 text-center">
        <h2 className="text-body-lg text-primary">{heading}</h2>
        <p className="text-body-lg text-tertiary">{subheading}</p>
      </Reveal>

      <div className="mx-auto mt-14 grid max-w-[900px] gap-10 px-6 md:grid-cols-2">
        {cards.map((c) => (
          <div key={c.title} className="group rounded-xl border border-hairline bg-glass-panel bg-[linear-gradient(137deg,rgba(17,18,20,0.75),rgba(12,13,15,0.9))] p-6 backdrop-blur-[10px]">
            <div className="flex items-center justify-between">
              <div className="flex items-center gap-3 text-body-lg">
                <svg width="24" height="24" viewBox="0 0 24 24" aria-hidden fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
                  {c.glyph === "hash" ? <path d="M9 4 7 20M17 4l-2 16M4 9h16M3 15h16" /> : <path d="M4 4l16 16M20 4 4 20" />}
                </svg>
                {c.title}
              </div>
              <span className="font-mono text-ui text-tertiary">{c.meta}</span>
            </div>
            <p className="mt-4 text-ui text-secondary">{c.body}</p>
            <a href="#" className="mt-4 inline-flex items-center gap-1 text-ui text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-red">
              {c.cta}
              <span aria-hidden className="transition-transform duration-arrow-nudge ease-arrow-nudge group-hover:translate-x-1">→</span>
            </a>
          </div>
        ))}
      </div>

      <div className="mx-auto mt-32 max-w-[1204px] [mask-image:linear-gradient(90deg,transparent,#000_15%,#000_85%,transparent)]">
        <Marquee speed={30} gap={40} pauseOnHover>
          {videos.map((v) => (
            <figure key={v.title} className="w-[230px] shrink-0">
              <div className={`relative aspect-video overflow-hidden rounded-lg border border-hairline bg-gradient-to-br ${v.tone} to-canvas`}>
                <img src={v.src} alt="" width={230} height={129} loading="lazy" className="h-full w-full object-cover grayscale-[0.5]" />
                <div aria-hidden className="absolute inset-0 bg-gradient-to-b from-white/20 to-transparent" />
              </div>
              <figcaption className="mt-4 text-ui font-medium text-secondary">{v.title}</figcaption>
            </figure>
          ))}
        </Marquee>
      </div>

      <div className="mx-auto mt-12 max-w-xs px-6 text-center">
        <p className="text-ui text-secondary">{footnote}</p>
        <a href="#" className="mt-6 inline-flex items-center gap-2 text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-red">
          <span className="inline-flex h-6 w-8 items-center justify-center rounded-md bg-accent-red"><span className="ml-0.5 border-y-4 border-l-[7px] border-y-transparent border-l-white" /></span>
          <span className="text-body font-semibold">{channelLabel}</span>
          <span aria-hidden>→</span>
        </a>
      </div>
    </section>
  );
}

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

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

const YK_MARQUEE_CSS = `@keyframes yk-marquee-x{to{transform:translate3d(calc(-1 * var(--yk-shift)),0,0)}}
@keyframes yk-marquee-y{to{transform:translate3d(0,calc(-1 * var(--yk-shift)),0)}}
[data-yk-marquee][data-pause]:hover [data-yk-track]{animation-play-state:paused}
@media (prefers-reduced-motion:reduce){[data-yk-track]{animation:none!important}}`;

/** An endless, seamless scrolling row (or column) of items: logos, quotes, tags. */
function Marquee({
  children,
  speed = 40,
  reverse = false,
  vertical = false,
  pauseOnHover = true,
  fade = true,
  gap = 48,
  className,
  style,
}: {
  children?: ReactNode;
  /** pixels per second */
  speed?: number;
  reverse?: boolean;
  vertical?: boolean;
  pauseOnHover?: boolean;
  fade?: boolean;
  gap?: number;
  className?: string;
  style?: CSSProperties;
}) {
  const box = useRef<HTMLDivElement>(null);
  const group = useRef<HTMLDivElement>(null);
  const [m, setM] = useState({ copies: 2, size: 0 });
  useEffect(() => {
    const measure = () => {
      const b = box.current, g = group.current;
      if (!b || !g) return;
      const size = vertical ? g.offsetHeight : g.offsetWidth;
      const room = vertical ? b.offsetHeight : b.offsetWidth;
      if (size > 0) setM({ size, copies: Math.max(2, Math.ceil(room / size) + 1) });
    };
    measure();
    const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null;
    if (box.current) ro?.observe(box.current);
    if (group.current) ro?.observe(group.current);
    return () => ro?.disconnect();
  }, [vertical]);
  // the copies are only there to fill the loop: hide them from screen readers and keyboards
  useEffect(() => {
    box.current?.querySelectorAll("[data-yk-copy]").forEach((el) => el.setAttribute("inert", ""));
  }, [m.copies]);
  const edge = vertical ? "to bottom" : "to right";
  const mask = fade ? `linear-gradient(${edge}, transparent, black 10%, black 90%, transparent)` : undefined;
  const dir = vertical ? "column" : "row";
  const items = (copy: number) => (
    <div
      key={copy}
      ref={copy === 0 ? group : undefined}
      data-yk-copy={copy > 0 ? "" : undefined}
      aria-hidden={copy > 0 || undefined}
      style={{ display: "flex", flexDirection: dir, flexShrink: 0, alignItems: "center", gap, [vertical ? "paddingBottom" : "paddingRight"]: gap }}
    >
      {children}
    </div>
  );
  return (
    <div
      ref={box}
      data-yk-marquee=""
      data-pause={pauseOnHover ? "" : undefined}
      className={className}
      style={{ overflow: "hidden", maskImage: mask, WebkitMaskImage: mask, ...style }}
    >
      <style>{YK_MARQUEE_CSS}</style>
      <div
        data-yk-track=""
        style={{
          display: "flex",
          flexDirection: dir,
          width: vertical ? "100%" : "max-content",
          ["--yk-shift" as string]: `${m.size}px`,
          animation: m.size ? `yk-marquee-${vertical ? "y" : "x"} ${m.size / Math.max(speed, 1)}s linear infinite${reverse ? " reverse" : ""}` : undefined,
        }}
      >
        {Array.from({ length: m.copies }, (_, i) => items(i))}
      </div>
    </div>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Obsidian Launcher

The whole style →

AI Agent Bento Showcase

Feature sections

Blog Category Filter Row

Tab bars

Frosted Pill Navbar

Headers & nav bars

Centered Glow Hero

Heroes

Light Pill Download Button

Buttons

Launcher Window Showcase

Media & mockups