mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-20 19:01:52 +02:00
Extract the "scroll to top" section as a partial
This commit is contained in:
parent
e6e8b05e07
commit
1460aefdd6
2 changed files with 8 additions and 7 deletions
|
@ -26,13 +26,7 @@
|
||||||
<main id="main-content" class="grow">
|
<main id="main-content" class="grow">
|
||||||
{{ block "main" . }}{{ end }}
|
{{ block "main" . }}{{ end }}
|
||||||
{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }}
|
{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }}
|
||||||
<div class="pointer-events-none absolute top-[100vh] bottom-0 w-12 ltr:right-0 rtl:left-0">
|
{{- partial "scroll-to-top.html" . -}}
|
||||||
<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" }}">
|
|
||||||
↑
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</main>
|
</main>
|
||||||
{{- partial "footer.html" . -}}
|
{{- partial "footer.html" . -}}
|
||||||
|
|
7
layouts/partials/scroll-to-top.html
Normal file
7
layouts/partials/scroll-to-top.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="pointer-events-none absolute top-[100vh] 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" }}">
|
||||||
|
↑
|
||||||
|
</a>
|
||||||
|
</div>
|
Loading…
Add table
Reference in a new issue