{"size": 2880, "ext": "js", "max_stars_repo_path": "ba.js", "max_stars_repo_name": "Arood/bajs", "max_stars_repo_stars_event_min_datetime": "2015-05-27T07:52:19.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-17T03:20:32.000Z", "max_issues_repo_path": "ba.js", "max_issues_repo_name": "Arood/bajs", "max_issues_repo_issues_event_min_datetime": "2015-06-18T15:17:29.000Z", "max_issues_repo_issues_event_max_datetime": "2016-05-24T18:31:37.000Z", "max_forks_repo_path": "ba.js", "max_forks_repo_name": "Arood/bajs", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 8, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 27.6923076923, "max_line_length": 123, "alphanum_fraction": 0.5607638889}
/**
 * ba.js - Basic (CSS3) Animations in JavaScript
 */
(function() {

  var support = false,
      domPrefixes = 'Webkit Moz O ms Khtml'.split(' '),
      prefix  = '',
      test = document.createElement('p'),
      needsPrefix = ['transform'];

  document.body.insertBefore(test,null);

  if (test.style.animationName) { support = true; }
   
  if (!support) {
    for (var i = 0; i<domPrefixes.length; i++) {
      if (test.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
        prefix = domPrefixes[i];
        support = true;
        break;
      }
    }
  }

  document.body.removeChild(test);

  var guid = function() {
    var S4 = function() {
       return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
    };
    return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
  };

  var bajs = function() {
    return this;
  };

  // Animator
  bajs.a = function(el, config, cb) {
    var fullprefix = (prefix !== '' ? "-"+prefix.toLowerCase()+"-" : "");
    var properties = ["duration", "curve", "delay", "repeat", "direction", "fill"];
    var id = guid();

    var duration = config.duration || "1s";
    var curve = config.curve || "ease";
    var delay = config.delay || "0s";
    var repeat = config.repeat || "1";
    var direction = config.direction || "normal";
    var fillMode = config.fill || "none";

    el.style[fullprefix + "animation"] = 'bajs-'+id+' '+duration+' '+curve+' '+delay+' '+repeat+' '+direction+' '+fillMode;

    var styleEl = document.createElement('style');
    styleEl.setAttribute('id','bajs-'+id);
    document.getElementsByTagName('head')[0].appendChild(styleEl);
   
    bajs.ade(el, function() {
      document.getElementsByTagName('head')[0].removeChild(styleEl);
      el.style[fullprefix + "animation"] = null;
      if (cb) { cb.call(el); }
    });

    var kf = '@' + fullprefix + 'keyframes bajs-'+id+' { ';

    for (var key in config) {
      if (config.hasOwnProperty(key) && properties.indexOf(key) === -1) {
        kf += key+' { ';
        for (var property in config[key]) {
          if (config[key].hasOwnProperty(property)) {
            kf += (needsPrefix.indexOf(property) !== -1 ? fullprefix : '')+property+': '+config[key][property]+'; ';
          }
        }
        kf += '} ';
      }
    }

    kf += '}';
   
    styleEl.innerHTML = kf;
  };

  // Animation Did End
  bajs.ade = function(el, cb) {
    var eventName = prefix === 'Webkit' ? 'webkitAnimationEnd' : (prefix === 'O' ? 'oAnimationEnd' : 'animationend');
    var animCB = function() {
      cb.call(el);
      el.removeEventListener(eventName, animCB);
    };
    el.addEventListener(eventName, animCB);
  };

  // Availability Test
  bajs.at = function(testCase) {
    if (!testCase) {
      return support;
    }
  }

  window.bajs = bajs;

  document.appendChild(document.createComment("\uD83D\uDCA9"));

})();