All effectsClick & switch

Ink Bloom Reveal

墨迹显现

A stain spreads from a point and reveals text or an image inside its irregular edge.

Play the reveal and watch the ink spread

Where to use it

Open a chapter or reveal a featured work in an editorial sequence. Let the reveal finish quickly and leave the artwork fully visible once the stain stops spreading.

Practical example

A gallery introduces an ink painting by spreading an irregular mask from the left side of the print until the entire composition is visible.

Also called

  • Ink Reveal
  • Smoke Reveal

AI prompt

Reveal [content] with Ink Bloom. A dark ink or smoke stain spreads from a point and leaves the content visible in its wake. Keep the reveal under two seconds. For reduced motion, fade in the content.

Example code

Save the standalone HTML as a file and open it in your browser. It uses the same code as the preview.

View HTML
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Ink Bloom Reveal</title>
  <style>
    :root {
      color-scheme: dark;
      --demo-bg: #171629;
      --demo-ink: #f8f5ff;
      --demo-accent: #b9a6ff;
      --demo-muted: #bfbbd3;
      font-family: system-ui, sans-serif;
      color: var(--demo-ink);
      background: var(--demo-bg);
    }

    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; min-width: 0; }
    button, input { font: inherit; }

    .demo {
      display: grid;
      place-items: center;
      align-content: center;
      min-height: 100vh;
      padding: 14px;
      overflow: hidden;
      background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
    }

    .demo-button {
      border: 1px solid #ffffff3d;
      border-radius: 7px;
      background: #ffffff12;
      color: var(--demo-ink);
      padding: 6px 11px;
      font-size: 12px;
      cursor: pointer;
    }

    :focus-visible {
      outline: 2px solid var(--demo-accent);
      outline-offset: 3px;
    }

    .demo { background: radial-gradient(ellipse at 48% 0%, #f2e6ce, #ddccae 82%); }
    .ink-scene {
      display: grid; justify-items: center; gap: 8px; width: min(100%, 510px);
    }
    .ink-print { display: block; width: 100%; max-height: calc(100vh - 64px); overflow: hidden; }
    .ink-replay {
      border: 1px solid #908268; border-radius: 5px; padding: 5px 9px;
      background: #eee2c9; color: #344252; font-size: 11px; font-weight: 650; cursor: pointer;
    }
    .ink-replay:focus-visible { outline-color: #28415f; }
  </style>
</head>
<body>
  <main class="demo">
    <div class="ink-scene">
      <svg class="ink-print" viewBox="0 0 360 150" role="img" aria-label="Quiet Tide, an indigo ink print of mountains and moon">
        <defs>
          <linearGradient id="ink-sky" x2=".4" y2="1" gradientUnits="objectBoundingBox">
            <stop stop-color="#182844"/><stop offset="1" stop-color="#5f6a80"/>
          </linearGradient>
          <linearGradient id="ink-water" x2=".3" y2="1" gradientUnits="objectBoundingBox">
            <stop stop-color="#ced0ba"/><stop offset="1" stop-color="#7a9795"/>
          </linearGradient>
          <filter id="ink-bleed" x="-40%" y="-65%" width="180%" height="230%">
            <feTurbulence type="fractalNoise" baseFrequency=".045" numOctaves="3" seed="11" result="grain"/>
            <feDisplacementMap in="SourceGraphic" in2="grain" scale="43" xChannelSelector="R" yChannelSelector="G"/>
          </filter>
          <mask id="ink-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="360" height="150">
            <circle cx="176" cy="72" r="225" fill="white" filter="url(#ink-bleed)" data-ink-mask/>
          </mask>
          <clipPath id="ink-edges">
            <path d="M4 12 Q39 7 61 11 Q134 5 190 10 Q267 7 356 12 L355 140 Q290 142 252 139 Q154 144 108 139 Q44 143 5 138 Z"/>
          </clipPath>
        </defs>
        <g clip-path="url(#ink-edges)" mask="url(#ink-mask)">
          <rect width="360" height="150" fill="url(#ink-sky)"/>
          <circle cx="261" cy="57" r="19" fill="#e5d5a9"/>
          <path d="M0 109 L36 71 55 81 100 57 151 88 185 64 205 88 225 96 269 99 301 73 360 104 V150 H0Z" fill="#536178"/>
          <path d="M0 123 L26 101 49 87 74 105 94 90 118 102 141 112 182 119 213 115 254 105 288 112 335 94 360 115 V150 H0Z" fill="#283d54"/>
          <path d="M0 127 Q79 117 164 125 Q251 112 360 122 V150 H0Z" fill="url(#ink-water)"/>
          <path d="M153 132 H191 M215 127 H259 M235 135 H281 M269 130 H296 M195 142 H265" stroke="#e6e3c9" opacity=".58"/>
          <path d="M0 126 Q37 123 61 131 L85 150 H0Z M316 143 Q333 133 360 132 V150 H294Z" fill="#253d52"/>
          <text x="23" y="53" fill="#efe2c0" font-family="Georgia, serif" font-size="22" font-style="italic" aria-hidden="true">Quiet Tide</text>
        </g>
        <circle cx="176" cy="72" r="0" fill="none" stroke="#172b47" stroke-width="18" filter="url(#ink-bleed)" data-ink-edge/>
      </svg>
      <button class="ink-replay" type="button" data-ink-replay>Replay reveal</button>
    </div>
  </main>
  <script>
    const svg = document.querySelector('.ink-print');
    const mask = document.querySelector('[data-ink-mask]');
    const edge = document.querySelector('[data-ink-edge]');
    const button = document.querySelector('[data-ink-replay]');
    const reduced = matchMedia('(prefers-reduced-motion: reduce)');
    let frame;
    let fade;

    function showPrint() {
      cancelAnimationFrame(frame);
      fade?.cancel();
      mask.setAttribute('r', '225');
      edge.setAttribute('r', '0');
      edge.setAttribute('opacity', '0');
    }

    button.addEventListener('click', () => {
      showPrint();
      if (reduced.matches) {
        fade = svg.animate([{ opacity: .15 }, { opacity: 1 }], { duration: 240 });
        return;
      }

      mask.setAttribute('r', '1');
      const started = performance.now();
      function bloom(time) {
        const progress = Math.min((time - started) / 1160, 1);
        const spread = 1 - Math.pow(1 - progress, 1.8);
        const radius = 1 + spread * 224;
        mask.setAttribute('r', radius.toFixed(2));
        edge.setAttribute('r', radius.toFixed(2));
        edge.setAttribute('opacity', (Math.sin(progress * Math.PI) * .32).toFixed(3));
        if (progress < 1) frame = requestAnimationFrame(bloom);
        else showPrint();
      }
      frame = requestAnimationFrame(bloom);
    });

    reduced.addEventListener('change', showPrint);
  </script>
</body>
</html>

Original example by UI Skills