} t_onReady(function () { t_setWindowVars(); t_blocksdisplay(); window.addEventListener( 'resize', t_throttle(function () { t_setWindowVars(); }, 200) ); window.addEventListener( 'resize', t_throttle(function () { t_blocksdisplay(); }, 200) ); });})();/** * Defining heights for covers and other blocks in the mobile version, * reducing fonts and tracking blocks that are not optimized for the mobile version */(function () { var isInstagram = navigator.userAgent.indexOf('Instagram') !== -1; function t_correctHeight() { var coverCarries = document.querySelectorAll('.t-cover__carrier'); var factor = 0; for (var i = 0; i < coverCarries.length; i++) { var element = coverCarries[i]; var elementStyle = element.style; if (elementStyle.height.indexOf('vh') > -1) { factor = parseInt(elementStyle.height, 10) / 100; var div = document.createElement('div'); div.id = 'tempDiv'; div.style.cssText = 'position:absolute;top:0;left:0;width:100%;height:100vh;visibility:hidden;'; document.body.appendChild(div); var tempDiv = document.getElementById('tempDiv'); var tempDivHeight = parseInt(getComputedStyle(tempDiv).height.replace('px', '')); t_removeEl(tempDiv); var newHeight = Math.round(tempDivHeight * factor) + 'px'; var cover = element.closest('.t-cover'); if (cover) { var coverFilter = cover.querySelector('.t-cover__filter'); var textBox = cover.querySelector('.t-cover__wrapper'); cover.style.height = newHeight; if (coverFilter) coverFilter.style.height = newHeight; if (textBox) textBox.style.height = newHeight; } elementStyle.height = newHeight; } } // others var elCarries = document.querySelectorAll('[data-height-correct-vh]'); var windowHeight = window.innerHeight; factor = 0; for (var i = 0; i < elCarries.length; i++) { var element = elCarries[i]; var elementStyle = element.style; if (elementStyle.height.indexOf('vh') > -1) { factor = parseInt(elementStyle.height) / 100; newHeight = windowHeight * (isNaN(factor) ? 1 : factor) + 'px'; elementStyle.height = newHeight; } } } if (window.isMobile || window.parent.isPagePreview) { t_onReady(function () { setTimeout(t_correctHeight, 400); }); window.addEventListener('load', function () { setTimeout(t_correctHeight, 400);