From ccff6ae2cd38b7a48d26dc6c2080f66014c031ab Mon Sep 17 00:00:00 2001 From: NCanggoro Date: Mon, 28 Aug 2023 21:58:52 +0700 Subject: [PATCH] fixing index text input --- src/app.css | 48 +++++++++++++++++++++++++++++++++++++++- src/pages/Home/index.tsx | 32 ++++++++++++++------------- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/src/app.css b/src/app.css index f786fd3..cc3ba2c 100644 --- a/src/app.css +++ b/src/app.css @@ -19,18 +19,63 @@ } form.search-input { - display: none + display: none; + margin-left: 0; } button.dropdown-menu { display: block; } + + .search-input-dropdown { + margin-right: 10px; + display: block !important; + } + + h1.title-dropdown { + display: none; + } +} + +@media screen and (max-width: 390px){ + input.text-input-search { + width: 230px; + } } .dropdown-menu { display: none; } +.search-input { + margin-left: auto; +} + +label { + position: relative; +} + +label:before { + content: ""; + position: absolute; + left: 10px; + top: 0; + bottom: 0; + width: 18px; + background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' width='18' height='18' viewBox='0 0 25 25' fill-rule='evenodd'%3E%3Cpath d='M16.036 18.455l2.404-2.405 5.586 5.587-2.404 2.404zM8.5 2C12.1 2 15 4.9 15 8.5S12.1 15 8.5 15 2 12.1 2 8.5 4.9 2 8.5 2zm0-2C3.8 0 0 3.8 0 8.5S3.8 17 8.5 17 17 13.2 17 8.5 13.2 0 8.5 0zM15 16a1 1 0 1 1 2 0 1 1 0 1 1-2 0'%3E%3C/path%3E%3C/svg%3E") center / contain no-repeat; +} + +.text-input-search { + padding: 12px 20px 12px 40px; + border-radius: 12px; + width: 325px; + font-size: 1em; + background-color: #4b4b4b; +} + +.title { + font-size: 32px; +} .content { max-width: 1280px; @@ -44,6 +89,7 @@ font-size: 14px; } + .nav-container { background-color: #4b4b4b; padding: 10px 0; diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index c6cf8fa..f2897ec 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -7,6 +7,7 @@ import React from 'preact/compat'; function Home() { const [count, setCount] = useState(0) const [searchVal, setSearchVal] = useState(''); + const [dropdown, setDropdown] = useState(false); const onInput = (e: React.ChangeEvent): void => { const val = e.target as HTMLInputElement; @@ -19,35 +20,36 @@ function Home() { } const onDropdown = (e): void => { - alert("bruh"); + setDropdown(!dropdown) + // alert("bruh"); } return (
-
-
-

HilingRiviw

-
- - +
+

HilingRiviw

+ + - -