7.1 万 Star!超实用,60 多种动画效果的 CSS 库

  发布时间:2025-11-05 15:22:54   作者:玩站小弟   我要评论
简介animate.css 是一个有趣的,跨浏览器的 css3 动画库,兼容性好,使用方便。它预设了抖动、闪烁、弹跳、翻转、旋转、淡入淡出等多达 60 多种动画效果,几乎包含了所有常见的动画效果。an 。

简介

animate.css 是实用一个有趣的,跨浏览器的多种动画的 css3 动画库,兼容性好,效果使用方便。实用它预设了抖动、多种动画的闪烁、效果弹跳、实用翻转、多种动画的旋转、效果淡入淡出等多达 60 多种动画效果,实用几乎包含了所有常见的多种动画的b2b信息网动画效果。

animate.css 基于 CSS3,效果只兼容支持 CSS3 animate 属性的实用浏览器,IE10+、多种动画的Firefox、效果Chrome、Opera、Safari。

项目地址是:

https:// github.com/animate-css/ animate.css

安装

使用 npm 安装: $ npm install animate.css --save  使用 yarn 安装: $ yarn add animate.css  使用 CDN 直接引入: <head>   <link     rel="stylesheet"     href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"   /> </head> 

简单使用

基本用法。安装 animate.css 后,将以下属性添加到中即可完成动画效果的创建。 <h1 class="animate__animated animate__bounce">An animated element</h1>  自定义属性。使用自定义属性来定义动画持续时间、香港云服务器延迟,这使得它非常灵活,当需要更改动画持续时间的时间,只需要为全局或本地设置一个新值。 /* This only changes this particular animation duration */ .animate__animated.animate__bounce {   --animate-duration: 2s; } /* This changes all the animations globally */ :root {   --animate-duration: 800ms;   --animate-delay: 0.9s; }  同时自定义属性还可以动态更改所有时间受限的属性,可以通过 JS 脚本动态修改。 // All animations will take twice the time to accomplish document.documentElement.style.setProperty(--animate-duration, 2s); // All animations will take half the time to accomplish document.documentElement.style.setProperty(--animate-duration, .5s);  延迟效果:可以直接在元素的 class 属性上添加延迟效果: <div class="animate__animated animate__bounce animate__delay-2s">Example</div> // animate.css 提供了这些延迟属性: class               默认延迟时间 animate__delay-2s   2s animate__delay-3s   3s animate__delay-4s   4s animate__delay-5s   5s // 也可以通过 --animate-delay 属性进行自定义: /* All delay classes will take 2x longer to start */ :root {   --animate-delay: 2s; } /* All delay classes will take half the time to start */ :root {   --animate-delay: 0.5s; }  动画速度:可以通过添加这些 class 来控制动画的速度: <div class="animate__animated animate__bounce animate__faster">Example</div> // 速度的 class 包括这些: class            默认速度 animate__slow    2s animate__slower  3s animate__fast    800ms animate__faster  500ms // 可以通过 --animate-duration 全局或本地属性自定义动画时间: /* All animations will take twice as long to finish */ :root {   --animate-duration: 2s; } /* Only this element will take half the time to finish */ .my-element {   --animate-duration: 0.5s; }  循环效果:可以通过添加这些 class 来控制动画的循环次数: <div class="animate__animated animate__bounce animate__repeat-2">Example</div> // 可供选择的 class 有: class              循环次数 animate__repeat-1  1 animate__repeat-2  2 animate__repeat-3  3 animate__infinite  无限循环 // 类似的,也可以自定义循环次数: /* The element will repeat the animation 2x    Its better to set this property locally and not globally or    you might end up with a messy situation */ .my-element {   --animate-repeat: 2; } 
  • Tag:

相关文章

  • 以风控360为主题的综合评价(一站式风控解决方案的关键优势)

    摘要:在当前数字化时代,随着互联网金融的快速发展,风险管理和防控变得尤为重要。风控360作为一种全面的风险管理解决方案,受到了广泛关注。本文将从不同角度对风控360进行评价,探讨其在风险...
    2025-11-05
  • 大规模集群故障处理,能抗住这3个灵魂拷问算你赢

    我相信每一个集群管理员,在长期管理多个不同体量及应用场景的集群后,都会多少产生情绪。其实这在我看来,是一个很微妙的事,即大家也已经开始人性化的看待每一个集群了。既然是人性化的管理集群,我总是会思考几个
    2025-11-05
  • filter、interceptor、aspect应如何选择?很多人中招

    前言小伙伴们应该听说过过滤器、拦截器、切面,印象上都能够起到截断拦截的作用,在做一些业务需求时,不知道如何选择,今天老顾就来介绍一下他们之间的区别。Filter过滤器过滤器可以拦截到方法的请求和响应(
    2025-11-05
  • 微服务架构:利用事件驱动实现最终一致性

    事务一致性首先,我们来回顾一下ACID原则:Atomicity:原子性,改变数据状态要么是一起完成,要么一起失败 Consistency:一致性,数据的状态是完整一致的 I
    2025-11-05
  • 如何处理控件报文错误(解决电脑控件报文错误的方法与技巧)

    摘要:随着计算机技术的发展,我们在使用电脑时常常会遇到各种问题,其中之一就是控件报文错误。控件报文错误是指在使用控件时,因为一些原因导致报文传输出现问题,使得电脑无法正常工作。本文将介绍...
    2025-11-05
  • 【React技术栈】从零开始手写redux

    看完这篇,你也可以实现一个 redux.本篇文章对应的代码在: https://github.com/YvetteLau/... 建议先 clone 代码,然后对照代码阅读本文。1. Redux 是什
    2025-11-05

最新评论