>_htmlhub
library/3d & webgl/vanta-cells

Vanta Cells

Live previewPerformance varies by device
vanta-cells.html

No account needed to copy or download. Check dependencies and thelicense status before publishing. Standalone download includes required libraries inline so it runs offline and in HTMLDeck.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Vanta.js Cells</title>
    <style>
      html,
      body {
        height: 100%;
        margin: 0;
        overflow: hidden;
        background: #07080d;
        color: #f5f7fb;
        font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      }
      #vanta {
        position: fixed;
        inset: 0;
        background:
          radial-gradient(circle at 25% 25%, rgba(0, 184, 169, 0.34), transparent 34%),
          radial-gradient(circle at 74% 62%, rgba(255, 222, 89, 0.28), transparent 38%),
          #101820;
      }
    </style>
    <script src="../vendor/three.r134.min.js"></script>
    <script src="../vendor/vanta/dist/vanta.cells.min.js"></script>
  </head>
  <body>
    <div id="vanta"></div>
    <script>
      if (!matchMedia('(prefers-reduced-motion: reduce)').matches) {
      VANTA.CELLS({
        el: "#vanta",
        THREE: window.THREE,
        mouseControls: true,
        touchControls: true,
        gyroControls: false,
        forceAnimate: true,
        minHeight: 200,
        minWidth: 200,
        color1: 0x00b8a9,
        color2: 0xffde59,
        backgroundColor: 0x101820,
        amplitudeFactor: 1,
        ringFactor: 1.25,
        rotationFactor: 0.65,
        size: 1.35,
        speed: 0.95
      });
      }
    </script>
</body>
</html>

About this animation

Vanta.js cellular shader pattern with teal and gold organic motion.

Under the hood

Vanta.js Cellular Shader in Teal and Gold

This delegates rendering to VANTA.CELLS() from Vanta.js on Three.js WebGL, and unlike the other Vanta wrappers it loads no p5 script and instead passes THREE: window.THREE explicitly, with forceAnimate: true and minHeight/minWidth of 200. The cellular pattern runs at size: 1.35 and speed: 0.95 with amplitudeFactor: 1, ringFactor: 1.25 and rotationFactor: 0.65, in teal color1: 0x00b8a9 and yellow color2: 0xffde59 over backgroundColor: 0x101820. The wrapper itself also paints teal and yellow radial-gradient glows behind the #vanta canvas, and interaction is on via mouseControls: true and touchControls: true, with gyroControls: false.

Source Code
Copied to clipboard