diff --git a/index.html b/index.html index 7207d79..9ad1f0b 100644 --- a/index.html +++ b/index.html @@ -14,22 +14,32 @@ + +
+
+ + +
+ +
-
-
-
-
-
-
-
-
-

- Random Disco - - Light Simulator - -

+
+
+ +
+
+
+
+
+
+
+

+ Random Disco + + Light Simulator + +

-
+
+ + + - \ No newline at end of file diff --git a/script.js b/script.js index 89493b2..3b624fd 100644 --- a/script.js +++ b/script.js @@ -186,14 +186,16 @@ document.addEventListener('DOMContentLoaded', () => { const timeInput = document.getElementById('time'); + const randomTimeInterval = Math.floor(Math.random() * 5000) + 1000; + timeInput.value = randomTimeInterval; const unitSelect = document.getElementById('unit'); const randomUnitIndex = Math.random() < 0.5 ? 1 : 2; if (randomUnitIndex == 1) { - var randomTimeInterval = Math.floor(Math.random() * 1000) + 1; + randomTimeInterval = Math.floor(Math.random() * 1000) + 1; timeInput.value = randomTimeInterval; } else { - var randomTimeInterval = Math.floor(Math.random() * 10) + 1; + randomTimeInterval = Math.floor(Math.random() * 10) + 1; timeInput.value = randomTimeInterval; } unitSelect.selectedIndex = randomUnitIndex; @@ -371,4 +373,17 @@ document.getElementById('submit').addEventListener('click', function () { document.getElementById(selectedMusic).play(); } }); -}); \ No newline at end of file +}); + +function effect(){ + loader.style.display="none"; + document.querySelector(".unload").style.display="block"; + document.querySelector(".snowflakes").style.display="block"; + } + + + + var loader=document.querySelector(".loader"); + window.addEventListener('load',()=>{ + let timout=setTimeout(effect,4000); + }) diff --git a/style.css b/style.css index 83d7f20..c4c19d5 100644 --- a/style.css +++ b/style.css @@ -15,6 +15,20 @@ body { font-family: 'Playfair Display', serif; } + +.unload{ + display: none; +} + +.loader{ + display: flex; + align-items: center; + justify-content: center; + width: 100vw; + height: 100vh; +} + + #particles-js { position: absolute; width: 100%;