Is your feature request related to a problem? Please describe.
I am using a config based heavily on the preset named Presets. Open that link and try this for yourself: When I resize my browser to be smaller, the particles gets all squished together and then when I make my browser window bigger, they stay squished together. I do not want this behavior.
Describe the solution you'd like
How do I reset the particles when the window gets resized? Or make the particles spread out more when the browser gets bigger?
Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.61. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Hi @baieric,
This behavior can be hard to resolve because reposition particles after a window resize can bring unexpected side effects.
If you want particles to be always well fit inside the window you can try to refresh the particles like this:
window.addEventListener("resize", function () { // or () => { if you prefer lambdas
var container = tsParticles.domItem(0); // or let or const
if (!container) {
return;
}
container.refresh();
});
This will reload the options restarting all the animations. It's a workaround to have particles always well fit, but if you have emitters or absorbers this solution won't fit very well since they'll be reset too.