>_htmlhub
library/backgrounds/vanta-clouds2

Vanta Clouds 2

Live previewPerformance varies by device
vanta-clouds2.html

No account needed to copy or download. Check dependencies and thelicense status before publishing.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Vanta.js Clouds 2</title>
    <style>
      html,
      body {
        height: 100%;
        margin: 0;
        overflow: hidden;
        cursor: none;
        background: #07080d;
        color: #f5f7fb;
        font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      }
      #vanta {
        position: fixed;
        inset: 0;
        cursor: none;
      }
      canvas {
        cursor: none !important;
      }
    </style>
    <script src="../vendor/three.r134.min.js"></script>
    <script src="../vendor/p5.min.js"></script>
    <script src="../vendor/vanta/dist/vanta.clouds2.min.js"></script>
  </head>
  <body>
    <div id="vanta"></div>
    <script>
      VANTA.CLOUDS2({
        el: "#vanta",
        mouseControls: true,
        touchControls: true,
        gyroControls: false,
        backgroundColor: 0x000000,
        skyColor: 0x7ac7e8,
        cloudColor: 0x314d86,
        lightColor: 0xffffff,
        speed: 0.75,
        texturePath: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiB2aWV3Qm94PSIwIDAgMjU2IDI1NiI+CiAgPGZpbHRlciBpZD0ibm9pc2UiPgogICAgPGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuODUiIG51bU9jdGF2ZXM9IjQiIHNlZWQ9IjI0Ii8+CiAgICA8ZmVDb2xvck1hdHJpeCB0eXBlPSJzYXR1cmF0ZSIgdmFsdWVzPSIwIi8+CiAgPC9maWx0ZXI+CiAgPHJlY3Qgd2lkdGg9IjI1NiIgaGVpZ2h0PSIyNTYiIGZpbHRlcj0idXJsKCNub2lzZSkiLz4KPC9zdmc+Cg=="
      });
    </script>
</body>
</html>

About this animation

Vanta.js alternate cloud shader using a local noise texture for layered motion.

Under the hood

Vanta.js Clouds from an Inline Noise Texture

This delegates rendering to VANTA.CLOUDS2() from Vanta.js on Three.js WebGL, the texture-driven sibling of Clouds, mounted on a fixed full-viewport #vanta div. Its texturePath is not a file but an inline data:image/svg+xml;base64 noise texture, an SVG feTurbulence with type="fractalNoise", baseFrequency="0.85", numOctaves="4" and seed="24", desaturated by an feColorMatrix with saturate 0, sampled over skyColor: 0x7ac7e8 and a much darker cloudColor: 0x314d86 with lightColor: 0xffffff, backgroundColor: 0x000000 and speed: 0.75. Interaction is on via mouseControls: true and touchControls: true with gyroControls: false, and as with Clouds the wrapper hides the cursor, including on the canvas.

Source Code
Copied to clipboard