NCU Fresh Coder
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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 New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy 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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 也許可以放點東西? ###### tags: `開工` <!-- import"資訊欄"--> {%hackmd WytMqepOTcKzqNFq7mXjLQ %} :::success :::spoiler Click to open TOC [TOC] ::: ## 置中排版大補帖 > By. Mango [https://www.w3.org/Style/Examples/007/center.en.html](https://www.w3.org/Style/Examples/007/center.en.html) ## 全域css調整 [https://hackmd.io/@2021ncu-fresh-code/S1VGtA7pd](https://hackmd.io/@2021ncu-fresh-code/S1VGtA7pd) ## 來自柏儒的貼心小提醒 1. 可以用美工組給的字型了,css加上font-family: 'reisyo'; 就有了 2. 串連後端api (假設原本是http://localhost:8000/test,現在只要打/api/test就可以了) 3. 跟企劃組討論的時候可以試試看用ngrok (https://ngrok.com/) :::info ngrok載完以後打 ``` ./ngrok http 3000 ``` 應該可以把測試的server公開到公網上讓企劃組看,不過速度頗慢。 執行概況 ![](https://i.imgur.com/WZ26Gr7.png) Forwarding前面的網址就是被公開的連結,每次啟動都會換掉,不用擔心 ::: ## 沒有設計滾輪主頁可以使用的現有css > 這是一個沒有設計滾輪往下滑的頁面可以使用的程式碼(或許往下滾的也可以),我的classmain是整個頁面最外層的div > [name=湯以謙] > 我是用section分區段,基本上只要將每個height乘上section數量就可以直接用 > [name=大俠] ```css .main { margin-top: 8vh; height: 92vh; width: 100%; background-image: url("..."); background-repeat: repeat; background-attachment: scroll, local; background-position: center; background-size: cover; } @media (max-height: 850px) { .main { margin-top: 11vh; height: 89vh; } } @media (max-height: 720px) { .main { margin-top: 13vh; height: 87vh; } } @media (max-height: 650px) { .main { margin-top: 14vh; height: 86vh; } } @media (max-height: 500px) { .main { margin-top: 15vh; height: 85vh; } } ``` ## Nuxt 動畫沒有觸發 如果兩個頁面設定的layout不一樣,可能會導致在page設定好的transition無效 Page A ```javascript=vue export default { layout: "groups", transition: "group", methods: { ... } } <style lang="scss" scoped> .group-leave-active { transition: 1.8s; opacity: 0; } </style> ``` Page B ```javascript=vue export default { layout: "activities", methods: { ... } } <style lang="scss" scoped> ... } </style> ``` 當A頁面跳轉到B頁面時不會觸發transition,如果在B頁面中加入`layout: "groups"`就能解決問題 補: `transition`的名稱設定也要相同 ## 字型整理 標題: 各種書法字體 ```css= font-family: "kouzan", "aoyagireisyosimo_otf_2"; ``` 內文: 微軟正黑體 ```css= font-family: "Microsoft JhengHei"; ``` ## SVG Animation 一開始接到兩個筆刷的hover動畫,想著效果蠻常見也挺直覺的,後來才發現根本不是靠簡單的CSS Animation就可以解決的。 結論: 不要輕易答應企劃的動畫需求 > 0802更新 > 好啦還是來寫一下好了,感覺越來越多人遇到這個需求 ### Why svg? 想要呈現筆刷圈選or平抹用CSS transform幾乎很難做到,svg可以透過path繪製筆刷的路徑,疊上遮罩(.png),基本上可以完美解決企劃的要求了! ### Steps 1. 設定path - https://www.oxxostudio.tw/articles/201406/svg-04-path-1.html - https://yqnn.github.io/svg-path-editor/ 2. 找你的美術要一個遮罩or自己生出一個遮罩 - 遮罩需由灰階色彩組成,下面是幾個遮罩範本 - ![](https://i.imgur.com/1jLIfbc.png) - ![](https://i.imgur.com/tDAgoC5.png) ### 橫抹筆刷 ```html <svg class="line_svg" id="course_line" viewBox="0 0 240 55" > <defs> <mask id="line_mask" maskUnits="userSpaceOnUse"> <image width="240" height="55" href="~/assets/documents/section2/line_mask.png" /> </mask> </defs> <path d="m 10 10 l 250 0" /> </svg> ``` ```css .line_svg { position: absolute; transform: scale(1.25); width: 80%; height: 80%; path { fill: none; stroke: #383227; stroke-width: 80; stroke-linecap: square; //筆刷速度 stroke-dasharray: 4000 4000; stroke-dashoffset: 4000; mask: url(#line_mask); } } &:hover .line_svg { path { animation-duration: 6s; animation-name: line_anim; animation-fill-mode: forwards; animation-timing-function: linear; } } @keyframes line_anim { to { stroke-dashoffset: 0; } } ``` ### 圈選筆刷 ```html <svg class="circle_svg" id="course_circle" viewBox="0 0 250 125" > <defs> <mask id="circle_mask" maskUnits="userSpaceOnUse"> <image width="250" height="125" href="~/assets/documents/section2/circle_mask.png" /> </mask> </defs> <path d="m 239 43 a 115 50 0 1 1 -61 -30" /> </svg> ``` ```css= .circle_svg { position: absolute; transform: scale(1.25); width: 100%; path { fill: none; stroke: #c48888; stroke-width: 50; stroke-linecap: round; //這兩項控制動畫速度 stroke-dasharray: 2000 2000; stroke-dashoffset: 2000; mask: url(#circle_mask); } } &:hover .circle_svg { path { animation-duration: 1s; animation-name: circle_anim; animation-fill-mode: forwards; animation-timing-function: linear; } } @keyframes circle_anim { to { stroke-dashoffset: 0; } } ``` ## 絕對位置在手機開小鍵盤的時候可能會跑版 除了強制固定body的大小,好像沒看到什麼比較好的方法。目前我是想辦法用flex container還有relative的子元素來調整。 ## nuxt link問題 nuxt link的點擊事件要改用`@click.native`,但是使用emit仍然會有問題

    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