From 544ea6026cf9b6e27e566f397bd93f2dc88d4bea Mon Sep 17 00:00:00 2001 From: Taha Dostifam Date: Sun, 31 Mar 2024 12:39:56 +0330 Subject: [PATCH 1/3] fix: search input styles and behavior improved --- public/assets/css/components/searchBar.css | 40 +++++++++------------- public/assets/css/components/topBar.css | 9 +++-- src/components/Topbar.vue | 11 +++--- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/public/assets/css/components/searchBar.css b/public/assets/css/components/searchBar.css index e25f359..ca59d7c 100644 --- a/public/assets/css/components/searchBar.css +++ b/public/assets/css/components/searchBar.css @@ -9,7 +9,9 @@ width: 70vw; background: var(--searchBar-field-active-background-color); box-shadow: var(--base-shadow); - padding: 15px 25px; + padding: 16px 17px; + + transition: 0.3s ease; } .searchBar-input { @@ -36,42 +38,30 @@ align-items: center; justify-content: flex-start; background: var(--searchBar-field-background-color); - padding: 6px 10px; + padding: 11px 12px; border-radius: 12px; - transition: width 0.3s ease-in-out; - width: 53px; + width: 200px; overflow: hidden; gap: 10px; box-shadow: 0 0 0 0 transparent; } +@media screen and (max-width: 850px) { + .searchBar-field { + width: 160px; + } +} + .searchBar-icon { position: relative; top: 2px; cursor: pointer; } -.searchBar-shortcut>.mdi { - position: relative; - top: 0px; - cursor: pointer; - font-size: 15px; - font-weight: 900; -} - .searchBar-icon>.mdi { font-size: 20px; } -.searchBar-shortcut { - display: flex; -} - -.searchBar-shortcut>.mdi+span { - font-size: 14px; - font-weight: 500; -} - .searchBar-results { position: absolute; top: 76px; @@ -88,12 +78,14 @@ .searchBar.active { position: fixed; - z-index: 1; - top: 0; + z-index: 20; + top: 20px; left: 0; right: 0; bottom: 0; margin: 20px; display: flex; justify-content: center; -} \ No newline at end of file +} + + diff --git a/public/assets/css/components/topBar.css b/public/assets/css/components/topBar.css index 6517021..88645bc 100644 --- a/public/assets/css/components/topBar.css +++ b/public/assets/css/components/topBar.css @@ -11,7 +11,7 @@ display: flex; align-items: center; justify-content: space-between; - gap: 20px; + gap: 35px; } .topBar-navigation { @@ -90,6 +90,7 @@ height: 24px; display: inline-block; position: relative; + top: 2px; } .topBar-hamburger-inner { @@ -157,6 +158,10 @@ } @media screen and (max-width: 745px) { + .topBar-wrapper { + gap: 10px; + } + .topBar-navigation { position: absolute; top: 50px; @@ -183,4 +188,4 @@ .topBar-hamburger { display: inline-block; } -} \ No newline at end of file +} diff --git a/src/components/Topbar.vue b/src/components/Topbar.vue index 2ccca67..151de4b 100644 --- a/src/components/Topbar.vue +++ b/src/components/Topbar.vue @@ -13,15 +13,14 @@
-
+
{{ isSearchActive ? 'close' : 'search' }}
-
- / -
- + +
@@ -44,7 +43,9 @@
+
+