成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

7.1 萬 Star!超實用,60 多種動畫效果的 CSS 庫

開發 前端
animate.css 是一個有趣的,跨瀏覽器的CSS3 動畫庫。

簡介

animate.css 是一個有趣的,跨瀏覽器的 css3 動畫庫,兼容性好,使用方便。它預設了抖動、閃爍、彈跳、翻轉、旋轉、淡入淡出等多達 60 多種動畫效果,幾乎包含了所有常見的動畫效果。

animate.css 基于 CSS3,只兼容支持 CSS3 animate 屬性的瀏覽器,IE10+、Firefox、Chrome、Opera、Safari。

項目地址是:

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

安裝

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

簡單使用

  • 基本用法。安裝 animate.css 后,將以下屬性添加到中即可完成動畫效果的創建。
  1. <h1 class="animate__animated animate__bounce">An animated element</h1> 
  • 自定義屬性。使用自定義屬性來定義動畫持續時間、延遲,這使得它非常靈活,當需要更改動畫持續時間的時間,只需要為全局或本地設置一個新值。
  1. /* This only changes this particular animation duration */ 
  2. .animate__animated.animate__bounce { 
  3.   --animate-duration: 2s; 
  4.  
  5. /* This changes all the animations globally */ 
  6. :root { 
  7.   --animate-duration: 800ms; 
  8.   --animate-delay: 0.9s; 
  • 同時自定義屬性還可以動態更改所有時間受限的屬性,可以通過 JS 腳本動態修改。
  1. // All animations will take twice the time to accomplish 
  2. document.documentElement.style.setProperty('--animate-duration''2s'); 
  3.  
  4. // All animations will take half the time to accomplish 
  5. document.documentElement.style.setProperty('--animate-duration''.5s'); 
  • 延遲效果:可以直接在元素的 class 屬性上添加延遲效果:
  1. <div class="animate__animated animate__bounce animate__delay-2s">Example</div> 
  2.  
  3. // animate.css 提供了這些延遲屬性: 
  4. class               默認延遲時間 
  5. animate__delay-2s   2s 
  6. animate__delay-3s   3s 
  7. animate__delay-4s   4s 
  8. animate__delay-5s   5s 
  9.  
  10. // 也可以通過 --animate-delay 屬性進行自定義: 
  11. /* All delay classes will take 2x longer to start */ 
  12. :root { 
  13.   --animate-delay: 2s; 
  14.  
  15. /* All delay classes will take half the time to start */ 
  16. :root { 
  17.   --animate-delay: 0.5s; 
  • 動畫速度:可以通過添加這些 class 來控制動畫的速度:
  1. <div class="animate__animated animate__bounce animate__faster">Example</div> 
  2.  
  3. // 速度的 class 包括這些: 
  4. class            默認速度 
  5. animate__slow    2s 
  6. animate__slower  3s 
  7. animate__fast    800ms 
  8. animate__faster  500ms 
  9.  
  10. // 可以通過 --animate-duration 全局或本地屬性自定義動畫時間: 
  11.  
  12. /* All animations will take twice as long to finish */ 
  13. :root { 
  14.   --animate-duration: 2s; 
  15.  
  16. /* Only this element will take half the time to finish */ 
  17. .my-element { 
  18.   --animate-duration: 0.5s; 
  • 循環效果:可以通過添加這些 class 來控制動畫的循環次數:
  1. <div class="animate__animated animate__bounce animate__repeat-2">Example</div> 
  2.  
  3. // 可供選擇的 class 有: 
  4. class              循環次數 
  5. animate__repeat-1  1 
  6. animate__repeat-2  2 
  7. animate__repeat-3  3 
  8. animate__infinite  無限循環 
  9.  
  10. // 類似的,也可以自定義循環次數: 
  11. /* The element will repeat the animation 2x 
  12.    It's better to set this property locally and not globally or 
  13.    you might end up with a messy situation */ 
  14. .my-element { 
  15.   --animate-repeat: 2

 

 

責任編輯:張燕妮 來源: 知乎
相關推薦

2021-05-11 08:30:54

前端css技術熱點

2011-03-09 09:25:12

CSS3

2020-02-27 09:46:19

GitHub代碼開發者

2024-04-29 09:02:46

Vue頁面動畫樣式

2011-06-29 13:22:58

CSS3

2015-03-23 17:43:31

transitionViewControl

2018-12-12 19:10:01

Oracle數據庫自動備份

2022-06-23 09:04:14

ReactHooks項目

2024-06-21 14:47:52

2023-11-01 08:33:45

CSS動畫效果

2025-06-10 10:00:00

Python開發

2025-01-06 11:59:32

2012-12-26 10:34:56

CSSWeb前端

2024-03-28 09:11:24

CSS3TransitionCSS屬性

2022-06-29 21:22:49

CSS動感倒計時

2021-01-25 16:23:15

5G基站網絡

2023-04-18 10:03:51

AI英偉達

2023-02-13 15:09:01

開發webCSS技巧

2024-05-30 07:29:59

開源工具類庫擴展

2022-07-29 09:01:20

Chrome試源代碼調試技巧
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 天天干天天草 | 亚洲成人久久久 | 国产欧美视频一区二区三区 | 国产精品xxxx| 免费观看黄色一级片 | 亚洲欧美成人影院 | 国产精品自拍视频 | 色婷婷精品国产一区二区三区 | 国产精品国产三级国产aⅴ原创 | 日韩中文字幕免费 | 亚洲精品久久久久avwww潮水 | 久久久999成人 | 国产精品av久久久久久久久久 | 亚洲视频网 | 欧美三级成人理伦 | 99久久精品一区二区成人 | 青草福利 | 国产探花在线观看视频 | 精品日韩一区二区 | 欧美成人a∨高清免费观看 老司机午夜性大片 | 欧美性生活免费 | 中文字幕一区二区三区精彩视频 | 97福利在线 | 日韩欧美在线观看视频 | 国产精品一区二区三区四区五区 | www.久久99| 国产91久久精品一区二区 | 成人久久18免费网站 | 激情小说综合网 | 欧美一级免费 | 99久久精品免费看国产免费软件 | 国产在线精品一区二区 | 日日操夜夜干 | 国产超碰人人爽人人做人人爱 | 中文字幕在线免费观看 | 国产精品久久久久久久免费观看 | 视频在线h| 男女爱爱网站 | 国产一级在线视频 | 亚洲一区二区三区欧美 | 91看片网 |