
(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 2
size : 210,
weight : 8,
color: '#f5f5f5',
duration: 0.7,
fade: 0.7,
delay: 0.05,
easing: d3_ease.easeSinInOut.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});
});
})();
- - , .
برچسب:
نویسنده: استخدام کار