Get started with tsparticles-path-curves CDN
MIT licensed
TSParticles-PathCurves is a library for creating dynamic, curved particle paths in Three.js.
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-path-curves CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with tsparticles-path-curves CDN - cdnhub.io</title>
<style>
#tsparticles {
height: 100vh;
width: 100%;
}
</style>
</head>
<body>
<div id="tsparticles"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/worksans.min.css"></script>
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/[email protected]/base/tsparticles.min.js"></script>
<script src="https://cdn.cdnhub.io/tsparticles-path-curves/2.12.0/tsparticles.path.curves.min.js"></script>
<script>
const particlesInit = async (main) => {
await main.load();
main.addCurve('path1', {
path: [
{ x: 0.1, y: 0.1 },
{ x: 0.4, y: 0.3 },
{ x: 0.7, y: 0.1 },
{ x: 1, y: 0.1 },
],
color: '#ff7f50',
size: 5,
opacity: 0.5,
links: {
count: 50,
color: '#ff7f50',
width: 1,
opacity: 0.2,
},
});
main.addCurve('path2', {
path: [
{ x: 0, y: 0.5 },
{ x: 0.5, y: 0.5 },
{ x: 1, y: 0 },
],
color: '#2980b9',
size: 3,
opacity: 0.8,
links: {
count: 50,
color: '#2980b9',
width: 1,
opacity: 0.2,
},
});
};
document.addEventListener('DOMContentLoaded', () => {
const particlesContainer = document.querySelector('#tsparticles');
new TSParticles(particlesContainer, {
backgroundMode: {
enable: true,
color: '#333',
opacity: 0.1,
},
particles: {
number: {
value: 80,
density: {
enable: true,
value_area: 800,
},
},
color: {
value: '#ff7f50',
},
shape: {
type: 'circle',
},
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: 4,
size_min: 0.1,
sync: false,
},
},
links: {
enable: false,
distance: 150,
color: '#ff7f50',
opacity: 0.2,
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: {
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: 2,
},
},
},
curves: {
enable: true,
type: 'path',
path_following: {
enable: false,
offset: 0.1,
},
paths: [
{
id: 'path1',
color: '#ff7f50',
width: 2,
opacity: 0.5,
points: [
{ x: 0.1, y: 0.1 },
{ x: 0.4, y: 0.3 },
{ x: 0.7, y: 0.1 },
{ x: 1, y: 0.1 },
],
},
{
id: 'path2',
color: '#2980b9',
width: 2,
opacity: 0.8,
points: [
{ x: 0, y: 0.5 },
{ x: 0.5, y: 0.5 },
{ x: 1, y: 0 },
],
},
],
},
});
});
</script>
</body>
</html>
Copied!
Copied!