Sha256: 7e19da5cfa25b49a51b3aa8f71193bd3cf7cfba5e8ec417b3bd0835d497e061c

Contents?: true

Size: 924 Bytes

Versions: 60

Compression:

Stored size: 924 Bytes

Contents

mumuki.load(() => {
  let characters = mumuki.characters || {};

  muvment.loadCharacters(characters, '/character/animations.json').then((characterFinishedLoadingPromises) => {
    Promise.all(characterFinishedLoadingPromises).then((characterIds) => {
      mumuki.presenterCharacter = characters[atRandom(characterIds)];
      placeKidsAnimations();
    });
  });

  function placeKidsAnimations() {
    placeAnimation('.mu-kids-character-result-aborted', 'failure');
    placeAnimation('.mu-kids-character-animation', 'blink');
    placeAnimation('.mu-kids-character-context', 'context');
    placeAnimation('.mu-kids-character-result', 'blink');
  }

  function placeAnimation(selector, clip) {
    let canvas = $(selector);
    mumuki.presenterCharacter.playAnimation(clip, canvas);
  }

  function atRandom(array) {
    return array[Math.floor(Math.random() * array.length)];
  }

  mumuki.characters = characters;
});

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
mumuki-laboratory-9.9.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.8.2 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.8.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.8.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.7.2 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.7.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.7.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.6.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.5.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.5.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.4.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.4.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.3.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.3.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.2.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.1.3 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.1.2 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.1.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.1.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.0.6 app/assets/javascripts/mumuki_laboratory/application/characters.js