VincentGarreau / particles.js

A lightweight JavaScript library for creating particles
https://vincentgarreau.com/particles.js/
MIT License
28.66k stars 4.81k forks source link

Canvas size issue after resizing window #444

Open RM6SS62 opened 3 years ago

RM6SS62 commented 3 years ago

I'm initializing it this way

particlesJS.load('particles-js', '/assets/js/particles.json', function() { let el = document.querySelector(".particles-js-canvas-el"); el.setAttribute("height", "500px"); });

If I un-maximize the window and then maximize it back I get this weird behavior, the canvas gets almost 3 times bigger

Before After

Particles.json

matteobruni commented 3 years ago

Why settings those attributes programmatically? Use CSS, particles.js adjust itself automatically.

Anyway this project is abandoned, I recommend you the litghter alternative tsParticles

lindelof commented 3 years ago

Oh, I think this project has not been abandoned, on the contrary it is very powerful and convenient. Please respect the author's work.