Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

mobile styles and keyboard focus styles

Jason Kenta2adce6a37ce
diff --git a/web/css/event-filter.css b/web/css/event-filter.css
index 3ea31830a..19cee807a 100644
--- a/web/css/event-filter.css
+++ b/web/css/event-filter.css
@@ -1,7 +1,8 @@
.filter-controls {
background: #333;
padding: 5px;
- border-bottom: 1px solid #666;
+ max-width: 290px;
+ margin: 0 auto;
.filter-dates-icons {
display: inline-block;
max-width: 224px;
@@ -36,7 +37,6 @@
}
.events-filter {
-
.event-filter-date-range {
height: 50px;
.thru-label {
@@ -98,10 +98,9 @@
color: #fff;
text-align: center;
padding: 10px 0;
- width: 284px;
+ width: 100%;
margin: 0 auto;
- border-top: 1px solid #666;
- background: #333;
+
font-size: 15px;
svg {
margin-left: 6px;
diff --git a/web/css/events.css b/web/css/events.css
index cfaa1dfb0..0aa86cca7 100644
--- a/web/css/events.css
+++ b/web/css/events.css
@@ -8,6 +8,8 @@
}
.event-container {
+
+ background: #333;
.no-events {
text-align: center;
color: #eee;
@@ -16,6 +18,14 @@
margin: 15px auto;
}
min-height: 166px;
+ @media (max-width: 768px) {
+ height: calc(100vh - 36px)
+ }
+ .event-scroll-list {
+ border-top: 1px solid #666;
+ border-bottom: 1px solid #666;
+ background: #222;
+ }
}
.map-item-list li.item {
@@ -33,6 +43,9 @@
.map-item-list li.item h4 {
font-size: 0.85em;
+ @media (max-width: 768px) {
+ font-size: 1em;
+ }
color: #ccc;
padding: 0 3px;
margin-left: 40px;
diff --git a/web/css/sidebar.css b/web/css/sidebar.css
index bb60d53ac..e27ccfb42 100644
--- a/web/css/sidebar.css
+++ b/web/css/sidebar.css
@@ -413,6 +413,29 @@ footer .compare-toggle-button {
border-radius: 6px;
position: absolute;
+ @media (max-width: 768px) {
+ left: 0;
+ width: 100%;
+ height: 100vh;
+ margin: 0;
+ border-radius: 0;
+ .modal-content, .modal-body, .modal-header, .modal-footer {
+ border-radius: 0;
+ }
+ .modal-content {
+ height: calc(100vh - 2px);
+ width: calc(100vw - 2px);
+ }
+ .modal-body {
+ height: calc(100vh - 44px)
+ }
+ .modal-footer {
+ position: absolute;
+ bottom: 10px;
+ width: 100vw;
+ }
+ }
+
.wv-label {
color: #fff;
width: 100%;
diff --git a/web/css/switch.css b/web/css/switch.css
index bd14709f3..7ef5bf8a2 100644
--- a/web/css/switch.css
+++ b/web/css/switch.css
@@ -46,6 +46,9 @@
border-radius: 30px;
position: relative;
transition: background-color 0.2s;
+ &:focus {
+ box-shadow: 0 0 3px 2px rgba(255, 255, 255, 0.75);
+ }
}
.react-switch-label .react-switch-button {
diff --git a/web/js/components/util/checkbox.js b/web/js/components/util/checkbox.js
index 6603e0976..41f4bd6bd 100644
--- a/web/js/components/util/checkbox.js
+++ b/web/js/components/util/checkbox.js
@@ -26,6 +26,7 @@ export default function Checkbox (props) {
checked={checked}
className={classNames}
onChange={onCheck}
+ tabIndex="0"
/>
{children}
<label htmlFor={id}>
diff --git a/web/js/components/util/switch.js b/web/js/components/util/switch.js
index 454f47e6b..7816e4daf 100644
--- a/web/js/components/util/switch.js
+++ b/web/js/components/util/switch.js
@@ -31,6 +31,15 @@ const Switch = (props) => {
toggleActive(!isActive);
}
+ function onKeyDown(e) {
+ const entered = e.keyCode === 13;
+ if (entered) {
+ e.preventDefault();
+ e.stopPropagation();
+ toggleSwitch();
+ }
+ }
+
return (
<div className={containerClass}>
<div className="react-switch-case switch-col">
@@ -45,6 +54,8 @@ const Switch = (props) => {
className="react-switch-label"
htmlFor={id}
style={style}
+ tabIndex="0"
+ onKeyDown={onKeyDown}
>
<span className="react-switch-button" />
</label>
@@ -59,7 +70,7 @@ const Switch = (props) => {
{tooltip
&& (
<>
- <FontAwesomeIcon icon="info-circle" id={`${id}-switch-tooltip`} />
+ <FontAwesomeIcon icon="info-circle" id={`${id}-switch-tooltip`} tabIndex="-1" />
<Tooltip
placement="right"
isOpen={tooltipOpen}
diff --git a/web/js/containers/sidebar/events.js b/web/js/containers/sidebar/events.js
index 2e01c47b2..f62f8ece4 100644
--- a/web/js/containers/sidebar/events.js
+++ b/web/js/containers/sidebar/events.js
@@ -102,6 +102,7 @@ function Events(props) {
</div>
<Scrollbars
+ className="event-scroll-list"
style={{ maxHeight: `${scrollbarMaxHeight}` }}
>
<div id="wv-events">