🐛 Move to top gap between content and icon

This commit is contained in:
Nuno Coração 2023-05-08 22:11:38 +01:00
parent a246ba2451
commit 16600ee159
4 changed files with 13 additions and 5 deletions

View file

@ -1403,8 +1403,8 @@ select {
top: 5rem;
}
.top-\[100vh\] {
top: 100vh;
.top-\[110vh\] {
top: 110vh;
}
.top-\[11px\] {

View file

@ -65,3 +65,11 @@ var updateMeta = () => {
style = getComputedStyle(elem);
document.querySelector('meta[name="theme-color"]').setAttribute('content', style.backgroundColor);
}
window.addEventListener("DOMContentLoaded", (event) => {
const scroller = document.getElementById("top-scroller");
const footer = document.getElementById("site-footer");
if(scroller.getBoundingClientRect().top > footer.getBoundingClientRect().top) {
scroller.hidden = true;
}
});

View file

@ -1,4 +1,4 @@
<footer class="py-10 print:hidden">
<footer id="site-footer" class="py-10 print:hidden">
{{/* Footer menu */}}
{{ if .Site.Params.footer.showMenu | default true }}
{{ if .Site.Menus.footer }}

View file

@ -1,4 +1,4 @@
<div class="pointer-events-none absolute top-[100vh] bottom-0 w-12 ltr:right-0 rtl:left-0">
<div id="top-scroller" class="pointer-events-none absolute top-[110vh] bottom-0 w-12 ltr:right-0 rtl:left-0">
<a href="#the-top"
class="pointer-events-auto sticky top-[calc(100vh-5.5rem)] flex h-12 w-12 mb-16 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 backdrop-blur hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
aria-label="{{ i18n "nav.scroll_to_top_title" }}" title="{{ i18n "nav.scroll_to_top_title" }}">