Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Adjust tour CSS and close modals if smaller than

ZachTRice9d44cdd1b0ad
diff --git a/web/css/tour.css b/web/css/tour.css
index eaab4b510..93b8ca921 100644
--- a/web/css/tour.css
+++ b/web/css/tour.css
@@ -47,7 +47,7 @@
.tour-start .modal {
overflow-y: auto;
height: 830px;
- width: 635px;
+ width: 500px;
margin-left: auto;
margin-right: auto;
top: 20px;
@@ -737,13 +737,20 @@
}
}
-/* Breakpoint: Medium (768px to 991px) */
-@media (min-width: 768px) {
+@media (min-width: 740px) {
.tour {
display: block;
}
+}
+
+/* Breakpoint: Medium (768px to 991px) */
+@media (min-width: 768px) {
/* .tour-start */
+ .tour-start .modal {
+ width: 635px;
+ }
+
.tour-start .modal-dialog {
max-width: 618px;
}
@@ -772,8 +779,9 @@
}
-@media (max-height: 664px) {
+@media (min-height: 665px) {
.tour {
- display: none;
+ display: block;
}
}
+
diff --git a/web/js/components/tour/tour.js b/web/js/components/tour/tour.js
index 2b16a48c7..d4c92111e 100644
--- a/web/js/components/tour/tour.js
+++ b/web/js/components/tour/tour.js
@@ -38,6 +38,20 @@ class Tour extends React.Component {
this.decreaseStep = this.decreaseStep.bind(this);
}
+ componentDidMount() {
+ window.addEventListener('resize', this.resize.bind(this));
+ this.resize();
+ }
+
+ resize() {
+ if (window.innerWidth < 740) {
+ this.setState({ modalStart: false, modalInProgress: false, modalComplete: false });
+ }
+ if (window.innerHeight < 665) {
+ this.setState({ modalStart: false, modalInProgress: false, modalComplete: false });
+ }
+ }
+
toggleModalStart(e) {
e.preventDefault();
this.setState({