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中的函数
前端·css
倚肆7 小时前
CSS 选择器空格使用区别详解
前端·css
盼哥PyAI实验室7 小时前
学会给网页穿衣服——学习 CSS 语言
前端·css·学习
程序猿_极客12 小时前
【期末网页设计作业】HTML+CSS+JS 旅行社网站、旅游主题设计与实现(附源码)
javascript·css·html·课程设计·期末网页设计
q***581917 小时前
【HTML+CSS】使用HTML与后端技术连接数据库
css·数据库·html
振华OPPO1 天前
Vue:“onMounted“ is defined but never used no-unused-vars
前端·javascript·css·vue.js·前端框架
J***Q2921 天前
前端CSS架构模式,BEM与ITCSS
前端·css
qq_398586541 天前
浏览器中内嵌一个浏览器
前端·javascript·css·css3
一个打工仔的笔记2 天前
使用css实现打开抽屉效果(css过渡动画)
css
fruge3 天前
设计稿还原技巧:解决间距、阴影、字体适配的细节问题
前端·css