Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

fix: video-element scroll to view based on header height

Christian Fei3e731d8ea645
diff --git a/client/components/video-element.js b/client/components/video-element.js
index f519203..11fbf17 100644
--- a/client/components/video-element.js
+++ b/client/components/video-element.js
@@ -207,7 +207,7 @@ class VideoElement extends HTMLElement {
video.addEventListener('play', () => {
console.log('video event play')
this.classList.add('big')
- setTimeout(this.scrollIntoViewWithOffset.bind(this, 150), document.querySelector('body > header').clientHeight)
+ setTimeout(this.scrollIntoViewWithOffset.bind(this, document.querySelector('body > header').clientHeight, "smooth"), 110)
this.pauseOtherVideos(video)
})
}