diff --git a/src/App.css b/src/App.css
index 602e5fb..227e63b 100644
--- a/src/App.css
+++ b/src/App.css
@@ -1,6 +1,11 @@
+a {
+ color: #3a4330;
+}
+
.Main {
display: flex;
height: 100vh;
+ position: relative;
}
.FilterPane {
@@ -15,6 +20,35 @@
overflow-y: scroll;
}
-a {
- color: #3a4330;
+@media (max-width: 700px) {
+ .FilterPane {
+ padding: 2rem 4rem;
+ flex-basis: 100%;
+ height: calc(100dvh - 4rem);
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 2;
+ }
+
+ .FilterPane--hidden {
+ z-index: -1;
+ }
+
+ .mapboxgl-map {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100dvh;
+ z-index: 1;
+ }
+}
+
+@media (max-width: 400px) {
+ .FilterPane {
+ min-width: unset;
+ padding: 1.5rem;
+ height: calc(100dvh - 3rem);
+ }
}
diff --git a/src/App.js b/src/App.js
index ecf2f5a..369216b 100644
--- a/src/App.js
+++ b/src/App.js
@@ -14,6 +14,7 @@ class App extends Component {
popup: { ...this.initialPopupState },
filters: { ...this.initialFiltersState },
data: [],
+ hideFiltersOnMobile: false,
};
this.onChangeAfterDate = this.onChangeAfterDate.bind(this);
@@ -107,6 +108,13 @@ class App extends Component {
});
};
+ onSubmit = (e) => {
+ e.preventDefault();
+ this.setState({
+ hideFiltersOnMobile: true,
+ });
+ };
+
onReset = (e) => {
e.preventDefault();
this.setState({
@@ -116,6 +124,12 @@ class App extends Component {
});
};
+ returnToFilters = () => {
+ this.setState({
+ hideFiltersOnMobile: false,
+ });
+ };
+
render() {
if (!this.state.data.length) {
return "";
@@ -142,7 +156,9 @@ class App extends Component {
return (
-
+
@@ -163,7 +180,12 @@ class App extends Component {
-
+
);
}
diff --git a/src/components/Attribution.css b/src/components/Attribution.css
index 6133dd9..f744872 100644
--- a/src/components/Attribution.css
+++ b/src/components/Attribution.css
@@ -2,3 +2,9 @@
display: block;
font-size: 0.75rem;
}
+
+@media (max-width: 400px) {
+ .Attribution {
+ font-size: 0.6rem;
+ }
+}
diff --git a/src/components/Filters.css b/src/components/Filters.css
index 4f00f88..d6c6dad 100644
--- a/src/components/Filters.css
+++ b/src/components/Filters.css
@@ -1,6 +1,21 @@
+.Filter-Buttons {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ gap: 6px;
+}
+
+.Filter-Submit {
+ display: none;
+ margin: 0;
+ font-size: 1rem;
+ width: fit-content;
+}
+
.Filter-Reset {
margin: 0;
font-size: 1rem;
+ width: fit-content;
}
form > label {
@@ -56,3 +71,40 @@ form > label {
transform: scale(1.15);
margin-right: 0.55rem;
}
+
+@media (max-width: 700px) {
+ .Filter-Submit {
+ display: block;
+ }
+}
+
+@media (max-width: 400px) {
+ .Filter-Text {
+ font-size: 1rem;
+ line-height: 1.25rem;
+ }
+
+ .Filter-DateText {
+ font-size: 0.8rem;
+ }
+
+ .Filter-SelectText {
+ font-size: 0.8rem;
+ }
+
+ .Filter-List {
+ padding-left: 0.75rem;
+ }
+
+ .Filter-Submit {
+ font-size: 0.8rem;
+ }
+
+ .Filter-Reset {
+ font-size: 0.8rem;
+ }
+
+ .Filter-DateText {
+ width: 85px;
+ }
+}
diff --git a/src/components/Filters.js b/src/components/Filters.js
index 65600c6..0874020 100644
--- a/src/components/Filters.js
+++ b/src/components/Filters.js
@@ -21,6 +21,7 @@ const Filters = ({
onChangeElectricity,
accessible,
onChangeAccessible,
+ onSubmit,
onReset,
}) => {
const beforeDateMin = add(afterDate || new Date(), { days: 1 });
@@ -138,12 +139,20 @@ const Filters = ({
-
+
+
+
+
);
diff --git a/src/components/Logotype.css b/src/components/Logotype.css
index 37b843f..328adab 100644
--- a/src/components/Logotype.css
+++ b/src/components/Logotype.css
@@ -17,3 +17,9 @@
font-size: 2rem;
font-family: NationalPark;
}
+
+@media (max-width: 400px) {
+ .Logotype-Title {
+ font-size: 1.65rem;
+ }
+}
diff --git a/src/components/Map.css b/src/components/Map.css
index 4d12378..d98f574 100644
--- a/src/components/Map.css
+++ b/src/components/Map.css
@@ -16,3 +16,29 @@
.Map-circle__selected {
box-shadow: 0px 0px 0px 3px #d00;
}
+
+.Map-Logo-Backing {
+ display: none;
+ position: absolute;
+ height: 5.5rem;
+ width: 5.5rem;
+ border-radius: 50%;
+ top: 1rem;
+ left: 1rem;
+ z-index: 3;
+ background: #faf3ce;
+ justify-content: center;
+ align-items: center;
+ cursor: pointer;
+}
+
+@media (max-width: 700px) {
+ .Map-Logo-Backing--active {
+ display: flex;
+ }
+}
+
+.Map-Logo {
+ height: 2.5rem;
+ transform: translateY(-0.1rem);
+}
diff --git a/src/components/Map.js b/src/components/Map.js
index f0656a1..3a171cc 100644
--- a/src/components/Map.js
+++ b/src/components/Map.js
@@ -32,57 +32,71 @@ class Map extends Component {
};
render() {
+ console.log(this.props);
+
return (
-
- {this.props.data.map((i) => (
-
- {
- this.setState({
- popup: {
- visible: true,
- info: i,
- location: {
- latitude: i.metadata.facility_latitude,
- longitude: i.metadata.facility_longitude,
+ <>
+
+
+
+
+ {this.props.data.map((i) => (
+
+ {
+ this.setState({
+ popup: {
+ visible: true,
+ info: i,
+ location: {
+ latitude: i.metadata.facility_latitude,
+ longitude: i.metadata.facility_longitude,
+ },
},
- },
- });
- }}
- >
-
- ))}
+ });
+ }}
+ >
+
+ ))}
- {this.state.popup.visible && }
-
+ {this.state.popup.visible && }
+
+ >
);
}
}
diff --git a/src/components/MapPopup.css b/src/components/MapPopup.css
index 8ed617d..e85b115 100644
--- a/src/components/MapPopup.css
+++ b/src/components/MapPopup.css
@@ -68,3 +68,9 @@
.Map-Popup-calendar .react-datepicker__day--highlighted:hover {
background-color: #3dcc4a;
}
+
+@media (max-width: 400px) {
+ .Map-Popup-calendar {
+ display: none;
+ }
+}