mirror of
https://github.com/Ellpeck/TinyLifeWeb.git
synced 2024-12-22 06:39:23 +01:00
remove scrolling background
This commit is contained in:
parent
d69d2812e0
commit
3692c13f62
1 changed files with 1 additions and 21 deletions
|
@ -27,25 +27,5 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let x = Math.random() * 100;
|
$(".top").css("background-position", `${Math.random() * 100}% ${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);
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue