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>
相关推荐
思码梁田4 小时前
CSS letter-spacing 属性详解:掌控字符之间的呼吸感
前端·css
贾伟康6 小时前
【安心陪诊 Agent v1.1】首页可信设计实战:HTML/CSS 状态卡与急症分流
css·html·harmonyos·ai agent·首页设计
AZaLEan__7 小时前
CSS文档流相关:BFC
前端·css
‘’林花谢了春红‘’20 小时前
小玩意 生日快乐
css·html·css3
梨想橙汁1 天前
CSS零基础入门:语法、引入方式与基础样式全解析
css
七牛开发者1 天前
RAG 工程里的上下文剪枝:如何减少 68% 的上下文
前端·css·github
叉歪1 天前
为 UnoCSS 扩展无限色阶与主题换色
前端·css
TheITSea1 天前
4、React+Tailwind CSS
前端·css·react.js
iCOD3R2 天前
Skill - kill-ai-slop 解决“AI 味”样式
前端·css·ai编程
努力成为AK大王2 天前
CSS 入门完整笔记
前端·css