diff --git a/assets/css/index.css b/assets/css/index.css index e298b48..9db9c16 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -421,3 +421,20 @@ body::-webkit-scrollbar-thumb { background-color: rgb(79, 78, 78); border-radius: 5px; } + +#goToTop { + display: none; + position: fixed; + bottom: 10px; + right: 10px; + z-index: 99; + border: none; + outline: none; + background-image: url(../images/up-arrow.png); + background-size: contain; + width: 40px; + height: 40px; + cursor: pointer; + color: white; + cursor: pointer; +} \ No newline at end of file diff --git a/assets/images/up-arrow.png b/assets/images/up-arrow.png new file mode 100644 index 0000000..e616a38 Binary files /dev/null and b/assets/images/up-arrow.png differ diff --git a/html/index.html b/html/index.html index a2dbfff..4cb856a 100644 --- a/html/index.html +++ b/html/index.html @@ -149,6 +149,8 @@
+
+ diff --git a/html/playlist.html b/html/playlist.html index b86fcc8..e0dae98 100644 --- a/html/playlist.html +++ b/html/playlist.html @@ -85,6 +85,8 @@

+ +
\ No newline at end of file diff --git a/src/common.js b/src/common.js index 58099ec..254f54a 100644 --- a/src/common.js +++ b/src/common.js @@ -97,4 +97,22 @@ function advancedToggle() { getId("advanced").style.display = "none"; advancedHidden = true; } -} \ No newline at end of file +} + +// Check scroll go to top + +window.onscroll = function() {scrollFunction()}; + +function scrollFunction() { + if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) { + getId("goToTop").style.display = "block"; + } else { + getId("goToTop").style.display = "none"; + } +} + +// Function to scroll go to top + +getId("goToTop").addEventListener("click", () => { + window.scrollTo({top: 0, behavior: 'smooth'}); +}); \ No newline at end of file diff --git a/src/renderer.js b/src/renderer.js index eee1d13..b80ecbf 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -846,6 +846,8 @@ function afterSave(location, filename, progressId) { ).innerHTML = `${i18n.__( "File saved. Click to Open" )}`; + + window.scrollTo(0, document.body.scrollHeight); } function showItem(location, filename) {