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>
相关推荐
牧艺8 小时前
cos-design PhotoAlbum:用 CSS 3D 做一个「能翻页」的实体相册
前端·css·交互设计
muddjsv1 天前
CSS 盒模型进阶约束:极值尺寸、固有尺寸与外边距折叠
前端·css
布兰妮甜1 天前
暗黑模式一键切换完整方案(CSS 变量 + 本地存储)
javascript·css·web开发·用户体验·前端工程化
muddjsv1 天前
CSS 盒模型完全指南:content-box 与 border-box 尺寸计算原理
前端·css
米码收割机1 天前
【前端】html+css 甘肃天水旅游(源码+文档)【独一无二】
前端·css·html
米码收割机2 天前
【前端】html_css 沐光公益阅读馆(源码+文档)【独一无二】
前端·css·html
布兰妮甜2 天前
原子化 CSS 深度解析:Tailwind 原理、自定义配置、大型项目利弊
css·性能优化·tailwind·前端工程化·设计系统
用户059540174462 天前
LangChain 记忆测试踩坑实录:这两个坑让我排查了 4 小时
前端·css
徐佳明2 天前
从"能聊天"到"能干活":MCP Server 如何让 AI 智能体真正落地
css
徐佳明2 天前
AI 智能体的"技能树":Skills 架构设计与工程落地实践
css