<commit_before>define('lyria/tween', ['eventmap', 'mixer', 'jqueryify'], function(EventMap, mixer, $fy) {
  var Tween = (function() {
    var Tween = function(elem) {
      this.$elem = $fy(elem);
      
      mixer(Tween.prototype, new EventMap());
    };
    
    return Tween;
  })();
  
  return Tween;
});<commit_msg>First draft of tweening API<commit_after>define('lyria/tween', ['eventmap', 'mixer', 'options', 'jqueryify'], function(EventMap, mixer, options, $fy) {
  var Tween = (function() {
    var Tween = function(opts) {
      opts = options(opts, {
        elem: null,
        effects: [{
          property: null,
          target: null,
          easing: Tween.defaults.easing,
          duration: Tween.defaults.duration,
          delay: Tween.defaults.delay
        }]
      });
      
      this.$elem = $fy(opts.elem);
      this.effects = opts.effects;

      this.hwAccelerated = true;

      mixer(Tween.prototype, new EventMap());

      var self = this;

      this.on('start', function() {
        if (self.$elem) {
          return;
        }
        
        var effects = [];
        var properties = {};
        
        for (var i = 0, j = self.effects.length; i < j; i++) {
          (function(item) {
            if (item.property == null || item.target == null) {
              return;
            }
            
            item.duration = item.duration || Tween.defaults.duration;
            item.easing = item.easing || Tween.defaults.easing;
            item.delay = item.delay || Tween.defaults.delay;
            
            effects.push([item.property, item.duration, item.easing, item.delay].join(' '));
            properties[item.property] = item.target;
          })(self.effects[i]);
        }
        
        properties['transition'] = effects.join(', ');
        self.$elem.css(properties);
        
        $(document).one('transitionend', function(e) {
          console.log(e.target);
        });
      });
    };
    
    Tween.defaults = {
      easing: 'linear',
      duration: '300ms',
      delay: '0ms'
    };

    return Tween;
  })();

  return Tween;
}); 
{'fraction_non_alphanumeric': 0.1551155115511551, 'fraction_numerical': 0.0023573785950023575, 'mean_word_length': 1.825565912117177, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1245931', 'n_tokens_mistral': 655, 'n_tokens_neox': 639, 'n_words': 126}