Timeout(() => {
      element.setAttribute(attr, end);
      element.removeChild(anim);
      if (typeof callback !== "undefined" && callback !== null) {
        callback();
      }
    }, duration);
  }

  function keyRelease(keyObject) {
    const rotation = keyObject.color === "white" ? 2 : 3.5;
    if (keyObject.playersColliding.size > 0) return;
    animate(keyObject.key, "rx", rotation, 0, 100, "easeInOutQuad", () => {
      keyObject.isPressed = false;
    });
  }

  function keyPress(keyObject) {
  