From 27eaf4664f5cf355afc1eacc83bb9494cf7f3ca6 Mon Sep 17 00:00:00 2001 From: Acris Liu Date: Sat, 18 Feb 2017 03:19:18 +0800 Subject: [PATCH] update local search layout --- layout/_partials/search/localsearch.swig | 20 +++-- .../components/third-party/localsearch.styl | 87 ++++++++++++------- source/css/_common/scaffolding/helpers.styl | 18 ---- 3 files changed, 71 insertions(+), 54 deletions(-) diff --git a/layout/_partials/search/localsearch.swig b/layout/_partials/search/localsearch.swig index 169b1b9a3..b0aeffd80 100644 --- a/layout/_partials/search/localsearch.swig +++ b/layout/_partials/search/localsearch.swig @@ -1,6 +1,14 @@ - \ No newline at end of file + diff --git a/source/css/_common/components/third-party/localsearch.styl b/source/css/_common/components/third-party/localsearch.styl index b3629be98..a3715d406 100644 --- a/source/css/_common/components/third-party/localsearch.styl +++ b/source/css/_common/components/third-party/localsearch.styl @@ -1,45 +1,55 @@ ul.search-result-list { - padding-left: 0px; - margin: 0px 5px 0px 8px; + padding: 0; + margin: 0 5px; } + p.search-result { border-bottom: 1px dashed #ccc; padding: 5px 0; } + a.search-result-title { font-weight: bold; + font-size: 16px; } -a.search-result { - border-bottom: transparent; - display: block; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} + .search-keyword { border-bottom: 1px dashed #f00; font-size: 14px; font-weight: bold; color: #f00; } + +.local-search-header { + padding: 5px; + height: 36px; + background: #f5f5f5; + border-top-left-radius: 5px; + border-top-right-radius: 5px; +} + #local-search-result { - height: 88%; overflow: auto; + position: relative; + padding: 5px 25px; + height: calc(100% - 55px); } + .popup { display: none; position: fixed; top: 10%; left: 50%; + -webkit-transform: translateX(-50%); + transform: translateX(-50%); width: 700px; height: 80%; - margin-left: -350px; - padding: 3px 0 0 10px; + padding: 0; background: #fff; color: #333; z-index: 9999; border-radius: 5px; - +mobile() { + +mobile() { padding: 3px; top: 0; left: 0; @@ -48,7 +58,6 @@ a.search-result { height: 100%; border-radius: 0px; } -// box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); } .popoverlay { @@ -58,32 +67,50 @@ a.search-result { top: 0px; left: 0px; z-index: 2080; - background-color: rgba(0,0,0,0.3); + background-color: rgba(0, 0, 0, 0.3); +} + +.local-search-input-wrapper { + display: inline-block; + width: calc(90% - 10px); + height: 36px; + line-height: 36px; +} + +.local-search-input-wrapper input { + padding: 8px 0; + height: 20px; + display: block; + width: 100%; + outline: none; + border: none; + background: transparent; + vertical-align: middle; } -#local-search-input { - margin-bottom: 10px; - padding: 10px; - width: 97%; - font-size: 18px +.search-icon, .popup-btn-close { + display: inline-block; + font-size: 18px; + padding: 0 10px; + color: #333333; + height: 36px; } -.popup .fa-search{padding-top:8px;} +.search-icon { + float: left; +} .popup-btn-close { - position: absolute; - top: 6px; - right: 14px; - color: #4EBD79; - font-size: 14px; - font-weight: bold; - text-transform: uppercase; + border-left: 1px solid #eee; + float: right; cursor: pointer; } #no-result { position: absolute; - left: 44%; - top: 42%; + left: 50%; + top: 50%; + -webkit-transform: translate(-50%, 50%); + transform: translate(-50%, 50%); color: #ccc; } diff --git a/source/css/_common/scaffolding/helpers.styl b/source/css/_common/scaffolding/helpers.styl index 9a1e19c99..a00d0bb4f 100644 --- a/source/css/_common/scaffolding/helpers.styl +++ b/source/css/_common/scaffolding/helpers.styl @@ -65,21 +65,3 @@ } .use-motion .motion-element { opacity: 0; } - -#local-search-input { - padding: 3px; - border: none; - text-indent: 14px; - border-radius: 0; - width: 140px; - outline: none; - border-bottom: 1px solid $grey-dark; - background: inherit; - opacity: 0.5; - &:focus { opacity: 1; } -} - -.search-icon { - position: absolute; - top: 9px; -}