init: hugo + blog awesome, struktura webu
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
;
|
||||
window.addEventListener('load', () => {
|
||||
const gttButton = document.getElementById("totop");
|
||||
if (!gttButton) return;
|
||||
window.onscroll = () => {
|
||||
if (
|
||||
document.body.scrollTop > 300 ||
|
||||
document.documentElement.scrollTop > 300
|
||||
) {
|
||||
gttButton.style.visibility = "visible";
|
||||
gttButton.style.opacity = "1";
|
||||
} else {
|
||||
gttButton.style.visibility = "hidden";
|
||||
gttButton.style.opacity = "0";
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user