Get started with tsparticles-preset-bubbles CDN

MIT licensed

The tsparticles-preset-bubbles library is a JS particle system that creates and animates bubbles.

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


<!DOCTYPE html>
<html>
<head>
  <title>Get started with tsparticles-preset-bubbles CDN - cdnhub.io</title>
  <style>
    body { margin: 0; }
    canvas { width: 100%; height: 100vh; }
  </style>
</head>
<body>
  <script src="https://cdn.jsdelivr.net/npm/worksans@4.2.0/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/three@0.122.0/build/three.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/three@0.122.0/examples/js/Detector.js"></script>
  <script src="https://cdn.cdnhub.io/tsparticles-preset-bubbles/2.12.0/tsparticles.preset.bubbles.min.js"></script>

  <script>
    if (!Detector.webgl) {
      console.error('WebGL not supported');
      return;
    }

    const particleContainer = document.createElement('div');
    particleContainer.style.position = 'fixed';
    particleContainer.style.top = '0';
    particleContainer.style.left = '0';
    particleContainer.style.width = '100%';
    particleContainer.style.height = '100%';
    document.body.appendChild(particleContainer);

    const particlesInit = async () => {
      const preset = {
        preset_name: 'bubbles',
        numbers: {
          count: 100
        },
        bubble: {
          size: 10,
          distance: 250,
          duration: 2,
          opacity: 0.8,
          random: true,
          shape: 'circle'
        },
        color: {
          value: '#ffffff'
        },
        opacity: {
          anim: {
            enable: true,
            speed: 1,
            opacity_min: 0,
            sync: false
          }
        }
      };

      const particleSystem = new TSParticles.DefaultPlugin(particleContainer, preset);

      await particleSystem.load();
      particleSystem.play();
    };

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

All versions