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>
相关推荐
小小199216 小时前
idea 配置less转化为css
前端·css·less
hhb_61816 小时前
Less嵌套避坑:优先级冲突实战解析
前端·css·less
AI视觉网奇20 小时前
three教学 3d资产拼接源代码
前端·css·css3
用户059540174461 天前
RAG 记忆层踩坑实录:用户偏好凭空消失,我排查了 4 小时,最后用 LangChain + Chroma 搭了套自动化回归测试
前端·css
何何____1 天前
svg基本图形绘制介绍
前端·css
jnene2 天前
html 时间、价格筛选样式处理
前端·css·html
用户059540174462 天前
Redis 缓存过期不一致踩坑实录:一个 bug 让我排查了 3 小时,最终用 Pytest 自动化堵上漏洞
前端·css
神明不懂浪漫2 天前
【第三章】CSS(一)——基础选择器、CSS的属性
前端·css·html·css3
用户059540174462 天前
localStorage清除策略踩坑实录:一个过期的token让我排查了3小时
前端·css
#麻辣小龙虾#2 天前
js实现视频播放画中画模式
javascript·css·音视频