Get started with tsparticles-plugin-export-json CDN
MIT licensed
The tsparticles-plugin-export-json allows exporting particle system data as JSON format.
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-export-json CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with tsparticles-plugin-export-json CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/tsparticles@3.3.2/dist/js/tsparticles.min.js"></script>
<script src="https://cdn.cdnhub.io/tsparticles-plugin-export-json/2.12.0/tsparticles.plugin.export.json.min.js"></script>
<style>
#tsparticles {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="tsparticles"></div>
<script>
const particlesConfig = {
fpsLimit: 60,
interactable: false,
particles: {
number: {
value: 100,
density: {
enable: true,
value_area: 800
}
},
color: {
value: "#ffffff"
},
shape: {
type: "circle"
},
opacity: {
value: 0.5,
random: true,
anim: {
enable: true,
speed: 0.5,
opacity_min: 0.1
}
},
size: {
value: 5,
random: true,
anim: {
enable: true,
speed: 1,
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"
}
},
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
},
remove: {
particles_nb: 8
}
}
},
retina_detect: true
};
const particles = new TSParticles(particlesConfig);
particles.addListener("exportParticlesData", (data) => {
const jsonData = JSON.stringify(data, null, 2);
const link = document.createElement("a");
link.href = "data:text/plain;charset=utf-8," + encodeURIComponent(jsonData);
link.download = "particles.json";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
});
particles.init();
</script>
</body>
</html>
Copied!
Copied!