let saving = false; function iOS() { return [ 'iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod' ].includes(navigator.platform) || (navigator.userAgent.includes("Mac") && "ontouchend" in document) } let vh = window.innerHeight * 0.01; document.documentElement.style.setProperty('--vh', `${vh}px`); window.addEventListener('resize', () => { if ($(window).width() > 768) { let vh = window.innerHeight * 0.01; document.documentElement.style.setProperty('--vh', `${vh}px`); } }); $(document).ready(function() { serviceHeaders(); $(window).on('resize', function() { serviceHeaders() }); $('.jumbotron_arrow').on('click', (e) => { e.preventDefault(); $('html, body').animate({ scrollTop: $("#text").offset().top }, 500); }); if ($('.cookies').length === 1) { setTimeout(function() { $(".cookies").addClass('cookies--open'); }, 500); $('.cookies .close_cookie').on('click', function(e) { e.preventDefault(); $.ajax({ url: templateDir + "/services/set_consent.php", success: function(res) { $('.cookies').removeClass('cookies--open'); $('.linkedin').removeClass('hide'); } }); }) } }); function serviceHeaders() { if ($(window).width() >= 520) { let height = 0; let numRows = Math.ceil($('.service').length / 2); let rowCounter = 1; for(let i = 1; i <= $('.service').length; i++) { if ($('.service:eq(' + (i-1) + ') h2').height() > height) height = $('.service:eq(' + (i-1) + ') h2').height(); if (i % 2 === 0) { $('.service:eq(' + (i-1) + ') .service_header, .service:eq(' + (i-2) + ') .service_header').height(height + 20); height = 0; rowCounter++; } } } else { $('.service .service_header').height('auto'); } }