<commit_before>'use strict';
/*global SVG */

SVG.DumpTruckHaul = SVG.invent({
  create: 'g',
  inherit: SVG.G,
  extend: {
    build: function() {
      this.t = 10000;

      this.body = this.doc().use('Haulage_Dump_Truck_2', 'images/master.svg');
      this.add(this.body);

      return this;
    }
  }
  , construct: {
    dumpTruckHaul: function() {
      return this.put(new SVG.DumpTruckHaul)
        .build();
    }
  }
});

SVG.extend(SVG.DumpTruckHaul, {
  forward: function() {
    return this
      .animate(this.t)
      .x(300)
      .y(-14)
    ;
  }

  , backward: function() {
    return this
      .animate(this.t)
      .x(0)
      .y(0)
    ;
  }

  , go: function() {
    var self = this;
    self.forward().after(function(){
      self.backward().after(function(){
        self.go();
      });
    });
  }

});<commit_msg>Add clip to haul truck<commit_after>'use strict';
/*global SVG */

SVG.DumpTruckHaul = SVG.invent({
  create: 'g',
  inherit: SVG.G,
  extend: {
    build: function() {
      this.t = 10000;

      this.rect = this.doc().rect(250, 100);
      this.rect.move(280, 500);
      this.add(this.rect);

      this.body = this.doc().use('Haulage_Dump_Truck_2', 'images/master.svg');
      this.add(this.body);

      this.clipWith(this.rect);

      return this;
    }
  }
  , construct: {
    dumpTruckHaul: function() {
      return this.put(new SVG.DumpTruckHaul)
        .build();
    }
  }
});

SVG.extend(SVG.DumpTruckHaul, {
  forward: function() {
    return this.body
      .animate(this.t)
      .x(300)
      .y(-14)
    ;
  }

  , backward: function() {
    return this.body
      .animate(this.t)
      .x(0)
      .y(0)
    ;
  }

  , flip: function() {
    return this.body.scale(-1, 1);
  }

  , go: function() {
    var self = this;
    self.forward().after(function(){
      self.body.rotate(-5);
      self.flip();
      self.backward().after(function(){
        self.flip();
        self.body.rotate(0);
        self.go();
      });
    });
  }

});
{'fraction_non_alphanumeric': 0.18036870951669157, 'fraction_numerical': 0.02092675635276532, 'mean_word_length': 2.001494768310912, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7643242', 'n_tokens_mistral': 816, 'n_tokens_neox': 761, 'n_words': 122}