>_htmlhub

Vanta Trunk

Live previewPerformance varies by device
vanta-trunk.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 Trunk</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;
      }
    </style>
    <script src="../vendor/three.r134.min.js"></script>
    <script src="../vendor/p5.min.js"></script>
    <script src="../vendor/vanta/dist/vanta.trunk.min.js"></script>
  </head>
  <body>
    <div id="vanta"></div>
    <script>
      VANTA.TRUNK({
        el: "#vanta",
        mouseControls: true,
        touchControls: true,
        gyroControls: false,
        color: 0x4cc9f0,
        backgroundColor: 0x0e1626,
        spacing: 1.2,
        chaos: 1.05
      });
    </script>
</body>
</html>

About this animation

Vanta.js p5 branching trunk lines with pink generative motion.

Under the hood

Vanta.js Branching Trunk Lines in Cyan

This delegates rendering to VANTA.TRUNK() from Vanta.js, mounted on a fixed full-viewport #vanta div, and the wrapper's own inline code calls only that Vanta entry point. The branching trunk pattern is set by just two structural values, spacing: 1.2 and chaos: 1.05, drawn in vivid cyan color: 0x4cc9f0 over backgroundColor: 0x0e1626. Interaction is on via mouseControls: true and touchControls: true, with gyroControls: false.

Source Code
Copied to clipboard