Closed seyedasfar closed 5 years ago
Absolutely not an ideal solution but it did work for me. I created an app.css file and have my app.js import it. Inside the CSS file I have the following:
canvas { width: 100%; height: 100%; position: fixed; background-size: cover; background-position: 50% 50%; background-repeat: no-repeat; }
Basically I used the stackoverflow post below but tweaked it for React to modify the canvas tag since you can't access the '#particles-js' id since it's imported as a component. As I said earlier not ideal at all and I'm sure there is a better way to do this but I did manage to get it to work (somehow)
https://stackoverflow.com/questions/45405463/particles-js-not-covering-entire-page (did not need to use the .body-particles styles this answer refers to in order for it to work)
Hope this helps
You can use style or canvasClassName props to set canvas css. Please refer to the main readme. Answers given, closing.
https://stackoverflow.com/questions/54359429/why-particles-js-height-not-expanding