diff --git a/snowfall.js b/snowfall.js index 12b0c09..c9c55b2 100644 --- a/snowfall.js +++ b/snowfall.js @@ -42,7 +42,15 @@ observer.observe(document.body, { function createSnowflakes() { - const container = document.getElementById('snowfall'); + const container = document.querySelector('.snowfall') || document.createElement("div"); + + if (!document.querySelector('.snowfall')) { + container.className = "snowfall"; + container.setAttribute("aria-hidden", "true"); + document.body.appendChild(container); + } + + const windowWidth = window.innerWidth; const windowHeight = window.innerHeight; diff --git a/test-site.html b/test-site.html index bf7984b..499ef44 100644 --- a/test-site.html +++ b/test-site.html @@ -15,7 +15,7 @@ -
+