diff --git a/src/main.ts b/src/main.ts index 5c78173..9585929 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,14 +26,8 @@ let setImages = () => { for (let index in images) { let img = document.createElement("img"); img.setAttribute("src", images[index]); - img.style.setProperty( - "left", - (Math.random() * window.innerWidth).toString() + "px", - ); - img.style.setProperty( - "top", - (Math.random() * window.innerHeight).toString() + "px", - ); + img.style.setProperty("left", (Math.random() * 100).toString() + "%"); + img.style.setProperty("top", (Math.random() * 100).toString() + "%"); app.append(img); } }; diff --git a/src/style.css b/src/style.css index 7f486ed..510c84b 100644 --- a/src/style.css +++ b/src/style.css @@ -16,9 +16,10 @@ body, html { - block-size: 100dvb; - inline-size: 100dvi; + block-size: 100svb; + inline-size: 100svi; margin: 0; + padding: 0; overflow: hidden; } @@ -26,6 +27,7 @@ html { inline-size: 100%; block-size: 100%; display: flex; + margin: 0; align-items: center; justify-content: center; flex-direction: column;