Do it! CSS 웹 표준의 정석

Transition and Animation

lshjju 2025. 11. 6. 16:31

Keyword overview


Null



The Code Card


transform

https://lshjju.tistory.com/748

 

transform

정적인 요소를 움직이고 회전시키는 transform 속성은 웹 디자인에 생동감을 불어넣는 마법과 같습니다.1. CSS transform의 정의transform은 단어 뜻 그대로 요소의 모양, 크기, 위치, 회전을 시각적으로

lshjju.tistory.com


transition

https://lshjju.tistory.com/749

 

transition

transition은 스타일 속성이 변경될 때 그 변화를 일정 시간에 걸쳐 일어나게 하여 애니메이션 효과를 만들어냅니다.1. CSS transition의 정의transition은 CSS 속성값이 변경될 때(예: 마우스 호버 시 색상

lshjju.tistory.com


CSS Animation and @keyframes

https://lshjju.tistory.com/750

 

CSS Animation and @keyframes

단순한 상태 변화를 넘어 웹 요소에 연속적이고 자율적인 생명력을 불어넣는 CSS Animation에 대해 알아보겠습니다.transition이 A에서 B로 가는 일회성 변화라면, animation은 여러 단계를 거치거나 무한

lshjju.tistory.com


translate() center center alignment

https://lshjju.tistory.com/711

 

translate() center center alignment

중앙 박스 코드 동작 원리top: 50%, left: 50%: 박스의 왼쪽 상단 꼭짓점을 화면 정중앙에 가져다 놓습니다. (이 상태에선 박스가 우측 하단으로 쏠려 보입니다.)translate(-50%, -50%): 박스 자신의 너비($X$)

lshjju.tistory.com


 


14-1 트랜스폼 알아보기



transform 과 트랜스폼 함수



2차원 트랜스폼과 3차원 트랜스폼



웹 요소를 이동시키는 translate() 함수


translate 함수로 웹 요소 이동하기
https://github.com/lshjju/doit-hcj-new/blob/main/14/results/translate.html

 

트랜지션 효과 추가하기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/translate.html



요소를 확대 축소하는 scale() 함수


scale() 함수를 사용해 확대 축소하기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/scale.html



요소를 회전시키는 rotate() 함수



2차원 rotate() 함수


함수를 사용해 2차원에서 회전하기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/rotate.html



3차원 rotate() 함수와 perspective 속성


이미지 회전하며 원근감 주기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/perspective.html

 

rotate() 함수를 사용해 3차원에서 회전하기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/rotate3d.html



요소를 비틀어 왜곡하는 skew() 함수


skew() 함수로 도형 비틀기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/skew.html



14-2 트랜지션 알아보기



트랜지션이란



트랜지션과 속성



트랜지션의 대상을 지정하는 transition-property



트랜지션의 진행 시간을 지정하는 transition-duration



트랜지션의 속도 곡선을 지정하는 transition-timing-function



트랜지션의 지연 시간을 설정하는 transition-delay



트랜지션의 속성을 한꺼번에 표기하는 transition


트랜지션 속성을 한꺼번에 지정하기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/tr-1.html



실습


마우스 오버하면 상품 정보 표시하기

 

1단계 HTML 파일 살펴보기

2단계 CSS 파일 수정하고 저장하기

3단계 마우스 포인터를 올리면 상품 설명 글 보여 주기

 

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/product.html

 

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/css/product.css



14-3 애니메이션 알아보기



css 애니메이션에서 사용하는 속성



애니매이션의 지점과 이름을 설정하는 @keyframes, animation-name 


애니메이션 정의하기

animation-name 속성 사용하기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/ani-1.html



애니매이션의 실행 시간을 지정하는 animation-duration


animation-duration 속성 지정하기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/ani-1.html



반복 횟수를 지정하는 animation-iteration-count 



애니매이션의 방향을 지정하는 animation-direction 


왕복하는 애니메이션 만들기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/ani-2.html



애니매이션의 속도 곡선을 지정하는 animation-timing-function




애니매이션의 속성을 한꺼번에 표기하는 animation


애니메이션 2개를 한꺼번에 지정하기

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/ani-3.html



실습 - 트랜스폼과 트랜지션을 사용해 버튼 효과 만들기


1단계 동적인 효과가 완료됐을 때 스타일 만들기

2단계 배경과 글자 나타내기

3단계 동적 효과의 모양 개선하기

4단계 동적 효과 구현하기

 

준비

https://github.com/lshjju/doit-hcj-new/blob/main/14/button.html

결과

https://github.com/lshjju/doit-hcj-new/blob/main/14/results/button.html




Copyright

이 포스팅의 깃허브코드와 강의 목차 저작권은 이지스퍼블리싱에 있습니다.
https://www.easyspub.co.kr/20_Menu/BookView/696/PUB


 

'Do it! CSS 웹 표준의 정석' 카테고리의 다른 글

CSS Advanced Selectors  (0) 2025.11.06
Grid layout  (0) 2025.11.06
Flexbox layout  (0) 2025.11.06
RWD and Media query  (0) 2025.11.06
Image and Gradient  (0) 2025.11.06