%PDF- %PDF-
Direktori : /home/tradesc/www/relax/wp-content/plugins/bdthemes-element-pack-lite/assets/vendor/js/ |
Current File : /home/tradesc/www/relax/wp-content/plugins/bdthemes-element-pack-lite/assets/vendor/js/ztext.min.js |
/*! * ztext.js v0.0.2 * https://bennettfeely.com/ztext * Licensed MIT | (c) 2020 Bennett Feely * ********** Warning ********** * Don't replace this files by update vendors. * Customized this file by - Shahidul Islam */ if(CSS.supports("-moz-transform-style","preserve-3d")||CSS.supports("-ms-transform-style","preserve-3d")||CSS.supports("-webkit-transform-style","preserve-3d")||CSS.supports("transform-style","preserve-3d")){z_default={depth:"1rem",direction:"both",event:"none",eventRotation:"30deg",eventDirection:"default",fade:!1,layers:10,perspective:"500px",z:!0};var zs=document.querySelectorAll("[data-z]");function Ztextify(e,t,n){document.querySelectorAll(e).forEach(e=>{zDraw(e,t,n)})}function zDraw(e,t,n){if("false"!==(t.zEngaged||z_default.zEngaged)){var r=t.depth||z_default.depth,a=r.match(/[a-z]+/)[0],s=parseFloat(r.replace(a,"")),o=t.direction||z_default.direction,l=t.event||z_default.event,d=t.eventRotation||z_default.eventRotation,c=d.match(/[a-z]+/)[0],p=parseFloat(d.replace(c,"")),f=t.eventDirection||z_default.eventDirection,u=t.fade||z_default.fade,v=t.layers||z_default.layers,y=t.perspective||z_default.perspective,w=t.transform||z_default.transform,z=n;e.innerHTML="",e.style.display="inline-block",e.style.position="relative",e.style.webkitPerspective=y,e.style.perspective=y;var h=document.createElement("span");h.setAttribute("class","z-text"),h.style.display="inline-block",h.style.webkitTransformStyle="preserve-3d",h.style.transformStyle="preserve-3d";var m=document.createElement("span");for(m.setAttribute("class","z-layers"),m.style.display="inline-block",m.style.webkitTransformStyle="preserve-3d",m.style.transformStyle="preserve-3d",h.append(m),i=0;i<v;i++){let e=i/v;var b=document.createElement("span");if(b.setAttribute("class","z-layer"),b.innerHTML=z,b.style.display="inline-block","backwards"===o)var g=-e*s;if("both"===o)g=-e*s+s/2;if("forwards"===o)g=-e*s+s;w="translateZ("+g+a+")";b.style.webkitTransform=w,b.style.transform=w,i>=1&&(b.style.position="absolute",b.style.top=0,b.style.left=0,b.setAttribute("aria-hidden","true"),b.style.pointerEvents="none",b.style.mozUserSelect="none",b.style.msUserSelect="none",b.style.webkitUserSelect="none",b.style.userSelect="none",!0!==u&&"true"!==u||(b.style.opacity=(1-e)/2)),m.append(b)}function _(e,t){if("reverse"==f)var n=-1;else n=1;var r=e*p*n,i=-t*p*n,a=(Math.min(Math.max(r,-1),1),Math.min(Math.max(i,-1),1),"rotateX("+i+c+") rotateY("+r+c+")");m.style.webkitTransform=a,m.style.transform=a}if(e.append(h),"pointer"===l&&(window.addEventListener("mousemove",e=>{_(2*(e.clientX/window.innerWidth-.5),2*(e.clientY/window.innerHeight-.5))},!1),window.addEventListener("touchmove",e=>{_(2*(e.touches[0].clientX/window.innerWidth-.5),2*(e.touches[0].clientY/window.innerHeight-.5))},!1)),"scroll"==l){function S(){var t=e.getBoundingClientRect(),n=t.left+t.width/2-window.innerWidth/2,r=t.top+t.height/2-window.innerHeight/2;_(n/window.innerWidth*-2,r/window.innerHeight*-2)}S(),window.addEventListener("scroll",S,!1)}if("scrollY"==l){function E(){var t=e.getBoundingClientRect();_(0,(t.top+t.height/2-window.innerHeight/2)/window.innerHeight*-2)}E(),window.addEventListener("scroll",E,!1)}if("scrollX"==l){function k(){var t=e.getBoundingClientRect();_((t.left+t.width/2-window.innerWidth/2)/window.innerWidth*-2,0)}k(),window.addEventListener("scroll",k,!1)}}}zs.forEach(e=>{options={depth:e.dataset.zDepth||z_default.depth,direction:e.dataset.zDirection||z_default.direction,event:e.dataset.zEvent||z_default.event,eventRotation:e.dataset.zEventrotation||z_default.eventRotation,eventDirection:e.dataset.zEventdirection||z_default.eventDirection,fade:e.dataset.zFade||z_default.fade,layers:parseFloat(e.dataset.zLayers)||z_default.layers,perspective:e.dataset.zPerspective||z_default.perspective,zEngaged:e.dataset.z||z_default.z},zDraw(e,options)})}else console.error("ztext is disabled because transform-style: preserve-3d; is unsupported");