File: /var/www/linde/wp-content/themes/linde/frontend/js/core.bundle.js
"use strict";
(function ($) {
$(document).ready(function () {
var initialize = function initialize() {
//drawing line animation
var animateLine = document.querySelectorAll("[data-line]");
var animateArrows = document.querySelectorAll("[data-arrows]");
var firstLineRow = document.querySelector(".step-1");
var indexLine = 0;
var indexArrow = 0;
var flagLine = false;
var flagArrow = false;
function animateLineByLine() {
if (animateLine.length > 0) {
setTimeout(function () {
if (indexLine !== 2) {
animateLine[indexLine].classList.add("line-overlay__animate");
}
if (indexLine === 2) {
animateLine[indexLine].classList.add("line-overlay-3__animate");
}
indexLine++;
if (indexLine < animateLine.length) {
animateLineByLine();
}
}, indexLine === 0 ? 0 : 500 + indexLine * 10);
}
}
function animateArrowByArrow() {
if (animateArrows.length > 0) {
setTimeout(function () {
if (indexArrow === 0) {
animateArrows[indexArrow].classList.add("requirements__line-overlay-animate-left");
}
if (indexArrow === 1) {
animateArrows[indexArrow].classList.add("requirements__line-overlay-animate-right");
}
indexArrow++;
if (indexArrow < animateArrows.length) {
animateArrowByArrow();
}
}, indexArrow === 0 ? 0 : 500 + indexArrow * 10);
}
}
function isInViewport(element) {
if (element) {
var rect = element.getBoundingClientRect();
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
}
}
document.addEventListener("scroll", function () {
if (isInViewport(firstLineRow) && !flagLine) {
flagLine = true;
return animateLineByLine();
}
if (isInViewport(animateArrows[0]) && !flagArrow) {
flagArrow = true;
return animateArrowByArrow();
}
});
};
initialize();
window.LINDE_ANIMATION = initialize;
});
})(jQuery);
"use strict";
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
(function ($) {
$(document).ready(function () {
//This targets only Internet Explorer for optimization
var isIE = /*@cc_on!@*/false || !!document.documentMode;
if (isIE) {
var navLinks = document.querySelectorAll(".site-header__link");
for (var link = 0; link < navLinks.length; link++) {
if (navLinks[link].innerHTML === "Login") {
navLinks[link].setAttribute("href", "https://admin.vr.linde.com/");
navLinks[link].setAttribute("target", "_blank");
}
}
objectFitImages();
svg4everybody();
}
//End of Internet explorer optimization
AOS.init();
$(document).on("click", 'a[href^="#"]', function (event) {
var clickedHref = $(event.currentTarget).attr("href");
event.preventDefault();
if (clickedHref !== "#" && $("" + clickedHref).length) {
$("html, body").animate({ scrollTop: $(clickedHref).offset().top }, 1000);
}
});
var mediaQueryMobile = window.matchMedia("(min-width: 992px)");
//#region instagram carousel
if (!mediaQueryMobile.matches) {
var _$$owlCarousel;
// window width is less than 992px
$(".homepage-course-slider").owlCarousel((_$$owlCarousel = {
loop: true,
margin: 0,
nav: false,
dots: false
}, _defineProperty(_$$owlCarousel, "margin", 10), _defineProperty(_$$owlCarousel, "responsive", {
0: {
items: 1.2
},
600: {
items: 1.5
},
768: {
items: 2.2
}
}), _$$owlCarousel));
}
//#endregion
$(".homepage-articles-slider").owlCarousel({
margin: 0,
center: true,
nav: false,
dots: false,
loop: true,
responsive: {
0: {
items: 1.5
},
600: {
items: 1
},
768: {
items: 2,
center: false
}
}
});
var owl = $(".homepage-articles-slider");
$(".articles-slider-left").click(function () {
owl.trigger("prev.owl.carousel", [300]);
});
$(".articles-slider-right").click(function () {
owl.trigger("next.owl.carousel");
});
$(".homepage-testimonials-slider").owlCarousel({
margin: 0,
center: true,
nav: false,
dots: false,
responsive: {
0: {
items: 1.2,
loop: false
},
600: {
items: 1.5
},
768: {
items: 2,
center: false
}
}
});
var modulePickerOwl = $(".tabs-menu__tabs");
if (modulePickerOwl) {
var tabItems = document.querySelectorAll(".tabs-menu__tab");
var prevArrow = document.querySelector(".tabs-menu-arrow--left");
var nextArrow = document.querySelector(".tabs-menu-arrow--right");
var tabItemsContainer = document.querySelector(".owl-stage");
var counter = 0;
if (tabItems.length > 0 && prevArrow && nextArrow && tabItemsContainer) {
modulePickerOwl.owlCarousel({
margin: 20,
center: true,
nav: false,
dots: false,
loop: false,
stagePadding: 20,
responsive: {
0: {
items: 1.2
},
500: {
items: 1.5
},
768: {
items: 3.2
}
}
});
tabItems.forEach(function (item, index) {
if (item.classList.contains("tabs-menu--active")) {
var tabItemsContainerWidth = tabItemsContainer.offsetWidth;
var tabItemsContainerWidthParent = tabItemsContainer.parentElement.offsetWidth;
var result = (tabItemsContainerWidth - tabItemsContainerWidthParent) * -1;
counter = index;
modulePickerOwl.trigger("to.owl.carousel", [index, 300]);
if (tabItemsContainerWidthParent > 768) {
if (counter === tabItems.length - 1) {
tabItemsContainer.style.transform = "translateX(" + (result - 300) + "px)";
}
if (counter === 0) {
tabItemsContainer.style.transform = "translateX(300px)";
}
}
}
item.addEventListener("click", function () {
var tabItemsContainerWidth = tabItemsContainer.offsetWidth;
var tabItemsContainerWidthParent = tabItemsContainer.parentElement.offsetWidth;
var result = (tabItemsContainerWidth - tabItemsContainerWidthParent) * -1;
counter = index;
if (index !== 0 && index !== tabItems.length - 1) {
prevArrow.classList.remove("tabs-menu-arrow--disabled");
nextArrow.classList.remove("tabs-menu-arrow--disabled");
modulePickerOwl.trigger("to.owl.carousel", counter);
} else if (index === 0) {
tabItemsContainer.style.transform = "translateX(300px)";
prevArrow.classList.add("tabs-menu-arrow--disabled");
}
if (index === tabItems.length - 1) {
tabItemsContainer.style.transform = "translateX(" + (result - 300) + "px)";
nextArrow.classList.add("tabs-menu-arrow--disabled");
}
});
});
if (counter === 0) {
prevArrow.classList.add("tabs-menu-arrow--disabled");
} else {
prevArrow.classList.remove("tabs-menu-arrow--disabled");
}
if (counter === tabItems.length - 1) {
nextArrow.classList.add("tabs-menu-arrow--disabled");
} else {
nextArrow.classList.remove("tabs-menu-arrow--disabled");
}
prevArrow.addEventListener("click", function () {
var tabItemsContainerWidthParent = tabItemsContainer.parentElement.offsetWidth;
if (counter !== 0) {
counter = counter - 1;
$(tabItems[counter]).trigger("click");
modulePickerOwl.trigger("to.owl.carousel", counter);
}
if (counter === 0) {
if (tabItemsContainerWidthParent > 768) {
tabItemsContainer.style.transform = "translateX(300px)";
}
prevArrow.classList.add("tabs-menu-arrow--disabled");
nextArrow.classList.remove("tabs-menu-arrow--disabled");
} else {
prevArrow.classList.remove("tabs-menu-arrow--disabled");
}
if (counter !== tabItems.length - 1) {
nextArrow.classList.remove("tabs-menu-arrow--disabled");
}
});
nextArrow.addEventListener("click", function () {
var tabItemsContainerWidth = tabItemsContainer.offsetWidth;
var tabItemsContainerWidthParent = tabItemsContainer.parentElement.offsetWidth;
var result = (tabItemsContainerWidth - tabItemsContainerWidthParent) * -1;
if (counter !== tabItems.length - 1) {
counter = counter + 1;
$(tabItems[counter]).trigger("click");
modulePickerOwl.trigger("to.owl.carousel", counter);
}
if (counter === 0) {
prevArrow.classList.add("tabs-menu-arrow--disabled");
nextArrow.classList.remove("tabs-menu-arrow--disabled");
} else {
prevArrow.classList.remove("tabs-menu-arrow--disabled");
}
if (counter === tabItems.length - 1) {
if (tabItemsContainerWidthParent > 768) {
tabItemsContainer.style.transform = "translateX(" + (result - 300) + "px)";
}
nextArrow.classList.add("tabs-menu-arrow--disabled");
}
});
}
}
$(".tabs-item").hide();
$(".tabs-item--active").show();
$(".tabs-info--active").show();
var url = window.location.href;
$("#hiddenUrl").attr("value", url);
//#region Modal
$(".modal-form-trigger").click(function (e) {
e.preventDefault();
$(".modal-form").addClass("visible");
// if courses page, send active module name with url
if ($(this).parent().hasClass("tabs-info_tab")) {
var activeModuleName = $(".tabs-menu--active .tabs-menu__title").text();
var urlModule = window.location.href + " - " + activeModuleName;
$("#hiddenUrl").attr("value", urlModule);
}
});
$(".close-modal").click(function (e) {
e.preventDefault();
$(this).closest(".modal-window").removeClass("visible");
});
//#endregion
//#interview Modal
$(".modal-interview-trigger").click(function (e) {
e.preventDefault();
var id = $(this).data("trigger");
$("#modal_" + id).addClass("visible");
});
if ($("select").length) {
$("select").niceSelect();
}
$(".filter-btn").click(function (e) {
$(this).toggleClass("active");
$(".not-visible").toggleClass("show");
});
$("[data-ar-model]").click(function () {
var selectedModel = this.getAttribute("data-ar-model");
$("[data-ar-img]").removeClass("active");
$("[data-ar-model]").removeClass("active");
$(this).addClass("active");
$("[data-ar-img=\"" + selectedModel + "\"]").addClass("active");
$(".model-viewer").attr("id", "");
$("[data-ar-viewer=\"" + selectedModel + "\"]").attr("id", "active-viewer");
});
});
$(".popup .action-bar__item").click(function (e) {
e.preventDefault();
$(".popup__content").toggleClass("open");
});
$(".popup a.copy").click(function (e) {
e.preventDefault();
var temp = document.createElement("input"),
currentUrl = window.location.href;
document.body.appendChild(temp);
temp.value = currentUrl;
temp.select();
document.execCommand("copy");
document.body.removeChild(temp);
$(".popup__copy-text").fadeToggle("fast");
setTimeout(function () {
$(".popup__copy-text").fadeToggle("slow");
}, 1500);
});
function facebookShare() {
window.open("http://www.facebook.com/share.php?u=" + window.location.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");
return false;
}
function linkedinShare() {
window.open("http://www.linkedin.com/sharing/share-offsite/?url=" + window.location.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");
return false;
}
$(".js-facebook-share").click(function () {
facebookShare();
});
$(".js-linkedin-share").click(function () {
linkedinShare();
});
if ($(".model-viewer").length) {
var startAr = document.getElementById("start-ar-demo");
startAr.onclick = function (e) {
e.preventDefault();
var activeElement = document.getElementById("active-viewer");
activeElement.activateAR();
};
}
})(jQuery);
"use strict";
(function ($) {
$(document).ready(function () {
// const mediaQueryMobile = window.matchMedia("(min-width: 992px)");
// if (mediaQueryMobile.matches) {
// // window width is at least 992px
// } else {
// // window width is less than 992px
// }
var slideWrap = $("#js-slider");
var activeSlideId = 0;
var paginationItems = void 0;
var sliderItems = document.getElementsByClassName("slider__item-wrap");
var sliderItemsCount = sliderItems.length;
var sliderPagination = document.querySelector(".slider__pagination");
var autoplay = void 0;
var autoplayTimer = 8000;
if (sliderItems.length) {
// NEXT
var nextSlide = function nextSlide() {
var prevArrow = document.querySelector(".slider-arrows__left");
if (!prevArrow) {
return;
}
prevArrow.classList.remove("hide");
if (activeSlideId < sliderItems.length - 1) {
sliderItems[activeSlideId].classList.add("removing");
activeSlideId = activeSlideId + 1;
setTimeout(function () {
switchSlideNext(activeSlideId);
}, 1000);
updatePagination(activeSlideId);
}
if (activeSlideId === sliderItems.length - 1) {
document.querySelector(".slider-arrows__right").classList.add("hide");
}
};
var switchSlideNext = function switchSlideNext(id) {
sliderItems[id - 1].classList.remove("active");
sliderItems[id].classList.remove("next");
sliderItems[id].classList.add("active");
if (id < sliderItems.length - 1) {
sliderItems[id + 1].classList.add("next");
}
};
// PREV
var prevSlide = function prevSlide() {
document.querySelector(".slider-arrows__right").classList.remove("hide");
if (activeSlideId === 1) {
document.querySelector(".slider-arrows__left").classList.add("hide");
}
if (activeSlideId > 0) {
sliderItems[activeSlideId].classList.add("next");
if (activeSlideId === sliderItemsCount - 1) {} else {
sliderItems[activeSlideId + 1].classList.remove("next");
}
sliderItems[activeSlideId - 1].classList.add("active");
sliderItems[activeSlideId].classList.remove("active");
activeSlideId = activeSlideId - 1;
setTimeout(function () {
switchSlidePrev(activeSlideId);
}, 1000);
updatePagination(activeSlideId);
}
};
var switchSlidePrev = function switchSlidePrev(id) {
sliderItems[id].classList.remove("next");
sliderItems[id].classList.remove("removing");
};
var initPagination = function initPagination() {
for (var i = 0; i < sliderItemsCount; i++) {
var paginationItem = document.createElement("div");
paginationItem.className = "slider__pagination-item";
sliderPagination.appendChild(paginationItem);
}
paginationItems = document.getElementsByClassName("slider__pagination-item");
paginationItems[0].classList.add("active");
};
var updatePagination = function updatePagination(id) {
for (var i = 0; i < paginationItems.length; i++) {
paginationItems[i].classList.remove("active");
}
paginationItems[id].classList.add("active");
};
if (activeSlideId === 0) {
document.querySelector(".slider-arrows__left").classList.add("hide");
}
document.querySelector(".slider-arrows__right").addEventListener("click", function () {
clearInterval(autoplay);
setTimeout(function () {
autoplay = setInterval(function () {
return nextSlide();
}, autoplayTimer);
}, 500);
nextSlide();
});
document.querySelector(".slider-arrows__left").addEventListener("click", function () {
clearInterval(autoplay);
setTimeout(function () {
autoplay = setInterval(function () {
return nextSlide();
}, autoplayTimer);
}, 500);
prevSlide();
});
slideWrap.on("swipeleft", function (e, data) {
clearInterval(autoplay);
setTimeout(function () {
autoplay = setInterval(function () {
return nextSlide();
}, autoplayTimer);
}, 500);
nextSlide();
});
slideWrap.on("swiperight", function (e, data) {
clearInterval(autoplay);
setTimeout(function () {
autoplay = setInterval(function () {
return nextSlide();
}, autoplayTimer);
}, 500);
prevSlide();
});
initPagination();
autoplay = setInterval(function () {
return nextSlide();
}, autoplayTimer);
}
});
})(jQuery);
"use strict";
(function ($) {
$(document).ready(function () {
// Modal Contact Form Ajax reCaptcha validation
var contactForm = $(".js-contact-form");
var contactFormFeedbackSuccess = $(".js-contact-form-feedback.success");
var contactFormFeedbackError = $(".js-contact-form-feedback.error");
var loadingAnimation = $(".js-contact-form-loading");
var thankYouPageLink = contactFormFeedbackSuccess.attr("data-thank-you-link");
contactForm.submit(function (event) {
event.preventDefault();
contactFormFeedbackSuccess.hide();
contactFormFeedbackError.hide();
loadingAnimation.show();
grecaptcha.ready(function () {
grecaptcha.execute("6Lc_PDYqAAAAAILAbCYdOsNNquFpyxTI5IA7LE0L", { action: "submit" }).then(function (token) {
$.post(ajaxurl, {
action: "post_contact_form",
data: $(".js-contact-form").serialize(),
token: token
}, function (response) {
loadingAnimation.hide();
if (response.data.result == "success") {
window.location.href = thankYouPageLink;
} else {
loadingAnimation.hide();
contactFormFeedbackError.show().text("Error: " + response.data.msg);
}
}, "json").fail(function (data) {
// Form sending request failed
contactFormFeedbackError.show().text("There was an error trying to send your message. Please try again!");
loadingAnimation.hide();
});
});
});
});
});
})(jQuery);
"use strict";
document.addEventListener("DOMContentLoaded", function () {
var cookiesContainer = document.querySelector("[data-cookie-bar]");
if (!cookiesContainer) {
return;
}
var acceptAllCookiesBtn = cookiesContainer.querySelector("[data-cookies-accept-all-btn]");
var acceptCookiesBtn = cookiesContainer.querySelector("[data-cookies-accept-necessary-btn]");
var cookieSettingsContainer = cookiesContainer.querySelector("[data-cookies-settings]");
var cookieSettingsButton = cookiesContainer.querySelector("[data-cookies-settings-btn]");
var cookieSettingsForm = cookiesContainer.querySelector("[data-cookies-settings-form]");
// const saveCookiesPreferencesBtn = cookiesContainer.querySelector('[data-cookies-save-preferences-btn]')
var closeCookiesContainer = function closeCookiesContainer() {
cookiesContainer.style.display = "none";
};
// Accept all cookies event listener
acceptAllCookiesBtn.addEventListener("click", function () {
initThirdPartyScripts();
cookies.createCookie("cookiesCleared", "true", "365");
cookies.createCookie("marketingCookies", "true", "365");
closeCookiesContainer();
window.location.reload();
});
// Accept only necessary cookies event listener
acceptCookiesBtn.addEventListener("click", function () {
cookies.createCookie("cookiesCleared", "true", "365");
cookies.createCookie("marketingCookies", "false", "365");
closeCookiesContainer();
});
// Save preferences form submit event listener
cookieSettingsForm.addEventListener("submit", function (e) {
e.preventDefault();
var isPerformanceChecked = cookieSettingsForm.querySelector("#performance").checked;
cookies.createCookie("cookiesCleared", "true", "365");
if (isPerformanceChecked) {
cookies.createCookie("marketingCookies", "true", "365");
window.location.reload();
} else {
cookies.createCookie("marketingCookies", "false", "365");
}
closeCookiesContainer();
});
// Show/hide cookie settings event listener
cookieSettingsButton.addEventListener("click", function () {
cookieSettingsContainer.classList.toggle("cookie__settings--visible");
if (cookiesContainer.style.overflowY === "auto") {
cookiesContainer.style.overflowY = "hidden";
} else {
cookiesContainer.style.overflowY = "auto";
}
});
// Read cookies
var cookiesCleared = cookies.readCookie("cookiesCleared");
var marketingCookies = cookies.readCookie("marketingCookies");
// Init third party scripts if marketing cookies are accepted
if (marketingCookies === "true") {
initThirdPartyScripts();
}
// Show cookies if cookies are not cleared yet
if (!cookiesCleared) {
cookiesContainer.style.display = "block";
}
});
var initThirdPartyScripts = function initThirdPartyScripts() {
// Pardot tracking
window.piAId = "311981";
window.piCId = "34893";
window.piHostname = "pi.pardot.com";
(function () {
function async_load() {
var s = document.createElement("script");
s.type = "text/javascript";
s.src = ("https:" == document.location.protocol ? "https://pi" : "http://cdn") + ".pardot.com/pd.js";
var c = document.getElementsByTagName("script")[0];
c.parentNode.insertBefore(s, c);
}
if (window.attachEvent) {
window.attachEvent("onload", async_load);
} else {
window.addEventListener("load", async_load, false);
}
})();
// Global site tag (gtag.js) - Google Analytics
var scriptTag = document.createElement("script");
scriptTag.src = "https://www.googletagmanager.com/gtag/js?id=" + googleAnalyticsTrackingId;
document.head.appendChild(scriptTag);
gtag("js", new Date());
gtag("config", "" + googleAnalyticsTrackingId);
};
var cookies = {
createCookie: function createCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
var expires = "; expires=" + date.toUTCString();
} else var expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
},
readCookie: function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(";");
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == " ") {
c = c.substring(1, c.length);
}if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
},
eraseCookie: function eraseCookie(name) {
createCookie(name, "", -1);
}
};
"use strict";
(function ($) {
$(document).ready(function () {
var hoverCircles = document.querySelectorAll("[data-customized-training]");
var modal = document.querySelectorAll("[data-modal-customized-training]");
var closeModal = document.querySelectorAll("[data-modal-close]");
var modalAbout = document.querySelectorAll(".customized-training-modal__about");
//This targets only Internet Explorer for optimization
var isIE = /*@cc_on!@*/false || !!document.documentMode;
if (isIE) {
var _loop = function _loop(index) {
hoverCircles[index].addEventListener("click", function () {
modal[index].classList.add("visible");
modalAbout[index].classList.add("visible");
});
closeModal[index].addEventListener("click", function () {
modalAbout[index].classList.remove("visible");
modal[index].classList.remove("visible");
});
};
for (var index = 0; index < hoverCircles.length; index++) {
_loop(index);
}
//End of Internet explorer optimization
} else {
var getPosition = function getPosition(elem, target) {
var targetRect = target.getBoundingClientRect();
var elemRect = elem.getBoundingClientRect();
TweenLite.set(elem, {
x: 0,
y: 0,
width: targetRect.width,
height: targetRect.height
});
var newRect = elem.getBoundingClientRect();
TweenLite.set(elem, {
width: elemRect.width,
height: elemRect.height
});
return {
left: targetRect.left - newRect.left,
top: targetRect.top - newRect.top,
width: newRect.width,
height: newRect.height
};
};
if (hoverCircles.length > 0) {
hoverCircles.forEach(function (item, index) {
item.addEventListener("click", function () {
var newRect = getPosition(modal[index].firstElementChild, item);
modal[index].classList.add("visible");
var tl = new TimelineMax();
TweenMax.set(modal[index].firstElementChild, {
x: newRect.left,
y: newRect.top,
width: newRect.width,
height: newRect.height,
scale: 0
});
tl.to(modal[index].firstElementChild, 0.5, {
x: 0,
y: 0,
width: "100%",
height: "fit-content",
scale: 1,
transformOrigin: "center"
}).then(function () {
modalAbout[index].classList.add("visible");
});
});
closeModal[index].addEventListener("click", function () {
var newRect = getPosition(modal[index].firstElementChild, item);
var tl = new TimelineMax();
modalAbout[index].classList.remove("visible");
tl.to(modal[index].firstElementChild, 0.5, {
x: newRect.left,
y: newRect.top,
width: newRect.width,
height: newRect.height,
scale: 0
}).then(function () {
modal[index].classList.remove("visible");
});
});
});
}
}
});
})(jQuery);
"use strict";
(function ($) {
$(document).ready(function () {
// const mediaQueryMobile = window.matchMedia("(min-width: 992px)");
// Headroom
// grab an element
var headerElement = document.querySelector(".site-header");
// construct an instance of Headroom, passing the element
var headroom = new Headroom(headerElement);
// initialise
headroom.init();
$(".hamburger").click(function (e) {
$(".site-header__wrap").toggleClass("open");
$(".site-header").toggleClass("menu-open");
if ($("html").hasClass("menu-open")) {
setTimeout(function () {
$("html").removeClass("menu-open");
}, 300);
}
$("html").addClass("menu-open");
$("body").toggleClass("menu-open");
$(this).toggleClass("active");
});
$(".site-header__item").click(function (e) {
$(".site-header__wrap").removeClass("open");
$(".site-header").removeClass("menu-open");
$("html").removeClass("menu-open");
$("body").removeClass("menu-open");
$(".hamburger").removeClass("active");
});
// if (mediaQueryMobile.matches) {
// $(".site-header__item.dropdown").hover(function (e) {
// // window width is at least 992px
// });
// } else {
// $(".site-header__item.dropdown").click(function (e) {
// // window width is less than 992px
// $(this).find(".site-header__submenu").slideToggle();
// });
// }
});
})(jQuery);
"use strict";
(function ($) {
$(document).ready(function () {
$(".js-newsletter-signup").on("submit", function (e) {
e.preventDefault();
var newsletterContainer = document.querySelector("#js-newsletter");
var errorResponse = $(".js-newsletter-error-response", this);
errorResponse.removeClass("newsletter-form__error--active");
grecaptcha.ready(function () {
grecaptcha.execute("6Lc_PDYqAAAAAILAbCYdOsNNquFpyxTI5IA7LE0L", { action: "submit" }).then(function (token) {
$.post(ajaxurl, {
action: "post_newsletter_form",
data: $("#newsletterForm").serialize(),
token: token
}, function (response) {
if (response.data.result === "success") {
newsletterContainer.classList.add("newsletter--success");
} else {
errorResponse.html(data.msg);
errorResponse.addClass("newsletter-form__error--active");
}
}, "json").fail(function () {
errorResponse.addClass("newsletter-form__error--active");
errorResponse.html("Error in sending request. Please try again.");
});
});
});
});
});
})(jQuery);
"use strict";
(function ($) {
$(document).ready(function () {
//swup
var flag = document.getElementById("swup-inside");
var loadScripts = function loadScripts() {
var changeActiveCard = function changeActiveCard() {
AOS.init();
var activeCard = document.querySelector(".tabs-menu--active");
var cards = document.querySelectorAll(".tabs-menu__link");
var locationLink = window.location.href;
if (activeCard) {
activeCard.classList.remove("tabs-menu--active");
cards.forEach(function (cardLink) {
if (cardLink.getAttribute("href") === locationLink) {
cardLink.firstElementChild.classList.add("tabs-menu--active");
}
});
}
};
window.LINDE_ANIMATION();
changeActiveCard();
};
var options = {
containers: ["#swup-inside"],
linkSelector: ".tabs-menu__link"
};
if (flag) {
var swup = new Swup(options);
swup.on("contentReplaced", loadScripts);
}
});
})(jQuery);
"use strict";
(function ($) {
$(document).ready(function () {
var video = document.getElementById("video");
if (video) {
var togglePlay = function togglePlay() {
if (video.paused || video.ended) {
video.play();
} else {
video.pause();
}
};
var updatePlayButton = function updatePlayButton() {
playbackIcons.forEach(function (icon) {
return icon.classList.toggle("hidden");
});
if (video.paused) {
playButton.setAttribute("data-title", "Play (p)");
} else {
playButton.setAttribute("data-title", "Pause (p)");
}
};
var formatTime = function formatTime(timeInSeconds) {
var result = new Date(timeInSeconds * 1000).toISOString().substr(11, 8);
return {
minutes: result.substr(3, 2),
seconds: result.substr(6, 2)
};
};
var initializeVideo = function initializeVideo() {
var videoDuration = Math.round(video.duration);
seek.setAttribute("max", videoDuration);
progressBar.setAttribute("max", videoDuration);
var time = formatTime(videoDuration);
duration.innerText = time.minutes + ":" + time.seconds;
duration.setAttribute("datetime", time.minutes + "m " + time.seconds + "s");
};
var updateTimeElapsed = function updateTimeElapsed() {
var time = formatTime(Math.round(video.currentTime));
timeElapsed.innerText = time.minutes + ":" + time.seconds;
timeElapsed.setAttribute("datetime", time.minutes + "m " + time.seconds + "s");
};
var updateProgress = function updateProgress() {
seek.value = Math.floor(video.currentTime);
progressBar.value = Math.floor(video.currentTime);
};
var updateSeekTooltip = function updateSeekTooltip(event) {
var skipTo = Math.round(event.offsetX / event.target.clientWidth * parseInt(event.target.getAttribute("max"), 10));
seek.setAttribute("data-seek", skipTo);
var t = formatTime(skipTo);
seekTooltip.textContent = t.minutes + ":" + t.seconds;
var rect = progressBar.getBoundingClientRect();
seekTooltip.style.left = event.pageX - rect.left + "px";
};
var skipAhead = function skipAhead(event) {
var skipTo = event.target.dataset.seek ? event.target.dataset.seek : event.target.value;
video.currentTime = skipTo;
progressBar.value = skipTo;
seek.value = skipTo;
};
var updateVolume = function updateVolume() {
if (video.muted) {
video.muted = false;
}
$(".volume-value").width(volume.value * 100);
video.volume = volume.value;
};
var updateVolumeIcon = function updateVolumeIcon() {
volumeIcons.forEach(function (icon) {
icon.classList.add("hidden");
});
volumeButton.setAttribute("data-title", "Mute (m)");
if (video.muted || video.volume === 0) {
volumeMute.classList.remove("hidden");
volumeButton.setAttribute("data-title", "Unmute (m)");
} else if (video.volume > 0 && video.volume <= 0.5) {
volumeLow.classList.remove("hidden");
} else {
volumeHigh.classList.remove("hidden");
}
};
var toggleMute = function toggleMute() {
video.muted = !video.muted;
if (video.muted) {
$(".volume-value").width(0);
volume.setAttribute("data-volume", volume.value);
volume.value = 0;
} else {
volume.value = volume.dataset.volume;
$(".volume-value").width(volume.value * 100);
}
};
var animatePlayback = function animatePlayback() {
playbackAnimation.animate([{
opacity: 1,
transform: "scale(1)"
}, {
opacity: 0,
transform: "scale(1.3)"
}], {
duration: 500
});
};
var toggleFullScreen = function toggleFullScreen() {
if (document.fullscreenElement) {
document.exitFullscreen();
} else {
videoContainer.requestFullscreen();
}
};
var updateFullscreenButton = function updateFullscreenButton() {
fullscreenIcons.forEach(function (icon) {
return icon.classList.toggle("hidden");
});
if (document.fullscreenElement) {
fullscreenButton.setAttribute("data-title", "Exit full screen (f)");
} else {
fullscreenButton.setAttribute("data-title", "Full screen (f)");
}
};
var hideControls = function hideControls() {
if (video.paused) {
return;
}
videoControls.classList.add("hide");
};
var showControls = function showControls() {
videoControls.classList.remove("hide");
};
var videoControls = document.getElementById("video-controls");
var playButton = document.getElementById("play");
var playbackIcons = document.querySelectorAll(".playback-icons svg");
var timeElapsed = document.getElementById("time-elapsed");
var duration = document.getElementById("duration");
var progressBar = document.getElementById("progress-bar");
var seek = document.getElementById("seek");
var seekTooltip = document.getElementById("seek-tooltip");
var volumeButton = document.getElementById("volume-button");
var volumeIcons = document.querySelectorAll(".volume-icons svg");
var volumeMute = document.querySelector('.icon-sound-off');
var volumeLow = document.querySelector('.icon-sound-low');
var volumeHigh = document.querySelector('.icon-sound-on');
var volume = document.getElementById("volume");
var playbackAnimation = document.getElementById("playback-animation");
var fullscreenButton = document.getElementById("fullscreen-button");
var videoContainer = document.getElementById("video-container");
var fullscreenIcons = null;
if (fullscreenButton) {
fullscreenIcons = fullscreenButton.querySelectorAll(".fullscreen-icons svg");
}
var videoWorks = !!document.createElement("video").canPlayType;
if (videoWorks) {
video.controls = false;
videoControls.classList.remove("hidden");
}
playButton.addEventListener("click", togglePlay);
video.addEventListener("play", updatePlayButton);
video.addEventListener("pause", updatePlayButton);
video.addEventListener("loadedmetadata", initializeVideo);
video.addEventListener("timeupdate", updateTimeElapsed);
video.addEventListener("timeupdate", updateProgress);
video.addEventListener("volumechange", updateVolumeIcon);
video.addEventListener("click", togglePlay);
video.addEventListener("click", animatePlayback);
video.addEventListener("mouseenter", showControls);
video.addEventListener("mouseleave", hideControls);
videoControls.addEventListener("mouseenter", showControls);
videoControls.addEventListener("mouseleave", hideControls);
seek.addEventListener("mousemove", updateSeekTooltip);
seek.addEventListener("input", skipAhead);
volume.addEventListener("input", updateVolume);
volumeButton.addEventListener("click", toggleMute);
fullscreenButton.addEventListener("click", toggleFullScreen);
videoContainer.addEventListener("fullscreenchange", updateFullscreenButton);
$("body").on('click', '.video-trigger', function (e) {
e.preventDefault();
$("body").addClass("o-hidden");
// This might not be needed if we inject the video dinamically on click
var current = $(this).attr("data-video-link");
$("#video source").attr('src', current);
$(".modal-video").addClass("visible");
video.load();
video.play();
});
$(".close-video-modal").click(function (e) {
e.preventDefault();
$("body").removeClass("o-hidden");
$(".modal-video").removeClass("visible");
video.pause();
// stop play
});
}
});
})(jQuery);