Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add sidebar collapse animation #1182

Benjamin Kingcdbc04ec770a
diff --git a/web/css/sidebar.css b/web/css/sidebar.css
index c86eee9b8..e3047392e 100644
--- a/web/css/sidebar.css
+++ b/web/css/sidebar.css
@@ -14,6 +14,8 @@
box-sizing: border-box;
padding: 0;
border-top: none;
+ transition: max-height 0.1s ease;
+ overflow: hidden;
}
#productsHolder .layer-container {
box-sizing: border-box;
diff --git a/web/js/components/sidebar/sidebar.js b/web/js/components/sidebar/sidebar.js
index aae2233e0..5c5ae1938 100644
--- a/web/js/components/sidebar/sidebar.js
+++ b/web/js/components/sidebar/sidebar.js
@@ -149,6 +149,7 @@ class Sidebar extends React.Component {
showListAllButton,
comparisonType,
onGetData,
+ windowHeight,
filterEventList
} = this.state;
const {
@@ -201,7 +202,14 @@ class Sidebar extends React.Component {
secondDateObject.layers.baselayers.length
}
/>
- <div id="productsHolder" style={isCollapsed ? { display: 'none' } : {}}>
+ <div
+ id="productsHolder"
+ style={
+ isCollapsed
+ ? { maxHeight: '0' }
+ : { maxHeight: windowHeight + 'px' }
+ }
+ >
<NavCase
tabTypes={tabTypes}
isMobile={isMobile}