Files
github-style/layouts/partials/header.html
yuweizzz 99afb0f751 search
2024-09-03 23:41:28 +08:00

65 lines
4.2 KiB
HTML

<div style="position: relative">
<header class="Header js-details-container Details px-3 px-md-4 px-lg-5 flex-wrap flex-md-nowrap open Details--on">
<div class="Header-item mobile-none" style="margin-top: -4px; margin-bottom: -4px;">
<a class="Header-link" href="{{ .Site.BaseURL }}">
<img class="octicon" height="32" width="32" src="{{ .Site.Params.headerIcon }}">
</a>
</div>
<div class="Header-item d-md-none">
<button class="Header-link btn-link js-details-target" type="button"
onclick="document.querySelector('#header-search').style.display = document.querySelector('#header-search').style.display == 'none'? 'block': 'none'">
<svg height="24" class="octicon octicon-three-bars" viewBox="0 0 16 16" version="1.1" width="24">
<path fill-rule="evenodd" d="M1 2.75A.75.75 0 011.75 2h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 2.75zm0 5A.75.75 0 011.75 7h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 7.75zM1.75 12a.75.75 0 100 1.5h12.5a.75.75 0 100-1.5H1.75z">
</path>
</svg>
</button>
</div>
<div style="display: none;" id="header-search"
class="Header-item Header-item--full flex-column flex-md-row width-full flex-order-2 flex-md-order-none mr-0 mr-md-3 mt-3 mt-md-0 Details-content--hidden-not-important d-md-flex">
<div
class="Header-search header-search flex-auto js-site-search position-relative flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to">
<div class="position-relative">
{{ if .Site.Params.enableSearch }}
<form target="_blank" id="search-form" action="" accept-charset="UTF-8" method="get"
autocomplete="off">
<label
class="Header-search-label form-control input-sm header-search-wrapper p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center">
<input type="text"
class="Header-search-input form-control input-sm header-search-input jump-to-field js-jump-to-field js-site-search-focus js-site-search-field is-clearable"
name="q" value="" placeholder="Search" autocomplete="off">
</label>
</form>
{{ else }}
<form target="_blank" action="https://www.google.com/search" accept-charset="UTF-8" method="get"
autocomplete="off">
<label
class="Header-search-label form-control input-sm header-search-wrapper p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center">
<input type="text"
class="Header-search-input form-control input-sm header-search-input jump-to-field js-jump-to-field js-site-search-focus js-site-search-field is-clearable"
name="q" value="" placeholder="Search" autocomplete="off">
<input type="hidden" name="q" value="site:{{ .Site.BaseURL }}">
</label>
</form>
{{ end }}
</div>
</div>
</div>
<div class="Header-item Header-item--full flex-justify-center d-md-none position-relative">
<a class="Header-link " href="{{ .Site.BaseURL }}">
<img class="octicon octicon-mark-github v-align-middle" height="32" width="32" src="{{ .Site.Params.headerIcon }}">
</a>
</div>
<div class="Header-item" style="margin-right: 0;">
<a href="javascript:void(0)" class="Header-link no-select" onclick="switchTheme()">
<svg style="fill: var(--color-profile-color-modes-toggle-moon);" class="no-select" viewBox="0 0 16 16"
version="1.1" width="16" height="16">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M4.52208 7.71754C7.5782 7.71754 10.0557 5.24006 10.0557 2.18394C10.0557 1.93498 10.0392 1.68986 10.0074 1.44961C9.95801 1.07727 10.3495 0.771159 10.6474 0.99992C12.1153 2.12716 13.0615 3.89999 13.0615 5.89383C13.0615 9.29958 10.3006 12.0605 6.89485 12.0605C3.95334 12.0605 1.49286 10.001 0.876728 7.24527C0.794841 6.87902 1.23668 6.65289 1.55321 6.85451C2.41106 7.40095 3.4296 7.71754 4.52208 7.71754Z">
</path>
</svg>
</a>
</div>
</header>
</div>