Update README. Preared landing Page

This commit is contained in:
schnulller
2022-06-12 02:18:14 +02:00
parent 6ea1ad9806
commit 6be85d495b
4 changed files with 18 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@
/* STYLES */
.ha-scrollbutton {
@apply opacity-0 transition-opacity duration-500 cursor-pointer fixed left-[85%] text-center bottom-0 pb-3 pt-2 bg-slate-50 dark:bg-slate-700 dark:text-white px-2 shadow-md rounded-t-xl hover:shadow-lg text-hamannSlate-700 hover:text-hamannSlate-500
@apply opacity-0 transition-opacity duration-500 cursor-pointer fixed left-[82%] text-center bottom-0 pb-3 pt-2 bg-slate-50 dark:bg-slate-700 dark:text-white px-2 shadow-md rounded-t-xl hover:shadow-lg text-hamannSlate-700 hover:text-hamannSlate-500
}
.ha-scrollbuttonarrow {

View File

@@ -260,8 +260,12 @@ const get_theme_settings = function (standard) {
const scrollFunction = function () {
button = document.getElementById("ha-scrollbutton");
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 300) {
// button.style.display = "block";
button.style.pointerEvents = "auto";
button.style.opacity = "1";
} else {
// button.style.display = "none";
button.style.pointerEvents = "none";
button.style.opacity = "0";
}
}
@@ -269,6 +273,7 @@ const scrollFunction = function () {
//////////////////////////////// ONLOAD ////////////////////////////////////
window.addEventListener("load", function () {
// Scroll button
scrollFunction();
let scrollbutton = this.document.getElementById("ha-scrollbutton");
scrollbutton.addEventListener("click", () => {
document.body.scrollTop = 0; // For Safari