> 通過 CSS3,我們能夠創建動畫,這可以在許多網頁中取代動畫圖片、Flash 動畫以及 JavaScript。
[TOC]
## 手寫動畫 CSS
> 純手工方式可以有更強的自定義性,當然前期不熟悉的情況下,可以參考Animate.css的寫法
### CSS3 動畫屬性
| 屬性 | 描述 | CSS |
| --- | --- | --- |
| [@keyframes](https://www.w3school.com.cn/cssref/pr_keyframes.asp "CSS3 @keyframes 規則") | 規定動畫。 | 3 |
| [animation](https://www.w3school.com.cn/cssref/pr_animation.asp "CSS3 animation 屬性") | 所有動畫屬性的簡寫屬性,除了 animation-play-state 屬性。 | 3 |
| [animation-name](https://www.w3school.com.cn/cssref/pr_animation-name.asp "CSS3 animation-name 屬性") | 規定 @keyframes 動畫的名稱。 | 3 |
| [animation-duration](https://www.w3school.com.cn/cssref/pr_animation-duration.asp "CSS3 animation-duration 屬性") | 規定動畫完成一個周期所花費的秒或毫秒。默認是 0。 | 3 |
| [animation-timing-function](https://www.w3school.com.cn/cssref/pr_animation-timing-function.asp "CSS3 animation-timing-function 屬性") | 規定動畫的速度曲線。默認是 "ease"。 | 3 |
| [animation-delay](https://www.w3school.com.cn/cssref/pr_animation-delay.asp "CSS3 animation-delay 屬性") | 規定動畫何時開始。默認是 0。 | 3 |
| [animation-iteration-count](https://www.w3school.com.cn/cssref/pr_animation-iteration-count.asp "CSS3 animation-iteration-count 屬性") | 規定動畫被播放的次數。默認是 1。 | 3 |
| [animation-direction](https://www.w3school.com.cn/cssref/pr_animation-direction.asp "CSS3 animation-direction 屬性") | 規定動畫是否在下一周期逆向地播放。默認是 "normal"。 | 3 |
### CSS3 @keyframes 規則
> 0% 是動畫的開始,100% 是動畫的完成
> 為了得到最佳的瀏覽器支持,您應該始終定義 0% 和 100% 選擇器
~~~
@keyframes myfirst
{
0% {background: red;}
25% {background: yellow;}
50% {background: blue;}
100% {background: green;}
}
~~~
### 定義動畫 (animation),使用keyframes
~~~
.ami{
width: 100px;
height: 50px;
animation: myfirst 5s linear 2s infinite alternate;
}
~~~
## 使用 Animate.css 庫
> 可以用css3的原生代碼寫動畫效果,也可以使用別人封裝好的插件,比如 Animate.css
> 下載css文件:https://animate.style/
```
<template>
<view class="m-conatiner">
<view class="animate__animated animate__bounce">哈哈哈</view>
</view>
</template>
<style>
@import "/common/animate.min.css";
</style>
```
- 基礎知識
- UNI核心介紹
- flex布局
- 生命周期
- 全局方法
- 組件定義
- 自定義組件
- 全局組件
- 組件之間的數據傳輸
- 條件編譯
- 自定義頭部
- 節點信息 (SelectorQuery)
- vuejs基礎語法
- 頁面跳轉以及參數傳遞
- 事件的監聽注冊以及觸發
- css3動畫
- block的妙用
- mixin (混入)
- uniapp快捷鍵
- vuex狀態管理
- 實用功能
- 獲取服務提供商
- 啟動頁 / 啟動界面
- 引導頁
- tabbar配置
- 頭部導航欄基礎設置
- 上拉下拉(刷新/加載)
- 第三方登錄
- 第三方分享
- 推送通知 之 unipush
- scroll-view雙聯動
- 配置iOS通用鏈接(Universal Links)
- 本地緩存操作
- 升級/更新方案
- 熱更新
- 圖片上傳
- 搜索頁實現
- canvas繪圖助手
- 地圖定位
- 第三方支付————todo
- 分類輪播
- 清除應用緩存
- uniapp與webview的實時通訊
- 視頻-----todo
- 聊天----todo
- 長列表swiper左右切換
- 第三方插件
- uview
- mescroll
- uCharts (圖表)
- 無名 (更新插件)
- 第三方模版
- 自定義基座
- 打包發行
- 要封裝的方法
- 緩存 cache.js
- 請求接口 request.js
- 工具類 util.js
- 小程序登錄 xcxLogin.js
- 版本更新 update.js
- 優質插件
- 更新插件----todo
- 語音
- 語音識別 (含上傳)
- 百度語音合成播報接口
- 官方常用組建
- input 輸入框
- image 圖片
- audio 音頻
- picker 選擇器
- video 視頻
- scroll-view 滾動視圖