File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed
front/src/components/fadeInEntrance Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import FadeInDiv from './styled/FadeInDiv' ;
3+
4+ type Props = {
5+ children : any ;
6+ } ;
7+
8+ function FadeInEntrance ( { children } : Props ) {
9+ return < FadeInDiv startAnimation > { children } </ FadeInDiv > ;
10+ }
11+
12+ FadeInEntrance . displayName = 'FadeInEntrance' ;
13+
14+ export default FadeInEntrance ;
Original file line number Diff line number Diff line change 1+ import FadeInEntrance from './FadeInEntrance' ;
2+
3+ export default FadeInEntrance ;
Original file line number Diff line number Diff line change 1+ import styled , { keyframes , css } from 'styled-components' ;
2+
3+ const fadeIn = keyframes `
4+ from {
5+ opacity : 0 ;
6+ }
7+ to {
8+ opacity : 1 ;
9+ transform : none;
10+ }
11+ ` ;
12+
13+ const fadeInAnimationCss = css `
14+ opacity : 0 ;
15+ animation-name : ${ fadeIn } ;
16+ animation-timing-function : ease-in;
17+ animation-duration : 0.7s ;
18+ animation-delay : 0s ;
19+ animation-fill-mode : both;
20+ ` ;
21+
22+ type FadeInProps = {
23+ startAnimation : boolean ;
24+ } ;
25+
26+ const FadeInDiv = styled . div < FadeInProps > `
27+ ${ ( { startAnimation } ) => startAnimation && fadeInAnimationCss } ;
28+ ` ;
29+
30+ export default FadeInDiv ;
You can’t perform that action at this time.
0 commit comments