
9 changed files with 165 additions and 121 deletions
@ -1,17 +0,0 @@ |
|||||||
.control-bar { |
|
||||||
display: flex; |
|
||||||
line-height: 2em; |
|
||||||
} |
|
||||||
|
|
||||||
.control-bar .refresh-btn { |
|
||||||
flex: 0 0 100px; |
|
||||||
color: black; |
|
||||||
background-color: rgba(255,255,255,.9); |
|
||||||
border-radius: 5px; |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
.control-bar input { |
|
||||||
flex: auto; |
|
||||||
color: black; |
|
||||||
background-color: rgba(255,255,255,.9); |
|
||||||
} |
|
@ -1,42 +0,0 @@ |
|||||||
import React, {Component} from 'react'; |
|
||||||
import './ControlBar.css'; |
|
||||||
|
|
||||||
export class ControlBar extends Component { |
|
||||||
constructor(props) { |
|
||||||
super(props); |
|
||||||
this.state={ |
|
||||||
search_text: '', |
|
||||||
}; |
|
||||||
this.set_search_text=props.set_search_text; |
|
||||||
} |
|
||||||
|
|
||||||
on_change(event) { |
|
||||||
this.setState({ |
|
||||||
search_text: event.target.value, |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
on_keypress(event) { |
|
||||||
if(event.key==='Enter') |
|
||||||
this.set_search_text(this.state.search_text); |
|
||||||
} |
|
||||||
|
|
||||||
do_refresh() { |
|
||||||
this.setState({ |
|
||||||
search_text: '', |
|
||||||
}); |
|
||||||
this.set_search_text(null); |
|
||||||
} |
|
||||||
|
|
||||||
render() { |
|
||||||
return ( |
|
||||||
<div className="control-bar aux-margin"> |
|
||||||
<a className="refresh-btn" onClick={this.do_refresh.bind(this)}>最新树洞</a> |
|
||||||
|
|
||||||
<input value={this.state.search_text} placeholder="搜索" |
|
||||||
onChange={this.on_change.bind(this)} onKeyPress={this.on_keypress.bind(this)} |
|
||||||
/> |
|
||||||
</div> |
|
||||||
) |
|
||||||
} |
|
||||||
} |
|
@ -1,19 +1,37 @@ |
|||||||
.title { |
.title-bar { |
||||||
z-index: 1; |
z-index: 1; |
||||||
position: sticky; |
position: sticky; |
||||||
top: 0; |
top: -6em; |
||||||
left: 0; |
left: 0; |
||||||
width: 100%; |
width: 100%; |
||||||
height: 2em; |
height: 9em; |
||||||
line-height: 2em; |
|
||||||
font-size: 1.5em; |
|
||||||
background-color: rgba(255,255,255,.8); |
background-color: rgba(255,255,255,.8); |
||||||
padding: 0 50px; |
|
||||||
box-shadow: 0 0 25px #999; |
box-shadow: 0 0 25px #999; |
||||||
margin-bottom: 1em; |
margin-bottom: 1em; |
||||||
} |
} |
||||||
.title-links { |
|
||||||
float: right; |
.title { |
||||||
display: inline-block; |
font-size: 2em; |
||||||
font-size: .7em; |
line-height: 3em; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.control-bar { |
||||||
|
display: flex; |
||||||
|
margin-top: .5em; |
||||||
|
line-height: 2em; |
||||||
|
} |
||||||
|
|
||||||
|
.control-bar .refresh-btn { |
||||||
|
flex: 0 0 100px; |
||||||
|
color: black; |
||||||
|
background-color: rgba(255,255,255,.5); |
||||||
|
border-radius: 5px; |
||||||
|
text-align: center; |
||||||
|
border: 1px solid black; |
||||||
|
} |
||||||
|
.control-bar input { |
||||||
|
flex: auto; |
||||||
|
color: black; |
||||||
|
background-color: rgba(255,255,255,.5); |
||||||
} |
} |
Loading…
Reference in new issue