add div if
This commit is contained in:
@@ -42,7 +42,14 @@ observer.observe(document.body, {
|
||||
|
||||
|
||||
function createSnowstorm() {
|
||||
const container = document.getElementById('snowstorm');
|
||||
const container = document.querySelector('.snowstorm') || document.createElement("div");
|
||||
|
||||
if (!document.querySelector('.snowstorm')) {
|
||||
container.className = "snowstorm";
|
||||
container.setAttribute("aria-hidden", "true");
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
|
||||
const windowWidth = window.innerWidth;
|
||||
const windowHeight = window.innerHeight;
|
||||
|
||||
|
Reference in New Issue
Block a user