Added the search bar to the footer

This commit is contained in:
Asaf Gartner 2022-02-10 22:27:28 +02:00
parent 1ce6ec080b
commit b2a2b49abe
5 changed files with 9 additions and 12 deletions

View File

@ -7793,12 +7793,8 @@ article code {
vertical-align: top;
width: 90%; }
.site-search {
width: 100%; }
.site-search:focus {
width: 200%; }
.site-search[type=text].lite {
transition: border-bottom-color 60ms ease-in-out, width 300ms ease; }
.site-search[type=text].lite {
transition: border-bottom-color 60ms ease-in-out, width 300ms ease; }
#search_button_homepage {
margin: 0px;

View File

@ -720,12 +720,6 @@ footer {
}
.site-search {
width: 100%;
&:focus {
width: 200%;
}
&[type=text].lite {
// wow CSS selector priority sucks

View File

@ -29,4 +29,9 @@
<a href="{{ .Footer.ContactUrl }}">Contact</a>
</li>
</ul>
<form onsubmit="this.querySelector('input[name=q]').value = this.querySelector('#searchstring').value + ' site:handmade.network';" class="ma0 mt3 bg--card pa1 br2 dib" method="GET" action="{{ .Footer.SearchActionUrl }}" target="_blank">
<input type="hidden" name="q" />
<input class="site-search bn lite pa2 fira" type="text" id="searchstring" value="" placeholder="Search with DuckDuckGo" size="18" />
<input id="search_button_homepage" type="submit" value="Go"/>
</form>
</footer>

View File

@ -75,6 +75,7 @@ type Footer struct {
ProjectIndexUrl string
ForumsUrl string
ContactUrl string
SearchActionUrl string
}
type Thread struct {

View File

@ -84,6 +84,7 @@ func getBaseData(c *RequestContext, title string, breadcrumbs []templates.Breadc
ProjectIndexUrl: hmnurl.BuildProjectIndex(1),
ForumsUrl: hmnurl.HMNProjectContext.BuildForum(nil, 1),
ContactUrl: hmnurl.BuildContactPage(),
SearchActionUrl: "https://duckduckgo.com",
},
}