---
# System prepended metadata

title: 第七週 - 視差滾動
tags: [網頁切版直播班 - 2023 夏季班]

---

---
tags: 網頁切版直播班 - 2022 夏季班
---

# 第七週 - 視差滾動

* 提醒老師，要分享第八週的設計稿 +8 

## 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)
    a. forwards：停留在最後一個位置
    b. backrawds：回到原本位置
    c. both 擁有上面兩個的功能
5. [animate css](https://animate.style/)
6. 本週可以做到的範例：https://goldalles.com/

## 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)

## 中場休息
1. GSAP 章節本週已上傳
2. 直接 Demo 視差滾動
3. 洧杰老師動向：[The F2e 2019](https://challenge.thef2e.com/works)、[2021](https://2021.thef2e.com/)、[2022](https://2022.thef2e.com/)、[臉書社團](https://www.facebook.com/groups/173311386703334)
    * 規劃新課：[Node.js 企業專題班體驗營](https://www.hexschool.com/2023/01/31/2023-01-31-nodejs-live-course/)
5. 後續學習方向：
    * 方案一：有迫切學會技能學員：[JS 直播班，2天快閃老學員優惠](https://www.hexschool.com/courses/js-training.html)
    * 方案二：依照自己步調學習：[JS 組合包](https://www.hexschool.com/courses/?category=conbined-courses&combind=z_js-plus_js-core_vue3)

:::spoiler 2022活動圖
## 主題：互動式網頁！
![](https://i.imgur.com/dKybjjm.gif)

### 三大主題，其中一個主題將會使用進階視差滾動
- [紙飲料杯回收](https://recycle.rethinktw.org/trash/5)
- [萬波](https://wanpotea.com/)

:::

## aos 

1. [aos 官網](https://michalsnik.github.io/aos/)
2. [基本範例](https://codepen.io/liao/pen/PoPXKvm)
3. [第三週同學範例](https://rpg.hexschool.com/task/107/show)

### 載入步驟

在 </body>前加上以下程式碼

```
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/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

## 額外補充
* [hover.css](https://ianlunn.github.io/Hover/)
* [菁英團](https://courses.hexschool.com/courses/951862/lectures/20753023)

## 第七週主線任務

* <a href="https://rpg.hexschool.com/training/36/task?type=detail&id=352" target="_top">第七週 - 視差滾動</a>


**第七週作業，將你之前第一~六週做的網站套用視差滾動即可**

## 第八週設計稿

[AI 機器人服務](https://www.figma.com/file/zth5XUKMHePyTIxwxYbuBi/2023-%E5%88%87%E7%89%88%E5%A4%8F%E5%AD%A3%E7%8F%AD-W8---AI-%E8%99%9B%E6%93%AC%E9%99%AA%E4%BC%B4?type=design&node-id=622-1038&mode=design)