Get started with tsparticles-plugin-infection CDN

MIT licensed

TSParticles-plugin-infection is a TypeScript library that adds infectious particle effects to the TSParticles engine.

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-infection CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with tsparticles-plugin-infection 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@0.13.2/tsparticles.min.js"></script>
  <script src="https://cdn.cdnhub.io/tsparticles-plugin-infection/2.12.0/tsparticles.plugin.infection.min.js"></script>
  <script>
    const particles = new TSParticles('tsparticles', {
      background: {
        color: '#000000',
      },
      fpsLimit: 60,
      particles: {
        number: {
          value: 100,
          density: {
            enable: true,
            value_area: 800,
          },
        },
        color: {
          value: '#ffffff',
        },
        shape: {
          type: 'circle',
        },
        opacity: {
          anim: {
            enable: true,
            speed: 1,
            opacity_min: 0,
            sync: false,
          },
        },
        size: {
          value: 5,
          random: true,
          anim: {
            enable: false,
            speed: 4,
            size_min: 0.1,
            sync: false,
          },
        },
        line_linked: {
          enable: false,
          distance: 150,
          color: '#ffffff',
          opacity: 0.4,
          width: 1,
        },
        move: {
          enable: true,
          speed: 1,
          direction: 'none',
          random: true,
          straight: false,
          out_mode: 'out',
          bounce: false,
          attract: {
            enable: false,
            rotateX: 600,
            rotateY: 1200,
          },
        },
      },
      interactivity: {
        detect_on: 'canvas',
        events: {
          onHover: {
            enable: true,
            mode: 'repulse',
          },
          onClick: {
            enable: true,
            mode: 'push',
          },
          resize: true,
        },
        modes: {
          grab: {
            distance: 400,
            line_linked: {
              opacity: 1,
            },
          },
          bubble: {
            distance: 400,
            size: 40,
            duration: 2,
            opacity: 8,
            speed: 3,
          },
          repulse: {
            distance: 200,
            duration: 0.4,
          },
          push: {
            particles_nb: 4,
          },
          trail: {
            enable: true,
            length: 0.05,
            color: '#000000',
            full_trail: true,
          },
          grabTrail: {
            enable: false,
            length: 1,
          },
        },
      },
      plugins: [
        'infection',
      ],
      infection: {
        enable: true,
        rotate: true,
        frequency: 0.01,
        saturation: 1,
        brightness: 1,
        groundColor: {
          r: 0,
          g: 0,
          b: 0,
          a: 0,
        },
        particlesColor: {
          r: 255,
          g: 255,
          b: 255,
          a: 1,
        },
      },
    });

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

All versions