feat: add shake effect

This commit is contained in:
2023-12-13 00:15:41 +08:00
parent 520e9febd0
commit a886b4d3f2
2 changed files with 30 additions and 1 deletions

View File

@@ -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;
}