PageSourceSearch

https://chaoyuesong.github.io/MagicArticulate/static/js/lazy.js

js chaoyuesong.github.io collected 2026-10-03 08:47:02 UTC 946 bytes, 26 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function() {
2    var lazyVideos = [].slice.call(document.querySelectorAll("video.lazy"));
3  
4    if ("IntersectionObserver" in window) {
5      var lazyVideoObserver = new IntersectionObserver(function(entries, observer) {
6        entries.forEach(function(video) {
7          if (video.isIntersecting) {
8            for (var source in video.target.children) {
9              var videoSource = video.target.children[source];
10              if (typeof videoSource.tagName === "string" && videoSource.tagName === "SOURCE") {
11                videoSource.src = videoSource.dataset.src;
12              }
13            }
14  
15            video.target.load();
16            video.target.classList.remove("lazy");
17            lazyVideoObserver.unobserve(video.target);
18          }
19        });
20      });
21  
22      lazyVideos.forEach(function(lazyVideo) {
23        lazyVideoObserver.observe(lazyVideo);
24      });
25    }
26  });

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.