Site logo

Archived topic

Adding particles but specifying CSS ID using elements?

5 replies · Started by Michael on May 28, 2021

Viewing posts 1–6 of 6

Am following this page...

https://cakewp.com/divi-tutorials/add-nice-moving-particles-background-effect/

And using Gutenberg, which originally I wanted to use to add background particles on home page image. After experimenting with Generatepress elements, it somehow managed to show the particles in my background. I created a basic <div></div> as the element code, and generated it before main content.

Having them in the background looks nice, but running the page through pagespeed insights it looks like the particles.js file is being called in different places, even though in the element I put it as just "before content".

Any ideas how to fix this, or what I am doing wrong?

Hi there,

i can only see the particles.js request being made once - and i ran a PSI test, and i am not sure what you mean by 'being called in different places' - can you clarify?

I think it's just my bad understanding of a lighthouse report, see the image... can't understand why it's showing repeated entries, plus when I was trying yellowpencil css editor, I was clicking on different items on the page and kept saying particles was the CSS there.

I am not able to replicate that in my tests.
Just to note that JS is really processor intensive which can block the browsers main thread, especially on lower end devices ... which may not be good for user load times or your Web Dev metrics....

Metrics not too bad considering. Client requirement the particles.

Maybe it was just a glitch in the Lighthouse report as i can only see the one instanced of the script....

This archived topic is closed to new replies.