Interactive interface for browsing global, full-resolution satellite imagery
Add distraction free mode query string param, add shortcuts section in about page (#3399)
Ed Plato4904d80fdaf3
diff --git a/e2e/features/ui/distraction-free-mode-test.js b/e2e/features/ui/distraction-free-mode-test.jsindex 607f25d30..d3ebb9c83 100644--- a/e2e/features/ui/distraction-free-mode-test.js+++ b/e2e/features/ui/distraction-free-mode-test.js@@ -2,8 +2,12 @@ const reuseables = require('../../reuseables/skip-tour.js');const localSelectors = require('../../reuseables/selectors.js');const {+ infoToolbarButton,locationSearchMinimizeButton,locationSearchToolbarButton,+ mapRotateLeft,+ mapRotateReset,+ mapRotateRight,mapScaleImperial,mapScaleMetric,measureBtn,@@ -17,6 +21,53 @@ const {} = localSelectors;const TIME_LIMIT = 5000;+const closeDistractionFreeAlert = (c) => {+ c.waitForElementVisible('#distraction-free-mode-active-alert-close');+ c.click('#distraction-free-mode-active-alert-close');+};++// helper to confirm target els are removed/hidden in distraction free mode+const distractionFreeModeValidElsRemoved = (c, proj, isActive) => {+ const mapScaleMetricProj = `#wv-map-${proj} ${mapScaleMetric}`;+ const mapScaleImperialProj = `#wv-map-${proj} ${mapScaleImperial}`;+ const visibleEls = [+ timelineContainer,+ sidebarContainer,+ measureBtn,+ mapScaleMetricProj,+ mapScaleImperialProj,+ ];+ let presentEls = [+ infoToolbarButton,+ locationSearchToolbarButton,+ shareToolbarButton,+ projToolbarButton,+ snapshotToolbarButton,+ zoomInButton,+ zoomOutButton,+ ];++ // add rotate buttons for polar projections+ if (proj !== 'geographic') {+ presentEls = [+ ...presentEls,+ mapRotateLeft,+ mapRotateReset,+ mapRotateRight,+ ];+ }++ if (isActive) {+ // distraction free mode is active and els should be removed/hidden+ visibleEls.forEach((el) => c.waitForElementNotVisible(el, TIME_LIMIT));+ presentEls.forEach((el) => c.waitForElementNotPresent(el, TIME_LIMIT));+ } else {+ // els should be added/visible+ visibleEls.forEach((el) => c.waitForElementVisible(el, TIME_LIMIT));+ presentEls.forEach((el) => c.waitForElementPresent(el, TIME_LIMIT));+ }+};+module.exports = {before: (c) => {reuseables.loadAndSkipTour(c, TIME_LIMIT);@@ -27,47 +78,30 @@ module.exports = {// verify distraction free mode shortcut hides ui elements'Enabling distraction free mode with shortcut key hides UI elements': (c) => {- c.waitForElementVisible('#wv-info-button');- c.click('#wv-info-button');+ c.waitForElementVisible(infoToolbarButton);+ c.click(infoToolbarButton);c.waitForElementVisible('#distraction_free_info_item');c.click('#distraction_free_info_item');- c.pause(300);- c.waitForElementNotVisible(timelineContainer, TIME_LIMIT);- c.waitForElementNotVisible(sidebarContainer, TIME_LIMIT);- c.waitForElementNotVisible(locationSearchToolbarButton, TIME_LIMIT);- c.waitForElementNotPresent(shareToolbarButton, TIME_LIMIT);- c.waitForElementNotPresent(projToolbarButton, TIME_LIMIT);- c.waitForElementNotPresent(snapshotToolbarButton, TIME_LIMIT);- c.waitForElementNotVisible(measureBtn, TIME_LIMIT);- c.waitForElementNotPresent(zoomInButton, TIME_LIMIT);- c.waitForElementNotPresent(zoomOutButton, TIME_LIMIT);- c.waitForElementNotVisible(mapScaleMetric, TIME_LIMIT);- c.waitForElementNotVisible(mapScaleImperial, TIME_LIMIT);- c.waitForElementNotPresent('.wv-map-rotate-left', TIME_LIMIT);- c.waitForElementNotPresent('.wv-map-reset-rotation', TIME_LIMIT);- c.waitForElementNotPresent('.wv-map-rotate-right', TIME_LIMIT);+ closeDistractionFreeAlert(c);+ distractionFreeModeValidElsRemoved(c, 'arctic', true);},// verify turning off distraction free mode shortcut returns hidden ui elements'Disabling distraction free mode with shortcut key returns UI elements': (c) => {c.sendKeys('body', [c.Keys.SHIFT, 'd', c.Keys.NULL]);- c.pause(500);+ c.pause(300);++ distractionFreeModeValidElsRemoved(c, 'arctic', false);+ },++ // verify distraction free mode activates with query string parameter df (in geographic projection)+ 'Enabling distraction free mode activates query string parameter df': (c) => {+ c.url(`${c.globals.url}?df=true`);+ c.waitForElementVisible('#wv-exit-distraction-free-mode-button');- c.waitForElementVisible(timelineContainer, TIME_LIMIT);- c.waitForElementVisible(sidebarContainer, TIME_LIMIT);- c.waitForElementVisible(locationSearchToolbarButton, TIME_LIMIT);- c.waitForElementVisible(shareToolbarButton, TIME_LIMIT);- c.waitForElementPresent(projToolbarButton, TIME_LIMIT);- c.waitForElementPresent(snapshotToolbarButton, TIME_LIMIT);- c.waitForElementVisible(measureBtn, TIME_LIMIT);- c.waitForElementPresent(zoomInButton, TIME_LIMIT);- c.waitForElementPresent(zoomOutButton, TIME_LIMIT);- c.waitForElementPresent(mapScaleMetric, TIME_LIMIT);- c.waitForElementPresent(mapScaleImperial, TIME_LIMIT);- c.waitForElementPresent('.wv-map-rotate-left', TIME_LIMIT);- c.waitForElementPresent('.wv-map-reset-rotation', TIME_LIMIT);- c.waitForElementPresent('.wv-map-rotate-right', TIME_LIMIT);+ closeDistractionFreeAlert(c);+ distractionFreeModeValidElsRemoved(c, 'geographic', true);},after: (c) => {diff --git a/e2e/features/ui/info-mobile-test.js b/e2e/features/ui/info-mobile-test.jsindex 77757a035..687b36a53 100644--- a/e2e/features/ui/info-mobile-test.js+++ b/e2e/features/ui/info-mobile-test.js@@ -8,45 +8,40 @@ const {const TIME_LIMIT = 5000;module.exports = {- beforeEach: (client) => {- reuseables.loadAndSkipTour(client, TIME_LIMIT);- client.resizeWindow(375, 667); // iPhone 6/7/8 dimensions+ before: (c) => {+ reuseables.loadAndSkipTour(c, TIME_LIMIT);+ c.resizeWindow(375, 667); // iPhone 6/7/8 dimensions},// verify mobile info toolbar is visible and contains valid mobile menu items- 'Mobile info toolbar is visible and contains valid mobile menu items': (client) => {- client.expect.element(infoToolbarButton).to.be.present;- client.pause(500);- client.click(infoToolbarButton);-- client.waitForElementVisible('#toolbar_info', TIME_LIMIT);- client.expect.element('#send_feedback_info_item').to.be.present;- client.expect.element('#source_code_info_item').to.be.present;- client.expect.element('#whats_new_info_item').to.be.present;- client.expect.element('#about_info_item').to.be.present;+ 'Mobile info toolbar is visible and contains valid mobile menu items': (c) => {+ c.expect.element(infoToolbarButton).to.be.present;+ c.pause(500);+ c.click(infoToolbarButton);++ c.waitForElementVisible('#toolbar_info', TIME_LIMIT);+ c.expect.element('#send_feedback_info_item').to.be.present;+ c.expect.element('#source_code_info_item').to.be.present;+ c.expect.element('#whats_new_info_item').to.be.present;+ c.expect.element('#about_info_item').to.be.present;+ c.expect.element('#distraction_free_info_item').to.be.present;},// verify mobile source code menu item opens separate tab or window- 'Mobile source code menu item opens separate tab or window': (client) => {- client.pause(1000);- client.waitForElementVisible(infoToolbarButton, TIME_LIMIT);- client.click(infoToolbarButton);- client.waitForElementVisible('#toolbar_info', TIME_LIMIT);-- client.windowHandles((tabs) => {- client.assert.equal(tabs.value.length, 1);+ 'Mobile source code menu item opens separate tab or window': (c) => {+ c.windowHandles((tabs) => {+ c.assert.equal(tabs.value.length, 1);});- client.waitForElementVisible('#source_code_info_item', TIME_LIMIT);- client.click('#source_code_info_item');- client.pause(1000);+ c.click('#source_code_info_item');+ c.pause(500);- client.windowHandles((tabs) => {- client.assert.equal(tabs.value.length, 2);+ c.windowHandles((tabs) => {+ c.assert.equal(tabs.value.length, 2);});},- afterEach: (client) => {- client.end();+ after: (c) => {+ c.end();},};diff --git a/e2e/features/ui/info-test.js b/e2e/features/ui/info-test.jsindex 70be0f489..8b43b05fd 100644--- a/e2e/features/ui/info-test.js+++ b/e2e/features/ui/info-test.js@@ -28,8 +28,6 @@ module.exports = {// verify about menu item opens about modal'About menu item opens about modal': (c) => {- c.waitForElementVisible('#toolbar_info', TIME_LIMIT);- c.waitForElementVisible('#about_info_item', TIME_LIMIT);c.click('#about_info_item');c.pause(500);diff --git a/e2e/reuseables/selectors.js b/e2e/reuseables/selectors.jsindex 59c78f5f2..47c4a487c 100644--- a/e2e/reuseables/selectors.js+++ b/e2e/reuseables/selectors.js@@ -142,6 +142,9 @@ module.exports = {zoomOutButton: '.wv-map-zoom-out',mapScaleMetric: '.wv-map-scale-metric',mapScaleImperial: '.wv-map-scale-imperial',+ mapRotateLeft: '.wv-map-rotate-left',+ mapRotateReset: '.wv-map-reset-rotation',+ mapRotateRight: '.wv-map-rotate-right',// ui toolbarlocationSearchToolbarButton: '#wv-location-search-button',diff --git a/web/css/about.css b/web/css/about.cssnew file mode 100644index 000000000..cb58c802b--- /dev/null+++ b/web/css/about.css@@ -0,0 +1,126 @@+.about-page {+ background-color: #282828;+ padding: 5px;+}++.about-page div,+.about-page h1,+.about-page h2,+.about-page li,+.about-page p {+ color: #eee;+ font-weight: 100;+ font-family: 'Open Sans', sans-serif;+}++.about-page div,+.about-page li,+.about-page p {+ font-size: 16px;+ line-height: 22px;+}++.about-page h1 {+ font-size: 20px;+ font-weight: 600;+ line-height: 1em;+}++.about-page h2 {+ font-size: 18px;+ margin: 0.75em 0;+ font-weight: 600;+}++.about-page p {+ margin: 1.12em 0;+}++.about-page hr {+ display: block;+ height: 1px;+ border: 0;+ border-top: 1px solid #404040;+ margin: 1em 0;+ padding: 0;+}++.about-page ul {+ margin-left: 2em;+}++.about-page li {+ display: list-item;+}++.about-page a {+ color: #7bf;+ text-decoration: none;+ &:hover {+ color: #7df;+ text-decoration: none;+ }+}++.about-page .right {+ float: right;+ margin: 0 1em 1em;+}++.about-page .caption {+ font-size: 12px;+ line-height: 18px;+}++.about-page .gibs-caption {+ margin-top: 3px;+ width: 64px;+ font-style: italic;+ text-align: center;+}++/* Override default modal CSS */++.about-page-modal .modal-dialog {+ border: none;+}++.about-page-modal .modal-body {+ padding: 0;+}++.about-page-modal .about-page {+ padding: 10px 15px 0 10px;+}++/* Keyboard shortcuts section */++.about-page .keyboard-shortcuts-section {+ display: none;+}+.about-page .keyboard-shortcuts-table {+ width: 100%;+ margin-top: 20px;+ tr {+ :first-child {+ text-align: left;+ }+ :last-child {+ text-align: right;+ }+ }+ td {+ padding: 7px 0;+ }+ code {+ color: #f60;+ padding: 1px 8px;+ border: thin solid;+ }+}++@media (min-width: 769px) {+ .about-page .keyboard-shortcuts-section {+ display: block;+ }+}diff --git a/web/css/notifications.css b/web/css/notifications.cssindex 8e1e1d5ca..185e37c2e 100644--- a/web/css/notifications.css+++ b/web/css/notifications.css@@ -35,11 +35,11 @@display: none;}-.wv-info-button-distraction-free-mode {- opacity: 0.5;+.wv-exit-distraction-free-mode-button {+ opacity: 0.75;}-.wv-info-button-distraction-free-mode:hover {+.wv-exit-distraction-free-mode-button:hover {opacity: 1;}diff --git a/web/css/sidebar.css b/web/css/sidebar.cssindex ce54635f0..1a0c4a81f 100644--- a/web/css/sidebar.css+++ b/web/css/sidebar.css@@ -71,7 +71,7 @@}.wv-logo-distraction-free-mode {border-radius: 5px;- opacity: 0.5;+ opacity: 0.8;}.wv-logo-distraction-free-mode:hover {opacity: 1;diff --git a/web/css/tour.css b/web/css/tour.cssindex 32814ca39..d651068de 100644--- a/web/css/tour.css+++ b/web/css/tour.css@@ -8,7 +8,7 @@text-decoration: none;}-.about-page .modal-dialog .modal-header .close,+.about-page-modal .modal-dialog .modal-header .close,.tour-start .modal-dialog .modal-header .close,.tour-complete .modal-dialog .modal-header .close {font-size: 30px;@@ -19,14 +19,14 @@color: #fff;}}-.about-page .modal-header,+.about-page-modal .modal-header,.tour-complete .modal-header,.tour-start .modal-header {position: relative;background-color: rgb(0, 69, 123);padding: 6px 8px;}-.about-page .modal-title,+.about-page-modal .modal-title,.tour-start .modal-title,.tour-complete .modal-title {color: #fff;@@ -34,7 +34,7 @@line-height: 22px;font-weight: 300;}-.about-page .modal-body,+.about-page-modal .modal-body,.tour-complete .modal-body,.tour-start .modal-body {border-radius: 0;diff --git a/web/pages/images/gibs.png b/web/images/gibs.pngsimilarity index 100%rename from web/pages/images/gibs.pngrename to web/images/gibs.pngdiff --git a/web/js/app.js b/web/js/app.jsindex 060b62596..279cec43e 100644--- a/web/js/app.js+++ b/web/js/app.js@@ -75,6 +75,7 @@ import '../css/layer-coverage-panel.css';import '../css/anim.widget.css';import '../css/dateselector.css';import '../css/tooltip.css';+import '../css/about.css';import '../css/mobile.css';import '../css/measure.css';import '../css/list.css';@@ -84,7 +85,6 @@ import '../css/orbitTracks.css';import '../css/facets.css';import '../css/recent-layers.css';import '../css/location-search.css';-import '../pages/css/document.css';require('@elastic/react-search-ui-views/lib/styles/styles.css');diff --git a/web/js/components/about/about-page.js b/web/js/components/about/about-page.jsindex bf141b61c..b54fbdc21 100644--- a/web/js/components/about/about-page.js+++ b/web/js/components/about/about-page.js@@ -5,7 +5,7 @@ export default function AboutPage() {return (<Scrollbar style={{ height: 'calc(100vh - 200px)' }}>- <div id="page" className="wv-document">+ <div className="about-page"><div className="right"><div className="caption">Version @BUILD_VERSION@@@ -34,7 +34,7 @@ export default function AboutPage() {</p><div className="right">- <a href="https://earthdata.nasa.gov/gibs" className="gibs-logo" target="_blank" rel="noopener noreferrer"><img src="../../../pages/images/gibs.png" /></a>+ <a href="https://earthdata.nasa.gov/gibs" className="gibs-logo" target="_blank" rel="noopener noreferrer"><img src="images/gibs.png" /></a><div className="caption gibs-caption">Powered by GIBS</div></div>@@ -59,6 +59,54 @@ export default function AboutPage() {<a href="https://earthdata.nasa.gov/faq/worldview-gibs-faq" target="_blank" rel="noopener noreferrer">Frequently Asked Questions</a></p><hr />+ <section className="keyboard-shortcuts-section">+ <h2>Keyboard Shortcuts</h2>+ <table className="keyboard-shortcuts-table">+ <thead>+ <tr>+ <th>Key</th>+ <th>Action</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <td><code>↑</code></td>+ <td>Change date to a greater interval (e.g., days to months)</td>+ </tr>+ <tr>+ <td><code>↓</code></td>+ <td>Change date to a smaller interval (e.g., months to days</td>+ </tr>+ <tr>+ <td><code>←</code></td>+ <td>Move backward one time interval</td>+ </tr>+ <tr>+ <td><code>→</code></td>+ <td>Move forward one time interval</td>+ </tr>+ <tr>+ <td>+ <code>Shift</code>+ {' '}+ ++ {' '}+ <code>D</code>+ </td>+ <td>Toggle distraction free mode</td>+ </tr>+ <tr>+ <td><code>Space</code></td>+ <td>Animation play/pause</td>+ </tr>+ <tr>+ <td><code>Esc</code></td>+ <td>Stop animation/close modal</td>+ </tr>+ </tbody>+ </table>+ <hr />+ </section><h2>Imagery Use</h2><p>NASA supports andiff --git a/web/js/components/timeline/distraction-free-time.js b/web/js/components/timeline/distraction-free-time.jsindex 1b80195b6..d78f62821 100644--- a/web/js/components/timeline/distraction-free-time.js+++ b/web/js/components/timeline/distraction-free-time.js@@ -1,13 +1,41 @@-import React, { PureComponent } from 'react';+import React, { Component } from 'react';import PropTypes from 'prop-types';import util from '../../util/util';+import Alert from '../util/alert';++class DistractionFreeTimeUI extends Component {+ constructor(props) {+ super(props);+ this.state = {+ showDistractionFreeAlert: true,+ };+ }++ dismissDistractionFreeAlert = () => this.setState({ showDistractionFreeAlert: false });-class DistractionFreeTimeUI extends PureComponent {handleMouseOver = () => {const { hoverOverDistractionFreeTimeUI } = this.props;hoverOverDistractionFreeTimeUI(true);}+ renderDistractionFreeAlert = () => {+ const {+ showDistractionFreeAlert,+ } = this.state;+ const message = 'You are now in distraction free mode. Click the eye button to exit.';++ return showDistractionFreeAlert && (+ <Alert+ id="distraction-free-mode-active-alert"+ isOpen+ title="Distraction Free Mode is Active"+ timeout={6000}+ message={message}+ onDismiss={this.dismissDistractionFreeAlert}+ />+ );+ }+render() {const { date, hasSubdailyLayers, isHoverOverDistractionFreeTimeUI } = this.props;@@ -31,16 +59,18 @@ class DistractionFreeTimeUI extends PureComponent {displayDate = dateFirstHalfYMD.join(' ');}+ const opacityStyle = { opacity: isHoverOverDistractionFreeTimeUI ? '0' : '1' };return (- <div- className="distraction-free-date"- style={{- opacity: isHoverOverDistractionFreeTimeUI ? '0' : '1',- }}- onMouseOver={this.handleMouseOver}- >- {displayDate}- </div>+ <>+ {this.renderDistractionFreeAlert()}+ <div+ className="distraction-free-date"+ style={opacityStyle}+ onMouseOver={this.handleMouseOver}+ >+ {displayDate}+ </div>+ </>);}}diff --git a/web/js/containers/info.js b/web/js/containers/info.jsindex b4a839ad7..349adef66 100644--- a/web/js/containers/info.js+++ b/web/js/containers/info.js@@ -34,7 +34,7 @@ function InfoList (props) {notificationClick,} = props;- function getNotificationListItem(obj) {+ function getNotificationListItem() {const { number, type, object } = notifications;return {text: 'Notifications',@@ -54,8 +54,23 @@ function InfoList (props) {};}- function getListArray() {- const distractionFreeObj = {+ function getExploreWorldviewObj() {+ return {+ text: 'Explore Worldview',+ iconClass: 'ui-icon',+ iconName: 'truck',+ id: 'start_tour_info_item',+ onClick: () => {+ startTour(isTourActive);+ googleTagManager.pushEvent({+ event: 'tour_start_button',+ });+ },+ };+ }++ function getDistractionFreeObj() {+ return {text: isDistractionFreeModeActive ? 'Exit Distraction Free' : 'Distraction Free',iconClass: 'ui-icon',iconName: ['far', 'eye'],@@ -64,79 +79,70 @@ function InfoList (props) {toggleDistractionFreeMode();},};- if (!isDistractionFreeModeActive) {- const feedbackAction = isMobile- ? { href: 'mailto:@MAIL@?subject=Feedback for @LONG_NAME@ tool' }- : {- onClick: () => {- sendFeedback(feedbackIsInitiated);- },- };- const arr = [- {- text: 'Send feedback',- iconClass: 'ui-icon',- iconName: 'envelope',- id: 'send_feedback_info_item',- ...feedbackAction,- },- {- text: 'Source Code',- iconClass: 'ui-icon',- iconName: 'code',- id: 'source_code_info_item',- href: 'https://github.com/nasa-gibs/worldview',- },- {- text: 'What\'s new',- iconClass: 'ui-icon',- iconName: 'flag',- id: 'whats_new_info_item',- href: 'https://wiki.earthdata.nasa.gov/pages/viewrecentblogposts.action?key=GIBS',+ }++ function getListArray() {+ if (isDistractionFreeModeActive) {+ return [getDistractionFreeObj()];+ }++ const feedbackAction = isMobile+ ? { href: 'mailto:@MAIL@?subject=Feedback for @LONG_NAME@ tool' }+ : {+ onClick: () => {+ sendFeedback(feedbackIsInitiated);},- {- text: 'About',- iconClass: 'ui-icon',- iconName: 'file',- id: 'about_info_item',- onClick: () => {- aboutClick();- },+ };+ const arr = [+ {+ text: 'Send feedback',+ iconClass: 'ui-icon',+ iconName: 'envelope',+ id: 'send_feedback_info_item',+ ...feedbackAction,+ },+ {+ text: 'Source Code',+ iconClass: 'ui-icon',+ iconName: 'code',+ id: 'source_code_info_item',+ href: 'https://github.com/nasa-gibs/worldview',+ },+ {+ text: 'What\'s new',+ iconClass: 'ui-icon',+ iconName: 'flag',+ id: 'whats_new_info_item',+ href: 'https://wiki.earthdata.nasa.gov/pages/viewrecentblogposts.action?key=GIBS',+ },+ {+ text: 'About',+ iconClass: 'ui-icon',+ iconName: 'file',+ id: 'about_info_item',+ onClick: () => {+ aboutClick();},- ];+ },+ ];- // limit explore and distraction free for larger device displays- if (window.innerWidth >= 740+ // limit explore for larger device displays+ if (window.innerWidth >= 740&& window.innerHeight >= 615) {- if (- config.features.tour+ if (+ config.features.tour&& config.stories&& config.storyOrder) {- const exploreWorlviewObj = {- text: 'Explore Worldview',- iconClass: 'ui-icon',- iconName: 'truck',- id: 'start_tour_info_item',- onClick: () => {- startTour(isTourActive);- googleTagManager.pushEvent({- event: 'tour_start_button',- });- },- };- arr.splice(1, 0, exploreWorlviewObj);- }- arr.push(distractionFreeObj);- }- if (notifications.isActive) {- arr.splice(4, 0, getNotificationListItem());+ arr.splice(1, 0, getExploreWorldviewObj());}- return arr;}- return [distractionFreeObj];+ if (notifications.isActive) {+ arr.splice(4, 0, getNotificationListItem());+ }+ arr.push(getDistractionFreeObj());+ return arr;}-return (<IconList list={getListArray()} size="small" />);}@@ -144,10 +150,11 @@ function mapStateToProps(state) {const {ui, feedback, tour, notifications, config, models, browser,} = state;+ const { isDistractionFreeModeActive } = ui;return {feedbackIsInitiated: feedback.isInitiated,- isDistractionFreeModeActive: ui.isDistractionFreeModeActive,+ isDistractionFreeModeActive,isTourActive: tour.active,notifications,config,@@ -196,7 +203,7 @@ const mapDispatchToProps = (dispatch) => ({openCustomContent('ABOUT_MODAL', {headerText: 'About',bodyComponent: AboutPage,- wrapClassName: 'about-page',+ wrapClassName: 'about-page-modal',}),);},diff --git a/web/js/containers/sidebar/sidebar.js b/web/js/containers/sidebar/sidebar.jsindex ff37eb974..c0bde6f3c 100644--- a/web/js/containers/sidebar/sidebar.js+++ b/web/js/containers/sidebar/sidebar.js@@ -184,6 +184,7 @@ class Sidebar extends React.Component {href="/"title="Click to Reset Worldview to Defaults"id="wv-logo"+ className={isDistractionFreeModeActive ? 'wv-logo-distraction-free-mode' : ''}onClick={(e) => resetWorldview(e, isDistractionFreeModeActive)}ref={(iconElement) => { this.iconElement = iconElement; }}onWheel={wheelCallBack}diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.jsindex 3a66c8532..d98ec3984 100644--- a/web/js/containers/timeline/timeline.js+++ b/web/js/containers/timeline/timeline.js@@ -1054,35 +1054,33 @@ class Timeline extends React.Component {const mobileBottom = (hasSubdailyLayers && isScreenWidthLessThan450) || isScreenWidthLessThan350? '65px': '10px';-const isAnimationWidgetReady = isAnimationWidgetOpen&& !animationDisabled&& animationStartLocation&& animationStartLocationDate&& animationEndLocation&& animationEndLocationDate;++ const containerMouseLeave = isDistractionFreeModeActive && !isDraggerDragging && !isTimelineDragging+ ? () => this.hoverOverDistractionFreeTimeUI(false)+ : null;+ const containerDisplayStyle = {+ display: isDistractionFreeModeActive && !isHoverOverDistractionFreeTimeUI ? 'none' : 'block',+ };return (<>- {isDistractionFreeModeActive- ? (- <DistractionFreeTimeUI- date={selectedDate}- hasSubdailyLayers={hasSubdailyLayers}- hoverOverDistractionFreeTimeUI={this.hoverOverDistractionFreeTimeUI}- isHoverOverDistractionFreeTimeUI={isHoverOverDistractionFreeTimeUI}- />- )- : null}+ {(initialLoadComplete && isDistractionFreeModeActive) && (+ <DistractionFreeTimeUI+ date={selectedDate}+ hasSubdailyLayers={hasSubdailyLayers}+ hoverOverDistractionFreeTimeUI={this.hoverOverDistractionFreeTimeUI}+ isHoverOverDistractionFreeTimeUI={isHoverOverDistractionFreeTimeUI}+ />+ )}<divclassName="timeline-container"- onMouseLeave={- isDistractionFreeModeActive && !isDraggerDragging && !isTimelineDragging- ? () => this.hoverOverDistractionFreeTimeUI(false)- : null- }- style={{- display: isDistractionFreeModeActive && !isHoverOverDistractionFreeTimeUI ? 'none' : 'block',- }}+ onMouseLeave={containerMouseLeave}+ style={containerDisplayStyle}>{initialLoadComplete&& (diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.jsindex 9b8f01b5e..08056f4ed 100644--- a/web/js/containers/toolbar.js+++ b/web/js/containers/toolbar.js@@ -198,7 +198,10 @@ class toolbarContainer extends Component {renderProjectionButton() {const {- config, faSize, openModal, isDistractionFreeModeActive,+ config,+ faSize,+ isDistractionFreeModeActive,+ openModal,} = this.props;const buttonId = 'wv-proj-button';const labelText = 'Switch projection';@@ -223,12 +226,12 @@ class toolbarContainer extends Component {const {config,faSize,- isDistractionFreeModeActive,isLocationSearchExpanded,isMobile,openModal,shouldBeCollapsed,toggleShowLocationSearch,+ isDistractionFreeModeActive,} = this.props;const isFeatureEnabled = isLocationSearchFeatureEnabled(config);// do not render if Location Search feature isn't enabled@@ -245,10 +248,10 @@ class toolbarContainer extends Component {: () => toggleShowLocationSearch();const buttonDisplayConditions = isMobile || (!isMobile && !isLocationSearchExpanded) || shouldBeCollapsed;- return (+ return !isDistractionFreeModeActive && (<Buttonstyle={{- display: !isDistractionFreeModeActive && buttonDisplayConditions ? 'inline-block' : 'none',+ display: buttonDisplayConditions ? 'inline-block' : 'none',}}id={buttonId}className="wv-toolbar-button"@@ -310,14 +313,11 @@ class toolbarContainer extends Component {const buttonId = 'wv-info-button';const labelText = 'Information';- return (+ return !isDistractionFreeModeActive && (<Buttonid={buttonId}aria-label={labelText}- className={- `wv-toolbar-button${notificationClass}- ${isDistractionFreeModeActive ? 'wv-info-button-distraction-free-mode' : ''}`- }+ className={`wv-toolbar-button${notificationClass}`}onClick={() => openModal('TOOLBAR_INFO', CUSTOM_MODAL_PROPS.TOOLBAR_INFO)}data-content={notificationContentNumber}>@@ -327,6 +327,25 @@ class toolbarContainer extends Component {);}+ renderDistractionFreeExitButton() {+ const {+ faSize, isDistractionFreeModeActive, toggleDistractionFreeModeAction,+ } = this.props;+ const buttonId = 'wv-exit-distraction-free-mode-button';+ const labelText = 'Exit distraction free mode';+ return isDistractionFreeModeActive && (+ <Button+ id={buttonId}+ className="wv-toolbar-button wv-exit-distraction-free-mode-button"+ aria-label={labelText}+ onClick={() => toggleDistractionFreeModeAction()}+ >+ {this.renderTooltip(buttonId, labelText)}+ <FontAwesomeIcon icon={['far', 'eye']} size={faSize} />+ </Button>+ );+ }+render() {return (<ErrorBoundary>@@ -334,6 +353,7 @@ class toolbarContainer extends Component {id="wv-toolbar"className="wv-toolbar">+ {this.renderDistractionFreeExitButton()}{this.renderLocationSearchButtonComponent()}{this.renderShareButton()}{this.renderProjectionButton()}@@ -397,7 +417,7 @@ const mapStateToProps = (state) => {};const mapDispatchToProps = (dispatch) => ({- toggleDistractionFreeMode: () => {+ toggleDistractionFreeModeAction: () => {dispatch(toggleDistractionFreeMode());},toggleDialogVisible: (isVisible) => {@@ -489,5 +509,6 @@ toolbarContainer.propTypes = {rotation: PropTypes.number,shouldBeCollapsed: PropTypes.bool,toggleDialogVisible: PropTypes.func,+ toggleDistractionFreeModeAction: PropTypes.func,toggleShowLocationSearch: PropTypes.func,};diff --git a/web/js/location.js b/web/js/location.jsindex 4d3ffdefb..46f6ce23d 100644--- a/web/js/location.js+++ b/web/js/location.js@@ -264,6 +264,18 @@ const getParameters = function(config, parameters) {parse: (str) => tryCatchDate(str, now),},},+ df: {+ stateKey: 'ui.isDistractionFreeModeActive',+ initialState: false,+ type: 'bool',+ options: {+ serializeNeedsGlobalState: true,+ serialize: (boo, state) => {+ const isDistractionFreeModeActive = get(state, 'ui.isDistractionFreeModeActive');+ return isDistractionFreeModeActive ? boo : undefined;+ },+ },+ },e: {stateKey: 'events',type: 'object',diff --git a/web/pages/css/document.css b/web/pages/css/document.cssdeleted file mode 100644index a87f2a33b..000000000--- a/web/pages/css/document.css+++ /dev/null@@ -1,112 +0,0 @@-.wv-document {- background-color: #282828;- padding: 5px;-}--.wv-document div,-.wv-document h1,-.wv-document h2,-.wv-document li,-.wv-document p {- color: #eee;- font-weight: 100;- font-family: 'Open Sans', sans-serif;-}--.wv-document div,-.wv-document li,-.wv-document p {- font-size: 16px;- line-height: 22px;-}--.wv-document h1 {- font-size: 20px;- font-weight: 600;- line-height: 1em;-}--.wv-document h2 {- font-size: 18px;- margin: 0.75em 0;- font-weight: 600;-}--.wv-document p {- margin: 1.12em 0;-}--.wv-document hr {- display: block;- height: 1px;- border: 0;- border-top: 1px solid #404040;- margin: 1em 0;- padding: 0;-}--.wv-document ul {- margin-left: 2em;-}--.wv-document li {- display: list-item;-}--.wv-document a {- color: #7bf;- text-decoration: none;-}--.wv-document a:visited {- color: #7bf;- text-decoration: none;-}--.wv-document a:hover {- color: #7df;- text-decoration: none;-}--.wv-document .right {- float: right;- margin: 0 1em 1em;-}--.wv-document strong {- font-weight: 600;-}--.wv-document .underline {- text-decoration: underline;-}--.version {- font-size: 12px;-}--.wv-document .caption {- font-size: 12px;- line-height: 18px;-}--.wv-document .gibs-caption {- margin-top: 3px;- width: 64px;- font-style: italic;- text-align: center;-}--/* Override default modal CSS */--.about-page .modal-dialog {- border: none;-}--.about-page .modal-body {- padding: 0;-}--.about-page .wv-document {- padding: 10px 15px 0 10px;-}diff --git a/web/pages/css/standalone.css b/web/pages/css/standalone.cssdeleted file mode 100644index d4a3f89c1..000000000--- a/web/pages/css/standalone.css+++ /dev/null@@ -1,16 +0,0 @@-body {- margin: 0;- background-color: #000;- color: #fffbe7;-}--#page {- margin: 10px auto;- padding: 10px 20px;- border-radius: 5px;- max-width: 600px;-}--.wv-document ul {- margin-left: auto;-}