Get started with tsparticles-plugin-sounds CDN

MIT licensed

The tsparticles-plugin-sounds library enhances the tsparticles JS particle system by adding support for custom sounds and particle interactions based on sound events.

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-plugin-sounds CDN


<!DOCTYPE html>
<html>
<head>
  <style>
    #tsparticles {
      height: 100vh;
      width: 100%;
    }
  </style>
</head>
<body>
  <div id="tsparticles"></div>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tsparticles.min.js"></script>
  <script src="https://cdn.cdnhub.io/tsparticles-plugin-sounds/2.12.0/tsparticles.plugin.sounds.min.js"></script>
  <script>
    const particles = new TSParticles('tsparticles', {
      background: {
        color: '#000'
      },
      fpsLimit: 60,
      particles: {
        number: {
          value: 100,
          density: {
            enable: true,
            value_area: 800
          }
        },
        color: {
          value: '#fff'
        },
        links: {
          enable: true,
          distance: 150,
          color: '#fff'
        },
        collisions: {
          enable: true
        },
        polygon: {
          enable: false,
          sides: 5
        },
        move: {
          enable: true,
          speed: 1,
          direction: 'none',
          random: true,
          out_mode: 'out'
        },
        size: {
          value: 5,
          random: true
        },
        opacity: {
          value: 0.5,
          random: true,
          anim: {
            enable: true,
            speed: 1,
            opacity_min: 0.1,
            sync: false
          }
        }
      },
      plugins: [
        'tsparticles-plugin-sounds'
      ],
      sounds: [
        {
          name: 'explosion',
          url: 'path/to/explosion.mp3'
        },
        {
          name: 'impact',
          url: 'path/to/impact.wav'
        }
      ],
      interactivity: {
        events: {
          onClick: {
            enable: true,
            mode: 'repulse'
          },
          onHover: {
            enable: true,
            mode: 'grab'
          },
          resize: true
        },
        modes: {
          grab: {
            distance: 400,
            line_linked: {
              opacity: 0.5
            }
          },
          repulse: {
            distance: 200,
            duration: 0.4
          },
          push: {
            quantity: 4
          },
          remove: {
            quantity: 1
          }
        }
      },
      retinaDetect: true
    });

    particles.add(true);
  </script>
</body>
</html>
Copied!
Copied!

All versions