1document.addEventListener('DOMContentLoaded', function () { 2 const popup = document.querySelector('.sample-popup2'); 3 const closeButton = document.querySelector('.sample-close2'); 4 let overlay; 5 6 if (!popup) return; 7 8 function createOverlay() { 9 const overlay = document.createElement('div'); 10 overlay.style.position = 'fixed'; 11 overlay.style.top = '0'; 12 overlay.style.left = '0'; 13 overlay.style.right = '0'; 14 overlay.style.bottom = '0'; 15 overlay.style.backgroundColor = 'rgba(0, 0, 0, 0.7)'; 16 overlay.style.zIndex = '900'; 17 document.body.appendChild(overlay); 18 return overlay; 19 } 20 21 function showPopup() { 22 // ð´ Ðе показÑваем, еÑли Ñже закÑÑвали 23 if (localStorage.getItem('popupClosed')) return; 24 25 overlay = createOverlay(); 26 popup.style.display = 'block'; 27 popup.classList.add('opened'); 28 29 overlay.addEventListener('click', hidePopup); 30 } 31 32 function hidePopup() { 33 popup.style.display = 'none'; 34 popup.classList.remove('opened'); 35 36 // â Ðапоминаем закÑÑÑие 37 localStorage.setItem('popupClosed', '1'); 38 39 if (overlay) { 40 overlay.remove(); 41 overlay = null; 42 } 43 } 44 45 // â ÐÑовеÑка пеÑед авÑопоказом 46 if (!localStorage.getItem('popupClosed')) { 47 setTimeout(showPopup, popup.dataset.time * 1000); 48 } 49 50 if (closeButton) { 51 closeButton.addEventListener('click', hidePopup); 52 } 53 54 const observer = new MutationObserver(() => { 55 if (!popup.classList.contains('opened') && overlay) { 56 hidePopup(); 57 } 58 }); 59 60 observer.observe(popup, { attributes: true }); 61}); 62 63 64 65;(function($) { 66 'use strict'; 67 68 $(function(){ 69 70 $('.top-phones').unwrap(); 71 $('.bottom-phones').unwrap(); 72 73 if($('.sample-popup3').length) { 74 $('.sample-popup3').appendTo('body'); 75 76 let top = 200, 77 time = +$('.sample-popup3').data('time') * 1000; 78 79 function menuF(){ 80 if($(this).scrollTop()>=top){ 81 $('.sample-popup3').addClass('fixed2'); 82 }else{ 83 $('.sample-popup3').removeClass('fixed2'); 84 } 85 }; 86 $(window).scroll(menuF); 87 menuF(); 88 89 console.log(time) 90 91 92 if (!sessionStorage.getItem('showBlock')) { 93 setTimeout(function(){ 94 $('.sample-popup2').addClass('opened'); 95 }, time) 96 } 97 98 $('.sample-close2, .sample-btn a').on('click', function(){ 99 $('.sample-popup3').removeClass('opened'); 100 sessionStorage.setItem('showBlock', 1); 101 }) 102 103 } 104 105 }); 106 107})(jQuery);
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.