$(document).ready(function(reveal) {
function randPos(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
};
let getX = randPos(0, $('body').outerWidth());
let getY = randPos(0, $('body').outerHeight());
let a = randPos(0, 6);
for (let i = 0; i < 189; i++){function randPos(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
};
let a = randPos(0, 6);
$(".sample-result").append(`<div class="firefly-shadow
ff${i} float-style${a}"><div class="firefly"></div></div>`);
let diams = new Array(2, 5, 10, 15, 20, 30);
let FFdiam = diams[Math.floor(Math.random()*diams.length)];
let getX = randPos(0, $('body').outerWidth());
let getY = randPos(0, $('body').outerHeight());
$('.ff' + i).css({
'position' : 'absolute',
'left' : getX,
'top' : getY,
'width' : FFdiam,
'height' : FFdiam,
});
switch (a) {
case 0:
gsap.to(('.float-style'+a), { duration: 400, ease: "rough(
{ template: none.out, strength: 1, points: 20, taper: 'none',
randomize: true, clamp: false})", y: 500 });
break;
case 1:
gsap.to(('.float-style'+a), { duration: 350, ease: "rough(
{ template: none.out, strength: 1, points: 20, taper: 'none',
randomize: true, clamp: false})", x:-950 });
break;
case 2:
gsap.to(('.float-style'+a), { duration: 350, ease: "rough(
{ template: none.out, strength: 1, points: 20, taper: 'none',
randomize: true, clamp: false})", y: 750 });
break;
case 3:
gsap.to(('.float-style'+a), { duration: 200, ease: "rough(
{ template: none.out, strength: 1, points: 20, taper: 'none',
randomize: true, clamp: false})", x: 250 });
break;
case 4:
gsap.to(('.float-style'+a), { duration: 400, ease: "rough(
{ template: none.out, strength: 1, points: 20, taper: 'none',
randomize: true, clamp: false})", y:550 });
break;
case 5:
gsap.to(('.float-style'+a), { duration: 250, ease: "rough(
{ template: none.out, strength: 1, points: 20, taper: 'none',
randomize: true, clamp: false})", x: 450 });
break;
default:
gsap.to(('.float-style'+a), { duration: 300, ease: "rough(
{ template: none.out, strength: 1, points: 20, taper: 'none',
randomize: true, clamp: false})", y: 250 });
}
};
});