(function() {
/**
* checks if a number is Odd
*/
function isOdd(n) {
retu Math.abs(n % 2) == 1;
}
/**
* retus a random number between min and max
*/
function randomIntFromInterval(min,max) {
retu Math.floor(Math.random()*(max-min+1)+min);
}
var word = document.querySelector('.list__text'),
playCtrl = document.querySelector('.control__button--play'),
myText = new Letters(word, { // word 4
size : 300,
weight : 35,
color: ['#3B3E3B','#DC6A28','#8BC34A','#4585B7','#E24444'],
duration: 1,
fade: 1,
delay: [0.4,0.3,0.2,0.1,0],
individualDelays: true,
easing: d3_ease.easeCubicOut.ease
}),
endPlayCallback = function() {
playCtrl.className = 'control__button control__button--play';
word.setAttribute('data-state', 'stop');
};
// show word
myText.showInstantly();
playCtrl.addEventListener('click', function() {
if( word.getAttribute('data-state') === 'play' ) {
retu false;
}
word.setAttribute('data-state', 'play');
playCtrl.className = 'control__button control__button--play control__button--active';
// default behaviour
myText.hideInstantly();
myText.show({callback: endPlayCallback});
});
})();
سون لرن • آموزش...برچسب : نویسنده : استخدام کار 7learn بازدید : 276