Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

replace hamburger with state controlled left right carets

Edward Plato4c09d38807ff
diff --git a/web/css/timeline.css b/web/css/timeline.css
index 71a4a026f..d1013a184 100644
--- a/web/css/timeline.css
+++ b/web/css/timeline.css
@@ -392,6 +392,7 @@ g.plot rect.data-bar-invisible {
#timeline-footer {
border-left: 1px solid #666;
border-right: 1px solid #666;
+ /* margin-right: 58px; */
}
#timeline-footer svg {
@@ -505,16 +506,16 @@ g.plot rect.data-bar-invisible {
top: 0;
right: 0;
height: 64px;
- width: 20px;
- cursor: pointer;
+ width: 0;
+ /* cursor: pointer; */
border-left: 1px solid #1a1a1a;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
-#timeline-hide:hover {
+/* #timeline-hide:hover {
background-color: #fff;
-}
+} */
#guitarpick {
cursor: pointer;
diff --git a/web/js/components/timeline/timeline.css b/web/js/components/timeline/timeline.css
index 053e20f7d..2008100d5 100644
--- a/web/js/components/timeline/timeline.css
+++ b/web/js/components/timeline/timeline.css
@@ -197,6 +197,38 @@ form select {
}
+.wv-timeline-hide-arrow {
+ vertical-align: middle;
+ display: block;
+ margin: 26px 0 0 10px;
+ font-size: 40px;
+ color: white;
+ cursor: pointer;
+ background: rgba(40, 40, 40, 0.9);
+ width: 40px;
+ border-top-right-radius: 5px;
+ border-bottom-right-radius: 5px;
+ padding-left: 2px;
+ transform: scale(1.5,1);
+}
+
+.wv-timeline-hide-arrow:hover {
+ color: #1a1a1a;
+ background: white;
+}
+
+.timeline-hamburger-date {
+ position: relative;
+ width: 20px;
+ left: 15px;
+ top: 5px;
+ font-weight: 800;
+ letter-spacing: 2px;
+ font-size: 14px;
+ color: white;
+ background: rgba(40, 40, 40, 0.9);
+}
+
/* DEMO DOM CLEANUP */
/* #timeline-footer-svg {
diff --git a/web/js/components/timeline/timeline.js b/web/js/components/timeline/timeline.js
index a7bafd3ef..15d70653c 100644
--- a/web/js/components/timeline/timeline.js
+++ b/web/js/components/timeline/timeline.js
@@ -27,7 +27,8 @@ class Timeline extends React.Component {
customIntervalValue: '',
customIntervalZoomLevel: '',
customIntervalModalOpen: false,
- inputChange: false
+ inputChange: false,
+ timelineHidden: false
};
}
@@ -129,6 +130,14 @@ class Timeline extends React.Component {
this.props.clickAnimationButton();
}
+ // toggle hide timeline
+ toggleHideTimeline = () => {
+ console.log('hey')
+ this.setState({
+ timelineHidden: !this.state.timelineHidden
+ }, this.props.toggleHideTimeline());
+ }
+
shouldComponentUpdate(nextProps, nextState) {
// console.log(this.props, nextProps, this.state, nextState)
// if (this.state.inputChange) {
@@ -203,10 +212,16 @@ class Timeline extends React.Component {
</div>
{/* hammmmmmmmmmmburger 🍔 */}
- <div id="timeline-hide">
- <svg className="hamburger" width="10" height="9">
+ <div className="timeline-hamburger-date">DAY</div>
+ <div id="timeline-hide" onClick={this.toggleHideTimeline}>
+ {this.state.timelineHidden ?
+ <i className="far fa-caret-square-right wv-timeline-hide-arrow"></i>
+ :
+ <i className="far fa-caret-square-left wv-timeline-hide-arrow"></i>
+ }
+ {/* <svg className="hamburger" width="10" height="9">
<path d="M 0,0 0,1 10,1 10,0 0,0 z M 0,4 0,5 10,5 10,4 0,4 z M 0,8 0,9 10,9 10,8 0,8 z" />
- </svg>
+ </svg> */}
</div>
</React.Fragment>
:
diff --git a/web/js/date/timeline.js b/web/js/date/timeline.js
index 05f82ba83..986170d78 100644
--- a/web/js/date/timeline.js
+++ b/web/js/date/timeline.js
@@ -473,6 +473,8 @@ export function timeline(models, config, ui) {
console.log(ui);
};
+
+
var getInitialProps = () => {
// console.log(self)
let selectedDate = models.date[models.date.activeDate];
@@ -493,7 +495,8 @@ export function timeline(models, config, ui) {
dateFormatted: new Date(selectedDate).toISOString(),
inputProps: inputProps,
stopper: stopper,
- clickAnimationButton: clickAnimationButton
+ clickAnimationButton: clickAnimationButton,
+ toggleHideTimeline: self.toggle
};
};
@@ -660,12 +663,12 @@ export function timeline(models, config, ui) {
}
}
- $('#timeline-hide').click(function() {
- googleTagManager.pushEvent({
- event: 'timeline_hamburger'
- });
- self.toggle();
- });
+ // $('#timeline-hide').click(function() {
+ // googleTagManager.pushEvent({
+ // event: 'timeline_hamburger'
+ // });
+ // self.toggle();
+ // });
$(window).resize(function() {
self.resize();