Get started with tsparticles-shape-rounded-polygon CDN

MIT licensed

Library tsparticles-shape-rounded-polygon adds rounded polygon shapes to tsparticles particle system.

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-rounded-polygon CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with tsparticles-shape-rounded-polygon CDN - cdnhub.io</title>
  <style>
    #tsparticles {
      height: 100vh;
      width: 100%;
    }
  </style>
  <script src="https://cdn.jsdelivr.net/npm/worksans@4.2.0/worksans.min.css"></script>
  <script src="https://cdn.jsdelivr.net/npm/*@2.8.4/dist/umd/popper.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.min.js"></script>
  <script src="https://cdn.cdnhub.io/tsparticles-shape-rounded-polygon/2.12.0/tsparticles.shape.rounded-polygon.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/tsparticles@3.5.1/dist/js/tsparticles.min.js"></script>
</head>
<body>
  <div id="tsparticles"></div>
  <script>
    const particlesInit = async (main) => {
      await main.load();
      main.addShape('roundedPolygon', {
        position: { x: 50, y: 50 },
        shape: {
          type: 'roundedPolygon',
          polygon: {
            numPoints: 5,
            innerRadius: 20,
            outerRadius: 40,
            cornerSize: 10,
          },
        },
        style: {
          move: {
            enable: true,
            speed: 0.5,
            direction: 'none',
          },
          shape: {
            color: '#ff7f50',
            strokeWidth: 2,
            point: {
              color: '#ff7f50',
              size: 5,
            },
          },
          opacity: {
            value: 0.5,
            random: true,
            anim: {
              enable: true,
              speed: 0.5,
              opacity_min: 0.1,
              sync: false,
            },
          },
        },
        interact: {
          events: {
            onClick: {
              enable: true,
              mode: 'push',
            },
            onHover: {
              enable: true,
              mode: 'repulse',
            },
          },
          modes: {
            push: {
              distance: 100,
              duration: 0.3,
            },
            repulse: {
              distance: 150,
              duration: 0.4,
            },
          },
        },
      });
    };

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

All versions