-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f7acc2
commit 580cb99
Showing
1 changed file
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,226 @@ | ||
<header class="py-6 font-semibold text-neutral-900 dark:text-neutral print:hidden sm:py-10"> | ||
<nav class="flex items-start justify-between sm:items-center"> | ||
{{/* Site logo/title */}} | ||
<div class="z-40 flex flex-row items-center"> | ||
{{ partial "logo.html" . }} | ||
{{ partial "translations.html" . }} | ||
</div> | ||
{{ if or .Site.Menus.main (.Site.Params.enableSearch | default false) }} | ||
{{/* Hamburger menu */}} | ||
<label id="menu-button" for="menu-controller" class="block sm:hidden"> | ||
<input type="checkbox" id="menu-controller" class="hidden" /> | ||
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400"> | ||
{{ partial "icon.html" "bars" }} | ||
</div> | ||
<div | ||
id="menu-wrapper" | ||
class="fixed inset-0 z-30 invisible w-full h-full m-auto overflow-auto transition-opacity opacity-0 cursor-default bg-neutral-100/50 backdrop-blur-sm dark:bg-neutral-900/50" | ||
> | ||
<ul | ||
class="flex flex-col w-full px-6 py-6 mx-auto overflow-visible list-none max-w-7xl ltr:text-right rtl:text-left sm:px-14 sm:py-10 sm:pt-10 md:px-24 lg:px-32" | ||
> | ||
<li class="mb-1"> | ||
<span class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400" | ||
>{{ partial "icon.html" "xmark" }}</span | ||
> | ||
</li> | ||
{{ if .Site.Menus.main }} | ||
{{ range .Site.Menus.main }} | ||
<li class="mb-1 group"> | ||
{{ if eq .Params.action "search" }} | ||
{{ $.Scratch.Add "searchCount" 1 }} | ||
{{ if $.Site.Params.enableSearch | default false }} | ||
<button | ||
id="search-button-{{ $.Scratch.Get "searchCount" }}" | ||
title="{{ .Title | default (i18n "search.open_button_title") }}" | ||
> | ||
{{ with .Params.icon | default "search" }} | ||
<span | ||
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600" | ||
> | ||
{{ partial "icon.html" . }} | ||
</span> | ||
{{ end }}{{ if .Params.showName | default true }} | ||
<span | ||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2" | ||
>{{ .Name | markdownify | emojify }}</span | ||
> | ||
{{ end }} | ||
</button> | ||
{{ end }} | ||
{{ else if eq .Params.action "appearance" }} | ||
{{ $.Scratch.Add "switchCount" 1 }} | ||
<button | ||
id="appearance-switcher-{{ $.Scratch.Get "switchCount" }}" | ||
type="button" | ||
aria-label="appearance switcher" | ||
> | ||
<span | ||
class="inline transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600 dark:hidden" | ||
title="{{ i18n "footer.dark_appearance" }}" | ||
> | ||
{{ with .Params.icon | default "moon" }} | ||
{{ partial "icon.html" . }} | ||
{{ end }} | ||
{{ if .Params.showName | default true }} | ||
<span | ||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2" | ||
>{{ .Name | markdownify | emojify }}</span | ||
> | ||
{{ end }} | ||
</span> | ||
<span | ||
class="hidden transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600 dark:inline" | ||
title="{{ i18n "footer.light_appearance" }}" | ||
> | ||
{{ with .Params.icon | default "sun" }} | ||
{{ partial "icon.html" . }} | ||
{{ end }} | ||
{{ if .Params.showName | default true }} | ||
<span | ||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2" | ||
>{{ .Name | markdownify | emojify }}</span | ||
> | ||
{{ end }} | ||
</span> | ||
</button> | ||
{{ else }} | ||
<a | ||
href="{{ .URL }}" | ||
title="{{ .Title }}" | ||
{{ with .Params.target }}target="{{ . }}"{{ end }} | ||
>{{ with .Params.icon }} | ||
<span | ||
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600" | ||
> | ||
{{ partial "icon.html" . }} | ||
</span> | ||
{{ end }}{{ if .Params.showName | default true }} | ||
<span | ||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2" | ||
>{{ .Name | markdownify | emojify }}</span | ||
> | ||
{{ end }}</a | ||
> | ||
{{ end }} | ||
</li> | ||
{{ end }} | ||
{{ if and ($.Site.Params.enableSearch | default false) (eq ($.Scratch.Get "searchCount") 0) }} | ||
<li class="mb-1 group"> | ||
<button id="search-button-m0" title="{{ i18n "search.open_button_title" }}"> | ||
<span | ||
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600" | ||
> | ||
{{ partial "icon.html" "search" }} | ||
</span> | ||
</button> | ||
</li> | ||
{{ end }} | ||
{{ end }} | ||
</ul> | ||
</div> | ||
</label> | ||
{{/* Basic menu */}} | ||
<ul class="flex-row hidden list-none ltr:text-right rtl:text-left sm:flex"> | ||
{{ if .Site.Menus.main }} | ||
{{ range .Site.Menus.main }} | ||
<li | ||
class="mb-1 group sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0" | ||
> | ||
{{ if eq .Params.action "search" }} | ||
{{ $.Scratch.Add "searchCount" 1 }} | ||
{{ if $.Site.Params.enableSearch | default false }} | ||
<button | ||
id="search-button-{{ $.Scratch.Get "searchCount" }}" | ||
title="{{ .Title | default (i18n "search.open_button_title") }}" | ||
> | ||
{{ with .Params.icon | default "search" }} | ||
<span | ||
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600" | ||
> | ||
{{ partial "icon.html" . }} | ||
</span> | ||
{{ end }}{{ if .Params.showName | default true }} | ||
<span | ||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2" | ||
>{{ .Name | markdownify | emojify }}</span | ||
> | ||
{{ end }} | ||
</button> | ||
{{ end }} | ||
{{ else if eq .Params.action "appearance" }} | ||
{{ $.Scratch.Add "switchCount" 1 }} | ||
<button | ||
id="appearance-switcher-{{ $.Scratch.Get "switchCount" }}" | ||
type="button" | ||
aria-label="appearance switcher" | ||
> | ||
<span | ||
class="inline transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600 dark:hidden" | ||
title="{{ i18n "footer.dark_appearance" }}" | ||
> | ||
{{ with .Params.icon | default "moon" }} | ||
{{ partial "icon.html" . }} | ||
{{ end }} | ||
{{ if .Params.showName | default true }} | ||
<span | ||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2" | ||
>{{ .Name | markdownify | emojify }}</span | ||
> | ||
{{ end }} | ||
</span> | ||
<span | ||
class="hidden transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600 dark:inline" | ||
title="{{ i18n "footer.light_appearance" }}" | ||
> | ||
{{ with .Params.icon | default "sun" }} | ||
{{ partial "icon.html" . }} | ||
{{ end }} | ||
{{ if .Params.showName | default true }} | ||
<span | ||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2" | ||
>{{ .Name | markdownify | emojify }}</span | ||
> | ||
{{ end }} | ||
</span> | ||
</button> | ||
{{ else }} | ||
<a | ||
href="{{ .URL }}" | ||
title="{{ .Title }}" | ||
{{ with .Params.target }}target="{{ . }}"{{ end }} | ||
>{{ with .Params.icon }} | ||
<span | ||
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600" | ||
> | ||
{{ partial "icon.html" . }} | ||
</span> | ||
{{ end }}{{ if .Params.showName | default true }} | ||
<span | ||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2" | ||
>{{ .Name | markdownify | emojify }}</span | ||
> | ||
{{ end }}</a | ||
> | ||
{{ end }} | ||
</li> | ||
{{ end }} | ||
{{ if and ($.Site.Params.enableSearch | default false) (eq ($.Scratch.Get "searchCount") 0) }} | ||
<li | ||
class="mb-1 group sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0" | ||
> | ||
<button id="search-button-m1" title="{{ i18n "search.open_button_title" }}"> | ||
<span | ||
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600" | ||
> | ||
{{ partial "icon.html" "search" }} | ||
</span> | ||
</button> | ||
</li> | ||
{{ end }} | ||
|
||
{{ end }} | ||
</ul> | ||
{{ end }} | ||
</nav> | ||
</header> |