From c966372da35b16bb03652fdb9ceca681610066df Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Fri, 2 Sep 2022 13:38:17 -0400 Subject: remove particles, remove link rainbows --- index.js | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 9d8d1f3..57e378e 100644 --- a/index.js +++ b/index.js @@ -1,31 +1,12 @@ -particlesJS.load('particles-js', '/particles.json', () => - console.log('callback - particles.js config loaded') -); -// -// //canvas of the particles -// const particleWrapper = document.querySelector('#particles-js') -// console.log(document.body.scrollHeight, particleWrapper.style.height) - -const thresholdFidelity = 500; - -// const particleObserver = new IntersectionObserver(entries => { -// // note - if the boundingClientRect.y is negative, then they are scrolling down -// // note - since using id, only 1 entry -// console.log(entries[0]) -// const {intersectionRatio, boundingClientRect} = entries[0]; -// if (intersectionRatio !== 1) { -// console.log(particleWrapper.style) -// particleWrapper.style.top = `${parseFloat(particleWrapper.style.top.replace('px', '')) - boundingClientRect.top}px`; -// } -// }, { -// threshold: .5 -// }); -// particleObserver.observe(particleWrapper) +const THRESHOLD_FIDELITY = 1000; // mutation observer for the video element const videoTitle = document.querySelector('#video-title'); console.log(videoTitle); +const pastryIframe = document.querySelector('#connie-pastries') +console.log(pastryIframe.textContent); + const observer = new IntersectionObserver(entries => { // note - if the boundingClientRect.y is negative, then they are scrolling down @@ -37,7 +18,7 @@ const observer = new IntersectionObserver(entries => { videoTitle.currentTime = 2; } }, { - threshold: [...Array(thresholdFidelity).keys()].map(num => num/thresholdFidelity) + threshold: [...Array(THRESHOLD_FIDELITY).keys()].map(num => num/THRESHOLD_FIDELITY) }); // after two seconds pause the video -- cgit v1.2.3-70-g09d2