JSFiddle - React, Tailwind, and code Playground

by the94air

HTML

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      body {
        height: 80vh;
      }
      article {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
      }
    </style>
  </head>

  <body>
    <article>
      <div>
        <button id="party">Click for party!</button>
      </div>
    </article>


    <script src="https://cdn.jsdelivr.net/npm/party-js@latest/bundle/party.min.js"></script>
    <script>
      const partyButton = document.getElementById('party');

      partyButton.addEventListener('click', function(event) {
        party.confetti(event.target, {
          count: party.variation.range(20, 40)
        });
      });

    </script>
  </body>

</html>