Smaller step size, add random rotation, remove z-index increments

This commit is contained in:
Nono 2025-12-19 12:25:39 +01:00
parent bbf60b8ae8
commit 9b307813d6

View file

@ -1,10 +1,6 @@
const stepSize = 100; const stepSize = 1;
const main = document.querySelector('main'); const main = document.querySelector('main');
for(let guideDraggable of document.querySelectorAll("#page-guide main > *")) {
guideDraggable.classList.add("draggable");
}
const draggables = document.querySelectorAll(".draggable"); const draggables = document.querySelectorAll(".draggable");
const randomStarts = document.querySelectorAll(".randomStart"); const randomStarts = document.querySelectorAll(".randomStart");
@ -24,8 +20,6 @@ function stepedSize(n) {
function move(e) { function move(e) {
e.preventDefault(); e.preventDefault();
let target = e.target; let target = e.target;
target.style['z-index'] = zIndex;
zIndex++;
target.moving = true; target.moving = true;
@ -75,6 +69,7 @@ function randomizeDragables() {
randY = Math.floor(Math.random() * maxY); randY = Math.floor(Math.random() * maxY);
randomStart.style.left = randX + "px"; randomStart.style.left = randX + "px";
randomStart.style.top = randY + "px"; randomStart.style.top = randY + "px";
randomStart.style.rotate = Math.floor(Math.random() * 61) - 30 + "deg";
} }
} }