Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function randomFrames(x: number, y: number): any[] {
const common = { x, y, cubic: Hitu.CUBIC_EASE_IN_OUT };
return [
{
frame: 0,
...common,
},
{
frame: TOTAL_FRAMES / 2,
...common,
x: x - Math.random() * RANDOM_OFFSET * 2 + RANDOM_OFFSET,
y: y - Math.random() * RANDOM_OFFSET * 2 + RANDOM_OFFSET,
},
{
frame: TOTAL_FRAMES,
...common,
},
originX: 1,
originY: 1,
x: 56,
y: 96,
cubic: Hitu.CUBIC_EASE_IN_OUT,
},
{
frame: 20,
rotate: 7,
cubic: Hitu.CUBIC_EASE_IN_OUT,
},
{
frame: 40,
rotate: -5,
cubic: Hitu.CUBIC_EASE_IN_OUT,
},
{
frame: 60,
rotate: 7,
},
{
frame: 80,
rotate: 0,
},
],
},
{
type: 'shape',
source: RightLeaf,
frames: [
{
{ frame: 40, rotate: 9 },
{ frame: 60, rotate: -7 },
{ frame: 80, rotate: 0 },
],
},
{
type: 'shape',
source: LeftLeaf,
frames: [
{
frame: 0,
originX: 1,
originY: 1,
x: 56,
y: 96,
cubic: Hitu.CUBIC_EASE_IN_OUT,
},
{
frame: 20,
rotate: 7,
cubic: Hitu.CUBIC_EASE_IN_OUT,
},
{
frame: 40,
rotate: -5,
cubic: Hitu.CUBIC_EASE_IN_OUT,
},
{
frame: 60,
rotate: 7,
},