Get started with tsparticles-preset-fire CDN

MIT licensed

Tsparticles-preset-fire is a particle system preset for Three.js library, creating realistic fire effects.

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-preset-fire CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with tsparticles-preset-fire CDN - cdnhub.io</title>
  <style>
    body { margin: 0; }
    canvas { width: 100%; height: 100vh; }
  </style>
</head>
<body>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/worksans.min.css"></script>
  <script src="https://cdn.jsdelivr.net/npm/@tweenjs/tween.min/dist/TWEEN.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/build/three.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/Detector.js"></script>
  <script src="https://cdn.cdnhub.io/tsparticles-preset-fire/2.12.0/tsparticles.preset.fire.min.js"></script>

  <script>
    if (!Detector.webgl) {
      Detector.addGetWebGLMessage();
      return;
    }

    const particleContainer = document.createElement('div');
    document.body.appendChild(particleContainer);

    const particles = new TSParticles.DefaultPlugin({
      container: particleContainer,
      backgroundMode: {
        color: '#000',
      },
      fpsLimit: 60,
      preset: 'tsparticles-preset-fire',
      particles: {
        number: 50,
        color: {
          value: '#ffffff',
          anim: {
            enable: true,
            speed: 1,
            sync: false,
          },
        },
        size: {
          value: 5,
          random: true,
          anim: {
            enable: false,
            speed: 0,
            size: 0,
            sync: false,
          },
        },
        opacity: {
          value: 0.5,
          random: true,
          anim: {
            enable: false,
            speed: 1,
            opacity: 1,
            sync: false,
          },
        },
        lineLinked: {
          enable: false,
          distance: 150,
          color: '#ffffff',
          opacity: 0.4,
          width: 1,
        },
        move: {
          enable: true,
          speed: 1,
          direction: 'none',
          random: true,
          straight: false,
          outModes: {
            default: 'bounce',
            bottom: 'bounce',
            left: 'reflect',
            right: 'reflect',
          },
        },
      },
      interactivity: {
        detectsOn: 'canvas',
        events: {
          onHover: {
            enable: true,
            mode: 'repulse',
          },
          onClick: {
            enable: true,
            mode: 'push',
          },
          resize: true,
        },
        modes: {
          grab: {
            distance: 400,
            lineLinked: {
              opacity: 1,
            },
          },
          bubble: {
            distance: 400,
            size: 40,
            duration: 2,
            opacity: 8,
            speed: 3,
          },
          repulse: {
            distance: 200,
            duration: 0.4,
          },
          push: {
            distance: 400,
            duration: 0.4,
          },
          remove: {
            enabled: true,
            quantity: 1,
          },
        },
      },
      custom: {
        mouseActions: {
          hover: {
            distance: 200,
          },
          click: {
            quantity: 1,
          },
        },
      },
      debug: {
        show: false,
      },
    });

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

All versions