1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import styled, { css } from 'styled-components';
- const position: {[index: string]: any} = {
- left: css`
- top: 0;
- bottom: 0;
- left: 0;
- right: auto;
- `,
- top: css`
- top: 0;
- bottom: auto;
- left: 0;
- right: 0;
- `,
- right: css`
- top: 0;
- bottom: 0;
- left: auto;
- right: 0;
- `,
- bottom: css`
- top: auto;
- bottom: 0;
- left: 0;
- right: 0;
- `,
- };
- const close: {[index: string]: any} = {
- left: css`
- transform: translate(-267px, 0);
- `,
- top: css`
- transform: translate(0, -267px);
- `,
- right: css`
- transform: translate(267px, 0);
- `,
- bottom: css`
- transform: translate(0, 267px);
- `,
- };
- export const Slide = styled('div')<{open: boolean; anchor: string; zIndex: number}>`
- position: fixed;
- transition: transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms;
- z-index: ${props => props.zIndex};
- background-color: white;
- ${props => position[props.anchor]}
- ${props => (props.open ? css`
- transform: translate(0, 0);
- ` : close[props.anchor]
- )}
- `;
- export const Container = styled.div`
- min-width: 267px;
- min-height: 267px;
- height: 100%;
- width: 100%;
- box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.24);
- `;
|