Closed Alainledev closed 8 months ago
Thank you for your reply !
I've tried the suggestions and added the below to my codes :
CSS Home
.main {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 4rem 0;
}
.particlesContainer {
height: 100vh;
position : relative;
}
#tsparticles {
height: 100vh;
position: absolute;
left: 0;
right: 0;
margin: 0;
padding: 0;
z-index: 0;
}
Related to the Home component :
<div className={styles.particlesContainer}>
<Particles
id="tsparticles"
init={particlesInit}
loaded={particlesLoaded}
options={particlesOptions}
/>
</div>
Sadly it only affected sizes of my div but nothing changed at the level of the particles. These are still active on my component Technologies when I scroll down.
Have you changed the config? Please read carefully the post
Regarding the config, I've copy/paste yours for a try :
{
fullScreen: { enable: false, zIndex: 0 },
particles: {
color: {
value: "#ff0000",
animation: {
enable: true,
speed: 20,
sync: true,
},
},
lineLinked: {
blink: false,
color: "random",
consent: false,
distance: 30,
enable: true,
opacity: 0.3,
width: 0.5,
},
move: {
attract: {
enable: false,
rotate: {
x: 600,
y: 1200,
},
},
bounce: false,
direction: "none",
enable: true,
outMode: "bounce",
random: true,
speed: 0.5,
straight: false,
},
number: {
density: {
enable: false,
area: 2000,
},
limit: 0,
value: 200,
},
opacity: {
animation: {
enable: true,
minimumValue: 0.05,
speed: 2,
sync: false,
},
random: false,
value: 1,
},
shape: {
type: "circle",
},
size: {
animation: {
enable: false,
minimumValue: 0.1,
speed: 40,
sync: false,
},
random: true,
value: 1,
},
},
polygon: {
draw: {
enable: true,
lineColor: "rgba(255,255,255,0.2)",
lineWidth: 0.3,
},
move: {
radius: 10,
},
inlineArrangement: "equidistant",
scale: 0.5,
type: "inline",
url: "https://particles.js.org/images/smalldeer.svg",
},
};
And here is the result :
It only takes a part of the screen
That's because you disabled the full screen css, now it's a standard div and you have to manage the css yourself.
Contact Details
le.alain@live.fr
What do you need?
Hello !
This is my first post and I'm a very beginner programmer, so sorry in advance if anything missing.
I am on React with Next.js.
I would like to create a website with particles on my Homepage, which correspond to a component named "Home". And the particles should disappear on the component below named "Technologies". Basically, I would like to get something similar to that regarding the particles : https://whosbl33h.netlify.app/
The problem on my side is that particles stay even when I scroll down.
Here are my codes below.
Component Home.js :
ParticlesOptions :
Component Tehcnologies :
And my page App :
Sorry in advance for all these lines of codes. Please let me know if you may need any other information.
Thank you very much for any help !
tsParticles Version
3.0.2
Code of Conduct