Skip to content

Commit 8da6840

Browse files
committed
Add mobile searchbar
1 parent 89004f5 commit 8da6840

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

app/styles/app.scss

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,6 @@ body {
7474
min-width: 200px;
7575
}
7676

77-
input.search {
78-
font-size: 90%;
79-
border: none;
80-
color: black;
81-
outline: 0;
82-
margin-left: 30px;
83-
padding: 5px 5px 5px 25px;
84-
background-image: url('/assets/search.png');
85-
background-repeat: no-repeat;
86-
background-position: 6px 6px;
87-
@include border-radius(15px);
88-
}
89-
9077
button {
9178
background: none;
9279
outline: 0;
@@ -118,6 +105,31 @@ body {
118105
}
119106
}
120107

108+
#header input.search, #mobile-search input.search {
109+
font-size: 90%;
110+
border: none;
111+
color: black;
112+
outline: 0;
113+
margin-left: 30px;
114+
padding: 5px 5px 5px 25px;
115+
background-image: url('/assets/search.png');
116+
background-repeat: no-repeat;
117+
background-position: 6px 6px;
118+
@include border-radius(15px);
119+
}
120+
121+
#mobile-search {
122+
display: none;
123+
margin-bottom: 10px;
124+
input.search {
125+
width: 100%;
126+
margin: 0;
127+
}
128+
@media only screen and (max-width: 820px) {
129+
display: block;
130+
}
131+
}
132+
121133
span.small {
122134
color: $main-color-light;
123135
font-size: 80%;

app/templates/application.hbs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@
7070
</div>
7171
</div>
7272

73+
<form id='mobile-search' class='search' action='/search' {{ action "search" on="submit" }} >
74+
{{input type="text" class="search" name="q"
75+
placeholder="Search"
76+
value=search
77+
tabindex="1"}}
78+
</form>
79+
7380
<div id="main" class='inner-content'>
7481
<p id='flash' class={{if flashError "shown"}}>{{flashError}}</p>
7582

0 commit comments

Comments
 (0)