frontend.js 3.38 KB
!function(n){function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e={};t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:i})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=5)}([,,,,,function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(6),o=e.n(i);/*!
 * getwid-content-timeline
 */
!function(n){var t=this;n(document).ready(function(e){n(document.body).on("post-load",function(n){i()});var i=function(){n(".wp-block-getwid-content-timeline:not(.getwid-init)").each(function(e,i){n(t).addClass("getwid-init");var c=!1,r="wp-block-getwid-content-timeline-item",a=n(i).find(".".concat(r)),s="none"!=n(i).data("animation")?n(i).data("animation"):null,d=n(i).find("div[class$=__point]").data("point-color"),u=n(i).data("filling");n.each(a,function(t,e){s&&(e.getBoundingClientRect().top>.8*window.innerHeight?n(e).addClass("is-hidden"):n(e).addClass(s));var i=n(e).find(".".concat(r,"__content-wrapper"));(0==i.children().length||i.find(".".concat(r,"__mobile-meta")).is(":only-child"))&&i.addClass("has-no-content")});var l=function(t){n.each(a,function(e,i){n(i).hasClass("is-hidden")&&i.getBoundingClientRect().top<=.8*window.innerHeight&&(n(i).removeClass("is-hidden"),n(i).addClass(t))}),c=!1};s&&n(document).scroll(function(){c||(c=!0,window.requestAnimationFrame?window.requestAnimationFrame(function(){return l(s)}):setTimeout(function(){return l(s)},250))});var f=n(window).height()/2,p=function(){var t=n(i).find(".".concat(r,"__point")),e=0;n.each(t,function(n,i){t[n+1]&&(e+=t[n+1].getBoundingClientRect().top-i.getBoundingClientRect().top)});var c=n(i).find("div[class$=__line]"),a=t.get(),s=o()(a),d=s[0],u=(s.slice(1),n(d).position().top+n(d).height()/2);c.css({height:e,top:u})},g=function(){var t=n(i).find(".".concat(r,"__point")),e=t.get(),c=o()(e);c[0],c.slice(1).length&&n.each(t,function(t,e){var i=e.getBoundingClientRect().top,o=n(e).parents(".".concat(r))[0];i<=f?(n(o).hasClass("is-active")||n(o).addClass("is-active"),n(e).find(":first-child").css({borderColor:d||""})):(n(o).hasClass("is-active")&&n(o).removeClass("is-active"),n(e).find(":first-child").css({borderColor:""}))})},h=function(){var t=n(i).find(".".concat(r,"__point")),e=n(i).find("div[class*=__bar]")[0],c=e.getBoundingClientRect().top,a=t.toArray(),s=o()(a),d=s[0],u=s.slice(1),l=f-d.getBoundingClientRect().top;if(u.length){var p=u.slice(-1).pop(),g=p.getBoundingClientRect().top;c<=f&&g>=f&&n(e).css({height:l}),c>=f&&n(e).css({height:0}),g<=f&&n(e).css({height:"100%"})}};n(document).ready(function(){var t=setInterval(function(){"complete"==document.readyState&&(p(),u&&(g(),h()),u&&n(document).scroll(function(){g(),h()}),clearInterval(t))},1e3)}),n(window).resize(function(){p(),u&&(g(),h())})})};i()})}(jQuery)},function(n,t,e){function i(n){return o(n)||c(n)||r()}var o=e(7),c=e(8),r=e(9);n.exports=i},function(n,t){function e(n){if(Array.isArray(n))return n}n.exports=e},function(n,t){function e(n){if(Symbol.iterator in Object(n)||"[object Arguments]"===Object.prototype.toString.call(n))return Array.from(n)}n.exports=e},function(n,t){function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.exports=e}]);