import type {HTMLAttributes} from 'react';
import styled from '@emotion/styled';
import type {AnimationControls} from 'framer-motion';
import {motion} from 'framer-motion';
import testableTransition from 'sentry/utils/testableTransition';
type Props = {
animateVariant: AnimationControls;
} & HTMLAttributes;
function PageCorners({animateVariant, ...rest}: Props) {
return (
);
}
export default PageCorners;
const transition = testableTransition({
type: 'spring',
duration: 0.8,
});
const TopLeft = styled(motion.svg)`
position: absolute;
top: 0;
left: 0;
`;
TopLeft.defaultProps = {
initial: {x: '-40px', opacity: 0, originX: 0, originY: 0, scale: 'var(--corner-scale)'},
variants: {
none: {x: '-40px', opacity: 0},
'top-right': {x: '-40px', opacity: 0},
'top-left': {x: 0, opacity: 1},
},
transition,
};
const TopRight = styled(motion.svg)`
position: absolute;
top: 0;
right: 0;
`;
TopRight.defaultProps = {
initial: {
x: '40px',
opacity: 0,
originX: '100%',
originY: 0,
scale: 'var(--corner-scale)',
},
variants: {
none: {x: '40px', opacity: 0},
'top-left': {x: '40px', opacity: 0},
'top-right': {x: 0, opacity: 1},
},
transition,
};
const BottomLeft = styled(motion.svg)`
position: absolute;
bottom: 0;
left: 0;
`;
BottomLeft.defaultProps = {
initial: {
x: '-40px',
opacity: 0,
originX: 0,
originY: '100%',
scale: 'var(--corner-scale)',
},
variants: {
none: {x: '-40px', opacity: 0},
'top-left': {x: '-40px', opacity: 0},
'top-right': {x: 0, opacity: 1},
},
transition,
};
const BottomRight = styled(motion.svg)`
position: absolute;
bottom: 0;
right: 0;
`;
BottomRight.defaultProps = {
initial: {
x: '40px',
opacity: 0,
originX: '100%',
originY: '100%',
scale: 'var(--corner-scale)',
},
variants: {
none: {x: '40px', opacity: 0},
'top-right': {x: '40px', opacity: 0},
'top-left': {x: 0, opacity: 1},
},
transition,
};
const Container = styled('div')`
pointer-events: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
color: ${p => p.theme.purple200};
opacity: 0.4;
`;