remove scrolling background

This commit is contained in:
Ell 2022-09-21 11:46:51 +02:00
parent d69d2812e0
commit 3692c13f62

View file

@ -27,25 +27,5 @@
</div>
<script>
let x = Math.random() * 100;
let y = Math.random() * 100;
let angle = Math.random() * 2 * Math.PI;
let addX = Math.cos(angle) * 0.02;
let addY = Math.sin(angle) * 0.02;
let background = $(".top");
background.css("background-position", `${x}% ${y}%`);
$(window).on("load", function () {
setInterval(function () {
x += addX;
y += addY;
if (x < 0 || x > 100)
addX *= -1;
if (y < 0 || y > 100)
addY *= -1;
background.css("background-position", `${x}% ${y}%`);
}, 30);
});
$(".top").css("background-position", `${Math.random() * 100}% ${Math.random() * 100}%`);
</script>