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>
相关推荐
漂流瓶jz5 小时前
运行时vs编译时:CSS in JS四种主流方案介绍和对比
前端·javascript·css
钮钴禄·爱因斯晨6 小时前
他到底喜欢我吗?赛博塔罗Java+前端实现,一键解答!
java·开发语言·前端·javascript·css·html
DoWhatUWant12 小时前
WebUI页面结构
css·html5
爱上好庆祝16 小时前
移动端适配
前端·css·学习·html·css3
邂逅星河浪漫1 天前
【银行内网开发-管理端】Vue管理端+Auth后台开发+Nginx配置+Linux部署(详细解析)
linux·javascript·css·vue.js·nginx·html·前后端联调
慕斯fuafua1 天前
CSS——浮动
前端·css
xcjbqd01 天前
CSS中隐藏元素的多重技巧与应用场景
前端·css
慕斯fuafua2 天前
CSS——定位
前端·css
AnalogElectronic2 天前
html+js+css实现七龙珠神龙召唤特效
javascript·css·html
qq_381338502 天前
现代 CSS 黑科技:Container Queries、:has() 与嵌套语法实战
前端·css·科技