feat: add shake effect
This commit is contained in:
16
css/game.css
16
css/game.css
@@ -5,8 +5,10 @@
|
||||
}
|
||||
#desktop{
|
||||
position: absolute;
|
||||
/*background-image: url('../asset/pic/qinshihuang/desktop.png');*/
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#desktop img{
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
#restaurant .customer img {
|
||||
@@ -157,3 +159,15 @@
|
||||
#kung-pao-chicken img{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 定义抖动动画 */
|
||||
@keyframes shake {
|
||||
0%, 100% { transform: translateX(0); }
|
||||
10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
|
||||
20%, 40%, 60%, 80% { transform: translateX(10px); }
|
||||
}
|
||||
|
||||
.shake-animation {
|
||||
animation: shake 0.8s; /* 动画持续时间 */
|
||||
animation-timing-function: ease-in-out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user