Skip to content

Commit

Permalink
update local search layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Acris committed Feb 17, 2017
1 parent 9fd8427 commit 27eaf46
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 54 deletions.
20 changes: 14 additions & 6 deletions layout/_partials/search/localsearch.swig
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<div class="popup">
<span class="search-icon fa fa-search"></span>
<input type="text" id="local-search-input">
<div id="local-search-result"></div>
<span class="popup-btn-close">close</span>
</div>
<div class="popup local-search-popup">
<div class="local-search-header clearfix">
<span class="search-icon">
<i class="fa fa-search"></i>
</span>
<span class="popup-btn-close">
<i class="fa fa-times-circle"></i>
</span>
<div class="local-search-input-wrapper">
<input autocapitalize="off" autocomplete="off" autocorrect="off" placeholder="Searching..." spellcheck="false" type="text" id="local-search-input">
</div>
</div>
<div id="local-search-result"></div>
</div>
87 changes: 57 additions & 30 deletions source/css/_common/components/third-party/localsearch.styl
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand All @@ -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;
}
18 changes: 0 additions & 18 deletions source/css/_common/scaffolding/helpers.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 27eaf46

Please sign in to comment.