durations
This commit is contained in:
parent
16c95bfa18
commit
1ba6a9695b
@ -60,14 +60,14 @@ const animations = {};
|
|||||||
function animateCryp(id) {
|
function animateCryp(id) {
|
||||||
if (animations[id]) return false;
|
if (animations[id]) return false;
|
||||||
animations[id] = true;
|
animations[id] = true;
|
||||||
|
const duration = anime.random(2000, 20000);
|
||||||
const target = document.getElementById(id);
|
const target = document.getElementById(id);
|
||||||
return anime({
|
return anime({
|
||||||
targets: target,
|
targets: target,
|
||||||
translateX: () => anime.random(-20, 20),
|
translateX: () => anime.random(-20, 20),
|
||||||
translateY: () => anime.random(0, -40),
|
translateY: () => anime.random(0, -40),
|
||||||
rotate: () => anime.random(-15, 15),
|
rotate: () => anime.random(-15, 15),
|
||||||
duration: () => anime.random(2000, 5000),
|
duration,
|
||||||
delay: () => anime.random(0, 2000),
|
|
||||||
direction: 'alternate',
|
direction: 'alternate',
|
||||||
easing: 'linear',
|
easing: 'linear',
|
||||||
loop: true,
|
loop: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user