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.23.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.22.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.21.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.20.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.20.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.19.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.18.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.18.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.17.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.16.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.15.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.14.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.14.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.13.2 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.13.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.13.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.12.1 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.12.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.11.0 app/assets/javascripts/mumuki_laboratory/application/characters.js
mumuki-laboratory-9.10.0 app/assets/javascripts/mumuki_laboratory/application/characters.js