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>
相关推荐
传人14 小时前
页面中心圆圈放大效果如何写
前端·css
被摘下的星星18 小时前
CSS 基础说明
前端·css
传人once2 天前
网页文字滚动效果如何做
前端·css·html·jquery·html5
乌暮2 天前
拆解网页的底层逻辑:用费曼学习法讲透 HTML 与 CSS
前端·css·学习·html
传人once2 天前
多图片上传预览功能如何写
前端·css·html·jquery·html5
传人once2 天前
悬停旋转放大和位移效果如何写
javascript·css·动画
听风3473 天前
windplay网页创意实验场
css·html·创意·website·windplay
福兮说3 天前
设计稿是 #4A7C6F,页面量出来是 #4B7C6F:HEX、HSL、透明度、canvas 来回转的七个坑
前端·javascript·css·canvas
weixin_448290253 天前
书庐开发实战教学
javascript·css·html
传人4 天前
悬停旋转放大和位移效果如何写
前端·javascript·css