Page sections / Feature sections

Embossed Advent Tile Grid

Four-column square grid of pale clay tiles separated by 1px grey hairlines, each holding a soft 3D embossed object (triangle, sphere, umbrella, screw, hand, keys) with a small day number in the top-right corner. The final tile spans two columns and two rows with a large embossed logo.

Rebuilt from teenage.engineering in the Embossed Lab Monochrome style.

npx shadcn@latest add https://justyoink.it/r/embossed-lab-monochrome/blocks/embossed-tile-grid.json

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

Usage

Props: intro (array of heading lines), countdownLabel and countdown (footer text). Click a tile to toggle it open; tiles lift and fade on hover.

components/embossed-tile-grid.tsx
import { useState } from "react";

type Props = {
  intro?: string[];
  countdownLabel?: string;
  countdown?: string;
};

const shapes = ["ring", "ball", "tri", "bars", "arch", "cross"] as const;

function Emboss({ kind }: { kind: string }) {
  const base = "bg-tile shadow-emboss-relief";
  if (kind === "ball")
    return <div className={`h-3/4 w-3/4 rounded-full ${base} bg-[radial-gradient(circle_at_35%_30%,#fff,#d9d9d9)]`} />;
  if (kind === "ring")
    return <div className={`flex h-3/4 w-3/4 items-center justify-center rounded-full ${base}`}><div className="h-1/2 w-1/2 rounded-full bg-tile-shade shadow-inner" /></div>;
  if (kind === "tri")
    return (
      <svg viewBox="0 0 100 100" className="h-3/4 w-3/4 drop-shadow-[2px_3px_3px_rgba(0,0,0,0.25)]">
        <path d="M50 10 L92 88 L8 88 Z" fill="none" stroke="#fff" strokeWidth="5" strokeLinejoin="round" />
      </svg>
    );
  if (kind === "bars")
    return (
      <div className="flex h-1/2 w-3/4 items-stretch gap-1">
        {Array.from({ length: 9 }).map((_, i) => (
          <div key={i} className={`flex-1 rounded-soft ${base}`} />
        ))}
      </div>
    );
  if (kind === "arch")
    return <div className={`h-1/2 w-3/4 rounded-t-full ${base}`} />;
  return (
    <div className="relative h-3/4 w-3/4">
      <div className={`absolute left-[35%] top-0 h-full w-[30%] rounded-soft ${base}`} />
      <div className={`absolute left-0 top-[35%] h-[30%] w-full rounded-soft ${base}`} />
    </div>
  );
}

export default function EmbossedAdventTileGrid({
  intro = ["A little countdown of small surprises,", "one tile unlocks every morning,", "running through the whole festive month."],
  countdownLabel = "Next tile unlocks in:",
  countdown = "06:12:48",
}: Props) {
  const [opened, setOpened] = useState<number[]>([]);
  const toggle = (n: number) =>
    setOpened((o) => (o.includes(n) ? o.filter((x) => x !== n) : [...o, n]));

  return (
    <section className="bg-canvas px-1 py-10 text-on-dark animate-fade-in">
      <div className="bg-tile px-4 py-10 text-center text-body text-ink uppercase">
        {intro.map((l) => (
          <p key={l}>{l}</p>
        ))}
      </div>
      <div className="grid grid-cols-2 gap-px bg-hairline md:grid-cols-4">
        {Array.from({ length: 24 }).map((_, i) => {
          const n = i + 1;
          const isOpen = opened.includes(n);
          return (
            <button
              key={n}
              onClick={() => toggle(n)}
              aria-pressed={isOpen}
              aria-label={`Tile ${n}`}
              className="relative flex aspect-square items-center justify-center bg-tile bg-clay-sheen text-ink transition duration-tile-hover ease-tile-hover hover:-translate-y-0.5 hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ink"
            >
              <span className="absolute right-3 top-2 text-caption text-muted">{n}</span>
              <div className={`flex h-full w-full items-center justify-center transition ${isOpen ? "scale-90 opacity-40" : ""}`}>
                <Emboss kind={shapes[i % shapes.length]} />
              </div>
            </button>
          );
        })}
        <button
          onClick={() => toggle(25)}
          aria-label="Tile 25"
          className="relative col-span-2 row-span-2 flex aspect-square items-center justify-center bg-tile bg-clay-sheen text-ink transition duration-tile-hover ease-tile-hover hover:-translate-y-0.5 hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ink"
        >
          <span className="absolute right-3 top-2 text-caption text-muted">25</span>
          <div className="flex h-3/4 w-3/4 items-center justify-center rounded-[20%] bg-tile shadow-emboss-lift">
            <div className="h-1/2 w-1/2 rounded-full bg-tile-shade shadow-emboss-relief" />
          </div>
        </button>
      </div>
      <p className="mt-16 text-center text-body uppercase">
        {countdownLabel}<br />{countdown}
      </p>
    </section>
  );
}

Quality checks

Automated, in a real browser · today
—

More from Embossed Lab Monochrome

The whole style →

Pictogram Mega Nav Bar

Headers & nav bars

Centered Link Footer

Footers

Embossed Relief Tile

Cards

Centered Uppercase Intro Panel

Heroes

Quiet Countdown Readout

Stats & metrics

Hairline Newsletter Signup

Forms