Transitions က property value တစ်ခုမှ နောက်တစ်ခုကို ချောချောမွေ့မွေ့ပြောင်းစေပါတယ်။ Hover animation, button feedback, card lift effect တွေမှာအသုံးများပါတယ်။ Animation က အလှအတွက်ပဲမဟုတ်ဘဲ user action ကို feedback ပြန်ပေးတဲ့နည်းလမ်းလည်းဖြစ်ပါတယ်။ ဒါပေမယ့် အလွန်အကျွံလှုပ်ရင် website က disco floor ဖြစ်သွားနိုင်တာကိုတော့ သတိထားပါ။
css
.button {
background-color: #77f5ff;
transform: translateY(0);
transition: transform 0.25s ease, background-color 0.25s ease;
}
.button:hover {
background-color: #ff4dcd;
transform: translateY(-2px);
}You should see
Button ကို hover လုပ်တဲ့အခါ အရောင်ပြောင်းပြီး နည်းနည်းမြောက်သွားတာကိုချောမွေ့စွာမြင်ရပါမယ်။Warning
Transition လုပ်တဲ့ property တိုင်း performance မတူပါ။ transform နဲ့ opacity က animation အတွက်ပိုသင့်တော်ပါတယ်။