芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/portpulselogistics.com/public/themes/html/assets/js/libraries/jarallax.js
/**! Jarallax Version : 1.7.3 GitHub : https://github.com/nk-o/jarallax */ !function(a){"use strict";function l(){j=a.innerWidth||document.documentElement.clientWidth,k=a.innerHeight||document.documentElement.clientHeight}function o(a,b,c){a.addEventListener?a.addEventListener(b,c):a.attachEvent("on"+b,function(){c.call(a)})}function p(b){a.requestAnimationFrame(function(){"scroll"!==b.type&&l();for(var a=0,c=m.length;a
0&&"none"!==c}(),c=navigator.userAgent.toLowerCase().indexOf("android")>-1,d=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!a.MSStream,e=!!a.opera,f=/Edge\/\d+/.test(navigator.userAgent),g=/Trident.*rv[ :]*11\./.test(navigator.userAgent),h=!!Function("/*@cc_on return document.documentMode===10@*/")(),i=document.all&&!a.atob;l();var m=[],n=function(){function b(b,i){var k,j=this;if(j.$item=b,j.defaults={type:"scroll",speed:.5,imgSrc:null,imgWidth:null,imgHeight:null,enableTransform:!0,elementInViewport:null,zIndex:-100,noAndroid:!1,noIos:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null},k=JSON.parse(j.$item.getAttribute("data-jarallax")||"{}"),j.options=j.extend({},j.defaults,k,i),!(c&&j.options.noAndroid||d&&j.options.noIos)){j.options.speed=Math.min(2,Math.max(-1,parseFloat(j.options.speed)));var l=j.options.elementInViewport;l&&"object"==typeof l&&void 0!==l.length&&(l=l[0]),!l instanceof Element&&(l=null),j.options.elementInViewport=l,j.instanceID=a++,j.image={src:j.options.imgSrc||null,$container:null,$item:null,width:j.options.imgWidth||null,height:j.options.imgHeight||null,useImgTag:d||c||e||g||h||f},j.initImg()&&j.init()}}var a=0;return b}();n.prototype.css=function(b,c){if("string"==typeof c)return a.getComputedStyle?a.getComputedStyle(b).getPropertyValue(c):b.style[c];c.transform&&(c.WebkitTransform=c.MozTransform=c.transform);for(var d in c)b.style[d]=c[d];return b},n.prototype.extend=function(a){a=a||{};for(var b=1;b
1?n=Math.abs(l-k):i<0?n=l/i+Math.abs(l):n+=Math.abs(k-e)*(1-i),l/=2),m=n*g/h,m
=0&&h.right>=0&&h.top<=k&&h.left<=j,a||c.isElementInViewport){var l=Math.max(0,e),m=Math.max(0,f+e),n=Math.max(0,-e),o=Math.max(0,e+f-k),p=Math.max(0,f-(e+f-k)),q=Math.max(0,-e+k-f),r=1-2*(k-e)/(k+f),s=1;if(f
=200&&this.status<400){var c=JSON.parse(this.responseText);b.videoImage=c[0].thumbnail_large,a(b.videoImage)}},f.send(),f=null}},e.prototype.getIframe=function(b){var c=this;if(c.$iframe)return void b(c.$iframe);c.onAPIready(function(){function k(a,b,c){var d=document.createElement("source");d.src=b,d.type=c,a.appendChild(d)}var e;if(c.$iframe||(e=document.createElement("div"),e.style.display="none"),"youtube"===c.type){c.playerOptions={},c.playerOptions.videoId=c.videoID,c.playerOptions.playerVars={autohide:1,rel:0,autoplay:0},c.options.controls||(c.playerOptions.playerVars.iv_load_policy=3,c.playerOptions.playerVars.modestbranding=1,c.playerOptions.playerVars.controls=0,c.playerOptions.playerVars.showinfo=0,c.playerOptions.playerVars.disablekb=1);var f,g;c.playerOptions.events={onReady:function(a){c.options.mute&&a.target.mute(),c.options.autoplay&&c.play(c.options.startTime),c.fire("ready",a)},onStateChange:function(a){c.options.loop&&a.data===YT.PlayerState.ENDED&&c.play(c.options.startTime),f||a.data!==YT.PlayerState.PLAYING||(f=1,c.fire("started",a)),a.data===YT.PlayerState.PLAYING&&c.fire("play",a),a.data===YT.PlayerState.PAUSED&&c.fire("pause",a),a.data===YT.PlayerState.ENDED&&c.fire("end",a),c.options.endTime&&(a.data===YT.PlayerState.PLAYING?g=setInterval(function(){c.options.endTime&&c.player.getCurrentTime()>=c.options.endTime&&(c.options.loop?c.play(c.options.startTime):c.pause())},150):clearInterval(g))}};var h=!c.$iframe;if(h){var i=document.createElement("div");i.setAttribute("id",c.playerID),e.appendChild(i),document.body.appendChild(e)}c.player=c.player||new a.YT.Player(c.playerID,c.playerOptions),h&&(c.$iframe=document.getElementById(c.playerID),c.videoWidth=parseInt(c.$iframe.getAttribute("width"),10)||1280,c.videoHeight=parseInt(c.$iframe.getAttribute("height"),10)||720)}if("vimeo"===c.type){c.playerOptions="",c.playerOptions+="player_id="+c.playerID,c.playerOptions+="&autopause=0",c.options.controls||(c.playerOptions+="&badge=0&byline=0&portrait=0&title=0"),c.playerOptions+="&autoplay="+(c.options.autoplay?"1":"0"),c.playerOptions+="&loop="+(c.options.loop?1:0),c.$iframe||(c.$iframe=document.createElement("iframe"),c.$iframe.setAttribute("id",c.playerID),c.$iframe.setAttribute("src","https://player.vimeo.com/video/"+c.videoID+"?"+c.playerOptions),c.$iframe.setAttribute("frameborder","0"),e.appendChild(c.$iframe),document.body.appendChild(e)),c.player=c.player||new Vimeo.Player(c.$iframe),c.player.getVideoWidth().then(function(a){c.videoWidth=a||1280}),c.player.getVideoHeight().then(function(a){c.videoHeight=a||720}),c.player.setVolume(c.options.mute?0:100);var j;c.player.on("timeupdate",function(a){j||c.fire("started",a),j=1,c.options.endTime&&c.options.endTime&&a.seconds>=c.options.endTime&&(c.options.loop?c.play(c.options.startTime):c.pause())}),c.player.on("play",function(a){c.fire("play",a),c.options.startTime&&0===a.seconds&&c.play(c.options.startTime)}),c.player.on("pause",function(a){c.fire("pause",a)}),c.player.on("ended",function(a){c.fire("end",a)}),c.player.on("loaded",function(a){c.fire("ready",a)})}if("local"===c.type){if(!c.$iframe){c.$iframe=document.createElement("video"),c.options.mute&&(c.$iframe.muted=!0),c.options.loop&&(c.$iframe.loop=!0),c.$iframe.setAttribute("id",c.playerID),e.appendChild(c.$iframe),document.body.appendChild(e);for(var l in c.videoID)k(c.$iframe,c.videoID[l],"video/"+l)}c.player=c.player||c.$iframe;var m;d(c.player,"playing",function(a){m||c.fire("started",a),m=1}),d(c.player,"timeupdate",function(){c.options.endTime&&c.options.endTime&&this.currentTime>=c.options.endTime&&(c.options.loop?c.play(c.options.startTime):c.pause())}),d(c.player,"play",function(a){c.fire("play",a)}),d(c.player,"pause",function(a){c.fire("pause",a)}),d(c.player,"ended",function(a){c.fire("end",a)}),d(c.player,"loadedmetadata",function(){c.videoWidth=this.videoWidth||1280,c.videoHeight=this.videoHeight||720,c.fire("ready"),c.options.autoplay&&c.play(c.options.startTime)})}b(c.$iframe)})},e.prototype.init=function(){var a=this;a.playerID="VideoWorker-"+a.ID};var f=0,g=0;e.prototype.loadAPI=function(){var b=this;if(!f||!g){var c="";if("youtube"!==b.type||f||(f=1,c="//www.youtube.com/iframe_api"),"vimeo"!==b.type||g||(g=1,c="//player.vimeo.com/api/player.js"),c){"file://"===a.location.origin&&(c="http:"+c);var d=document.createElement("script"),e=document.getElementsByTagName("head")[0];d.src=c,e.appendChild(d),e=null,d=null}}};var h=0,i=0,j=new c,k=new c;e.prototype.onAPIready=function(b){var c=this;if("youtube"===c.type&&("undefined"!=typeof YT&&0!==YT.loaded||h?"object"==typeof YT&&1===YT.loaded?b():j.done(function(){b()}):(h=1,a.onYouTubeIframeAPIReady=function(){a.onYouTubeIframeAPIReady=null,j.resolve("done"),b()})),"vimeo"===c.type)if("undefined"!=typeof Vimeo||i)"undefined"!=typeof Vimeo?b():k.done(function(){b()});else{i=1;var d=setInterval(function(){"undefined"!=typeof Vimeo&&(clearInterval(d),k.resolve("done"),b())},20)}"local"===c.type&&b()},a.VideoWorker=e}(window),function(){"use strict";if("undefined"!=typeof jarallax){var a=jarallax.constructor,b=a.prototype.init;a.prototype.init=function(){var a=this;b.apply(a),a.video&&a.video.getIframe(function(b){var c=b.parentNode;a.css(b,{position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",width:"100%",height:"100%",maxWidth:"none",maxHeight:"none",visibility:"visible",margin:0,zIndex:-1}),a.$video=b,a.image.$container.appendChild(b),c.parentNode.removeChild(c)})};var c=a.prototype.coverImage;a.prototype.coverImage=function(){var a=this;c.apply(a),a.video&&"IFRAME"===a.image.$item.nodeName&&a.css(a.image.$item,{height:a.image.$item.getBoundingClientRect().height+400+"px",marginTop:-200+parseFloat(a.css(a.image.$item,"margin-top"))+"px"})};var d=a.prototype.initImg;a.prototype.initImg=function(){var a=this,b=d.apply(a);if(a.options.videoSrc||(a.options.videoSrc=a.$item.getAttribute("data-jarallax-video")||!1),a.options.videoSrc){var c=new VideoWorker(a.options.videoSrc,{startTime:a.options.videoStartTime||0,endTime:a.options.videoEndTime||0});if(c.isValid()&&(a.image.useImgTag=!0,c.on("ready",function(){var b=a.onScroll;a.onScroll=function(){b.apply(a),a.isVisible()?c.play():c.pause()}}),c.on("started",function(){a.image.$default_item=a.image.$item,a.image.$item=a.$video,a.image.width=a.options.imgWidth=a.video.videoWidth||1280,a.image.height=a.options.imgHeight=a.video.videoHeight||720,a.coverImage(),a.clipContainer(),a.onScroll(),a.image.$default_item&&(a.image.$default_item.style.display="none")}),a.video=c,"local"!==c.type&&c.getImageURL(function(b){a.image.src=b,a.init()})),"local"!==c.type)return!1;if(!b)return a.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",!0}return b};var e=a.prototype.destroy;a.prototype.destroy=function(){var a=this;e.apply(a)}}}();