// animate the piece to the destination square
animatedPieceEl.addEventListener('transitionend', complete, {once: true});
requestAnimationFrame(() => {
- animatedPieceEl.style.transitionProperty = 'top left';
+ animatedPieceEl.style.transitionProperty = 'top, left';
animatedPieceEl.style.transitionDuration = cfg.moveSpeed + 'ms';
animatedPieceEl.style.top = destSquarePosition.top + 'px';
animatedPieceEl.style.left = destSquarePosition.left + 'px';
// animate the piece to the target square
draggedPieceEl.addEventListener('transitionend', complete, {once: true});
requestAnimationFrame(() => {
- draggedPieceEl.style.transitionProperty = 'top left';
+ draggedPieceEl.style.transitionProperty = 'top, left';
draggedPieceEl.style.transitionDuration = cfg.snapbackSpeed + 'ms';
draggedPieceEl.style.top = sourceSquarePosition.top + 'px';
draggedPieceEl.style.left = sourceSquarePosition.left + 'px';
// snap the piece to the target square
draggedPieceEl.addEventListener('transitionend', complete, {once: true});
requestAnimationFrame(() => {
- draggedPieceEl.style.transitionProperty = 'top left';
+ draggedPieceEl.style.transitionProperty = 'top, left';
draggedPieceEl.style.transitionDuration = cfg.snapSpeed + 'ms';
draggedPieceEl.style.top = targetSquarePosition.top + 'px';
draggedPieceEl.style.left = targetSquarePosition.left + 'px';