Get started with tsparticles-preset-confetti CDN
MIT licensed
Three.js confetti preset: tsparticles-preset-confetti
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-confetti CDN
<!DOCTYPE html>
<html>
<head>
<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/[email protected]/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tsparticles.min.js"></script>
<script src="https://cdn.cdnhub.io/tsparticles-preset-confetti/2.12.0/tsparticles.preset.confetti.min.js"></script>
<script>
const confetti = new TSParticles.Confetti({
canvas: document.querySelector('canvas'),
width: window.innerWidth,
height: window.innerHeight,
particles: {
number: {
value: 100,
density: {
enable: true,
value_area: 800
}
},
color: {
value: '#ff69b4'
},
shape: {
type: 'circle',
stroke: {
width: 0,
color: '#000000'
},
polygon: {
nb_sides: 5
},
image: {
src: 'img/particle.png',
width: 100,
height: 100
}
},
opacity: {
value: 0.5,
random: true,
anim: {
enable: false,
speed: 1,
opacity_min: 0.1,
sync: false
}
},
size: {
value: 5,
random: true,
anim: {
enable: false,
speed: 40,
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: {
detectsOn: 'canvas',
events: {
onClick: {
enable: true,
mode: 'push'
},
onHover: {
enable: true,
mode: 'repulse'
},
resize: true
},
modes: {
push: {
quantity: 4
},
repulse: {
distance: 200,
duration: 0.4
}
}
},
retinaDetect: true
});
confetti.add(true);
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!