Skip to content

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

JavaScript
7.4 KB
Raw Blame
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Visual Contrast Sampling Fixture</title>
  <style>
    body {
      margin: 0;
      padding: 32px;
      background: #f5f5f7;
      color: #16161a;
      font-family: system-ui, sans-serif;
    }

    .grid {
      display: grid;
      grid-template-columns: 460px 460px;
      gap: 24px;
      width: 944px;
      margin: 0 auto;
    }

    .column {
      display: grid;
      gap: 16px;
      align-content: start;
    }

    .column > h2 {
      margin: 0;
      color: #3f4654;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.08em;
      line-height: 1.4;
      text-transform: uppercase;
    }

    .card {
      width: 460px;
      min-height: 120px;
      padding: 24px;
      border-radius: 12px;
      box-sizing: border-box;
    }

    .card h3 {
      margin: 0 0 8px;
      font-size: 22px;
      font-weight: 700;
      line-height: 1.3;
    }

    .card p {
      margin: 0;
      font-size: 15px;
      line-height: 1.5;
    }

    /* A photo stand-in every panel can sit on, so the underlay is real pixels
       rather than a color token. */
    .photo {
      position: relative;
      overflow: hidden;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 460 200'%3E%3Crect width='460' height='200' fill='%2314171d'/%3E%3Ccircle cx='352' cy='42' r='120' fill='%23262c38'/%3E%3Cpath d='M0 160c74-40 142-34 210-2s126 22 250-52v96H0z' fill='%230d1015'/%3E%3C/svg%3E");
      background-size: cover;
      background-position: center;
    }

    .photo-pale {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 460 200'%3E%3Crect width='460' height='200' fill='%23d9d4c8'/%3E%3Ccircle cx='96' cy='60' r='104' fill='%23e6e2d8'/%3E%3Cpath d='M0 150c80-30 150-22 220 8s130 20 240-40v82H0z' fill='%23cec8ba'/%3E%3C/svg%3E");
      background-size: cover;
      background-position: center;
    }

    /* 1. A glass panel: the blur samples the photo under the card, never the
       surface the glyphs sit on. */
    .glass {
      position: relative;
      z-index: 1;
      margin: 16px;
      width: 428px;
      background: rgba(18, 20, 26, 0.86);
      -webkit-backdrop-filter: blur(14px);
      backdrop-filter: blur(14px);
      color: #ffffff;
    }

    /* 2. A filtered wrapper over a dark band: the rendered pixels above the
       numerals belong to the band, not to the panel. */
    .filtered {
      filter: drop-shadow(0 12px 24px rgba(10, 12, 18, 0.35));
    }

    .metric {
      width: 460px;
      height: 140px;
      padding: 24px;
      box-sizing: border-box;
      border-radius: 12px;
      background: #fbfbfa;
      color: #101014;
      font-size: 48px;
      font-weight: 700;
      line-height: 1.2;
    }

    /* 3. A CTA whose gradient ends in a transparent stop the browser
       serializes with a light grey RGB. Nothing on the button paints grey. */
    .cta {
      display: block;
      position: relative;
      width: 240px;
      height: 56px;
      border-radius: 28px;
      background-image: linear-gradient(rgb(62, 69, 204) 0%, rgb(62, 69, 204) 100%);
      color: #ffffff;
      font-size: 16px;
      font-weight: 700;
      line-height: 56px;
      text-align: center;
      text-decoration: none;
      overflow: hidden;
    }

    .cta-glow {
      position: absolute;
      inset: -20px;
      background-image: radial-gradient(50% 50%, rgba(133, 38, 254, 0.82) 0%, rgba(171, 171, 171, 0) 100%);
    }

    .cta-label {
      position: relative;
      z-index: 1;
      margin: 0;
    }

    /* 4. A stat card tinted with a 10%-alpha wash of the text's own color over
       white: composited once it is near-white, not the tint. */
    .tinted {
      background-image: linear-gradient(to right bottom, rgba(55, 65, 81, 0.1) 0%, rgba(55, 65, 81, 0.1) 100%);
      background-color: #ffffff;
      color: #374151;
    }

    /* 5. Text painted from its own background: the computed color is
       transparent, so there is no foreground for a contrast reading. (The
       gradient-text rule is what has an opinion about this heading.) */
    .clipped-heading {
      margin: 0;
      width: 412px;
      font-size: 28px;
      font-weight: 700;
      line-height: 1.25;
      background-image: linear-gradient(90deg, #3e45cc, #8526fe);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

    /* 6. A collapsed accordion trigger faded by an opacity stack: pale grey on
       white is what a visitor is asked to click. */
    .faded {
      opacity: 0.34;
    }

    .trigger {
      display: block;
      width: 428px;
      height: 48px;
      padding: 0 16px;
      box-sizing: border-box;
      border: 0;
      border-radius: 10px;
      background: transparent;
      color: #171717;
      font-size: 16px;
      font-weight: 600;
      line-height: 48px;
      text-align: left;
    }

    /* 7. A translucent pill on a pale photo, under the hero's own scrim: the
       scrim's stops disagree about this text, so only rendered pixels can say
       what the pill sits on. */
    .scrim {
      position: absolute;
      inset: 0;
      background-image: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    }

    .pill {
      position: relative;
      z-index: 1;
      display: inline-block;
      margin: 24px;
      padding: 6px 14px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.1);
      color: #ffffff;
      font-size: 13px;
      font-weight: 600;
      line-height: 20px;
    }
  </style>
</head>
<body>
  <main class="grid">
    <section class="column" data-col="pass">
      <h2>Should pass: the pixels were misread, not the design</h2>

      <div class="card photo" style="padding: 0;">
        <div class="card glass">
          <h3>Glass panel heading</h3>
          <p style="color: #d6d9e2;">White type on a near-black glass card reads at about eighteen to one; the blur is not its background.</p>
        </div>
      </div>

      <div class="filtered">
        <div class="metric">60%</div>
      </div>

      <a class="cta" href="#cta"><span class="cta-glow"></span><p class="cta-label">Try the editor</p></a>

      <div class="card tinted">
        <h3>Tinted stat card</h3>
        <p style="color: #374151;">A ten percent wash of this same ink over white leaves a near-white card, not an opaque slab of the ink.</p>
      </div>

      <div class="card" style="background: #ffffff;">
        <h3 class="clipped-heading">Heading painted from its own gradient</h3>
      </div>

    </section>

    <section class="column" data-col="flag">
      <h2>Should flag: faint text a visitor has to read</h2>

      <div class="card" style="background: #ffffff; padding: 12px;">
        <div class="faded">
          <div class="trigger" role="button" tabindex="0">Collapsed accordion trigger</div>
        </div>
      </div>

      <div class="card photo-pale" style="padding: 0; position: relative; overflow: hidden;">
        <div class="scrim"></div>
        <div class="pill">Start your shop for free</div>
      </div>

      <div class="card photo-pale">
        <h3 style="color: #fbfbfb;">Hero headline on a pale photo</h3>
        <p style="color: #f2f2f2;">White copy laid over a pale photograph stays hard to read wherever the picture goes light.</p>
      </div>
    </section>
  </main>
</body>
</html>