728x90
글자가 올라왔다 내려갔다 반복하는 효과 ⇡⇣
글자가 '점핑저점핑'하는 효과를 만들어봅시다 !
#1. HTML 코드를 확인해보자
글자마다 span으로 감싸서 만들어줍니다.
<h1>
<span>I</span>
<span>'</span>
<span>m</span>
<span>G</span>
<span>y</span>
<span>u</span>
<span>p</span>
<span>p</span>
</h1>
#2. CSS(SCSS) 코드를 확인해보자
html, body {
width: 100%;
height: 100%;
background: linear-gradient(140deg, black 0%, plum 100%);
display: flex;
justify-content: center;
align-items: center;
}
h1 {
height: 100px;
}
h1 span {
font-family: serif;
font-size: 80px;
color: #fff;
position: relative;
top: 20px;
display: inline-block;
/* 폰트가 부드러워지게 설정 */
-webkit-font-smoothing: antialiased;
/* x축, y축, 블러 설정 */
text-shadow: 0 1px 0 #ccc,
0 2px 0 #ccc,
0 3px 0 #ccc,
0 4px 0 #ccc,
0 5px 0 #ccc,
0 6px 0 transparent,
0 7px 0 transparent,
0 8px 0 transparent,
0 9px 0 transparent,
0 10px 10px rgba(0,0,0,0.4);
animation: bounce 0.3s ease infinite alternate;
}
h1 span:nth-child(2){animation-delay: 0.1s;}
h1 span:nth-child(3){animation-delay: 0.2s;}
h1 span:nth-child(4){animation-delay: 0.3s;}
h1 span:nth-child(5){animation-delay: 0.4s;}
h1 span:nth-child(6){animation-delay: 0.5s;}
h1 span:nth-child(7){animation-delay: 0.6s;}
h1 span:nth-child(8){animation-delay: 0.7s;}
@keyframes bounce {
100% {
top: -20px;
text-shadow: 0 1px 0 #ccc,
0 1px 0 #ccc,
0 3px 0 #ccc,
0 4px 0 #ccc,
0 5px 0 #ccc,
0 6px 0 transparent,
0 7px 0 transparent,
0 8px 0 transparent,
0 9px 0 transparent,
0 50px 20px rgba(0,0,0,0.4);
}
}
'CSS > ANIMATION' 카테고리의 다른 글
CSS | ANIMATION | 마우스를 따라 움직이는 눈 (5) | 2022.09.26 |
---|---|
CSS | ANIMATION | 빙빙 돌아가는 로딩 만들기 (4) | 2022.09.26 |
CSS | ANIMATION | 입체감 있는 마우스 오버효과 (7) | 2022.09.20 |
CSS | ANIMATION | 울렁울렁 웨이브 만들기 (10) | 2022.09.19 |
ANIMATION | SVG 텍스트 애니메이션 만들기 (5) | 2022.09.08 |
댓글