chore: modularize search; deduplicate helpers
This commit is contained in:
parent
d2ad1147b3
commit
643aa242ff
7 changed files with 224 additions and 254 deletions
29
src/components/search/SearchForm.astro
Normal file
29
src/components/search/SearchForm.astro
Normal file
|
@ -0,0 +1,29 @@
|
|||
<form class="search__form" action="https://duckduckgo.com" method="get">
|
||||
<input
|
||||
class="search__form--input"
|
||||
placeholder="Search"
|
||||
type="search"
|
||||
name="q"
|
||||
autocomplete="off"
|
||||
autofocus
|
||||
/>
|
||||
<details>
|
||||
<summary class="highlight-text">Filter by type</summary>
|
||||
<fieldset class="search__form--type">
|
||||
{["post", "link", "artist", "genre", "book", "movie", "show"].map(type => (
|
||||
<label>
|
||||
<input type="checkbox" name="type" value={type} checked />
|
||||
{type.charAt(0).toUpperCase() + type.slice(1)}
|
||||
</label>
|
||||
))}
|
||||
</fieldset>
|
||||
</details>
|
||||
<input
|
||||
class="search__form--fallback"
|
||||
type="hidden"
|
||||
name="sites"
|
||||
value="coryd.dev"
|
||||
/>
|
||||
</form>
|
||||
<ul class="search__results client-side"></ul>
|
||||
<button class="search__load-more client-side" style="display:none">Load More</button>
|
Reference in a new issue