summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-21.devices.brown.edu>2022-09-06 12:11:40 -0400
committerMichael Foiani <sotech117@michaels-mbp-21.devices.brown.edu>2022-09-06 12:11:40 -0400
commitf8fbbfedaf1dd607ce04970532540f97fa148075 (patch)
tree6780d0f0a6abf08df38c5d03afde51d00dbb0125 /index.js
parentfd268b7fde8438d9044a384f3632fcab1c08e133 (diff)
fix links, color match the animated title
Diffstat (limited to 'index.js')
-rw-r--r--index.js52
1 files changed, 0 insertions, 52 deletions
diff --git a/index.js b/index.js
deleted file mode 100644
index 84e3aeb..0000000
--- a/index.js
+++ /dev/null
@@ -1,52 +0,0 @@
-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
- // note - since using id, only 1 entry
- const {intersectionRatio, boundingClientRect} = entries[0];
- if (intersectionRatio !== 1 && boundingClientRect.y <= 0) {
- videoTitle.currentTime = 5 - 3 * intersectionRatio;
- } else {
- videoTitle.currentTime = 2;
- }
-}, {
- threshold: [...Array(THRESHOLD_FIDELITY).keys()].map(num => num/THRESHOLD_FIDELITY),
- rootMargin: '-50px'
-});
-
-// after two seconds pause the video
-setTimeout(() => {
- videoTitle.pause();
- videoTitle.currentTime = 2;
- observer.observe(videoTitle);
-}, 2500)
-
-// // math for interactive conic border on weekly specials
-// const conicElement = document.querySelector('.conic-border');
-// window.addEventListener('mousemove', ({ clientX, clientY }) => {
-// const { x, y, width, height } = conicElement.getBoundingClientRect();
-// const dx = clientX - (x + 0.5 * width);
-// const dy = clientY - (y + 0.5 * height);
-// const angle = Math.atan2(dy, dx) * 180 / Math.PI;
-//
-// conicElement.style.setProperty('--startDeg', `${angle + 90}deg`);
-// }, false);
-
-// borrowed from https://www.w3schools.com/howto/howto_js_collapse_sidepanel.asp
-/* Set the width of the sidebar to 250px (show it) */
-openNav = () => {
- document.querySelector('#sidepanel').style.width = "250px";
-}
-
-/* Set the width of the sidebar to 0 (hide it) */
-closeNav = () => {
- document.querySelector('#sidepanel').style.width = "0";
-} \ No newline at end of file