diff --git a/index.css b/index.css index 3e429b5..de3e155 100644 --- a/index.css +++ b/index.css @@ -14,7 +14,7 @@ div.container { background: linear-gradient(rgba(255, 0, 0, 1) 0%, rgba(255, 154, 0, 1) 10%, rgba(208, 222, 33, 1) 20%, rgba(79, 220, 74, 1) 30%, rgba(63, 218, 216, 1) 40%, rgba(47, 201, 226, 1) 50%, rgba(28, 127, 238, 1) 60%, rgba(95, 21, 242, 1) 70%, rgba(186, 12, 248, 1) 80%, rgba(251, 7, 217, 1) 90%, rgba(255, 0, 0, 1) 100%) 0 0/100% 200%; - animation: rainbow 6s linear infinite; + animation: rainbow 10s linear infinite; } img#sun { @@ -28,7 +28,7 @@ img#sun:hover { transform: scale(1.05) skew(4deg, -3deg); } -video { +video#video { display: none; margin: 300px; max-width: 1920px; @@ -37,7 +37,7 @@ video { border-radius: 24px; transform: scale(0.9) rotate(0deg); box-shadow: 12px 12px 12px 12px rgba(0, 0, 0, 0.5); - animation: 3s ease-in-out 1s alternate infinite scale; + animation: 5s ease-in 1s alternate infinite scale; } @keyframes scale { diff --git a/index.html b/index.html index 48e4c9a..0fdbf2a 100644 --- a/index.html +++ b/index.html @@ -12,10 +12,10 @@ - +
-
diff --git a/index.js b/index.js index 69fd445..4f75b4f 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,6 @@ -const body = document.getElementById('body') -const media = document.querySelector("video"); +const media = document.getElementById("video"); const sun = document.getElementById('sun') -let audioSource = null; let filter = null; let saturation = 1; @@ -26,22 +24,22 @@ function increaseValues() { } function createFilter() { - if (audioSource === null) { + if (filter === null) { const context = new AudioContext(); - audioSource = context.createMediaElementSource(media); + const audioSource = context.createMediaElementSource(media); + filter = context.createBiquadFilter(); audioSource.connect(filter); + filter.connect(context.destination); filter.type = "lowshelf"; } - - return filter; } sun.addEventListener('click', (event) => { event.preventDefault(); - const filter = createFilter(); + createFilter(); filter.frequency.value = freq; filter.gain.value = gain;