document.write("
"); ;(function(window) { 'use strict'; function isIOSSafari() { var userAgent; userAgent = window.navigator.userAgent; return userAgent.match(/iPad/i) || userAgent.match(/iPhone/i); }; function isTouch() { var isIETouch; isIETouch = navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; return [].indexOf.call(window, 'onclick') >= 0 || isIETouch; }; var isIOS = isIOSSafari(), clickHandler = isIOS || isTouch() ? 'click' : 'click'; function extend( a, b ) { for( var key in b ) { if( b.hasOwnProperty( key ) ) { a[key] = b[key]; } } return a; } function Animocon(el, options) { this.el = el; this.options = extend( {}, this.options ); extend( this.options, options ); this.checked = false; this.timeline = new mojs.Timeline(); for(var i = 0, len = this.options.tweens.length; i < len; ++i) { this.timeline.add(this.options.tweens[i]); } var self = this; this.el.addEventListener(clickHandler, function() { if( self.checked ) { self.options.onUnCheck(); } else { self.options.onCheck(); self.timeline.replay(); } self.checked = !self.checked; }); } Animocon.prototype.options = { tweens : [ new mojs.Burst({}) ], onCheck : function() { return false; }, onUnCheck : function() { return false; } }; function init() { var pong=document.getElementById("10"); var el2 = pong.querySelector('button.icobutton'), el2span = el2.querySelector('span'),el2counter = el2.querySelector('span.icobutton__text'); loadXMLDoc('10'); /*falling animation*/ var opacityCurve12 = mojs.easing.path('M0,100 L20,100 L20,1 L100,1'); var translationCurve12 = mojs.easing.path('M0,100h20V0c0,0,0.2,101,80,101'); new Animocon(el2, { tweens : [ // burst animation new mojs.Burst({ parent: el2, count: 2, radius: {10:90}, angle: 92, top: '90%', children: { shape: 'line', fill: '#C0C1C3', scale: 1, radius: {40:0}, stroke: '#C0C1C3', strokeWidth: {4:1}, strokeLinecap:'round', opacity: 0.5, duration: 500, delay: 200, easing: mojs.easing.bezier(0.1, 1, 0.3, 1) } }), // burst animation new mojs.Burst({ parent: el2, count: 3, radius: {10:40}, angle: 182, top: '90%', children: { shape: 'line', fill: '#C0C1C3', opacity: 0.5, scale: 1, radius: {10:0}, stroke: '#C0C1C3', strokeWidth:{4:1}, strokeLinecap: 'round', duration: 600, delay: 200, easing: mojs.easing.bezier(0.1, 1, 0.3, 1) } }), // ring animation new mojs.Shape({ parent: el2, radius: {40: 0}, radiusY: {20: 0}, fill: '#C0C1C3', stroke: '#C0C1C3', strokeWidth: 1, opacity: 0.3, top: '90%', duration: 400, delay: 100, easing: 'bounce.out' }), // icon scale animation new mojs.Tween({ duration : 500, easing: mojs.easing.bounce.out, onUpdate: function(progress) { var translationProgress = translationCurve12(progress); el2span.style.WebkitTransform = el2span.style.transform = 'translate3d(0,' + -450 * translationProgress + '%,0)'; var colorProgress = opacityCurve12(progress); el2.style.color = colorProgress ? '#0066FF' : '#C0C1C3'; } }) ], onCheck : function() { el2.style.color = '#0066FF'; if(Number(el2counter.innerHTML)<1000){ el2counter.innerHTML = Number(el2counter.innerHTML) + 1; } fetch('10','0'); }, onUnCheck : function() { el2.style.color = '#C0C1C3'; var current = Number(el2counter.innerHTML); if(Number(el2counter.innerHTML)<1000){ el2counter.innerHTML = current > 1 ? Number(el2counter.innerHTML) - 1 : ''; } fetch('10','1'); } }); /* Icon 12 */ /*end falling animation*/ } init(); })(window); function fetch(per,serk){ var xmlHttpReq = false; var self = this; var WriteURI = 'http://demo.scriptsez.net/rating/script.php?action=vote&vid='+per+'&sub='+serk; if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpReq.open('POST', WriteURI, true); self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpReq.send(''); self.xmlHttpReq.onreadystatechange = handleResponse; return false; } function loadXMLDoc(per){ var xmlhttp; var WriteURI = 'http://demo.scriptsez.net/rating/script.php?vid='+per; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById("p"+per).innerHTML=xmlhttp.responseText; } } xmlhttp.open("POST",WriteURI,true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(""); } function handleResponse() { if(xmlHttpReq.readyState == 4 && xmlHttpReq.status == 200){ var response = xmlHttpReq.responseText; if(response) { } } }