Get started with tsparticles-shape-square CDN

MIT licensed

TSParticles-shape-square is a library for creating square particle shapes in Three.js using TSParticles.

Tags:
  • tsparticles
  • particles.js
  • particlesjs
  • particles
  • particle
  • canvas
  • jsparticles
  • xparticles
  • particles-js
  • particles-bg
  • particles-bg-vue
  • particles-ts
  • particles.ts
  • react-particles-js
  • react-particles.js
  • react-particles
  • react
  • reactjs
  • vue-particles
  • ngx-particles
  • angular-particles
  • particleground
  • vue
  • vuejs
  • preact
  • preactjs
  • jquery
  • angularjs
  • angular
  • typescript
  • javascript
  • animation
  • web
  • html5
  • web-design
  • webdesign
  • css
  • html
  • css3
  • animated
  • background
  • confetti
  • fireworks
  • fireworks-js
  • confetti-js
  • confettijs
  • fireworksjs
  • canvas-confetti

Stable version

Copied!

How to start using tsparticles-shape-square CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with tsparticles-shape-square CDN - cdnhub.io</title>
  <style>
    #tsparticles {
      height: 100vh;
      width: 100%;
    }
  </style>
</head>
<body>
  <div id="tsparticles"></div>
  <script src="https://cdn.jsdelivr.net/npm/worksans@4.2.0/worksans.min.css"></script>
  <script src="https://cdn.jsdelivr.net/npm/@tsparticles/core@5.1.2/tsparticles.min.js"></script>
  <script src="https://cdn.cdnhub.io/tsparticles-shape-square/2.12.0/tsparticles.shape.square.min.js"></script>
  <script>
    const particlesInit = async (main) => {
      await main.load();
      main.addShape({
        name: "square",
        type: "square",
        shape: {
          width: 50,
          height: 50,
          x: {
            sync: true,
            start: 10,
            min: 0,
            max: 100,
          },
          y: {
            sync: true,
            start: 50,
            min: 0,
            max: 100,
          },
        },
        style: {
          opacity: 0.5,
          fill: "#ff7f50",
        },
        count: 100,
      });
    };

    document.addEventListener("DOMContentLoaded", async () => {
      const particlesContainer = document.querySelector("#tsparticles");
      await particlesInit(tsparticles.load(particlesContainer));
    });
  </script>
</body>
</html>
Copied!
Copied!

All versions