1const body = document.querySelector('body') 2const iframe = document.createElement('iframe') 3const contener = document.createElement('div') 4contener.className = 'iframe-video iframe-disabled' 5const btn = document.createElement('button') 6iframe.setAttribute('name','iframe_a'); 7iframe.setAttribute('width', 500); 8 9btn.className = 'btn-close' 10btn.textContent = 'Ã' 11btn.onclick = closeBtn 12contener.append(btn, iframe) 13body.append(contener) 14 15function onframe(el){ 16 17 let top = window.scrollY 18 const screenWidth = window.screen.width 19 const screenHeight = window.screen.height 20 let delta = 30 21 const iframe = document.querySelector('.iframe-video') 22 if(screenWidth >= 800) delta = -200 23 if(screenWidth < 800 && screenWidth > 500 ) delta = 10 24 iframe.setAttribute('style',`top: ${top + delta }px;`) 25 iframe.className = 'iframe-video' 26 let isVk = el.getAttribute('data-vk') 27 if(Number(isVk) == 1){ 28 iframe.classList.add('iframe-vk'); 29 } 30} 31 32 function closeBtn(){ 33 const frame = document.querySelector('.iframe-video') 34 frame.className = 'iframe-video iframe-disabled' 35 frame.querySelector('iframe').remove() 36 const newframe = document.createElement('iframe') 37 newframe.setAttribute('name','iframe_a') 38 frame.append(newframe) 39 } 40 41 function searchHref(url){ 42 43 } 44 45const cursor_play = document.querySelectorAll('.btn-play-video') 46 47cursor_play.forEach((elm)=>{ 48 elm.addEventListener('mousemove', function (event) { 49 const x = elm.getBoundingClientRect().x - event.clientX 50 const y = elm.getBoundingClientRect().y - event.clientY 51 const span = elm.querySelector('span') 52 53 let xr = Math.round(-(x/1.8 +25)) 54 let yr = Math.round(-(y/1.8+25)) 55 span.setAttribute('style',`left:${xr}px; top:${yr}px`) 56 57 }) 58}) 59 60function isVisible(elem) { 61 let coords = elem.getBoundingClientRect(); 62 let windowHeight = document.documentElement.clientHeight; 63 let topVisible = coords.top > 0 && coords.top < windowHeight; 64 let bottomVisible = coords.bottom < windowHeight && coords.bottom > 0; 65 return topVisible || bottomVisible; 66} 67 68 function showVisible() { 69 for (let video of document.querySelectorAll('video')) { 70 const data = video.getAttribute('data') 71 if(data == null || data == '') continue 72 if (isVisible(video)) { 73 video.setAttribute('data','') 74 video.setAttribute('src', data) 75 } 76 } 77 } 78 79window.addEventListener('scroll', showVisible); 80 showVisible(); 81
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.