1class HomePage { 2 constructor() { 3 this.initMastheadPlayToggle(); 4 this.initParallax(); 5 this.initProcessVideo(); 6 } 7 8 initMastheadPlayToggle() { 9 const onAnimationFrame = () => { 10 const video = document.querySelector("#landingSplash video"); 11 if (!video) return; 12 if (window.scrollY > video.scrollHeight) video.pause() 13 else if (video.paused) { 14 video.volume = 0; 15 video.play() 16 } 17 18 requestAnimationFrame(onAnimationFrame); 19 } 20 requestAnimationFrame(onAnimationFrame); 21 } 22 23 initGetStarted() { 24 let letsGetStarted = document.querySelector("#letsGetStarted"); 25 console.log(letsGetStarted) 26 letsGetStarted.addEventListener("click", e => { 27 let req = new ApptRequest(); 28 req.init(); 29 }); 30 } 31 32 initParallax() { 33 // simpleParallax("parallax-bg"); 34 } 35 36 initProcessVideo() { 37 const video = document.querySelector("#process video"); 38 if(!video) { 39 console.warn("Could not find process video!", video); 40 return; 41 } 42 const isSafari = window.safari !== undefined; 43 if(isSafari) { 44 // video.classList.remove("poster"); 45 video.setAttribute("controls", "controls"); 46 } 47 document.addEventListener("DOMContentLoaded", e => { 48 // window.umami.track("process-group", {group: video.dataset.group}); 49 }) 50 51 video.addEventListener("click", evt => { 52 video.setAttribute("controls", "controls"); 53 if(window.matchMedia("only screen and (max-width:35em)").matches) { 54 video.play(); 55 } 56 window.umami.track("process-start"); 57 }, {once: true}); 58 59 video.addEventListener("play", evt => { 60 window.umami.track("process-play"); 61 video.classList.remove("poster"); 62 }); 63 64 video.addEventListener("pause", evt => { 65 window.umami.track("process-pause"); 66 }); 67 68 video.addEventListener("ended", evt => { 69 window.umami.track("process-ended"); 70 }); 71 72 video.addEventListener("seeked", evt => { 73 window.umami.track("process-seeked", {timecode: video.currentTime}); 74 }); 75 } 76}
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.