diff --git a/themes/leilukin/layouts/default.twig b/themes/leilukin/layouts/default.twig index b7b96ff..51fa1e3 100644 --- a/themes/leilukin/layouts/default.twig +++ b/themes/leilukin/layouts/default.twig @@ -1,5 +1,5 @@ - + @@ -134,6 +134,12 @@ {{ posts.next_link("Page %d" | translate | format(posts.page + 1)) }} </div> {% endif %} +<a href="#top" class="top-btn"> + <svg class="top-btn__arrow" focusable="false" aria-hidden="true" viewBox="0 0 26 28"> + <path d="M25.172 15.172c0 0.531-0.219 1.031-0.578 1.406l-1.172 1.172c-0.375 0.375-0.891 0.594-1.422 0.594s-1.047-0.219-1.406-0.594l-4.594-4.578v11c0 1.125-0.938 1.828-2 1.828h-2c-1.062 0-2-0.703-2-1.828v-11l-4.594 4.578c-0.359 0.375-0.875 0.594-1.406 0.594s-1.047-0.219-1.406-0.594l-1.172-1.172c-0.375-0.375-0.594-0.875-0.594-1.406s0.219-1.047 0.594-1.422l10.172-10.172c0.359-0.375 0.875-0.578 1.406-0.578s1.047 0.203 1.422 0.578l10.172 10.172c0.359 0.375 0.578 0.891 0.578 1.422z"></path> + </svg> + Back to Top +</a> <!-- Footer --> {{ trigger.call("end_content") }} </body> diff --git a/themes/leilukin/stylesheets/all.css b/themes/leilukin/stylesheets/all.css index 6520d61..97e0547 100644 --- a/themes/leilukin/stylesheets/all.css +++ b/themes/leilukin/stylesheets/all.css @@ -696,6 +696,37 @@ aside > *:last-child, div.standalone > *:last-child { margin-bottom: 0rem; } +.top-btn, +.top-btn:hover { + color: var(--clr-top-btn-txt); + text-decoration: none; +} +.top-btn { + position: fixed; + bottom: 0.5rem; + right: 0.5rem; + z-index: 999; + font-weight: 700; + color: #08031A !important; + background-color: #FFD05A; + display: flex; + align-items: center; + border-radius: 50em; + padding: 0.3em 0.5em; + gap: 0.2em; +} +.top-btn:focus { + outline: 0.25em solid #FFD05A; + outline-offset: 0.15em; +} +.top-btn__arrow { + display: inline-block; + width: 1em; + aspect-ratio: 1 / 1; + stroke-width: 0; + stroke: currentColor; + fill: currentColor; +} .ajax_loading { background-size: 30px 30px; background-image: linear-gradient(