diff --git a/src/css/style.css b/src/css/style.css index aef551b..780a941 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -617,6 +617,17 @@ input[type="radio"] { border: 2px solid #2d8a49; } +.scroll-up-button { + width: 50px; + height: 50px; + text-decoration: none; + position: fixed; + right: 1px; + bottom: 0; + display: none; + z-index: 1100; +} + .test { color: #59d1da; } \ No newline at end of file diff --git a/src/index.html b/src/index.html index 6e602cd..f27b58d 100644 --- a/src/index.html +++ b/src/index.html @@ -30,6 +30,8 @@ + +
diff --git a/src/js/HKCheckCompletion.js b/src/js/HKCheckCompletion.js index 16c0ca9..f815cf7 100644 --- a/src/js/HKCheckCompletion.js +++ b/src/js/HKCheckCompletion.js @@ -1,6 +1,6 @@ /* eslint-disable no-prototype-builtins */ -// ---------------- Load main Hollow Knight database file ----------------- // +// ---------------- Load main Hollow Knight database files ----------------- // import HK from "./hk-database.js"; import MAP from "./hk-dictionary.js"; diff --git a/src/js/hk-functions.js b/src/js/hk-functions.js new file mode 100644 index 0000000..e69de29 diff --git a/src/js/index.js b/src/js/index.js index 64a949d..27fc901 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -10,6 +10,8 @@ require("../css/style.css"); // required for meta tags (social) to be visible by Webpack require("../img/thumbnail1200x628.jpg"); +require("./page-functions.js"); + // Instantly load test save file from .json (fast Debugging script) // require("./LoadJson.js"); diff --git a/src/js/page-functions.js b/src/js/page-functions.js new file mode 100644 index 0000000..60fc997 --- /dev/null +++ b/src/js/page-functions.js @@ -0,0 +1,28 @@ +/* the document element root () */ +const ROOT = document.documentElement; + +function ScrollTo() { + +} + +function ShowElement() { + +} + +function HideElement() { + +} + +function DetectPageScroll() { + + /* Maximum number of pixels that can be scrolled by the user */ + let scrollTotal = ROOT.scrollHeight - ROOT.clientHeight; + + if ((ROOT.scrollTop / scrollTotal ) > 0.80) { + //show button + } else { + //hide button + } +} + +document.addEventListener("scroll", DetectPageScroll); \ No newline at end of file