src/js/lib/letterAnimation.js
/**
 * Starts the letter bounce animation.
 * @param letter that will be animated.
 */
Starts the letter bounce animation.
@param letter that will be animated.
Starts the letter bounce animation . @param letter that will be animated .
function startAnimation(letter) {
	let dx = -5;
	let dy = 0;
	const letterAnimations = new LetterAnimation(letter, dx, dy);
	const animation = new Animation([letterAnimations]);
	let last = null;
	window.requestAnimationFrame(function update(now) {
		const delta = now - (last === null ? now : last);
		last = now;
		if (animation.update(delta)) {
			window.requestAnimationFrame(update);
		}
	});
}
function startAnimation ( letter ) { let dx = - 5 ; let dy = 0 ; const letterAnimations = new LetterAnimation ( letter , dx , dy ) ; const animation = new Animation ( [ letterAnimations ] ) ; let last = null ; window . requestAnimationFrame ( function update ( now ) { const delta = now - ( last === null ? now : last ) ; last = now ; if ( animation . update ( delta ) ) { window . requestAnimationFrame ( update ) ; } } ) ; }
Starts the letter bounce animation.
Starts the letter bounce animation .
// Start updating the animation // Continue animating if there are cards left