const anime = require('animejs').default; function idle(id) { const duration = anime.random(2000, 18000); const target = document.getElementById(id); return anime({ targets: target, translateX: () => anime.random(-20, 20), translateY: () => anime.random(0, -40), rotate: () => anime.random(-15, 15), duration, direction: 'alternate', easing: 'linear', loop: true, }); } module.exports = idle;