Code works locally but on online experiments (Opacity)

Hi,

I have designed a study where, upon pressing the “space” key, the opacity of the polygon changes to 1. (It looks like there is no polygon, but when the participants press the spacebar, the polygon seems to appear)

The problem is this works locally but does not work when I run online experiments.

Any help would be appreciated. I am a newbie in terms of coding so any help will be appreciated