250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- html5
- iOS 개발자
- javascript
- keyframes
- HTML
- 애니메이션
- iPhone
- 자바스크립트
- xcode
- react
- effect
- 개발자
- MAC
- 풀스택
- ipad
- Animation
- css3
- CSS
- front-end
- IOS
- hover
- 비전공 개발자
- jQuery
- 백엔드
- php
- 프론트엔드
- image
- button
- 비전공자
- SWIFT
Archives
- Today
- Total
비전공자 개발일기
Elastic Line Animation 본문
728x90
SMALL
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS ELASTIC LINE ANIMATION</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="elastic">
<div class="ball"></div>
<svg>
<path></path>
</svg>
<svg>
<path></path>
</svg>
</div>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
position: relative;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #111;
}
.elastic {
width: 400px;
height: 400px;
display: flex;
justify-content: center;
align-items: flex-end;
}
.elastic::before {
content: '';
position: absolute;
bottom: 62.5px;
left: 5px;
width: 15px;
height: 15px;
background-color: #FFF;
border-radius: 50%;
z-index: 1;
}
.elastic::after {
content: '';
position: absolute;
bottom: 62.5px;
right: 5px;
width: 15px;
height: 15px;
background-color: #FFF;
border-radius: 50%;
z-index: 1;
}
.elastic svg {
position: absolute;
width: 400px;
height: 150px;
fill: none;
}
.elastic svg:nth-child(2) {
filter: blur(25px);
}
.elastic svg path {
width: 100%;
stroke: #FF0092;
stroke-width: 10;
stroke-linecap: round;
d: path("M 10 80 Q 190 80 390 80");
animation: animate 2.5s linear infinite, animateColor 2.5s linear infinite;
}
@keyframes animate {
0% {
d: path("M 10 80 Q 190 80 390 80");
}
10% {
d: path("M 10 80 Q 190 160 390 80");
}
20% {
d: path("M 10 80 Q 190 20 390 80");
}
30% {
d: path("M 10 80 Q 190 120 390 80");
}
35% {
d: path("M 10 80 Q 190 100 390 80");
}
40% {
d: path("M 10 80 Q 190 80 390 80");
}
50% {
d: path("M 10 80 Q 190 100 390 80");
}
55% {
d: path("M 10 80 Q 190 90 390 80");
}
60% {
d: path("M 10 80 Q 190 80 390 80");
}
}
@keyframes animateColor {
0%, 100% {
stroke: #FF0092;
}
33.33% {
stroke: #0F0;
}
66.66% {
stroke: #FF0;
}
}
.elastic .ball {
width: 60px;
height: 60px;
background-color: #FFF;
border-radius: 50%;
box-shadow: inset 0 -15px 20px rgba(0, 0, 0, .5);
animation: animateBall 2.5s linear infinite;
}
@keyframes animateBall {
0%, 100% {
transform: translateY(-72.5px);
}
10%, 11.5% {
transform: translateY(-40px);
}
50% {
transform: translateY(-350px);
}
}
728x90
LIST
'HTML _CSS' 카테고리의 다른 글
Noisy Grainy Icons (0) | 2022.12.21 |
---|---|
Credit Card2 (0) | 2022.12.19 |
Create Hover Effect (0) | 2022.12.12 |
Infinite Ticker (0) | 2022.12.10 |
3D Flip Product Card (0) | 2022.12.05 |