Local Weather, can't assign styles to the background images via classList.add() method [CLOSED]

Hi Guys,
I am trying to assign the styles of ‘bg’ class to the background images but it is not working.
Could someone help what’s wrong in my code?

Thanks,
Simon

https://codepen.io/simongjetaj/pen/KXvrVM

Codepen’s Autosave… :tired_face:

Sorry @camperextraordinaire, the code was erased…

Thanks for the answer @camperextraordinaire. I have one more question, pls.

My last issue is that I would like the background image to fit width, height and should auto-scale in proportion.

This is the photo in large screen devices


and this the photo in other screen devices
I would like the second option to be on all screen devices. Do you have any idea, what can I do?
This is my css:

* {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Skranji', cursive;
  font-size: 18px;
  background-size: cover;
  background-position: center;
  min-height: 100vh;
}
https://codepen.io/simongjetaj/pen/KXvrVM