1jQuery(document).ready(function($) { 2 $(window).load(function() { 3 let $screenWidth = $(window).width(); 4 $('.home .portfolioinner li').each(function() { 5 let $deskImage = $(this).find('.portfolio-desktop-cls'); 6 let $mobImage = $(this).find('.portfolio-mobile-cls'); 7 if ($screenWidth < 768) { 8 $deskImage.detach(); 9 } else { 10 $mobImage.detach(); 11 } 12 13 }); 14 $(document).on('click', '.mute-button', function(){ 15 $(this).closest('.brand-section').attr('ok', '1'); 16 $(this).closest('.brand-section').find('.brand-video').attr('ok2', '1'); 17 if($(this).hasClass('muted')){ 18 19 $(this).closest('.brand-section').find('.brand-video').prop('muted', false); 20 $(this).removeClass('muted'); 21 22 }else{ 23 24 $(this).closest('.brand-section').find('.brand-video').prop('muted', true); 25 $(this).addClass('muted'); 26 27 } 28 }); 29 checkBlocks(); 30 setTimeout(resizeBrandForMobile, 500); 31 resizeHeightAccordingly('.about-us-section .image-block'); 32 33}); 34$(window).on('load resize ', function() { 35 let $screenWidth = $(window).width(); 36 if ($screenWidth < 768) { 37 $('.home .portfolioinner li').each(function() { 38 let $portfolioImage = $(this); 39 $portfolioImage.height($($portfolioImage).width()); 40 }); 41 } 42 resizeHeightAccordingly('.about-us-section .image-block'); 43 resizePortfolioSize(); 44}); 45 46function checkBlocks(){ 47 var deviceHeight = $(window).height(); 48 var deviceActiveHeight = deviceHeight * 1; 49 var viewportTop = $(window).scrollTop(); 50 let $screenWidth = $(window).width(); 51 if ($screenWidth < 768) { 52 deviceActiveHeight = deviceActiveHeight * 1.5; 53 } 54 var viewportBottom = deviceActiveHeight + viewportTop; 55 56 $('.about-us-section').each(function() { 57 var elemStartY = $(this).offset().top; 58 var elemEndY = elemStartY + $(this).outerHeight()/2; 59 60 if(( viewportTop < (elemStartY + $(this).outerHeight()/2) && viewportBottom > elemEndY) ) 61 $(this).addClass('displayed'); 62 63 }); 64 65} 66$(window).on('resize scroll', function() { 67 checkBlocks(); 68 setTimeout(resizeBrandForMobile, 500); 69 console.log('resize'); 70}); 71 72function resizeBrandForMobile(){ 73 let $screenWidth = $(window).width(); 74 if ($screenWidth < 768) { 75 if($('body').hasClass('landscape')){ 76 $( ".brand-section" ).each(function( index ) { 77 $(this).find('.image-section').css('height', 'auto'); 78 }); 79 80 }else if($('body').hasClass('mobile-view') && !$('body').hasClass('landscape')){ 81 $('body').addClass('resize-true'); 82 var deviceHeight = $(window).height(); 83 $( ".brand-section" ).each(function( index ) { 84 var brandContentHeight = $(this).find('.brand-content').outerHeight() + parseFloat($(this).find('.brand-content-block').css('margin-bottom')); 85 var menuHeight = $('.prosvit-menu').outerHeight(); 86 var brandLogoHeight = $(this).find('.brand-logo').outerHeight(); 87 console.log(brandLogoHeight); 88 var brandLogoPosition = (brandLogoHeight + 23) * -1 ; 89 console.log(brandLogoPosition); 90 var heroHeight = deviceHeight - brandContentHeight - menuHeight - 30 - brandLogoHeight; 91 $(this).find('.image-section').css('padding-top', 0).height(heroHeight); 92 $(this).find('.brand-logo').css('bottom', brandLogoPosition).css('margin-bottom', 0); 93 }); 94 } 95 } 96} 97function resizeHeightAccordingly(selector){ 98 let $screenWidth = $(window).width(); 99 100 if ($screenWidth < 768) { 101 var height = $(selector).height(); 102 console.log(height); 103 104 $(selector).each(function(){ 105 $(this).height(height); 106 }); 107 } 108} 109 110function resizePortfolioSize(){ 111 let $screenWidth = $(window).width(); 112 console.log('start'); 113 if ($screenWidth > 767) { 114 var desc = $('.description-portfolio .content-block').height(); 115 $('.portfolio-section').attr('style', 'height: calc(100vh - '+ desc +'px )'); 116 } 117} 118});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.