Cards & content / Cards

Rounded Project Tile

Two-column grid of large media tiles (about 630×410) with 15–20px radius showing full-bleed photography, 3D renders or video. Below sits a small uppercase dot-separated tag line and a large regular-weight title.

Rebuilt from lusion.co in the Periwinkle Studio Float style.

npx shadcn@latest add https://justyoink.it/r/periwinkle-studio-float/blocks/rounded-project-tile.json

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

Images4 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 `projects` (title, tags, image, alt) to fill the two-column grid and `onSelect` to handle clicks. Hovering a tile zooms its image, shows a custom cursor label and nudges the title.

components/rounded-project-tile.tsx
"use client";

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

type Project = { title: string; tags: string[]; image: string; alt: string };

type Props = {
  projects?: Project[];
  onSelect?: (title: string) => void;
};

const defaults: Project[] = [
  { title: "Orbit - Travel Planner", tags: ["Web", "Design", "Development", "3D"], image: "https://justyoink.it/gen/object-glass-slabs.webp", alt: "Translucent glass slabs with violet light" },
  { title: "Northwind Summit 2025", tags: ["Web", "Design", "Motion"], image: "https://justyoink.it/gen/bg-nebula.webp", alt: "Deep space nebula" },
  { title: "Hillside Rail World", tags: ["Concept", "Web", "Game Design", "3D"], image: "https://justyoink.it/gen/bg-green-hills.webp", alt: "Rolling green hills" },
  { title: "Fizz Pop Experience", tags: ["AR", "Development", "3D"], image: "https://justyoink.it/gen/bg-sunset-sea.webp", alt: "Warm sunset over the sea" },
];

export default function RoundedProjectTile({ projects = defaults, onSelect }: Props) {
  const [cursor, setCursor] = useState<{ x: number; y: number; idx: number } | null>(null);

  return (
    <section className="relative bg-canvas px-5 py-16 text-ink font-sans md:px-[70px]">
      <ul className="grid grid-cols-1 gap-x-4 gap-y-16 md:grid-cols-2">
        {projects.map((p, i) => (
          <li key={p.title}>
            <Reveal from="up" delay={(i % 2) * 100}>
              <a
                href="#"
                onClick={(e) => { e.preventDefault(); onSelect?.(p.title); }}
                onMouseMove={(e) => {
                  const r = e.currentTarget.getBoundingClientRect();
                  setCursor({ x: e.clientX - r.left, y: e.clientY - r.top, idx: i });
                }}
                onMouseLeave={() => setCursor(null)}
                className="group block rounded-small focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-electric-blue"
              >
                <div className="relative aspect-[630/410] overflow-hidden rounded-[18px] bg-night md:cursor-none">
                  <img
                    src={p.image}
                    alt={p.alt}
                    width={630}
                    height={410}
                    loading="lazy"
                    className="h-full w-full object-cover transition-transform duration-snap ease-snap group-hover:scale-[1.05]"
                  />
                  <div className="pointer-events-none absolute inset-0 bg-side-scrim opacity-60" />
                  {cursor && cursor.idx === i && (
                    <span
                      aria-hidden="true"
                      className="pointer-events-none absolute flex h-20 w-20 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-circle bg-paper text-label uppercase text-ink shadow-soft-lift"
                      style={{ left: cursor.x, top: cursor.y }}
                    >
                      View
                    </span>
                  )}
                </div>
                <p className="mt-6 text-caption uppercase tracking-wide text-ink">
                  {p.tags.join(" • ")}
                </p>
                <h3 className="mt-1 text-h2 font-normal transition-transform duration-standard ease-standard group-hover:translate-x-2">
                  {p.title}
                </h3>
              </a>
            </Reveal>
          </li>
        ))}
      </ul>
    </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 · today
—

More from Periwinkle Studio Float

The whole style →

Tilted Panel Loader

Animated graphics

Floating Pill Header

Headers & nav bars

Oversized Section Heading with Side Blurb

Feature sections

Dot-Separated Category Tags

Badges & tags

Plus Crosshair Grid Markers

Animated backgrounds

Persistent WebGL Backdrop

Animated backgrounds