title: How to export a p5js animation to upload it as a NFT?
body: <p>Basically I created this animation with p5js and I wanted to figure out how I can export it to upload it as an NFT. Since it's an animation that keeps changing the export can't be jpg, gif or mp4 type. But it has to be of another type. I've heard of SVGs but I'm not sure if they could be the solution to the problem.</p>
  <p>That's the javascript file in p5js:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var msEndMvm = 0;
  var delayMvm = 10;
  var x = 0;
  var flag = true; //true is right false left
  // Create a new canvas to the browser size
  function setup() {
    createCanvas(400, 400, SVG);
    background('#FFFFFF');
    strokeJoin(MITER);
    strokeWeight(random(1, 5));
    rectMode(CENTER);
  }
  
  // On window resize, update the canvas size
  function windowResized() {
    resizeCanvas(400, 400);
  }
  
  // Render loop that draws shapes with p5
  function draw() {
    if (millis() &gt;= msEndMvm) {
      background('#FFFFFF');
      rect(x, 200, 20, 10);
      msEndMvm = millis() + delayMvm;
      if (flag) {
        x++;
        if (x &gt;= 400) {
          flag = false;
        }
      } else {
        x--;
        if (x &lt;= 0) {
          flag = true;
          console.log(millis());
        }
      }
    }
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>canvas {
    padding: 0;
    margin: auto;
    display: block;
    width: 800px;
    height: 600px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
  }
  
  body {
    margin: 0;
    padding: 0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;
  &lt;script src="https://unpkg.com/p5.js-svg@1.1.1"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>