Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const bbox = clip.getBBox();
const width = bbox.maxX - bbox.minX;
const height = bbox.maxY - bbox.minY;
const duration = 5000;
const delayDiff = 300;
for (let i = 0; i < waveCount; i++) {
const wave = group.addShape('path', {
attrs: {
path: getWaterWavePath(radius, bbox.minY + height * level, width / 4, 0, width / 64, x, y),
fill: colors[i],
clip,
opacity: 0.8,
},
});
// FIXME wave animation error in svg
if (Global.renderer === 'canvas') {
wave.animate(
{
transform: [['t', width / 2, 0]],
repeat: true,
},
duration - i * delayDiff
);
}
}
}