diff --git a/public/assets/css/front/index.css b/public/assets/css/front/index.css index f73f367..496a9c5 100644 --- a/public/assets/css/front/index.css +++ b/public/assets/css/front/index.css @@ -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; } } diff --git a/public/assets/css/global/forms.css b/public/assets/css/global/forms.css index f965472..26caf39 100644 --- a/public/assets/css/global/forms.css +++ b/public/assets/css/global/forms.css @@ -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; } diff --git a/public/assets/images/global/icon-search.svg b/public/assets/images/global/icon-search.svg index 47a3125..d41cc54 100644 --- a/public/assets/images/global/icon-search.svg +++ b/public/assets/images/global/icon-search.svg @@ -1,8 +1,4 @@ - - - - - - - + + + diff --git a/resources/views/front/index.blade.php b/resources/views/front/index.blade.php index e68b58e..13d5d34 100644 --- a/resources/views/front/index.blade.php +++ b/resources/views/front/index.blade.php @@ -1,13 +1,15 @@ -@extends('frame') +@extends('frame') @section('title', 'This is The Bad Space') @section('main-content') @parent + @csrf @@ -55,4 +57,4 @@ - @endsection \ No newline at end of file + @endsection