Skip to content

Commit f67da17

Browse files
committed
Move search form to header
1 parent 47d5fc2 commit f67da17

File tree

3 files changed

+227
-228
lines changed

3 files changed

+227
-228
lines changed

static/css/main.css

+4-3
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ h1.br-nav, h2.br-nav, h3.br-nav, h4.br-nav {color:#777;font-size: 1em;font-weigh
144144
.main-right-body {padding: 0;}
145145

146146
.body-nav {background-color: var(--main-bg-color);}
147+
.sf {display: inline-block;}
148+
.sf input {width: 130px; font-size: .7em;}
147149

148150
.index {padding: .5em;background-color: var(--main-bg-color);}
149151
.index article {border-bottom: 1px solid var(--line-color);}
@@ -311,8 +313,6 @@ body>footer a:hover {color: #eee}
311313
display: inline-block;}
312314
#recent_comments li a {color: #333;text-decoration:none;}
313315
#recent_comments li a:hover {color:#000;text-decoration: underline;}
314-
.sidebar section.search-form {color: #333;background-color:var(--bar-bg-color);text-align: center;padding: .5em}
315-
.sidebar section.search-form input {background-color: #FCFCFC;line-height: .8em;padding: .2em .5em;}
316316
#top-category-list {line-height: 1.8em;padding: .5em 1em .5em 1em;font-size: .9em;max-height: 163px;overflow: auto;}
317317
#top-category-list a {color: #333;text-decoration:none;padding: 2px 4px;}
318318
#top-category-list a:hover {color: #fff;background-color: #464747}
@@ -347,6 +347,7 @@ body>footer a:hover {color: #eee}
347347

348348
a.top {
349349
font-size: 0;
350+
opacity: 0;
350351
font-family: Helvetica,Arial,Verdana,sans-serif;
351352
position: fixed;
352353
bottom: 100px;
@@ -367,7 +368,7 @@ a.top {
367368
color: #666;
368369
background: rgba(255, 255, 255, .5);
369370
}
370-
a.top.visible {font-size: 24px;}
371+
a.top.visible {opacity:1;font-size: 24px;}
371372
a.top:hover{background: rgba(200, 200, 200, .8);}
372373

373374
#id-msg {color: rgb(202, 60, 60);}

views/ybs/base.qtpl

+5-6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ Page prints a page implementing Page interface.
114114
// Banner bg
115115
{% func (p *BasePage) Banner() %}
116116
<a href="/" class="pure-menu-heading pure-menu-link">{%s p.SiteCf.Name %}</a>
117+
<div class="sf">
118+
<form action="/q" method="get" class="pure-form">
119+
<input type="text" name="q" class="pure-input-rounded" placeholder="站内搜索" autocomplete="off" />
120+
</form>
121+
</div>
117122
<ul class="pure-menu-list">
118123
{% if p.CurrentUser.ID > 0 %}
119124
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover">
@@ -177,12 +182,6 @@ This is a base MainBody
177182
{% func (p *BasePage) Aside() %}
178183
<aside class="sidebar">
179184

180-
<section class="search-form">
181-
<form action="/q" method="get" class="pure-form">
182-
<input type="text" name="q" class="pure-input-rounded" placeholder="站内搜索" autocomplete="off" />
183-
</form>
184-
</section>
185-
186185
{% if len(p.RecentComment)>0 %}
187186
<section>
188187
<h1>💬 最近评论</h1>

0 commit comments

Comments
 (0)