Skip to content

Commit 71fc810

Browse files
committed
Chore : apply animation effect #172
1 parent 6359df2 commit 71fc810

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

src/components/main/Welcome.js

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { useNavigate, useLocation } from "react-router-dom";
77
import Stack from "@mui/material/Stack";
88
import { Button } from "@mui/material";
99
import propTypes from "prop-types";
10-
import useScrollFadeIn from "../../hooks/useScrollFadeIn";
10+
import useZoomIn from "../../hooks/useZoomIn";
11+
// import useScrollFadeIn from "../../hooks/useScrollFadeIn";
1112
import MAIN from "../../assets/images/mainImg.svg";
1213

1314
const CLIENT_ID = process.env.REACT_APP_CLIENT_ID;
@@ -17,6 +18,7 @@ const handleLogin = () => {
1718
window.location.href = githubURL;
1819
};
1920
export const Welcome = () => {
21+
const zoominItem = useZoomIn(1.2, 0);
2022
const location = useLocation();
2123

2224
const preventGoBack = (event) => {
@@ -33,7 +35,6 @@ export const Welcome = () => {
3335
window.removeEventListener("popstate", preventGoBack);
3436
};
3537
}, []);
36-
const animatedItem = useScrollFadeIn();
3738
const Logined = useRecoilValue(isLogin);
3839
const navigate = new useNavigate();
3940
return (
@@ -72,8 +73,8 @@ export const Welcome = () => {
7273
</LearnmoreBtn>
7374
</Stack>
7475
</InfoDiv>
75-
<ImgDiv>
76-
<MainImg {... useScrollFadeIn("left", 1.7, 0)} src={MAIN} />
76+
<ImgDiv {... zoominItem}>
77+
<MainImg src={MAIN} />
7778
</ImgDiv>
7879
</StWelcome>
7980
);
@@ -91,45 +92,57 @@ const StWelcome = styled.div`
9192
flex-direction: row;
9293
width: 100%;
9394
height: 80vh;
94-
background: ${COLOR.MAIN_WHITE};
95+
background: linear-gradient(
96+
to bottom,
97+
${COLOR.MAIN_HOVER},
98+
${COLOR.MAIN_BACKGROUND}
99+
);
95100
text-align: center;
96-
border-bottom: 0.5px solid ${COLOR.MAIN_HOVER};
97101
`;
98102

99103
const fadeIn = keyframes`
100104
0% {
101105
opacity: 0;
102-
transform: translate3d(0, 10%, 0);
106+
transform: translate3d(0, 15%, 0);
103107
} to {
104108
opacity: 1;
105109
transform: translateZ(0);
106110
}
107111
`;
112+
113+
const updown = keyframes`
114+
0% {
115+
transform: translateY(1rem);
116+
}
117+
100% {
118+
transform: translateY(-1rem);
119+
}
120+
`;
108121
const InfoDiv = styled.div`
109122
display: flex;
110123
justify-content: center;
111124
align-items: start;
112125
flex-direction: column;
113126
width: 50%;
114127
height: 80vh;
115-
padding-left: 30rem;
128+
padding-left: 20rem;
116129
text-align: center;
117-
animation: ${fadeIn} 1.7s;
118-
/* border: 1px solid pink; */
130+
animation: ${fadeIn} 1.5s;
119131
`;
120132

121133
const ImgDiv = styled.div`
122134
display: flex;
123135
justify-content: center;
124136
align-items: center;
125-
width: 50%;
126-
height: 100%;
137+
width: 40%;
138+
height: 90%;
127139
`;
128140

129141
const MainImg = styled.img`
130-
width: 80%;
131-
height: 80%;
132-
margin-right: 15rem;
142+
width: 90%;
143+
height: 90%;
144+
margin-right: 23rem;
145+
animation: ${updown} 2s ease-in-out infinite alternate-reverse;
133146
/* border: 1px solid green; */
134147
`;
135148
export const Title = styled.h1`

0 commit comments

Comments
 (0)