Skip to content

Commit 6eb9ec9

Browse files
committed
feat: 텍스트 그라데이션 애니메이션 추가
1 parent a687dca commit 6eb9ec9

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

src/components/Home/Home.module.scss

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "@/styles/_mixins.scss" as *;
2+
13
.Home {
24
padding-left: 1.25rem;
35
padding-right: 1.25rem;
@@ -24,6 +26,22 @@
2426
}
2527
}
2628

29+
.Title {
30+
@include titleLg;
31+
32+
line-height: 1.5;
33+
background-image: var(--color-text-gradient);
34+
-webkit-background-clip: text;
35+
background-clip: text;
36+
-webkit-text-fill-color: transparent;
37+
text-align: center;
38+
white-space: pre-line;
39+
background-size: 200% auto;
40+
-webkit-background-clip: text;
41+
-webkit-text-fill-color: transparent;
42+
animation: gradient 4s linear infinite;
43+
}
44+
2745
.HomeTop {
2846
z-index: 1;
2947
}
@@ -33,10 +51,6 @@
3351
display: flex;
3452
flex-direction: column;
3553
gap: 0.625rem;
36-
37-
& > h1 {
38-
white-space: pre-line;
39-
}
4054
}
4155

4256
.HomeImage {
@@ -59,3 +73,12 @@
5973
gap: 0.875rem;
6074
z-index: 1;
6175
}
76+
77+
@keyframes gradient {
78+
0% {
79+
background-position: 0% center;
80+
}
81+
100% {
82+
background-position: 200% center;
83+
}
84+
}

src/components/Home/Home.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ const Home = () => {
3131
<div className={styles.Home}>
3232
<div className={styles.HomeTop}>
3333
<div className={styles.HomeTitle}>
34-
<Text variant="titleLg" color="gradient" align="center" as="h1">
35-
{`영수증으로\nAI 음식 리뷰 남겨요`}
36-
</Text>
34+
<h1 className={styles.Title}>{`영수증으로\nAI 음식 리뷰 남겨요`}</h1>
3735
<Text variant="bodyLg" color="secondary" align="center">
3836
손쉬운 음식 리뷰 작성
3937
</Text>

0 commit comments

Comments
 (0)