Files
halo_theme_terminal/templates/modules/header.html
T

148 lines
10 KiB
HTML

<th:block th:fragment="header" th:with="menu = ${menuFinder.getPrimary()}">
<div class="header-inner">
<div class="header-logo">
<a data-pjax th:href="@{/}">
<div class="logo"
th:text="${#strings.isEmpty(theme.config.header.logo) ? site.title : theme.config.header.logo}">
Blog Title
</div>
</a>
</div>
<button
id="search-button"
th:attr="aria-label=#{header.search.open}"
type="button"
data-header-action="open-search"
th:if="${theme.config.header.search_button_enable != false and pluginFinder.available('PluginSearchWidget')}">
<svg class="icon-regular button-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path
fill="currentColor"
d="m19.6 21l-6.3-6.3q-.75.6-1.725.95T9.5 16q-2.725 0-4.612-1.888T3 9.5q0-2.725 1.888-4.612T9.5 3q2.725 0 4.612 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l6.3 6.3l-1.4 1.4ZM9.5 14q1.875 0 3.188-1.313T14 9.5q0-1.875-1.313-3.188T9.5 5Q7.625 5 6.312 6.313T5 9.5q0 1.875 1.313 3.188T9.5 14Z"
/>
</svg>
<svg class="icon-pixel button-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor"
d="M6 2h8v2H6zM4 6V4h2v2zm0 8H2V6h2zm2 2H4v-2h2zm8 0v2H6v-2zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2zm0-8h2v8h-2zm0 0V4h-2v2z"/>
</svg>
</button>
<div
id="color-scheme-picker"
class="color-scheme-picker"
th:if="${theme.config.header.color_scheme_switcher_enable == true}">
<button
id="color-scheme-trigger"
class="color-scheme-trigger"
type="button"
th:attr="aria-label=#{header.color_scheme.open}"
aria-haspopup="listbox"
aria-expanded="false"
aria-controls="color-scheme-menu">
<svg class="icon-regular button-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor" d="M12.6 3.6c-5.96 0-10.8 4.3-10.8 9.6c0 3.97 3.23 7.2 7.2 7.2h1.98c.98 0 1.62-1 1.25-1.91c-.5-1.22.4-2.59 1.73-2.59h2.24c3.31 0 6-2.69 6-6c0-3.48-4.3-6.3-9.6-6.3ZM6 14.4a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm3.6-4.8a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm6 0a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm3.6 4.8a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Z"></path>
</svg>
<svg class="icon-pixel button-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24">
<g fill="currentColor"><path d="M22.29 6.285h1.14V12h-1.14ZM21.143 12h1.147v2.287h-1.147ZM21.143 3.998h1.147v2.287h-1.147ZM20.003 14.288h1.14v1.14h-1.14ZM20.003 2.858h1.14v1.14h-1.14ZM18.855 15.428h1.148v1.147h-1.148ZM18.855 8.573h1.148v4.567h-1.148ZM17.715 16.575h1.14v1.14h-1.14ZM17.715 13.14h1.14v1.148h-1.14ZM17.715 1.718h2.287v1.14h-2.287ZM16.575 17.715h1.14v1.14h-1.14ZM16.575 14.288h1.14v1.14h-1.14ZM15.428 7.433h3.427v1.14h-3.427ZM15.428 18.855h1.147v1.148h-1.147ZM14.288 20.003h1.14v1.14h-1.14ZM12 15.428h4.575v1.147H12ZM14.288 8.573h1.14v1.14h-1.14ZM14.288 6.285h2.287v-1.14h1.14V3.998h-1.14v-1.14h-2.287v1.14h-1.14v1.147h1.14zM13.148 21.143h1.14v1.14h-1.14ZM13.148 9.712h1.14v1.148h-1.14ZM12 10.86h1.148V12H12ZM6.285 22.283h6.863v1.147H6.285ZM10.86 12H12v3.428h-1.14ZM9.712.57h8.003v1.148H9.712ZM10.86 16.575H8.573v1.14h-1.14v2.288h1.14v1.14h2.287v-1.14H12v-2.288h-1.14zM7.433 1.718h2.28v1.14h-2.28ZM7.433 9.712h2.28v-1.14h1.147V6.285H9.713v-1.14h-2.28v1.14H6.284v2.287h1.147zM4.005 15.428h2.28v-1.14h1.148V12H6.285v-1.14h-2.28V12H2.858v2.287h1.147zM5.145 2.858h2.288v1.14H5.145ZM5.145 21.143h1.14v1.14h-1.14ZM2.858 20.003h2.287v1.14H2.858ZM4.005 3.998h1.14v1.147h-1.14ZM2.858 5.145h1.147v2.288H2.858ZM1.718 17.715h1.14v2.287h-1.14ZM1.718 7.433h1.14v2.28h-1.14Z"/><path d="M.57 9.712h1.148v8.003H.57Z"/></g>
</svg>
</button>
<div
id="color-scheme-menu"
class="color-scheme-menu"
role="listbox"
th:attr="aria-label=#{header.color_scheme.list}"
hidden>
<button
class="color-scheme-option"
type="button"
role="option"
aria-selected="true"
data-color-scheme="default">
default
</button>
</div>
</div>
<button
id="appearance-toggle"
th:attr="aria-label=#{header.appearance.current}"
th:if="${theme.config.header.appearance_switcher_enable != false}"
type="button">
<svg class="appearance-icon icon-regular button-icon" data-appearance-mode="light" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="4" fill="currentColor"/>
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"
d="M12 2v2m0 16v2M4.93 4.93l1.42 1.42m11.3 11.3l1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3l1.42-1.42"/>
</svg>
<svg class="appearance-icon icon-pixel button-icon" data-appearance-mode="light" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor"
d="M10 0h4v4h-4zM10 20h4v4h-4zM0 10h4v4H0zM20 10h4v4h-4zM4 4h3v3H4zM17 4h3v3h-3zM4 17h3v3H4zM17 17h3v3h-3zM8 8h8v8H8z"/>
</svg>
<svg class="appearance-icon icon-regular button-icon" data-appearance-mode="dark" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor" d="M20.69 15.95A9 9 0 0 1 8.05 3.31a9 9 0 1 0 12.64 12.64Z"/>
</svg>
<svg class="appearance-icon icon-pixel button-icon" data-appearance-mode="dark" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor"
d="M8 2h6v2h-2v2h-2v6h2v2h6v-2h2v4h-2v2h-2v2H8v-2H6v-2H4V8h2V4h2z"/>
</svg>
<svg class="appearance-icon icon-regular button-icon" data-appearance-mode="system" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="8" fill="none" stroke="currentColor" stroke-width="2"/>
</svg>
<svg class="appearance-icon icon-pixel button-icon" data-appearance-mode="system" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor"
d="M8 2h8v2h4v4h2v8h-2v4h-4v2H8v-2H4v-4H2V8h2V4h4v2H6v2H4v8h2v2h2v2h8v-2h2v-2h2V8h-2V6h-2V4H8z"/>
</svg>
</button>
<button
id="pixel-toggle"
th:attr="aria-label=#{header.pixel_style.toggle}"
th:if="${theme.config.header.pixel_style_switcher_enable != false}"
type="button">
<svg class="icon-pixel button-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor"
d="M22 17h2v2h-2Zm-1 2h1v2h-1Zm1-6V9h1V6h-4v3h2v4h1zm-3 8h2v1h-2Zm0-8h2v1h-2Zm-1 9h1v2h-1Zm0-8h1v1h-1Zm-1 1h1v1h-1Zm-1 1h1v8h-1Zm1-3V3h1V0h-3v3h1v10ZM16 1h1v1h-1Zm-1 12h1v1h-1Zm-1 1h1v10h-1Zm-4-3h1v13h2V11h1V8h-4v3zm-1 3h1v10H9Zm-1-1h1v1H8Zm-1 5h1v6H7ZM8 7h1V3H6v4h1v6h1V7zM6 17h1v1H6Zm-1 5h1v2H5Zm0-6h1v1H5Zm1-1v-4H2v4h1v1h2v-1Zm-3-1v-1h2v1Zm0 7h2v1H3Zm-1-2h1v2H2Zm-2-2h2v2H0Z"/>
</svg>
<svg class="icon-regular button-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor"
d="M22 17h2v2h-2Zm-1 2h1v2h-1Zm1-6V9h1V6h-4v3h2v4h1zm-3 8h2v1h-2Zm0-8h2v1h-2Zm-1 9h1v2h-1Zm0-8h1v1h-1Zm-1 1h1v1h-1Zm-1 1h1v8h-1Zm1-3V3h1V0h-3v3h1v10ZM16 1h1v1h-1Zm-1 12h1v1h-1Zm-1 1h1v10h-1Zm-4-3h1v13h2V11h1V8h-4v3zm-1 3h1v10H9Zm-1-1h1v1H8Zm-1 5h1v6H7ZM8 7h1V3H6v4h1v6h1V7zM6 17h1v1H6Zm-1 5h1v2H5Zm0-6h1v1H5Zm1-1v-4H2v4h1v1h2v-1Zm-3-1v-1h2v1Zm0 7h2v1H3Zm-1-2h1v2H2Zm-2-2h2v2H0Z"/>
</svg>
</button>
</div>
<nav class="navigation-menu">
<ul th:if="${menu != null} and ${not #lists.isEmpty(menu.menuItems)}"
class="navigation-menu-inner menu--desktop">
<li th:each="menuItem : ${menu.menuItems}">
<div th:if="${#lists.isEmpty(menuItem.children)}">
<a data-pjax
th:href="@{${menuItem.status.href}}"
th:target="${menuItem.spec.target?.value}"
th:text="${menuItem.status.displayName}"></a>
</div>
<div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu">
<a data-pjax
th:href="@{${menuItem.status.href}}"
th:target="${menuItem.spec.target?.value}">
<span th:text="${menuItem.status.displayName}"></span>
</a>
<div class="sub-menu">
<div class="menu-trigger">▾</div>
<ul class="menu-dropdown">
<li th:each="childMenuItem : ${menuItem.children}">
<a data-pjax
th:href="@{${childMenuItem.status.href}}"
th:target="${childMenuItem.spec.target?.value}">
<span th:text="${childMenuItem.status.displayName}"></span>
</a>
</li>
</ul>
</div>
</div>
</li>
</ul>
</nav>
</th:block>