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>
相关推荐
朕的剑还未配妥5 小时前
CSS 实现渐变毛玻璃:从 backdrop-filter 到多层 mask
前端·css
用户059540174461 天前
用了3年Redis,才发现我一直没搞懂缓存一致性测试
前端·css
muddjsv1 天前
CSS选择器体系精讲:按身份、结构、状态精准匹配元素(零基础吃透)
前端·css
用户059540174462 天前
LLM对话记忆测试踩坑实录:手工回归30分钟,自动化后2分钟发现3个隐藏Bug
前端·css
Web - Anonymous2 天前
CSS+Vue3 + TS + Setup 10种生产级可视化循环动效合集(大屏高端交互、开箱复用)-附完整示例
前端·css·信息可视化
blns_yxl2 天前
正则驱动实时表单验证(HTML+CSS+JS+正则)
javascript·css·html
思码梁田3 天前
CSS cursor 属性全解析:从“小手“开始,玩转鼠标光标
前端·css·计算机外设·cursor·pointer
黑土豆3 天前
CSS 新特性:Container Queries 到底能解决什么痛点?
前端·css
思码梁田3 天前
CSS vertical-align 属性详解:表格与图文对齐的实用指南
前端·css·vertical-align
用户059540174464 天前
把记忆存储的回归测试从手工换成 Playwright + GitHub Actions,线上缺陷降低 80%
前端·css