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>
相关推荐
梨想橙汁1 小时前
CSS零基础入门:语法、引入方式与基础样式全解析
css
七牛开发者2 小时前
RAG 工程里的上下文剪枝:如何减少 68% 的上下文
前端·css·github
叉歪4 小时前
为 UnoCSS 扩展无限色阶与主题换色
前端·css
TheITSea8 小时前
4、React+Tailwind CSS
前端·css·react.js
iCOD3R1 天前
Skill - kill-ai-slop 解决“AI 味”样式
前端·css·ai编程
努力成为AK大王1 天前
CSS 入门完整笔记
前端·css
神明不懂浪漫2 天前
【第四章】CSS(二)——文本外观属性与复合选择器
前端·css·经验分享·笔记
H Journey2 天前
web开发学习:html、css、js
前端·css·html·js
用户059540174462 天前
AI Agent 记忆存储踩坑实录:这个问题让我排查了 3 天,最终用 pytest + Docker 实现秒级回归
前端·css
今日无bug2 天前
Emmet 语法速成指南
前端·css·html