μΉ/CSS
[CSS] λ³νκ³Ό μ λλ©μ΄μ
Judith Hopps
2023. 1. 8. 13:02
1. transform μμ±
π MDN λ¬Έμ 보기
μ£Όμ μμλ€μ μν₯μ λΌμΉμ§ μμΌλ©΄μ μμμ λͺ¨μ΅μ λ°κΏλλ€.
ex)
scale: ν¬κΈ°
rotate(45deg) : κ°λtranslate (x,y) : μμΉskew(0deg, 30deg) : μ곑
2. transition μμ±
π MDN λ¬Έμ 보기
π cubic-bezier κ° μμ±κΈ°
transiton μμ±μ CSS κ°μ΄ λ¬λΌμ§ λ μμμ μ΄λ€ ν¨κ³Όλ‘ λ°μλ μ§ μ§μ ν©λλ€.
μμ±, μ§μμκ°, μκ°ν¨μ, μ§μ°μκ° μμΌλ‘ κ°μ λ£μ μ μμ΅λλ€.
μ£Όμ! μ μ©ν CSS μμ±μ΄ μ΄λ―Έ κΈ°μ‘΄κ°μ΄ μ μ©λμ΄ μμ΄μΌ λμν©λλ€.
ex)
transition : left 2s ease-in / background-color 1s /all 1s
3. animation μμ±
π MDN λ¬Έμ 보기
animation μμ±μ μ¬μ©νλ©΄ μλ°μ€ν¬λ¦½νΈ μμ΄
μμμ μ λλ©μ΄μ
μ μ μ©ν μ μμ΅λλ€.
@keyframes roll-and-round {
/* μμ */
from {
left: 36px;
border-radius: 0;
transform: scale(1) rotate(0deg);
opacity: 1;
}
/* μ€κ°κ³Όμ μΆκ° */
/* 67% {
transform: scale(2) rotate(540deg);
border-radius: 10%;
opacity: 1;
} */
/* λ */
to {
left: 600px;
border-radius: 100%;
transform: scale(0.25) rotate(1080deg) ;
opacity: 0;
}
}
/* μμμ μ λλ©μ΄μ
μ μ μ© */
#square {
/* μ¬μ©ν μ λλ©μ΄μ
μ μ΄λ¦ */
animation-name: roll-and-round;
/* μ§μμκ° */
animation-duration: 2s;
/* μκ°ν¨μ */
animation-timing-function: linear;
/* μ§μ°μκ° */
animation-delay: 1s;
/* λ°λ³΅ νμ */
/* animation-iteration-count: 3; */
animation-iteration-count: infinite;
/* μ§νλ°©ν₯ */
/* animation-direction: reverse; */
/* animation-direction: alternate; : λμμ΄ */
}
4. μ€μ΅
νμΌ μ°Έκ³