fr.graniarcos.pt Open in urlscan Pro
94.46.168.230  Public Scan

URL: https://fr.graniarcos.pt/template/js/scroll.js
Submission: On December 20 via api from US — Scanned from PT

Form analysis 0 forms found in the DOM

Text Content

(function(){var a=document.createElement("style");a.innerHTML='.scrollable{-webkit-transform:translate3d(0,0,0)}.scrollability-scrollbar{position:absolute;top:0;right:2px;width:7px;height:1px;z-index:2147483647;opacity:0;-webkit-transform:translate3d(0,0,0);-webkit-box-sizing:border-box;-webkit-transform-origin:top left;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAABCAYAAADuHp8EAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC5JREFUeNpi/P//vyQDAwMjKytr2Z8/f9gYIICRAQH+Q/n/WVhYfgNBJ4gNEGAAhVUOGMTI0TwAAAAASUVORK5CYII=") no-repeat}',document.head.appendChild(a)})(),function(){(function(a,b,c){function d(){var a=[];a.push.apply(a,arguments),console.log(a.join(" "))}function E(){var a=document.createElement("style");document.head.appendChild(a),C=document.styleSheets[document.styleSheets.length-1]}function F(a){function f(a){a.preventDefault(),y=!0,e&&(clearTimeout(e),e=0),c&&(M(c),c=null);var b=g?a.touches[0]:a;w=b.clientX,x=b.clientY;if(A.length>1)for(var d=0;d<A.length;++d){var f=A[d];if(f.disable&&f.disable(w,x,u,v)){f.terminate(),A.splice(d--,1);if(A.length==1){var h=A[0];T("scrollability-lock",h.node,{direction:h.direction})}}}A.forEach(function(b){var c=b.filter(w,x);b.track(c,a.timeStamp)})}function h(a){if(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,1),c[0].dispatchEvent(b),M(c)}document.removeEventListener(g?"touchmove":"mousemove",f,!1),document.removeEventListener(g?"touchend":"mouseup",h,!1),A.forEach(function(a){a.takeoff()})}var b=g?a.touches[0]:a,c=null;w=u=b.clientX,x=v=b.clientY,y=!1,A=H(a.target,w,x,a.timeStamp);if(!A.length)return!0;var d=a.target,e=setTimeout(function(){e=0,c=L(d)},50);document.addEventListener(g?"touchmove":"mousemove",f,!1),document.addEventListener(g?"touchend":"mouseup",h,!1)}function G(a,b,c,d){function X(a,b){N.push({node:a,callback:b,keyframes:[]})}function Y(a){D=a}function Z(a){P=a,$(I,J)}function $(a,b){L=b-J,J=b,E=a-I,I=a,Math.abs(E)<i?++M:(M&&--M,M=0);if(f)if(v>x&&A==x){var c=v-x;E*=(1-c/G)*k}else if(v<w&&z==w){var c=w-v;E*=(1-c/G)*k}return v+=E,bc(v),e.style.webkitAnimationName="",N.forEach(function(a){a.node.style.webkitAnimationName=""}),!0}function _(a){var b=-w-x;if(u&&j<b){var c=j-q*2,d=c/b*c,e;if(a>x)d=Math.max(d-(a-x),r),e=0;else if(a<w){var f=d-(w-a);d=Math.max(d-(w-a),r),e=c-d}else e=Math.abs(a)/b*(c-d);return e+=q,"translate3d(0, "+Math.round(e)+"px,  0) "+"scaleY("+Math.round(d)+")"}}function ba(){M&&(E=0),v+=E,bc(v),E=E/L*s;var b=bb();if(!b.time){bf();return}T("scrollability-animate",e,{direction:a.direction,time:b.time,keyframes:b.keyframes}),e.cleanup&&e.cleanup(),C.insertRule(b.css,0),N.forEach(function(c,d){c.name="scrollability-track"+B++;var e=K(a,c.keyframes,c.name,b.time);C.insertRule(e,0)}),e.earlyEnd=function(){be(!0)},e.normalEnd=function(){bd(b.keyframes[b.keyframes.length-1].position),be()},e.cleanup=function(){delete e.cleanup,C.deleteRule(0),N.forEach(function(a){C.deleteRule(0)})},e.addEventListener("webkitAnimationEnd",e.normalEnd,!1),R(e,b.name,b.time),N.forEach(function(a){R(a.node,a.name,b.time)})}function bb(){function Q(a){var f=v-c;if(a||b-d>=t||e<0!=f<0)o.push({position:v,time:b}),N.forEach(function(a){a.keyframes.push({time:b,css:a.callback(v)})}),e=f,c=v,d=b}var b=0,c=v,d=0,e=0,i,k,m=0,n,o=[];if(g)if(Math.abs(v-x)>H||Math.abs(E)>p)if(v>x){if(x!=A){x+=j+D,w+=j+D;var q=w%j,r=-Math.round((v+j-q)/(j+D));T("scrollability-page",a.node,{page:r})}}else if(w!=z){x-=j+D,w-=j+D;var q=w%j,r=-Math.round((v-j-q)/(j+D));T("scrollability-page",a.node,{page:r})}var u=!0;while(u){if(v>x&&f)if(E>0){var y=v-x,C=1-y/G;E=Math.max(E-l,0)*C,v+=E}else m||(i=v,k=x-v),v=O(m,i,k,F),u=++m<=F&&Math.floor(Math.abs(v))>x;else if(v<w&&f)if(E<0){var y=w-v,C=1-y/G;E=Math.min(E+l,0)*C,v+=E}else m||(i=v,k=w-v),v=O(m,i,k,F),u=++m<=F&&Math.ceil(v)<w;else{u=Math.floor(Math.abs(E)*10)>0;if(!u)break;E*=h,v+=E}Q(!u),b+=s}if(g){var I=Math.round(v/(j+D));v=I*(j+D),Q(!0)}else v>x&&f?(v=x,Q(!0)):v<w&&f&&(v=w,Q(!0));var J=o.length?o[o.length-1].time:0,L="scrollability"+B++,M=K(a,o,L,J,P);return{time:J,position:v,keyframes:o,name:L,css:M}}function bc(b){if(!T("scrollability-scroll",e,{direction:a.direction,position:b}))return;bd(b),u&&y&&S(u)}function bd(b){e.style.webkitTransform=a.update(b+P),e.scrollableOffset=P,N.forEach(function(a){a.node.style.webkitTransform=a.callback(b)})}function be(b){u&&(b?S(u):(u.style.opacity="0",u.style.webkitTransition="opacity 0.33s linear")),e.removeEventListener("webkitAnimationEnd",e.normalEnd,!1),delete e.earlyEnd,delete e.normalEnd,a.mute||T("scrollability-end",e)}function bf(){be()}var e=a.node,f=a.constrained,g=a.paginated,j=a.viewport||0,u=a.scrollbar,v=a.position,w=a.min,x=a.max,z=w,A=Math.round(x/j)*j,D=0,E=0,F=g?n:m,G=a.bounce,H=j*o,I=startTouch=a.filter(b,c),J=d,L=0,M=0,N=[],P=e.scrollableOffset||0;if(!a.mute){var Q={position:v,track:X,setSpacing:Y,setOffset:Z};if(!T("scrollability-start",e,Q))return null}if(g){if(D===undefined){var U=Math.round(Math.abs(z)%j),V=(Math.abs(z)-U)/j+1;D=U/V}var W=Math.round(v/(j+D));w=x=W*(j+D),z+=D}return u&&(X(u,_),u.parentNode||e.parentNode.appendChild(u)),e.earlyEnd&&(R(e),N.forEach(function(a){R(a.node)}),e.earlyEnd(),bc(v)),a.reposition=bc,a.track=$,a.takeoff=ba,a.terminate=bf,a}function H(a,b,c,d){var e=[],f=document.querySelectorAll(".scrollable.universal");for(var g=0;g<f.length;++g)I(f[g],e,b,c,d);return f.length||I(a,e,b,c,d),e}function I(a,b,c,d,e){while(a){if(a.nodeType==1){var f=J(a,c,d,e);if(f){var g=!1;for(var h=0;h<b.length;++h)if(b[h].node==a){g=!0;break}g||(f=G(f,c,d,e),f&&b.push(f))}}a=a.parentNode}}function J(a,b,c,d){var e=a.className.split(" ");if(e.indexOf("scrollable")==-1)return;for(var f=0;f<e.length;++f){var g=e[f];if(D[g]){var h=D[g](a);return h.direction=g,h.paginated=e.indexOf("paginated")!=-1,h}}}function K(a,b,c,d,e){var f=["@-webkit-keyframes "+c+" {"];return b.forEach(function(b){var c=b.time/d*100,g=Math.floor(c)+"% {"+"-webkit-transform: "+(b.css||a.update(b.position+e))+";"+"}";f.push(g)}),f.push("}"),f.join("\n")}function L(a){var b=[];for(var c=a;c;c=c.parentNode)c.nodeType==1&&(c.className=(c.className?c.className+" ":"")+"touched",b.push(c));return b}function M(a){for(var b=0;b<a.length;++b){var c=a[b];c.className=c.className.replace("touched","")}}function N(a){if(!a.scrollableScrollbar){var b=a.scrollableScrollbar=document.createElement("div");b.className="scrollability-scrollbar"}return a.scrollableScrollbar}function O(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}function P(a){var b=a.parentNode,c=a.querySelector(".scrollable > .clipper")||a;a.style.webkitAnimation&&(a.style.webkitAnimationPlayState="paused");var d=getComputedStyle(a).webkitTransform,e=(new WebKitCSSMatrix(d)).m41-(a.scrollableOffset||0);return{node:a,min:-c.offsetWidth+b.offsetWidth,max:0,position:e,viewport:b.offsetWidth,bounce:b.offsetWidth*k,constrained:!0,filter:function(a,b){return a},disable:function(a,b,c,d){var e=Math.abs(a-c),f=Math.abs(b-d);if(f>e&&f>j)return!0},update:function(a){return"translate3d("+Math.round(a)+"px, 0, 0)"}}}function Q(a){var b=a.parentNode,c=a.querySelector(".scrollable > .clipper")||a;a.style.webkitAnimation&&(a.style.webkitAnimationPlayState="paused");var d=getComputedStyle(a).webkitTransform,e=(new WebKitCSSMatrix(d)).m42;return{node:a,scrollbar:N(a),position:e,min:-c.offsetHeight+b.offsetHeight,max:0,viewport:b.offsetHeight,bounce:b.offsetHeight*k,constrained:!0,filter:function(a,b){return b},disable:function(a,b,c,d){var e=Math.abs(a-c),f=Math.abs(b-d);if(e>f&&e>j)return!0},update:function(a){return"translate3d(0, "+Math.round(a)+"px, 0)"}}}function R(a,b,c){b&&(a.style.webkitAnimation=b+" "+c+"ms linear both"),a.style.webkitAnimationPlayState=b?"running":"paused"}function S(a){a.style.webkitTransition="",a.style.opacity="1"}function T(a,b,c){var d=document.createEvent("Events");d.initEvent(a,!1,!0);if(c)for(var a in c)d[a]=c[a];return b.dispatchEvent(d)}"style scrollability/scrollbar.css";var e="webkitTransform"in document.documentElement.style,f=e&&/OS 5_/.exec(navigator.userAgent),g="ontouchstart"in window,h=.9925,i=4,j=10,k=.75,l=.01,m=240,n=160,o=.5,p=2,q=2,r=7,s=4,t=24,u,v,w,x,y,z=0,A=[],B=0,C,D={horizontal:P,vertical:Q};b.directions=D,b.flashIndicators=function(){},a.ready(function(){document.addEventListener(g?"touchstart":"mousedown",F,!1),window.addEventListener("load",E,!1)})})({ready:function(a){a()}},window,{exports:window})}();