mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-19 00:58:28 -04:00
✨ Add scroll to top link
This commit is contained in:
@@ -14,17 +14,36 @@
|
||||
<body
|
||||
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 bg-neutral text-neutral-900 sm:px-14 md:px-24 lg:px-32 dark:bg-neutral-800 dark:text-neutral max-w-7xl"
|
||||
>
|
||||
<div class="absolute flex self-center">
|
||||
<div id="the-top" class="absolute flex self-center">
|
||||
<a
|
||||
class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 dark:bg-neutral-600 focus:translate-y-0"
|
||||
href="#main-content"
|
||||
><span class="font-bold ltr:pr-2 rtl:pl-2 text-primary-600 dark:text-primary-400"
|
||||
>↓</span
|
||||
>{{ i18n "header.skip_to_main" }}</a
|
||||
>{{ i18n "nav.skip_to_main" }}</a
|
||||
>
|
||||
</div>
|
||||
{{- partial "header.html" . -}}
|
||||
<main id="main-content" class="grow">{{- block "main" . }}{{- end }}</main>
|
||||
<main id="main-content" class="relative grow">
|
||||
{{- block "main" . }}{{- end }}
|
||||
{{ if .Site.Params.showScrollToTop | default true }}
|
||||
<div
|
||||
class="absolute top-[100vh] right-0 w-12 pointer-events-none {{ if .Params.showPagination | default (.Site.Params.article.showPagination | default true) }}
|
||||
bottom-16
|
||||
{{ else }}
|
||||
-bottom-4
|
||||
{{ end }}"
|
||||
>
|
||||
<a
|
||||
href="#the-top"
|
||||
class="w-12 h-12 sticky pointer-events-auto top-[calc(100vh-5rem)] text-neutral-500 bg-neutral/50 backdrop-blur rounded-full text-xl flex items-center justify-center hover:text-primary-500"
|
||||
aria-label="{{ i18n "nav.scroll_to_top_title" }}"
|
||||
title="{{ i18n "nav.scroll_to_top_title" }}"
|
||||
>↑</a
|
||||
>
|
||||
</div>
|
||||
{{ end }}
|
||||
</main>
|
||||
{{ if .Site.Params.enableSearch | default false }}
|
||||
{{- partial "search.html" . -}}
|
||||
{{ end }}
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
{{ if .Site.Params.attribution | default true }}
|
||||
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
||||
{{ $hugo := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
|
||||
href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a>` }}
|
||||
href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a>`
|
||||
}}
|
||||
{{ $congo := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500" href="https://git.io/hugo-congo" target="_blank" rel="noopener noreferrer">Congo</a>` }}
|
||||
{{ i18n "footer.powered_by" (dict "Hugo" $hugo "Congo" $congo) | safeHTML }}
|
||||
</p>
|
||||
@@ -43,14 +44,14 @@
|
||||
<div class="text-sm cursor-pointer text-neutral-400 dark:text-neutral-500">
|
||||
<button
|
||||
id="dark-toggle"
|
||||
class="inline px-2 py-1 border rounded-md border-neutral-200 dark:hidden hover:text-primary-500 hover:border-primary-400"
|
||||
class="inline px-3 py-2 border rounded-md border-neutral-200 dark:hidden hover:text-primary-500 hover:border-primary-400"
|
||||
title="{{ i18n "footer.dark_appearance" }}"
|
||||
>
|
||||
{{ partial "icon.html" "moon" }}
|
||||
</button>
|
||||
<button
|
||||
id="light-toggle"
|
||||
class="hidden px-2 py-1 border rounded-md cursor-pointer dark:inline border-neutral-700 hover:text-primary-400 hover:border-primary-500"
|
||||
class="hidden px-3 py-2 border rounded-md cursor-pointer dark:inline border-neutral-700 hover:text-primary-400 hover:border-primary-500"
|
||||
title="{{ i18n "footer.light_appearance" }}"
|
||||
>
|
||||
{{ partial "icon.html" "sun" }}
|
||||
|
||||
Reference in New Issue
Block a user