2020-08-31 00:49:06 +03:00
|
|
|
import React, { FunctionComponent } from 'react';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
shown?: boolean;
|
|
|
|
children: React.ReactNode;
|
|
|
|
rotate?: boolean;
|
|
|
|
}
|
|
|
|
|
2023-12-12 07:02:35 +03:00
|
|
|
const RightSlider: FunctionComponent<Props> = ({ shown, children, rotate }) => (
|
2020-08-31 00:49:06 +03:00
|
|
|
<div
|
2023-12-12 07:02:35 +03:00
|
|
|
css={[
|
|
|
|
{
|
|
|
|
WebkitFontSmoothing: 'subpixel-antialiased', // http://stackoverflow.com/a/21136111/4218591
|
|
|
|
position: 'absolute',
|
|
|
|
right: 0,
|
|
|
|
transform: 'translateX(150%)',
|
|
|
|
transition: 'transform 0.2s ease-in-out',
|
|
|
|
},
|
|
|
|
shown && {
|
|
|
|
position: 'static',
|
|
|
|
transform: 'translateX(0)',
|
|
|
|
},
|
|
|
|
rotate && {
|
|
|
|
transform: 'rotateX(90deg)',
|
|
|
|
transition: 'transform 0.2s ease-in-out 0.08s',
|
|
|
|
},
|
|
|
|
rotate &&
|
|
|
|
shown && {
|
|
|
|
transform: 'rotateX(0)',
|
|
|
|
transition: 'transform 0.2s ease-in-out 0.18s',
|
|
|
|
},
|
|
|
|
]}
|
2020-08-31 00:49:06 +03:00
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default RightSlider;
|