This repository has been archived by the owner on Jan 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Zhou
committed
Jun 13, 2019
1 parent
4aeaf4d
commit 20a67de
Showing
3 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.map-overlay { | ||
position: absolute; | ||
width: 15%; | ||
bottom: 5%; | ||
left: 0; | ||
padding: 10px; | ||
z-index:99; | ||
} | ||
|
||
.map-overlay .map-overlay-inner { | ||
background-color: #fff; | ||
box-shadow:0 1px 2px rgba(0, 0, 0, 0.20); | ||
border-radius: 3px; | ||
padding: 10px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.map-overlay input { | ||
background-color: transparent; | ||
display: inline-block; | ||
width: 100%; | ||
position: relative; | ||
margin: 0; | ||
cursor: ew-resize; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react"; | ||
import './MapOverlay.css'; | ||
|
||
const months = [ | ||
'January', | ||
'February', | ||
'March', | ||
'April', | ||
'May', | ||
'June', | ||
'July', | ||
'August', | ||
'September', | ||
'October', | ||
'November', | ||
'December' | ||
]; | ||
|
||
export default class MapOverlay extends React.Component { | ||
constructor(props, context) { | ||
super(props, context); | ||
this.state = { | ||
val: 0, | ||
month: months[0], | ||
} | ||
|
||
} | ||
|
||
handleChange = (event) => { | ||
|
||
this.setState({month: months[event.target.value]}) | ||
this.props.onMonthChange(event.target.value); | ||
} | ||
|
||
|
||
render() { | ||
return ( | ||
<div className='map-overlay top'> | ||
<div className='map-overlay-inner'> | ||
<label id='month'>{this.state.month}</label> | ||
<input id="slider" type="range" min="0" max="11" step="1" value={this.state.value} onChange={this.handleChange}/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters