// some regular checking var isIE = (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) ? parseFloat( RegExp.$1 ) : false, isIE8 = isIE === 8, isIE9 = isIE === 9; /* RADIUS EXAMPLES */ var radiusBtn = document.getElementById('radiusBtn'); var allRadius = KUTE.to('#allRadius',{borderRadius:80},{duration: 1500, easing:'easingCubicOut', repeat: 1, yoyo: true}); var tlRadius = KUTE.to('#tlRadius',{borderTopLeftRadius:150},{duration: 1500, easing:'easingCubicOut', repeat: 1, yoyo: true}); var trRadius = KUTE.to('#trRadius',{borderTopRightRadius:150},{duration: 1500, easing:'easingCubicOut', repeat: 1, yoyo: true}); var blRadius = KUTE.to('#blRadius',{borderBottomLeftRadius:150},{duration: 1500, easing:'easingCubicOut', repeat: 1, yoyo: true}); var brRadius = KUTE.to('#brRadius',{borderBottomRightRadius:150},{duration: 1500, easing:'easingCubicOut', repeat: 1, yoyo: true}); radiusBtn.addEventListener('click',function(){ if (!allRadius.playing) { allRadius.start(); tlRadius.start(); trRadius.start(); blRadius.start(); brRadius.start(); } }, false); /* RADIUS EXAMPLES */ /* BOX MODEL EXAMPLE */ var boxModel = document.getElementById('boxModel'), btb = boxModel.querySelector('.btn'), box = boxModel.querySelector('.example-box-model'); // built the tween objects var bm1 = KUTE.to(box,{marginTop:50},{ yoyo: true, repeat: 1, duration: 1500, update: onMarginTop}); var bm2 = KUTE.to(box,{marginBottom:50},{ yoyo: true, repeat: 1, duration: 1500, update: onMarginBottom}); var bm3 = KUTE.to(box,{paddingTop:15},{ yoyo: true, repeat: 1, duration: 1500, update: onPadding}); var bm4 = KUTE.to(box,{marginTop:50,marginLeft:50,marginBottom:70},{ yoyo: true, repeat: 1, duration: 1500, update: onMargin, complete: onComplete}); // chain the bms bm1.chain(bm2); bm2.chain(bm3); bm3.chain(bm4); //callback functions function onMarginTop() { var css = KUTE.gCS(box,'marginTop'); box.innerHTML = parseInt(css)+'px'+'
MARGIN'; } function onMarginBottom() { var css = KUTE.gCS(box,'marginBottom'); box.innerHTML = 'MARGIN
'+parseInt(css)+'px'; } function onPadding() { var css = KUTE.gCS(box,'paddingTop'); box.innerHTML = parseInt(css)+'px
PADDING'; } function onMargin() { var css = KUTE.gCS(box,'marginTop'); box.innerHTML = 'MARGIN
'+parseInt(css)+'px'; } function onComplete() { box.innerHTML = 'BOX
 MODEL '; } btb.addEventListener('click', function(e){ e.preventDefault(); !bm1.playing && !bm2.playing && !bm3.playing && !bm4.playing && bm1.start(); },false); /* BOX MODEL EXAMPLE */ /* TEXT PROPERTIES EXAMPLE */ var textProperties = document.getElementById('textProperties'), heading = textProperties.querySelector('h1'), button = textProperties.querySelectorAll('.btn')[0], tbt = textProperties.querySelectorAll('.btn')[1], // let's split the heading text by character chars = heading.innerHTML.split(''); // wrap the splits into spans and build an object with these spans heading.innerHTML = '' + chars.join('') + ''; var charsObject = heading.getElementsByTagName('SPAN'), l = charsObject.length; // built the tween objects var tp1 = KUTE.fromTo( button, {width: 150, opacity:0, height: 70, lineHeight:70, fontSize: 40}, {width: 100, opacity:1, height: 35, lineHeight:35, fontSize: 20}), tps = []; for (var i=0; i