{"size": 1097, "ext": "js", "max_stars_repo_path": "build/src/SearchField/macOs/cancelAnimation.js", "max_stars_repo_name": "ziktar/react-desktop", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "build/src/SearchField/macOs/cancelAnimation.js", "max_issues_repo_name": "ziktar/react-desktop", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "build/src/SearchField/macOs/cancelAnimation.js", "max_forks_repo_name": "ziktar/react-desktop", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.1282051282, "max_line_length": 162, "alphanum_fraction": 0.7119416591}
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = function (element) {
  if (requestAnimationFrame) {
    startTimestamp = null;
    var icon = element.getElementsByTagName('svg')[0];
    requestAnimationFrame(function (timestamp) {
      return animateCancelIcon(timestamp, icon);
    });
  }
};

var requestAnimationFrame = void 0;
if (typeof window !== 'undefined') {
  requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
}

var startTimestamp = void 0;
var duration = 150;

function animateCancelIcon(timestamp, element) {
  if (!startTimestamp) startTimestamp = timestamp;
  var progress = (timestamp - startTimestamp) / duration;
  if (progress > 1) progress = 1;

  element.style.height = 14 * progress + 'px';
  element.style.width = 14 * progress + 'px';
  element.style.opacity = progress;

  if (progress !== 1) {
    requestAnimationFrame(function (timestamp) {
      return animateCancelIcon(timestamp, element);
    });
  }
}