css 文字左右抖动效果

html 复制代码
<template>
  <div class="box">
    <div class="shake shape">抖动特效交字11</div>
  </div>
</template>

<script setup></script>

<style scope>
.shape {
    margin: 50px;
    width: 200px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border: 1px solid black;
 }


.shake:hover {
    animation: shakeAnimal 800ms ease-in-out;
}
@keyframes shakeAnimal { /* 水平抖动,核心代码 */
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(+2px, 0, 0); }
    30%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(+4px, 0, 0); }
    50% { transform: translate3d(-4px, 0, 0); }
}

</style>
相关推荐
冰暮流星18 小时前
css3网格布局2
前端·css·css3
沐风。561 天前
css函数
前端·css·css3
沐风。561 天前
通过js动态更新css变量
javascript·css·tensorflow
BD_Marathon1 天前
【JavaWeb】CSS_三种引入方式
前端·css
Hy行者勇哥1 天前
HTML5 + 原生 CSS + 原生 JS 网页实现攻略
javascript·css·html5
小王码农记2 天前
CSS中自定义属性函数var()
前端·css·vue.js
BD_Marathon2 天前
【JavaWeb】CSS浮动
前端·css
写代码的皮筏艇2 天前
CSS中常使用的函数
前端·css
草字2 天前
css 按钮的脉冲光环动画,强调动画。
前端·css
BD_Marathon2 天前
【JavaWeb】CSS_三大选择器
前端·css