dadidi910
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # JS30 - Flex Panels Image Gallery - 共筆:[JS30 我要成為 JavaScript 大師 - Day05](https://hackmd.io/_eiv7N89RBeozoQuHF_-CA?both#0705-%E4%B8%80-2100%EF%BC%8CDay05-Didi) - Demo:[JS30 - Flex Panels Image Gallery](https://codepen.io/dadidi910/pen/RwVWJGe) > By Didi --- ## 課程重點: 利用 <font color=orange>`flex` 的特性</font> 及 <font color=orange>`transition` 的動畫效果</font> 做出點擊後的效果呈現。 <font size=5>由於分享者是金魚腦,請課程結束後再發問唷,懇請大家配合。</font> <font size=5>(感激到痛哭流涕)</font> --- 這堂課想做出的效果是什麼? [Flex Panels 💪](https://dustinhsiao21.github.io/Javascript30-dustin/05%20-%20Flex%20Panel%20Gallery/) --- ## Flex ==啟用方式== <font color=orange>`display: flex;`</font> 設定在父層,此時子層就會變成 flex 的項目。 --- <font color=orange>`flex: 1;`</font> 是什麼? <font color=orange>`flex: 0 1 auto;`</font> 又是什麼鬼=_= 等等 Demo 告訴你! --- ### ==flex-direction== 定義容器內項目堆疊的方向。 - `flex-direction: row;` 橫排。 - `flex-direction: column;` 直排。 --- 問一下大家,現在這個畫面是橫排還是直排? --- ### ==justify-content==:主軸的對齊控制。 - 資料流的對齊:主軸 - <font size=5>`justify-content: flex-start;` 內容資料自起始位置對齊。</font> - <font size=5>`justify-content: center;` 內容資料置中位置對齊。</font> - <font size=5>`justify-content: flex-end;` 內容資料自尾位置對齊。</font> --- ### ==justify-content==:主軸的對齊控制。 - 資料流的間距:主軸 - <font size=4>`justify-content: space-around;` 內容資料的間距分配到每個物件的左右。</font> - <font size=4>`justify-content: space-between;` 內容資料的間距分配到物件之間。</font> --- ### ==align-items==:交叉軸的對齊控制。 - 針對僅單行的子物件。 - <font size=5>`align-items: flex-start;` 對齊資料流次軸起始位置。</font> - <font size=5>`align-items: center;` 對齊資料流次軸置中位置。</font> - <font size=5>`align-items: flex-end;` 對齊資料流次軸末端位置。</font> --- ## Transition ==轉換== <font color=orange size=6>`transition: 屬性 轉換時間 延遲執行時間 速度;`</font> <font size=5>中文意思為“轉變” 顧名思義它就是為了<font color=orange>改變兩個外觀間轉換的屬性</font>,只要加上transition, 就可以補足兩個外觀間轉換的補間動畫,可以<font color=orange>形成比較平滑的轉換</font>,而不會過於生硬。</font> --- ## <font color=orange>transform</font> 跟 <font color=orange>translate()</font> 改變元素的大小、形狀、方向、位置...等。 --- ### <font color=orange>transform: CSS 屬性</font> 使用此屬性, 元素可以被<font color=orange>平移、旋轉、縮放和傾斜</font>。 --- ### <font color=orange>translate(): CSS 函式</font> 使用此函式, 在水平或垂直方向<font color=orange>重新定位元素</font>。 --- Demo 時間!緊張阿!!!! --- ### 參考資料 / 資源 * [Flex Panels 💪](https://dustinhsiao21.github.io/Javascript30-dustin/05%20-%20Flex%20Panel%20Gallery/) * [課程文字解說 - 讚讚]((https://ithelp.ithome.com.tw/articles/10193306)) * [flex:0 1 auto 到底什麼鬼啦!](https://ithelp.ithome.com.tw/articles/10227461) * [css3貝塞爾曲線(cubic-bezier) 看這邊~](https://kknews.cc/zh-tw/code/4be66p3.html) * [cubic-bezier(.17,.67,.83,.67) 玩一下啦!](https://cubic-bezier.com/) * [CSS動畫-Transition](https://ithelp.ithome.com.tw/articles/10200365) * [Array.prototype.forEach() 的用法 | MDN](https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) * [HTMLElement: transitionend event | MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/transitionend_event) --- 這堂課就先到這裡囉!感~謝~大~家~ ![](https://i.imgur.com/d5u54kd.gif)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully