<commit_before>var Drawing = function (p5, pulse) {
  var defaults = {
    totalFrames: 15,
    slideFrames: 5,
    // out of 255
    r: 255,
    g: 255,
    b: 255
  }

  p5.pulsar.merge(defaults, pulse);

  defaults.framesLeft = defaults.totalFrames;
  
  this.pulse = defaults;
};

Drawing.prototype.draw = function (p) {
  var self = this;
  var pulse = self.pulse;

  p.rectMode(p.CORNER);
  p.fill(pulse.r, pulse.g, pulse.b);
  
  var framesIn = pulse.totalFrames - pulse.framesLeft;

  if (framesIn < pulse.slideFrames) {    
    p.rect(0, 
           p.windowHeight - p.windowHeight*(framesIn/pulse.slideFrames), 
           p.windowWidth, 
           p.windowHeight);
  } else if (framesIn > pulse.totalFrames - pulse.slideFrames) {
    p.rect(0, 
           p.windowHeight - p.windowHeight*((pulse.totalFrames - framesIn)/pulse.slideFrames), 
           p.windowWidth, 
           p.windowHeight);
  } else {
    p.rect(0, 
           0, 
           p.windowWidth, 
           p.windowHeight);
  }

<commit_msg>Add alpha option to slider drawing<commit_after>var Drawing = function (p5, pulse) {
  var defaults = {
    totalFrames: 15,
    slideFrames: 5,
    // out of 255
    r: 255,
    g: 255,
    b: 255,
    a: 255
  }

  p5.pulsar.merge(defaults, pulse);

  defaults.framesLeft = defaults.totalFrames;
  
  this.pulse = defaults;
};

Drawing.prototype.draw = function (p) {
  var self = this;
  var pulse = self.pulse;

  p.rectMode(p.CORNER);
  p.fill(pulse.r, pulse.g, pulse.b, pulse.a);
  
  var framesIn = pulse.totalFrames - pulse.framesLeft;

  if (framesIn < pulse.slideFrames) {    
    p.rect(0, 
           p.windowHeight - p.windowHeight*(framesIn/pulse.slideFrames), 
           p.windowWidth, 
           p.windowHeight);
  } else if (framesIn > pulse.totalFrames - pulse.slideFrames) {
    p.rect(0, 
           p.windowHeight - p.windowHeight*((pulse.totalFrames - framesIn)/pulse.slideFrames), 
           p.windowWidth, 
           p.windowHeight);
  } else {
    p.rect(0, 
           0, 
           p.windowWidth, 
           p.windowHeight);
  }


{'fraction_non_alphanumeric': 0.12667946257197696, 'fraction_numerical': 0.021593090211132437, 'mean_word_length': 2.130630630630631, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7180621', 'n_tokens_mistral': 794, 'n_tokens_neox': 696, 'n_words': 142}