Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

update axis on event finish animating, date arrow css cleanup

Ed Plato9fcd7dfcc654
diff --git a/e2e/features/timeline/date-selector-test.js b/e2e/features/timeline/date-selector-test.js
index c6e934658..a962cdbd2 100644
--- a/e2e/features/timeline/date-selector-test.js
+++ b/e2e/features/timeline/date-selector-test.js
@@ -55,7 +55,7 @@ module.exports = {
},
// verify default right arrow disabled since loaded on current day
- 'Right timeline arrow will be disabled by defaul': (c) => {
+ 'Right timeline arrow will be disabled by default': (c) => {
reuseables.loadAndSkipTour(c, TIME_LIMIT);
c.assert.cssClassPresent('#right-arrow-group', 'button-disabled');
},
diff --git a/e2e/reuseables/selectors.js b/e2e/reuseables/selectors.js
index 2560905a9..ce2dd10bc 100644
--- a/e2e/reuseables/selectors.js
+++ b/e2e/reuseables/selectors.js
@@ -13,7 +13,7 @@ module.exports = {
gifResults: '.gif-results-dialog-case img',
animationWidget: '#wv-animation-widget',
animationButtonCase: '#timeline-header .animate-button',
- animationButton: '#animate-button',
+ animationButton: '.animate-button',
// sidebar, layers
sidebarContainer: '#productsHolder',
diff --git a/web/css/timeline.css b/web/css/timeline.css
index 172eae3b0..1d0146462 100644
--- a/web/css/timeline.css
+++ b/web/css/timeline.css
@@ -151,19 +151,17 @@ button:focus {
& .date-arrows:hover,
& > .button-action-group:hover,
- & #zoom-buttons-group .button-action-group:hover {
+ & .button-action-group:hover {
background-color: #fff;
cursor: pointer;
}
& > .button-action-group .button-disabled:hover,
- & #zoom-buttons-group .button-disabled:hover {
+ & .button-disabled:hover {
background-color: transparent;
cursor: default;
}
& .button-action-group svg {
position: absolute;
- }
- & #zoom-buttons-group .button-action-group svg {
top: 50%;
margin-top: -15px;
left: 50%;
@@ -178,20 +176,17 @@ button:focus {
filter: FlipH;
-ms-filter: 'FlipH';
}
- & .now-button-group {
+ & #now-button-group {
width: 34px;
height: 34px;
- top: -1px;
- & svg {
- top: 0;
- left: 3px;
- margin: 0;
+ top: -2px;
+ svg {
+ left: 15px;
}
}
& > .button-action-group:hover .arrow,
- & #zoom-buttons-group .button-action-group:hover .arrow,
- & #zoom-buttons-group .button-action-group:hover .circle {
+ & #zoom-buttons-group .button-action-group:hover .arrow {
fill: #1a1a1a;
fill-opacity: 1;
stroke: none;
@@ -204,20 +199,17 @@ button:focus {
& #zoom-buttons-group .button-disabled:hover .arrow {
fill: #4d4d4d;
}
-
- & #animate-button {
- width: 100%;
- height: 100%;
- }
-
& .animate-button {
position: absolute;
height: 34px;
width: 37px;
top: 16px;
right: 4px;
- padding-left: 4px;
- padding-top: 5px;
+ & svg {
+ top: 5px;
+ left: 4px;
+ margin: 0;
+ }
}
& .animate-button:hover svg.wv-animate path {
fill: #1a1a1a;
diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.js
index 74c7e4406..1544bc64b 100644
--- a/web/js/components/timeline/timeline-axis/timeline-axis.js
+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js
@@ -68,6 +68,7 @@ class TimelineAxis extends Component {
draggerSelected,
timeScale,
isCompareModeActive,
+ isAnimatingToEvent,
hasFutureLayers,
hasSubdailyLayers,
matchingTimelineCoverage,
@@ -82,6 +83,7 @@ class TimelineAxis extends Component {
const checkForPropsUpdates = nextProps.axisWidth === axisWidth
&& nextProps.position === position
+ && nextProps.isAnimatingToEvent === isAnimatingToEvent
&& nextProps.dateA === dateA
&& nextProps.dateB === dateB
&& nextProps.draggerSelected === draggerSelected
@@ -134,6 +136,7 @@ class TimelineAxis extends Component {
hasFutureLayers,
onDateChange,
isAnimationPlaying,
+ isAnimatingToEvent,
isCompareModeActive,
isTimelineDragging,
draggerTimeState,
@@ -159,6 +162,11 @@ class TimelineAxis extends Component {
this.updateScale(draggerDate, timeScale, leftOffset, true, prevProps.timeScale);
}
+ // update axis on finish animate to event
+ if (prevProps.isAnimatingToEvent && !isAnimatingToEvent) {
+ this.updateScale(draggerDate, timeScale, 0.5);
+ }
+
// update axis on browser width change
if (axisWidth !== prevProps.axisWidth) {
this.updateScale(draggerDate, timeScale, 0.5);
@@ -1553,6 +1561,7 @@ TimelineAxis.propTypes = {
hoverTime: PropTypes.string,
isAnimationDraggerDragging: PropTypes.bool,
isAnimationPlaying: PropTypes.bool,
+ isAnimatingToEvent: PropTypes.bool,
isCompareModeActive: PropTypes.bool,
isDraggerDragging: PropTypes.bool,
isTimelineDragging: PropTypes.bool,
diff --git a/web/js/components/timeline/timeline-controls/animation-button.js b/web/js/components/timeline/timeline-controls/animation-button.js
index 82dc4fae9..64cc2e98e 100644
--- a/web/js/components/timeline/timeline-controls/animation-button.js
+++ b/web/js/components/timeline/timeline-controls/animation-button.js
@@ -11,10 +11,11 @@ class AnimationButton extends PureComponent {
const labelText = label || 'Set up animation';
return (
<div
+ onClick={clickAnimationButton}
className={disabled ? `wv-disabled-button ${className}` : className}
aria-label={labelText}
>
- <div id={buttonId} onClick={clickAnimationButton}>
+ <div id={buttonId}>
<UncontrolledTooltip
placement="top"
target={buttonId}
diff --git a/web/js/components/timeline/timeline-controls/date-change-arrows.js b/web/js/components/timeline/timeline-controls/date-change-arrows.js
index 601fed087..928b5a571 100644
--- a/web/js/components/timeline/timeline-controls/date-change-arrows.js
+++ b/web/js/components/timeline/timeline-controls/date-change-arrows.js
@@ -151,7 +151,7 @@ class DateChangeArrows extends PureComponent {
<svg height="30" width="30" viewBox="0 0 40 28">
<path
d="M 10.240764,0 24,15 10.240764,30 0,30 13.759236,15 0,0 10.240764,0 z M 26,30 26,0 34,0 34,30 z"
- className="arrow arrow-now"
+ className="arrow"
/>
</svg>
</div>
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index be03f128a..29bacbffb 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -1027,6 +1027,7 @@ class Timeline extends React.Component {
hasSubdailyLayers,
hideTimeline,
isAnimationPlaying,
+ isAnimatingToEvent,
isAnimationWidgetOpen,
isCompareModeActive,
isDataDownload,
@@ -1235,6 +1236,7 @@ class Timeline extends React.Component {
hasSubdailyLayers={hasSubdailyLayers}
isCompareModeActive={isCompareModeActive}
isAnimationPlaying={isAnimationPlaying}
+ isAnimatingToEvent={isAnimatingToEvent}
isTourActive={isTourActive}
isAnimationDraggerDragging={isAnimationDraggerDragging}
isDraggerDragging={isDraggerDragging}
@@ -1384,6 +1386,7 @@ function mapStateToProps(state) {
compare,
config,
date,
+ events,
embed,
layers,
map,
@@ -1411,6 +1414,7 @@ function mapStateToProps(state) {
const { isDistractionFreeModeActive } = ui;
const { isEmbedModeActive } = embed;
const isMobile = browser.lessThan.medium;
+ const { isAnimatingToEvent } = events;
// handle active layer filtering and check for subdaily
const activeLayers = getActiveLayers(state);
@@ -1489,6 +1493,7 @@ function mapStateToProps(state) {
hasSubdailyLayers,
customSelected,
isCompareModeActive,
+ isAnimatingToEvent,
hasFutureLayers,
dateA: getISODateFormatted(selected),
dateB: getISODateFormatted(selectedB),
@@ -1601,6 +1606,7 @@ Timeline.propTypes = {
hasSubdailyLayers: PropTypes.bool,
hideTimeline: PropTypes.bool,
isAnimationPlaying: PropTypes.bool,
+ isAnimatingToEvent: PropTypes.bool,
isAnimationWidgetOpen: PropTypes.bool,
isCompareModeActive: PropTypes.bool,
isDataDownload: PropTypes.bool,