mirror of
https://koodu.h-i.works/projects/thebadspace
synced 2025-05-06 14:41:02 -05:00
Merge pull request 'Refactor home search' (#21) from moiety/search into develop
Reviewed-on: https://koodu.h-i.works/projects/thebadspace/pulls/21 Reviewed-by: RXP <ro@noreply.koodu.h-i.works>
This commit is contained in:
commit
d310cf4fb9
@ -3,6 +3,12 @@ section.index-search {
|
||||
background: var(--white);
|
||||
}
|
||||
|
||||
/* TODO: move to a global file? it’s not only for forms. */
|
||||
section.index-search :focus-visible {
|
||||
outline: 2px solid var(--white);
|
||||
outline-offset: -4px;
|
||||
}
|
||||
|
||||
section.start a.search-link {
|
||||
color: var(--highlight);
|
||||
font-size: 2.5em;
|
||||
@ -12,36 +18,57 @@ section.start a.search-link {
|
||||
}
|
||||
|
||||
form.index-search-form {
|
||||
display: grid;
|
||||
grid-template-columns: auto max-content;
|
||||
gap: 15px;
|
||||
width: 80%;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
form.index-search-form > input,
|
||||
form.index-search-form > button {
|
||||
display: block;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
form.index-search-form > input:focus {
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
form.index-search-form > input[type="text"] {
|
||||
width: 88%;
|
||||
height: 50px;
|
||||
font: 44px var(--base-type);
|
||||
}
|
||||
|
||||
form.index-search-form > input[type="hidden"] {
|
||||
/* This removes it from the grid calculations */
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
form.index-search-form > button {
|
||||
height: 60px;
|
||||
display: grid;
|
||||
grid-template-columns: auto;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
width: 60px;
|
||||
position: relative;
|
||||
top: 9px;
|
||||
right: 0;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
form.index-search-form > button > img#search-icon {
|
||||
float: none;
|
||||
form.index-search-form > button > svg {
|
||||
justify-self: center;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
form.index-search-form > button > label {
|
||||
font-weight: 500;
|
||||
top: 15px;
|
||||
position: relative;
|
||||
font-size: 1.5em;
|
||||
form.index-search-form > button > span {
|
||||
display: none;
|
||||
margin-top: 3px;
|
||||
font-weight: 500;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
::placeholder {
|
||||
@ -81,37 +108,34 @@ table.index-meta td {
|
||||
|
||||
@media only screen and (max-width: 800px) {
|
||||
form.index-search-form > input[type="text"] {
|
||||
width: 85%;
|
||||
height: 50px;
|
||||
font: 34px var(--base-type);
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 650px) {
|
||||
form.index-search-form > input[type="text"] {
|
||||
width: 80%;
|
||||
height: 50px;
|
||||
font: 34px var(--base-type);
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 480px) {
|
||||
form.index-search-form {
|
||||
grid-template-columns: auto;
|
||||
}
|
||||
form.index-search-form > input[type="text"] {
|
||||
width: 99%;
|
||||
height: 50px;
|
||||
font: 27px var(--base-type);
|
||||
}
|
||||
|
||||
form.index-search-form > input[type="text"],
|
||||
form.index-search-form > button {
|
||||
width: 99%;
|
||||
top: 15px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
form.index-search-form > button > label {
|
||||
display: inline;
|
||||
form.index-search-form > button {
|
||||
grid-template-columns: auto 60px;
|
||||
}
|
||||
|
||||
form.index-search-form > button > img#search-icon {
|
||||
float: right;
|
||||
form.index-search-form > button span {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
@ -8,16 +8,25 @@ input[type="text"] {
|
||||
display: inline-block;
|
||||
background: var(--white);
|
||||
color: var(--primary);
|
||||
transition: all 0.2s linear;
|
||||
transition: 0.2s linear;
|
||||
transition-property: color, background-color;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
input[type="text"]:focus,
|
||||
input[type="password"]:focus {
|
||||
outline: solid var(--highlight);
|
||||
background-color: var(--highlight);
|
||||
}
|
||||
|
||||
/* TODO: generalise this a bit */
|
||||
button:focus,
|
||||
input[type="submit"]:focus,
|
||||
input[type="text"]:focus,
|
||||
input[type="password"]:focus {
|
||||
outline: 2px solid var(--white);
|
||||
outline-offset: -4px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
border: 0;
|
||||
border-radius: 3px;
|
||||
@ -34,7 +43,8 @@ input[type="submit"] {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
transition: all 0.3s linear;
|
||||
transition: 0.3s linear;
|
||||
transition-property: color, background-color;
|
||||
height: 35px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
@ -1,8 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated by Pixelmator Pro 3.3.8 -->
|
||||
<svg width="101" height="100" viewBox="0 0 101 100" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="Group-copy">
|
||||
<path id="Path-copy-2" fill="none" stroke="#efebe3" stroke-width="8.777778" stroke-linecap="round" stroke-linejoin="round" d="M 11 41.722221 C 11 58.68964 24.754808 72.444443 41.722221 72.444443 C 58.68964 72.444443 72.444443 58.68964 72.444443 41.722221 C 72.444443 24.754807 58.68964 11 41.722221 11 C 24.754808 11 11 24.754807 11 41.722221"/>
|
||||
<path id="Path-copy" fill="none" stroke="#efebe3" stroke-width="8.777778" stroke-linecap="round" stroke-linejoin="round" d="M 90 90 L 63.666668 63.666668"/>
|
||||
</g>
|
||||
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" id="search">
|
||||
<path fill="none" stroke="currentcolor" stroke-width="8.777778" stroke-linecap="round" stroke-linejoin="round" d="M 11 41.722221 C 11 58.68964 24.754808 72.444443 41.722221 72.444443 C 58.68964 72.444443 72.444443 58.68964 72.444443 41.722221 C 72.444443 24.754807 58.68964 11 41.722221 11 C 24.754808 11 11 24.754807 11 41.722221"/>
|
||||
<path fill="none" stroke="currentcolor" stroke-width="8.777778" stroke-linecap="round" stroke-linejoin="round" d="M 90 90 L 63.666668 63.666668"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 571 B |
@ -5,9 +5,11 @@
|
||||
<section class="index-search">
|
||||
<form class="index-search-form" action="/search" method="post" enctype="multipart/form-data">
|
||||
<input type="text" name="index_search" value="" placeholder="Hi! This is where you search." />
|
||||
<button aria-label="search-button">
|
||||
<label id="search-label">LOOK FOR IT</label>
|
||||
<img id="search-icon" class="button-icon" src="assets/images/global/icon-search.svg" />
|
||||
<button aria-labelledby="search-label">
|
||||
<span id="search-label">Look for it</span>
|
||||
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="trye">
|
||||
<use href="assets/images/global/icon-search.svg#search" />
|
||||
</svg>
|
||||
</button>
|
||||
@csrf
|
||||
</form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user