| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 | 31 |
- #image
- #이미지
- javascript
- #cgimall
- 솔루션
- php
- #happycgi
- #홈페이지
- #솔루션
- CSS
- #뉴스
- jquery
- 사이트제작
- #웹솔루션
- #홈페이지제작
- #쇼핑몰
- #CSS
- happycgi
- 홈페이지제작
- 해피CGI
- CGIMALL
- #업종별
- 이미지
- 웹솔루션
- #해피CGI
- 해피씨지아이
- #jQuery
- 게시판
- 홈페이지
- 웹사이트제작
- Today
- Total
웹솔루션개발 26년 노하우! 해피CGI의 모든것
[해피CGI][cgimall] CSS로 구현하는 순차 등장 애니메이션 본문
여러 도형이 순서에 따라 크기, 회전, 색상, 모양이 변화하는 CSS 애니메이션 예제입니다.
sibling-index()를 활용해 요소별로 시간차를 주어 자연스러운 흐름을 표현합니다.
반복되는 도형이나 그리드 형태의 모션 효과를 구현할 때 참고하기 좋습니다.


HTML 구조
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="./style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pen</title>
</head>
<body>
<div class="grid" lang="njk">
{% for i in range(0, 64) %}
<div></div>
{% endfor %}
</div>
<div class="warning">
⚠️ Sorry, your browser doesn't support sibling-index()
</div>
</body>
</html>
CSS 소스
html {
height: 100%;
background: #fcfcfc;
}
body {
display: grid;
grid-template-columns: minmax(0, 1fr);
height: 100%;
place-content: center;
margin: 0;
}
.grid {
display: grid;
grid-template-columns: repeat(8, minmax(0, 1fr));
width: 100%;
max-width: min(calc(100vmin - 2rem), 40rem);
margin-inline: auto;
div {
width: 100%;
aspect-ratio: 1;
background-color: #599cb7;
animation: spin 3s cubic-bezier(.79,.14,.15,.86) infinite;
animation-delay: calc(sibling-index() * 12ms);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
border-radius: 0;
}
35% {
transform: rotate(360deg) scale(calc(sibling-index() / sibling-count() / 1.4));
background-color: #ffd100;
border-radius: 100px;
}
70%, 100% {
border-radius: 0;
transform: rotate(0deg);
}
}
/* The below is just to warn users who don't have browser support */
.warning {
background: red;
padding: 1rem;
color: white;
text-transform: uppercase;
text-align: center;
font-family: system-ui, sans-serif;
position: fixed;
top: 0;
left: 0;
right: 0;
display: none;
}
@supports not (transform: scale(calc(sibling-index() / sibling-count()))) {
.warning {
display: block;
}
}
'웹프로그램밍 자료실 > 기타 자료' 카테고리의 다른 글
| [해피CGI][cgimall] 움직이는 인풋 버튼 애니메이션 Material Radio Button (0) | 2026.10.08 |
|---|---|
| [해피CGI][cgimall] 스킬을 표현하기 좋은 애니메이션 소스 Stats animation (0) | 2026.10.07 |
| [해피CGI][cgimall] 커서를 대항한 오픈소스 AI 코드 에디터 - voideditor (0) | 2026.09.23 |
| [해피CGI][cgimall] Zed v1.13.1 (0) | 2026.09.22 |
| [해피CGI][cgimall] Fancy multiple select 다중 셀렉트박스 (0) | 2026.09.15 |

