--- tags: 網頁切版直播班 - 2020 秋季班 --- # 🏅第七週老師講義 ## 報到佈告欄 * [報到](https://rpg.hexschool.com/training/15/calendar) Code:`quOD7M9Zrjdn` ## 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/) ## 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) ## 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 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 ## 額外補充 * [hover.css](https://ianlunn.github.io/Hover/) * [菁英團](https://courses.hexschool.com/courses/951862/lectures/20753023) ## 第七週主線任務 * <a href="https://rpg.hexschool.com/training/15/task?type=detail&id=160" target="_top">第七週 - 視差滾動</a> **第七週作業,您可以將你之前第一~六週做的網站套用視差滾動即可,不需拿第七週版型來重新做** ### 提交等級 (提交任務作業時,請告知您是做哪個等級的作業) * Lv1:只做 PC 版靜態排版 * Lv2:挑選第一~六週做的網站之一,來套用 JS 視差滾動即可,不需拿第七週版型來重新做 * Lv3:設計第七週版型,設計全部效果 備註一:可觀看 [作業設計稿 - 線上預覽操作教學](https://hackmd.io/J7ajdobzTlyideAARTLz5Q?view) 備註二:線上網址圖片,這裡六角已經上傳到[圖片空間](https://github.com/hexschool/webLayoutTraining1st),本次作業圖片都放在 **week7 資料夾**,網址如下,其他以此類推: * https://hexschool.github.io/webLayoutTraining1st/week1/photo.png * https://hexschool.github.io/webLayoutTraining1st/week1/line.svg >補充:[如果不知道怎麼找到圖片路徑請點我](https://i.imgur.com/O7nQcFm.gif)