赛亿官网

awb.min.js 9.7KB

    !function(t){var e={};function a(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)a.d(n,i,function(e){return t[e]}.bind(null,i));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=1)}({0:function(t,e,a){var n=a(2),i=n.requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame||function(t){var e=+new Date,a=Math.max(0,16-(e-o)),n=setTimeout(t,a);return o=e,n},o=+new Date;var r=n.cancelAnimationFrame||n.webkitCancelAnimationFrame||n.mozCancelAnimationFrame||clearTimeout;Function.prototype.bind&&(i=i.bind(n),r=r.bind(n)),(t.exports=i).cancel=r},1:function(t,e,a){t.exports=a(18)},18:function(t,e,a){"use strict";function n(t,e,a,n){var i,o=!1,r=0;function s(){i&&clearTimeout(i)}function c(){var c=this,l=Date.now()-r,d=arguments;function u(){r=Date.now(),a.apply(c,d)}function f(){i=void 0}o||(n&&!i&&u(),s(),void 0===n&&l>t?u():!0!==e&&(i=setTimeout(n?f:u,void 0===n?t-l:t)))}return"boolean"!=typeof e&&(n=a,a=e,e=void 0),c.cancel=function(){s(),o=!0},c}a.r(e);var i=a(0),o=a.n(i);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)} /*! * Name : Advanced WordPress Backgrounds * Author : nK https://nkdev.info */var s=window,c=s.AWBData,l=s.objectFitImages,d=window.jQuery,u=d(window),f=d(document),w=/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/g.test(navigator.userAgent||navigator.vendor||window.opera),b=!!document.documentMode,g=!b&&!!window.StyleMedia,h="undefined"!=typeof InstallTrigger,m=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),p=!!window.chrome&&!!window.chrome.webstore,v=!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,k=0,y=0;function x(){k=u.width(),y=u.height()}x(),u.on("resize load orientationchange",x),void 0!==l&&l(".jarallax-img");var _=!1,M=!1;function F(t,e){var a=t[0].getBoundingClientRect(),n=1;if(a.right<=0||a.left>=k)n=0;else if(a.bottom<0&&a.top<=y)n=0;else{var i=Math.max(0,a.height+a.top),o=Math.max(0,a.height-(a.top+a.height-y)),r=Math.max(0,-a.top),s=Math.max(0,a.top+a.height-y);a.height<y?n=1-(r||s)/a.height:i<=y?n=i/y:o<=y&&(n=o/y),n=n<0?0:n}return e?[n,a]:n}c.settings&&c.settings.disable_parallax&&c.settings.disable_parallax.length&&c.settings.disable_parallax.forEach((function(t){if(!_)switch(t){case"everywhere":_=!0;break;case"mobile":_=w;break;case"ie":_=b;break;case"edge":_=g;break;case"firefox":_=h;break;case"safari":_=m;break;case"chrome":_=p;break;case"opera":_=v}})),c.settings&&c.settings.disable_video&&c.settings.disable_video.length&&c.settings.disable_video.forEach((function(t){if(!M)switch(t){case"everywhere":M=!0;break;case"mobile":M=w;break;case"ie":M=b;break;case"edge":M=g;break;case"firefox":M=h;break;case"safari":M=m;break;case"chrome":M=p;break;case"opera":M=v}}));var j,S=!1,z=1;var A=n(200,(function(t,e,a){o()((function(){!function(t,e,a){var n,i,o;S.each((function(){var s=d(this);"object"===r(n=s.data("awb-mouse-data"))&&(n.is_in_viewport||a&&z)&&(a?(i=-n.size*t,o=-n.size*e):(i=(n.rect.width-(t-n.rect.left))/n.rect.width,o=(n.rect.height-(e-n.rect.top))/n.rect.height,(i>1||i<0||o>1||o<0)&&(i=.5,o=.5),i=n.size*(i-.5)*2,o=n.size*(o-.5)*2),a&&z?s.css({transform:"translateX(".concat(i,"px) translateY(").concat(o,"px) translateZ(0)")}):s.css({transition:"transform ".concat(a?2:n.speed,"s cubic-bezier(.22, .63, .6, .88)"),transform:"translateX(".concat(i,"px) translateY(").concat(o,"px) translateZ(0)")}))})),z=0}(t,e,a)}))}));function C(t){clearTimeout(j),t?o()((function(){var t=d(".nk-awb .nk-awb-wrap.nk-awb-mouse-parallax").children(".nk-awb-inner");t.length&&(S?S=t:(S=t,w&&window.DeviceOrientationEvent?u.on("deviceorientation",(function(t){A(t.originalEvent.gamma/90,t.originalEvent.beta/180,!0)})):u.on("mousemove",(function(t){A(t.clientX,t.clientY)})))),S&&S.each((function(){var t=d(this),e=t.parent(),a=parseFloat(e.attr("data-awb-mouse-parallax-size"))||30,n=parseFloat(e.attr("data-awb-mouse-parallax-speed"))||1e4;t.data("awb-mouse-data",{is_in_viewport:F(e)?e.is(":visible"):0,rect:e[0].getBoundingClientRect(),size:a,speed:n/1e3}),t.css({left:-a,right:-a,top:-a,bottom:-a})}))})):j=setTimeout(j,100)}function O(){d(".nk-awb:not(.wpb_column)").children('.nk-awb-wrap[data-awb-stretch="true"]').each((function(){var t=d(this),e=this.getBoundingClientRect(),a=e.left,n=k-e.right,i=parseFloat(t.css("margin-left")||0),o=parseFloat(t.css("margin-right")||0);t.css({"margin-left":i-a,"margin-right":o-n})})),d(".nk-awb.wpb_column").children('.nk-awb-wrap[data-awb-stretch="true"]').each((function(){var t=d(this),e=t.closest(".vc_row"),a=t.closest(".wpb_column"),n=this.getBoundingClientRect(),i=e[0].getBoundingClientRect(),o=a[0].getBoundingClientRect(),r=n.left,s=k-n.right,c=i.left+(parseFloat(e.css("padding-left"))||0),l=k-i.right+(parseFloat(e.css("padding-right"))||0),u=o.left,f=k-o.right,w={"margin-left":0,"margin-right":0};if(Math.round(c)===Math.round(u)){var b=parseFloat(t.css("margin-left")||0);w["margin-left"]=b-r}if(Math.round(l)===Math.round(f)){var g=parseFloat(t.css("margin-right")||0);w["margin-right"]=g-s}t.css(w)})),c.settings.full_width_fallback&&d(".nk-awb.alignfull").each((function(){var t=d(this).children(".nk-awb-wrap");if(t[0]){var e=t[0].getBoundingClientRect(),a=e.left,n=k-e.right,i=e.bottom,o=parseFloat(t.css("margin-left")||0),r=parseFloat(t.css("margin-right")||0),s=parseFloat(t.css("margin-bottom")||0),c=o-a,l=r-n,u="";if(t.closest(".ghostkit-col").length){var f=t.closest(".ghostkit-grid"),w=t.closest(".ghostkit-col"),b=f[0].getBoundingClientRect(),g=w[0].getBoundingClientRect(),h=b.left,m=k-b.right,p=g.left,v=k-g.right,y=g.bottom;Math.round(h)!==Math.round(p)&&(c=p-a+o),Math.round(m)!==Math.round(v)&&(l=v-n+r),u=s-(y-i)}t.css({"margin-left":c,"margin-right":l,"margin-bottom":u})}}))}u.on("resize scroll orientationchange load",C),setInterval(C,3e3);var T="";f.on("jetpack-lazy-loaded-image",".jarallax-img",(function(t){var e=d(t.target).parent().parent();e[0].jarallax&&e[0].jarallax.image&&e[0].jarallax.image.$item&&(e[0].jarallax.image.$item=t.target)})),window.nkAwbInit=function(){var t=d(".nk-awb .nk-awb-wrap[data-awb-mouse-parallax-size]:not(.nk-awb-mouse-parallax)");t.length&&(t.addClass("nk-awb-mouse-parallax"),C(!0)),d(".nk-awb-after-vc_row").each((function(){var t=d(this),e=t.prev(".vc_clearfix"),a=((e=!!e.length&&e)||t).prev(".vc_row:not(.nk-awb)");if(a.length){var n=t.children(".nk-awb-wrap");a.is("[data-vc-full-width=true]")&&n.removeAttr("data-awb-stretch"),a.addClass("nk-awb"),a.append(n)}t.remove()})),d(".nk-awb-after-vc_column").each((function(){var t=d(this),e=t.prev(".wpb_column:not(.nk-awb)"),a=e.closest(".vc_row");if(e.length){var n=t.children(".nk-awb-wrap");a.is("[data-vc-stretch-content=true]")&&n.removeAttr("data-awb-stretch"),e.addClass("nk-awb"),e.append(n)}t.remove()})),function(){if(!window.GHOSTKIT){var t=d(".nk-awb[data-ghostkit-styles]");if(t.length){t.each((function(){T+=d(this).attr("data-ghostkit-styles"),d(this).removeAttr("data-ghostkit-styles")}));var e=d("#ghostkit-awb-custom-css-inline-css");e.length||(e=d('<style id="ghostkit-awb-custom-css-inline-css">').appendTo("head")),e.html(T)}}}(),O(),void 0!==d.fn.jarallax&&d(".nk-awb .nk-awb-wrap:not(.nk-awb-rendered)").each((function(){var t=d(this).addClass("nk-awb-rendered"),e=t.attr("data-awb-type"),a=t.attr("data-awb-image-background-size"),n=t.attr("data-awb-image-background-position"),i=!1,o=0,r=0,s=0,c=!0,l=!0,u=!1,f=t.attr("data-awb-parallax"),b=t.attr("data-awb-parallax-speed"),g="true"===t.attr("data-awb-parallax-mobile")||"1"===t.attr("data-awb-parallax-mobile");if("yt_vm_video"!==e&&"video"!==e||(i=t.attr("data-awb-video"),o=parseFloat(t.attr("data-awb-video-start-time"))||0,r=parseFloat(t.attr("data-awb-video-end-time"))||0,s=parseFloat(t.attr("data-awb-video-volume"))||0,c="false"!==t.attr("data-awb-video-loop"),l="true"===t.attr("data-awb-video-always-play"),u="1"===t.attr("data-awb-video-mobile")||"true"===t.attr("data-awb-video-mobile"),!i||f||b||(f="scroll",b=1,g=u)),f||i){var h={type:f,speed:b,disableParallax:function(){return _||!g&&w},disableVideo:function(){return M||!u&&w},imgSize:a||"cover",imgPosition:n||"50% 50%"};"pattern"===a&&(h.imgSize="auto",h.imgRepeat="repeat"),i&&(h.speed=f?b:1,h.videoSrc=i,h.videoStartTime=o,h.videoEndTime=r,h.videoVolume=s,h.videoLoop=c,h.videoPlayOnlyVisible=!l),t.children(".nk-awb-inner").jarallax(h)}}))},o()((function(){window.nkAwbInit()}));var R=n(200,(function(){o()((function(){window.nkAwbInit()}))}));window.MutationObserver?new window.MutationObserver(R).observe(document.documentElement,{childList:!0,subtree:!0}):d(document).on("DOMContentLoaded DOMNodeInserted load",(function(){R()})),u.on("resize orientationchange load",n(200,O))},2:function(t,e,a){(function(e){var a;a="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=a}).call(this,a(3))},3:function(t,e){var a;a=function(){return this}();try{a=a||new Function("return this")()}catch(t){"object"==typeof window&&(a=window)}t.exports=a}});