美文网首页
animate.css入门

animate.css入门

作者: 转身丶即天涯 | 来源:发表于2025-01-06 11:11 被阅读0次

1. 前言

近年来前端出现了太多了框架,美其名曰帮助用户快速构建应用,但都沦为了资本流水线上的工人。
懂的人自然懂。

学习资料:

2. 引入animate.css

我们采用CDN的方式引入,其实就是通过网络的方式引入。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>初识Animate.css</title>
    <!-- 引入Animate.css -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
</head>

3. 第一个动画

创建一个h1标签,并让它动起来。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>初识Animate.css</title>
    <!-- 引入Animate.css -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
</head>
<body>
  <h1>引入Animate css</h1>
  <h1 class="animate__animated animate__bounce">An animated element</h1>
</body>
</html>

4. 什么是keyframes(关键帧)?

在动画设计中,关键帧指的是动画序列中定义了特定时间点样式变化的帧。
CSS中的@keyframes规则允许开发者指定一个动画周期内的关键帧,这些关键帧定义了动画在不同时间点的样式,从而创建出平滑的动画效果。
@keyframes是CSS3引入的一个特性,大大增强了网页的动态表现能力。

5. 尝试各种动画

image.png

官网首页的右侧,提供了所有动画功能,逐个动手体验一遍。
到目前为止,可以实现引入基本动画功能了。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>初识Animate.css</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
</head>
<body>
    <h1>Animate css 吸引眼球的12个动画</h1>

    <h1>1. 弹跳</h1>
    <div class="animate__animated animate__bounce">
        <span>this a sentence.</span>
    </div>

    <h1>2. 闪烁</h1>
    <div class="animate__animated animate__flash">
        <span>this a sentence.</span>
    </div>

    <h1>3. 缩放</h1>
    <div class="animate__animated animate__pulse">
        <span>this a sentence.</span>
    </div>

    <h1>4. 橡皮筋</h1>
    <div class="animate__animated animate__rubberBand">
        <span>this a sentence.</span>
    </div>

    <h1>5. X轴晃动</h1>
    <div class="animate__animated animate__shakeX">
        <span>this a sentence.</span>
    </div>

    <h1>6. Y轴晃动</h1>
    <div class="animate__animated animate__shakeY">
        <span>this a sentence.</span>
    </div>

    <h1>7. X轴轻微晃动</h1>
    <div class="animate__animated animate__headShake">
        <span>this a sentence.</span>
    </div>

    <h1>8. 摇摆(像钉在某一点上摇摆)</h1>
    <div class="animate__animated animate__swing">
        <span>this a sentence.</span>
    </div>

    <h1>9. tada</h1>
    <div class="animate__animated animate__tada">
        <span>this a sentence.</span>
    </div>

    <h1>10. 摇晃(像雨刷一样摇摆)</h1>
    <div class="animate__animated animate__wobble">
        <span>this a sentence.</span>
    </div>

    <h1>11. 果冻</h1>
    <div class="animate__animated animate__jello">
        <span>this a sentence.</span>
    </div>

    <h1>12. 心跳</h1>
    <div class="animate__animated animate__heartBeat">
        <span>this a sentence.</span>
    </div>
</body>
</html>

相关文章

  • 【Animate.css】CSS动画库

    本节目录 Animate.css简介 Animate.css基础用法 Animate.css配合JS的用法和讲解 ...

  • animate.css的使用方法

    animate.css介绍 animate.css是一个跨浏览器的css3动画库 animate.css基础使用 ...

  • Animate.css的初入门

    推荐一个网站最牛前端Animate.css是css动画库,封装了一些动画效果想要使用的话直接在github上下载,...

  • VUE之动画特效

    1. 在vue使用animate.css库 安装:npm install animate.css --save引用...

  • 基于animate和fullpage制作动画demo的总结

    animate.css就是一个动画库,使用时注意点: 用法: Animate.css 当与jQuery...

  • vue day03

    1.transition结合animate.css实现过渡 步骤:1.引入animate.css文件2.在想要进行...

  • CSS3的颜色渐变效果

    在 animate.css寻找自己想要的动态效果,看到标题Animate.css和按钮Animate it的颜色在...

  • HTML常用框架

    框架一 :: Animate.css Animate.css是一个css动画样式库,可以减少我们的开发时间.它预设...

  • WOW.js – 让页面滚动更有趣

    前面提到了animate.css,在这里推荐一个能与animate.css完美结合的控件——wow.js WOW....

  • JavaScript---动画框架

    animate.css animate.css是一个来自国外的CSS3动画库,它预设了抖动(shake)、闪烁(f...

网友评论

      本文标题:animate.css入门

      本文链接:https://www.haomeiwen.com/subject/eydryjtx.html