<commit_before>import {Ion} from 'ion-cloud';
import {easel} from './app';

// This makeItRain demo constantly keeps 100 particles (dollars) on the screen
export function makeItRain() {
  var headerText = '<%= name %> Version <%= appVersion %> by <%= authorName %>',
      shirtWidth = 0, shirtLeft = 0, // ease logical checks at runtime by
      logoWidth = 0, logoHeight = 0, // preprocessing the sizes of the images
      shirt = new Image(),
      logo = new Image(),
      dollar = new Image(),
      makeItRain = new Ion(100);

  // Lady shirt in the background
  shirt.src = 'http://i.imgur.com/Nvfvy87.png';
  shirt.onload = ()=>{
    shirtWidth = v.h / shirt.height * shirt.width;
    shirtLeft = v.w / 2 - shirtWidth / 2;
  };
  easel.config = ()=>{
    shirtWidth = v.h / shirt.height * shirt.width;
    shirtLeft = v.w / 2 - shirtWidth / 2;
  };

  // Gulp logo ontop of the lady shirt
  logo.src = 'http://i.imgur.com/dlwtnzo.png';
  logo.onload = function recheck() {
    if(!shirtWidth){ //need shirt to load first
      setTimeout(()=> recheck(),1); //keep checking until shirt loads
    }else{
      logoWidth = shirtWidth / 6;
      logoHeight = shirtWidth / logo.width * logo.height / 6;
    } //end if
  };

  // Dollar asset that floats from the top
  dollar.src = 'http://i.imgur.com/nLTCnEP.png';

  // Declare and initialize the scene
  makeItRain.startX = ()=> r(1, v.w); //start x location
  makeItRain.startY = 15; //start y location
  makeItRain.endX = ()=> r(1, v.w); //destination x location (minus wind factor)
  makeItRain.endY = v.h; //destination y location (minus wind factor)
  makeItRain.windX = ()=> r(0, 0.5) - 0.25; // wind-x variant factor
  makeItRain.windY = 0; //wind-y variant factor
  makeItRain.image = dollar; //pass an image for the particle
  makeItRain.imageWidth = 25; //lets override the width of the image
  makeItRain.imageHeight = 50; //lets override the height of the image<commit_msg>fix to support new ion syntax.<commit_after>import {Ion} from 'ion-cloud';
import {easel} from './app';

// This makeItRain demo constantly keeps 100 particles (dollars) on the screen
export function makeItRain() {
  var headerText = '<%= name %> Version <%= appVersion %> by <%= authorName %>',
      shirtWidth = 0, shirtLeft = 0, // ease logical checks at runtime by
      logoWidth = 0, logoHeight = 0, // preprocessing the sizes of the images
      shirt = new Image(),
      logo = new Image(),
      dollar = new Image(),
      v = easel.viewport, //viewport holds width and height of canvas
      ctx = easel.ctx, //link to canvas 2d drawing context
      makeItRain = new Ion(ctx,v), //animation class
      r = easel.randomInteger; //lowerbound, upperbound, isInteger?

  // Lady shirt in the background
  shirt.src = 'http://i.imgur.com/Nvfvy87.png';
  shirt.onload = ()=>{
    shirtWidth = v.h / shirt.height * shirt.width;
    shirtLeft = v.w / 2 - shirtWidth / 2;
  };
  easel.config = ()=>{
    shirtWidth = v.h / shirt.height * shirt.width;
    shirtLeft = v.w / 2 - shirtWidth / 2;
  };

  // Gulp logo ontop of the lady shirt
  logo.src = 'http://i.imgur.com/dlwtnzo.png';
  logo.onload = function recheck() {
    if(!shirtWidth){ //need shirt to load first
      setTimeout(()=> recheck(),1); //keep checking until shirt loads
    }else{
      logoWidth = shirtWidth / 6;
      logoHeight = shirtWidth / logo.width * logo.height / 6;
    } //end if
  };

  // Dollar asset that floats from the top
  dollar.src = 'http://i.imgur.com/nLTCnEP.png';

  // Declare and initialize the scene
  makeItRain.quantity = 100;
  makeItRain.startX = ()=> r(1, v.w); //start x location
  makeItRain.startY = 15; //start y location
  makeItRain.endX = ()=> r(1, v.w); //destination x location (minus wind factor)
  makeItRain.endY = v.h; //destination y location (minus wind factor)
  makeItRain.windX = ()=> r(0, 0.5) - 0.25; // wind-x variant factor
  makeItRain.windY = 0; //wind-y variant factor
  makeItRain.image = dollar; //pass an image for the particle
  makeItRain.imageWidth = 25; //lets override the width of the image
  makeItRain.imageHeight = 50; //lets override the height of the image
{'fraction_non_alphanumeric': 0.1391367253436219, 'fraction_numerical': 0.01663853387991319, 'mean_word_length': 2.816007359705612, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '2736575', 'n_tokens_mistral': 1427, 'n_tokens_neox': 1326, 'n_words': 438}