Skip to content

The design language that makes your AI harness better at design.

JavaScript
13.4 KB
Raw Blame
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Icon-Tile-Stack — Should Flag vs Should Pass</title>
  <style>
    /* ─── Layout convention: two-column fixture ─────────────────────────
       Left column = patterns the rule SHOULD flag.
       Right column = legitimate patterns the rule should NOT flag.
       Each test case is annotated with a unique <h3> text so the test
       can match snippets back to expectations.
       ──────────────────────────────────────────────────────────────── */
    body { font-family: system-ui, sans-serif; margin: 0; padding: 24px; }
    .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; max-width: 960px; margin: 0 auto; }
    .col h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 16px; color: #475569; }
    .case { margin-bottom: 24px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
    .case h3 { font-size: 18px; margin: 0 0 4px; color: #0f172a; }
    .case p { font-size: 14px; margin: 0; color: #64748b; }

    /* ── FLAG cases ── */

    /* 1: pastel-gradient icon-tile (the canonical massive-icons.html shape) */
    .icon-pastel {
      width: 80px; height: 80px;
      border-radius: 20px;
      background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px;
    }

    /* 2: solid-color icon-tile, white svg inside (no gradient) */
    .icon-solid {
      width: 64px; height: 64px;
      border-radius: 16px;
      background: #3b82f6;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px;
    }

    /* 3: white-bg outlined icon-tile (no chromatic background at all) */
    .icon-white {
      width: 72px; height: 72px;
      border-radius: 18px;
      background: #ffffff;
      border: 1px solid #e2e8f0;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px;
    }

    /* 4: larger square (still inside the 32–128 range) */
    .icon-large {
      width: 96px; height: 96px;
      border-radius: 24px;
      background: #f1f5f9;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px;
    }

    /* 5: inline emoji icon — tile contains an emoji/symbol character directly,
       not an <svg> or <i> child. This is the "card-icon" pattern from many
       generated demos. */
    .icon-emoji {
      width: 48px; height: 48px;
      border-radius: 12px;
      background: linear-gradient(135deg, #8b5cf6, #a855f7);
      display: flex; align-items: center; justify-content: center;
      font-size: 24px;
      margin-bottom: 16px;
    }

    /* 6: Tailwind's /10 tint, which computes to an alpha of exactly 0.1 */
    .icon-tint {
      width: 48px; height: 48px;
      border-radius: 12px;
      background: rgba(40, 85, 189, 0.1);
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px;
    }

    /* 7: a ring drawn by box-shadow, no fill and no border */
    .icon-ring {
      width: 56px; height: 56px;
      border-radius: 14px;
      box-shadow: 0 0 0 1px #cbd5e1;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px;
    }

    /* 8 and 9: Framer's shape. A transparent container around the tile, a
       masked div as the icon, and the heading several wrappers down or the
       tile behind a display: contents variant wrapper. */
    .tile-container { width: 70px; height: 70px; margin-bottom: 24px; }
    .icon-framer {
      width: 70px; height: 70px;
      border-radius: 15px;
      background: #f8fafc;
      display: flex; align-items: center; justify-content: center;
    }
    .icon-mask {
      width: 30px; height: 30px;
      background: #0f172a;
      -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3C%2Fsvg%3E");
      mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3C%2Fsvg%3E");
    }
    .contents-variant { display: contents; }
    .far-wrap { padding-top: 140px; }

    /* ── PASS cases ── */

    /* a: round avatar above name (border-radius: 50% — circle, not rounded square) */
    .avatar-round {
      width: 64px; height: 64px;
      border-radius: 50%;
      background: #f59e0b;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px;
    }

    /* b: wide thumbnail above article title (16:9, much wider than tall) */
    .thumb-wide {
      width: 200px; height: 112px;
      border-radius: 8px;
      background: #cbd5e1;
      margin-bottom: 16px;
    }

    /* c: inline icon next to heading (icon and h3 on the same row, NOT stacked) */
    .inline-row { display: flex; align-items: center; gap: 12px; }
    .inline-row .icon-inline {
      width: 80px; height: 80px;
      border-radius: 20px;
      background: #ddd6fe;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }

    /* d: nothing above the heading at all */
    .no-icon h3 { margin-top: 0; }

    /* e: icon-tile that's too small (under 32px) — out of size range */
    .icon-tiny {
      width: 24px; height: 24px;
      border-radius: 6px;
      background: #93c5fd;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px;
    }

    /* f: oversized image card / hero image (over 128px) — out of size range */
    .img-huge {
      width: 200px; height: 200px;
      border-radius: 16px;
      background: #cbd5e1;
      margin-bottom: 16px;
    }
  </style>
</head>
<body>
  <div class="grid">

    <!-- ════════════════════════════════════════════════════════════════
         LEFT COLUMN: should flag
         ═══════════════════════════════════════════════════════════════ -->
    <div class="col" data-col="flag">
      <h2>Should flag</h2>

      <div class="case">
        <div class="icon-pastel">
          <svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="#3b82f6" stroke-width="1.5">
            <polyline points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>
          </svg>
        </div>
        <h3>Lightning Fast</h3>
        <p>Built for speed and performance from the ground up.</p>
      </div>

      <div class="case">
        <div class="icon-solid">
          <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="1.5">
            <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
          </svg>
        </div>
        <h3>Secure Storage</h3>
        <p>Enterprise-grade security for your peace of mind.</p>
      </div>

      <div class="case">
        <div class="icon-white">
          <svg width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="#0f172a" stroke-width="1.5">
            <circle cx="12" cy="12" r="10"/>
            <path d="M12 6v6l4 2"/>
          </svg>
        </div>
        <h3>Easy Setup</h3>
        <p>Get started in minutes with zero configuration.</p>
      </div>

      <div class="case">
        <div class="icon-large">
          <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="#0f172a" stroke-width="1.5">
            <line x1="18" y1="20" x2="18" y2="10"/>
            <line x1="12" y1="20" x2="12" y2="4"/>
            <line x1="6" y1="20" x2="6" y2="14"/>
          </svg>
        </div>
        <h3>Powerful Analytics</h3>
        <p>Insights that drive smarter business decisions.</p>
      </div>

      <div class="case">
        <div class="icon-emoji">&#9889;</div>
        <h3>Emoji Inline Icon</h3>
        <p>The tile contains an emoji directly, no SVG child.</p>
      </div>

      <div class="case">
        <div class="icon-tint">
          <span>&#128221;</span>
        </div>
        <h3>Emoji In A Span</h3>
        <p>The tile's one child is a span holding only an emoji.</p>
      </div>

      <div class="case">
        <div class="icon-tint">
          <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#2855bd" stroke-width="1.5">
            <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
          </svg>
        </div>
        <h3>Tinted Tile</h3>
        <p>The tile's fill is a primary colour at 10% alpha.</p>
      </div>

      <div class="case">
        <div class="icon-ring">
          <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#0f172a" stroke-width="1.5">
            <circle cx="12" cy="12" r="10"/>
          </svg>
        </div>
        <h3>Ring Tile</h3>
        <p>A box-shadow ring draws the tile's edge.</p>
      </div>

      <div class="case">
        <div class="tile-container">
          <div class="icon-framer"><div class="icon-mask"></div></div>
        </div>
        <div><div><div><div><h3>Framer Card Heading</h3></div></div></div></div>
        <p>The heading sits four wrappers down from the tile's sibling.</p>
      </div>

      <div class="case">
        <div class="contents-variant"><div class="tile-container"><div class="icon-framer"><div class="icon-mask"></div></div></div></div>
        <div><h3>Contents Wrapped Tile</h3></div>
        <p>The tile hides behind a display: contents variant wrapper.</p>
      </div>
    </div>

    <!-- ════════════════════════════════════════════════════════════════
         RIGHT COLUMN: should pass
         ═══════════════════════════════════════════════════════════════ -->
    <div class="col" data-col="pass">
      <h2>Should pass</h2>

      <!-- a: round avatar (circle, not rounded square) -->
      <div class="case">
        <div class="avatar-round">
          <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2">
            <circle cx="12" cy="8" r="4"/>
            <path d="M4 22v-2a8 8 0 0116 0v2"/>
          </svg>
        </div>
        <h3>Sarah Chen</h3>
        <p>Product designer based in Berlin.</p>
      </div>

      <!-- b: wide 16:9 thumbnail (aspect ratio out of range) -->
      <div class="case">
        <div class="thumb-wide"></div>
        <h3>Article Headline</h3>
        <p>A summary of an interesting article.</p>
      </div>

      <!-- c: side-by-side icon and heading (not stacked vertically) -->
      <div class="case">
        <div class="inline-row">
          <div class="icon-inline">
            <svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="#7c3aed" stroke-width="1.5">
              <circle cx="12" cy="12" r="10"/>
            </svg>
          </div>
          <div>
            <h3>Inline Side By Side</h3>
            <p>Icon sits next to the heading, not above it.</p>
          </div>
        </div>
      </div>

      <!-- d: no icon above the heading at all -->
      <div class="case no-icon">
        <h3>Plain Heading No Icon</h3>
        <p>Just a heading with body text, nothing above.</p>
      </div>

      <!-- e: icon-tile too small (24px — under 32px floor) -->
      <div class="case">
        <div class="icon-tiny">
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1e40af" stroke-width="2">
            <circle cx="12" cy="12" r="10"/>
          </svg>
        </div>
        <h3>Tiny Icon Above Me</h3>
        <p>The icon container is smaller than 32px.</p>
      </div>

      <!-- f: huge image / hero (200px — over 128px ceiling) -->
      <div class="case">
        <div class="img-huge"></div>
        <h3>Huge Hero Image</h3>
        <p>The container is larger than the size cap.</p>
      </div>

      <!-- h: a tinted tile whose child span holds a word, not an emoji -->
      <div class="case">
        <div class="icon-tint">
          <span>AI</span>
        </div>
        <h3>Word In A Span</h3>
        <p>Two letters in a tile are a monogram, not an icon.</p>
      </div>

      <!-- i: a tinted tile whose only child is an emoji span that is hidden -->
      <div class="case">
        <div class="icon-tint">
          <span hidden>&#128221;</span>
        </div>
        <h3>Hidden Emoji In A Span</h3>
        <p>The emoji is never painted, so the tile holds no icon.</p>
      </div>

      <!-- g: a tile before the heading's wrapper, but far above the heading -->
      <div class="case">
        <div class="icon-tint">
          <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#2855bd" stroke-width="1.5">
            <circle cx="12" cy="12" r="10"/>
          </svg>
        </div>
        <div class="far-wrap"><h3>Far From The Tile</h3></div>
        <p>Climbing past a wrapper needs the tile just above the heading.</p>
      </div>
    </div>
  </div>
  <script src="/js/detect-antipatterns-browser.js"></script>
</body>
</html>