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>
相关推荐
Amumu1213841 分钟前
CSS简介
前端·css
温轻舟7 小时前
前端可视化大屏【附源码】
前端·javascript·css·html·可视化·可视化大屏·温轻舟
糖糖TANG8 小时前
学成在线 案例练习
前端·css
1314lay_10078 小时前
color: var(--el-color-success); CSS里面使用函数
前端·css
Kyl2n9 小时前
【密码口令保存小工具】
javascript·css·css3
银烛木18 小时前
黑马程序员前端h5+css3
前端·css·css3
听海边涛声18 小时前
CSS3 图片模糊处理
前端·css·css3
小黑的铁粉1 天前
使用 min-height: 0 为什么可以防止 flex 项目溢出?
前端·css
henry1010101 天前
DeepSeek生成的网页小游戏 - 单人壁球挑战赛
javascript·css·游戏·html5