Get started with tsparticles-interaction-light CDN

MIT licensed

Library for interactive WebGL particle effects with light interactions: tsparticles-interaction-light.

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-interaction-light CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with tsparticles-interaction-light CDN - cdnhub.io</title>
  <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-interaction-light/2.12.0/tsparticles.interaction.light.min.js"></script>
  <script>
    const particlesInit = async () => {
      await particlesJS('tsparticles', {
        background: {
          color: '#000'
        },
        interactivity: {
          modes: {
            light: {
              intensity: 0.5,
              color: '#ff0000'
            }
          }
        },
        particles: {
          number: {
            value: 80,
            density: {
              enable: true,
              value_area: 800
            }
          },
          color: {
            value: '#ffffff'
          },
          shape: {
            type: 'circle'
          },
          size: {
            value: 5,
            random: true,
            anim: {
              enable: false,
              speed: 4,
              size_min: 0.1,
              sync: false
            }
          },
          opacity: {
            value: 0.5,
            random: true,
            anim: {
              enable: false,
              speed: 1,
              opacity_min: 0.1
            }
          }
        },
        interactivity: {
          detectsOn: 'canvas',
          events: {
            onHover: {
              enable: true,
              mode: 'repulse'
            },
            onClick: {
              enable: true,
              mode: 'push'
            },
            onDrag: {
              enable: false,
              mode: 'push'
            },
            resize: true
          },
          modes: {
            repulse: {
              distance: 200,
              duration: 0.4
            },
            push: {
              distance: 400,
              duration: 0.4
            }
          }
        },
        retinaDetect: true
      });
    };

    particlesInit();
  </script>
</body>
</html>
Copied!
Copied!

All versions