owned this note
owned this note
Published
Linked with GitHub
# 🏅第七週老師講義
# 視差滾動範例
## animation
1. [基本範例](https://codepen.io/liao/pen/JjYwNVW?editors=1100)
2. [移動速率](https://codepen.io/liao/pen/gOaZWyj?editors=1100)
3. [完整解析 CSS 動畫 ( CSS Animation )](https://www.oxxostudio.tw/articles/201803/css-animation.html)
4. [animation-fill-mode](https://www.w3cplus.com/css3/understanding-css-animation-fill-mode-property.html)
## transform
1. [文件](https://www.w3schools.com/cssref/css3_pr_transform.asp)
2. [基本範例](https://codepen.io/liao/pen/VwvqWZQ)
## opacity
1. [基本範例](https://codepen.io/liao/pen/jObXwPN)
## animate.css
1. [官網](https://animate.style/)
2. [基本範例](https://codepen.io/liao/pen/NWGevLa)
3. [示範表](https://codepen.io/strapro/pen/dIqAH?editors=1010)
## aos
1. [aos 官網](https://michalsnik.github.io/aos/)
2. [基本範例](https://codepen.io/liao/pen/PoPXKvm)
3. [貝茲曲線](https://cubic-bezier.com/#0,1.36,.83,.67)
4. [animate+aos 範例](https://codepen.io/liao/pen/MWaZEEd)
1. aos 觸發動畫
2. animate.css 設計動畫效果
### 載入步驟
在 </body>前加上以下程式碼
```css
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>
AOS.init();
</script>
```
AOS 單一設計
```
<div
data-aos="fade-up"
data-aos-offset="200"
data-aos-delay="50"
data-aos-duration="1000"
data-aos-easing="ease-in-out"
data-aos-mirror="true"
data-aos-once="false"
data-aos-anchor-placement="top-center">
</div>
```
AOS 全域設計
```
AOS.init({
// Global settings:
disable: false, // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function
startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on
initClassName: 'aos-init', // class applied after initialization
animatedClassName: 'aos-animate', // class applied on animation
useClassNames: false, // if true, will add content of `data-aos` as classes on scroll
disableMutationObserver: false, // disables automatic mutations' detections (advanced)
debounceDelay: 50, // the delay on debounce used while resizing window (advanced)
throttleDelay: 99, // the delay on throttle used while scrolling the page (advanced)
// Settings that can be overridden on per-element basis, by `data-aos-*` attributes:
offset: 120, // offset (in px) from the original trigger point
delay: 0, // values from 0 to 3000, with step 50ms
duration: 400, // values from 0 to 3000, with step 50ms
easing: 'ease', // default easing for AOS animations
once: false, // whether animation should happen only once - while scrolling down
mirror: false, // whether elements should animate out while scrolling past them
anchorPlacement: 'top-bottom', // defines which position of the element regarding to window should trigger the animation
});
```
* 學員範例:https://codepen.io/liao/pen/BaovZRg
## AOS範例
* 文章左右偏移:https://codepen.io/bradtraversy/pen/bGbREWg
* 組合: https://codepen.io/amctagg1/pen/WVjGKw
* 完整範例:https://codepen.io/taohuh/pen/OZmgRV