Get started with tsparticles-updater-color CDN
MIT licensed
Tsparticles-updater-color: JS add-on for real-time color updates in 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-updater-color CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with tsparticles-updater-color CDN - cdnhub.io</title>
<style>
#tsparticles {
height: 100vh;
width: 100%;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/worksans@4.2.0/worksans.min.css"></script>
<script src="https://cdn.cdnhub.io/tsparticles/r118.1.1/tsparticles.min.js"></script>
<script src="https://cdn.cdnhub.io/tsparticles-updater-color/2.12.0/tsparticles.updater.color.min.js"></script>
</head>
<body>
<div id="tsparticles"></div>
<script>
const particlesInit = async () => {
const particlesContainer = document.querySelector('#tsparticles');
await particlesJS.load('tsparticles', 'https://cdn.jsdelivr.net/npm/tsparticles@1.18.1/demo/js/parts.json', {
interactable: false,
updaters: {
color: {
value: '#ffffff', // Initial color
property: 'color', // Property name for the color
update: (value, particle) => {
// Custom color update logic
// For example, update color based on particle position
const x = particle.position.x;
const y = particle.position.y;
const newColor = Math.random() * 0xffffff; // Generate random color
return newColor;
}
}
}
});
};
particlesInit();
</script>
</body>
</html>
Copied!
Copied!