From 4b70c28030bd8499a89b24fcd1c4c416fd8a7cdb Mon Sep 17 00:00:00 2001 From: XenGi Date: Tue, 8 Feb 2022 21:48:00 +0000 Subject: [PATCH] Update css/main.css, js/main.js Deleted main.css, main.js --- css/main.css | 9 +++++++++ js/main.js | 16 ++++++++++++++++ main.css | 8 -------- main.js | 16 ---------------- 4 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 main.css delete mode 100644 main.js diff --git a/css/main.css b/css/main.css index 31016d7..0a7e674 100644 --- a/css/main.css +++ b/css/main.css @@ -1,3 +1,12 @@ html { scroll-behavior: smooth; } + +#gototop_button { + display: none; + position: fixed; + bottom: 20px; + right: 30px; + z-index: 99; + cursor: pointer; +} diff --git a/js/main.js b/js/main.js index e69de29..1edf213 100644 --- a/js/main.js +++ b/js/main.js @@ -0,0 +1,16 @@ +// Show button on scroll +window.onscroll = function() { toggle_gototop() }; + +function toggle_gototop() { + gototop_button = document.getElementById("gototop"); + if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { + gototop_button.style.display = "block"; + } else { + gototop_button.style.display = "none"; + } +} + +function gototop() { + document.body.scrollTop = 0; // For Safari + document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera +} diff --git a/main.css b/main.css deleted file mode 100644 index c1b3e27..0000000 --- a/main.css +++ /dev/null @@ -1,8 +0,0 @@ -#gototop_button { - display: none; - position: fixed; - bottom: 20px; - right: 30px; - z-index: 99; - cursor: pointer; -} diff --git a/main.js b/main.js deleted file mode 100644 index 1edf213..0000000 --- a/main.js +++ /dev/null @@ -1,16 +0,0 @@ -// Show button on scroll -window.onscroll = function() { toggle_gototop() }; - -function toggle_gototop() { - gototop_button = document.getElementById("gototop"); - if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { - gototop_button.style.display = "block"; - } else { - gototop_button.style.display = "none"; - } -} - -function gototop() { - document.body.scrollTop = 0; // For Safari - document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera -}