Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to do slide in/ out? #13

Open
cellis opened this issue Dec 2, 2016 · 3 comments
Open

how to do slide in/ out? #13

cellis opened this issue Dec 2, 2016 · 3 comments

Comments

@cellis
Copy link

cellis commented Dec 2, 2016

It would be nice if there were examples to do slide in/out as with react-router-transition.

@misterfresh
Copy link
Owner

not sure what you are trying to achieve. care to provide a link with an example ?

@deathmood
Copy link

Maybe smth like this?

image

@misterfresh
Copy link
Owner

I did a slide in using aphrodite-css then the following code:

const enteringKeyframes = {
  'from': {
    transform: 'translate3d(100%, 0, 0) skewX(-30deg)',
    opacity: 0,
    zIndex: -99
  },
  '60%': {
    transform: 'skewX(20deg)',
    opacity: 1
  },
  '80%': {
    transform: 'skewX(-5deg)',
    opacity: 1
  },
  'to': {
    transform: 'none',
    opacity: 1,
    zIndex: 99
  }
};
const styles = StyleSheet.create({
  base: {
    transition: 'all 0.6s ease-in'
  },
  entering: {
    animationName: [enteringKeyframes],
    animationDuration: '600ms',
    animationTimingFunction: 'ease-out',
    animationFillMode: 'forwards'
  }
})

let Popup = ({ popupVisible }) => <div
      style={Object.assign({},
        {
          position: 'fixed',
          width: '100%',
          height: '100%',
          top: 0,
          left: 0,
          animationDuration: 0.6
        },
        (!popupVisible) && {
          opacity: 0,
          zIndex: -99
        }
      )}
      className={css(
        (popupVisible === 'entering') && styles.entering
      )}
    >popup contents</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants