diff --git a/src/components/tw-featured-projects/featured-projects.css b/src/components/tw-featured-projects/featured-projects.css index 11c3d1d0f..a869cb095 100644 --- a/src/components/tw-featured-projects/featured-projects.css +++ b/src/components/tw-featured-projects/featured-projects.css @@ -30,6 +30,12 @@ .projects { position: relative; + height: 155px; +} +.projects.transition { + transition: .2s height; +} +.projects.opened { height: 310px; } diff --git a/src/components/tw-featured-projects/featured-projects.jsx b/src/components/tw-featured-projects/featured-projects.jsx index 5688b2e82..60d0f1c47 100644 --- a/src/components/tw-featured-projects/featured-projects.jsx +++ b/src/components/tw-featured-projects/featured-projects.jsx @@ -7,6 +7,7 @@ import StudioView from '../tw-studioview/studioview.jsx'; import styles from './featured-projects.css'; import analytics from '../../lib/analytics'; import {setProjectId} from '../../lib/tw-navigation-utils.js'; +import classNames from 'classnames'; class FeaturedProjects extends React.Component { constructor (props) { @@ -16,7 +17,8 @@ class FeaturedProjects extends React.Component { 'handleOpenProjects' ]); this.state = { - opened: false + opened: false, + transition: true }; } componentDidUpdate (prevProps) { @@ -24,7 +26,8 @@ class FeaturedProjects extends React.Component { if (this.props.projectId === '0') { // eslint-disable-next-line react/no-did-update-set-state this.setState({ - opened: true + opened: true, + transition: false }); } } @@ -41,10 +44,16 @@ class FeaturedProjects extends React.Component { render () { const opened = this.state.opened; return ( -
-
+
+