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>
相关推荐
传人once11 小时前
多图片上传预览功能如何写
前端·css·html·jquery·html5
传人once13 小时前
悬停旋转放大和位移效果如何写
javascript·css·动画
听风3471 天前
windplay网页创意实验场
css·html·创意·website·windplay
福兮说1 天前
设计稿是 #4A7C6F,页面量出来是 #4B7C6F:HEX、HSL、透明度、canvas 来回转的七个坑
前端·javascript·css·canvas
weixin_448290252 天前
书庐开发实战教学
javascript·css·html
传人2 天前
悬停旋转放大和位移效果如何写
前端·javascript·css
geovindu2 天前
css: Timeline scribble
前端·css·iphone
易朵朵3 天前
CSS 格式化上下文
css·vue.js
COOLMO研究AI3 天前
企业官网服务页的信息架构怎么设计:从用户问题到语义化 HTML
前端·css·html
DsirNg3 天前
断点不该认识设备:组件布局的容器状态治理
css·前端工程化·组件化·响应式布局·css grid·设计系统·container queries