VincentGarreau / particles.js

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

react-particle-animation #303

Open transitive-bullshit opened 6 years ago

transitive-bullshit commented 6 years ago

<shameless-plug>

Just throwing this in here since I'm guessing a lot of people want to use something like this from react.

Check out react-particle-animation for a cool React alternative to particles.js.

</shameless-plug>

philmetzger commented 5 years ago

I do get this though:

window is not defined
ReferenceError: window is not defined
transitive-bullshit commented 5 years ago

Are you trying to render it server-side? That's the only reason that window would not be defined. If so, you want to guard it to only render if on the client-side.

philmetzger commented 5 years ago

yeah true, i loaded it dynamically and it worked.

philmetzger commented 5 years ago

any idea why the canvas height keeps increasing?

<canvas width="1479.2000732421875" height="2987.800048828125"></canvas>

transitive-bullshit commented 5 years ago

See the example app in the repo for a wrapper that definitely works. It's due to the sizing wrapper trying to be full size, but that's dependent on the surrounding css + dom.

transitive-bullshit commented 5 years ago

@philmetzger let's continue this discussion in the react-particle-animation repo.