Skip to content

Instantly share code, notes, and snippets.

@Domiii
Last active August 14, 2019 07:42
Show Gist options
  • Save Domiii/707257ceaa13d76ab6f743a1bae95e21 to your computer and use it in GitHub Desktop.
Save Domiii/707257ceaa13d76ab6f743a1bae95e21 to your computer and use it in GitHub Desktop.
網站開發 - 紀錄(中文版)

開始學習網站開發的技術

  • JavaScript 的基礎
  • HTML + CSS 的基礎

在本機端專門開發網站的工具

  1. 前提:用終端機來控制電腦~ (英文關鍵字:terminal, command prompt)
    1. 如何在 Windows 上面打開 terminal?
      1. Windows 還要多走一個步驟: 安裝 Git (+ cygwin command line tools)
    2. 如何在 MAC 上面打開 terminal?
  2. Windows: 安裝 choco
    1. node 包含一個幫我們整理所有的套件的軟體叫做 npm
    2. node 也包含一個可以執行任何套件裡面的執行檔的工具叫做 npx
    3. 平常準備好了一個 node 的程式之後,就可以用 npm start 來執行它

開始做第一個 React app: Create-react-app

  1. Start with create-react-app
    1. npx create-react-app my-app
    2. cd my-app
    3. npm start
    4. Test it out~
    5. (Read the create-react-app docs)
  2. In VSCode:
    1. File -> New Window
    2. -> Add Folder to WorkSpace
    3. -> Save Workspace as...
  3. check out file structure~
    1. 每個 node 的專案都有:
      1. node_modules 的資料夾:所有我們在套用的套件都在這裡面
      2. package.json 的檔案:就是設定我們的專案
      3. package-lock.json 的檔案:不用管他~�
    2. 我們的 src 的資料夾: 放我們所有程式碼的地方
    3. 我們的 public 的資料夾放: html, 圖片 還有其他的非程式碼的檔案。
    4. public/index.html 只是我們空的 html 架構
    5. src/index.js 反而是我們啟動整個網站的起點。
    6. 啟動 app 的時候, index.html + index.js 會自動被融合起來。
  4. Learn es6 (新版 JavaScript):
    1. https://devhints.io/es6
  5. Learn React
    1. Codecademy: Learn React Part #1
    2. Codecademy: Learn React Part #2
  6. Add react-router
  7. Add reactstrap (includes bootstrap)
  8. Getting data
    1. fetch
    2. Codecademy 線上課程:Asynchronous JS [1h]
  9. Design 基礎
    1. Codecademy 線上課程:Responsive Design [2h]
    2. Codecademy 線上課程:Color Design

CSS 練習

CSS 基礎概念

  1. CSS 的專用字: https://css-tricks.com/css-ruleset-terminology/
  2. :active selector:就是當你『按下去』的時候成立的
  3. transition property:讓任何兩個 CSS 狀態之間加動畫,等幾秒後才要完成的動畫(而不是馬上改過來)
  4. 排版 (Layout)
    1. 現代 CSS 都用 flexbox 來處理排版
    2. 學習 Flexbox 的遊戲
    3. Cheatsheets
      1. https://css-tricks.com/snippets/css/a-guide-to-flexbox/
      2. https://yoksel.github.io/flex-cheatsheet/
  5. 更多工具🔧
    1. Box-shadow Generator~

排版 (Layout) 的範例

  1. 很多個 layout 的範例: 30 Free Beautiful CSS Layouts for User Interface Designers
  2. 任務:把東西放在正中間
    1. 範例: https://codepen.io/anon/pen/KYyEEq

Fancy CSS 的幾個範例

  1. Buttons
    1. 3D Animated Button
      1. font-size -> 改 button 的大小
      2. box-shadow -> 邊邊的 3D 特效
      3. border-radius -> 角落要圓滑一點
      4. :active -> 減少 box-shadow 的大小
      5. transition: all 0.2s; -> 按下去的時候慢慢會有個變化發生
    2. 挑選了幾個很棒的 button:
    3. 更多的 button:
  2. Timeline
    1. https://codepen.io/FlorinPop17/pen/GLEPZy
  3. Galleries
    1. https://freefrontend.com/css-gallery/
    2. https://getbootstrap.com/docs/4.3/examples/album/

Bootstrap 套件

更多

  1. 接下來的步驟

    1. reactstrap -> bootstrap, bootstrap button + bootstrap list
    2. react-router -> Pages, routing + navigation; bootstrap navbar;
  2. 更多

    1. https://www.codecademy.com/learn/complex-data-structures
    2. npx create-react-app my-app

任務清單

  1. Design a pretty button that creates more buttons which create more buttons
    1. When clicking the button the first time, add a new button and disable this button
    2. When clicking the next button the first time, add a new button and disable this button
    3. repeat...
  2. Design a pretty timer
    1. Start by googling: https://www.google.com/search?q=css+pretty+timer
    2. Elements:
      1. pretty text display: display amount of elapsed seconds (一開始可以不需要分鐘之類的~)
      2. start button
      3. Pause/resume button
      4. reset button
    3. JS 提示:
      1. var start = Date.now(); /* ............. */ var end = Date.now(); var elapsedSeconds = (end - start)/1000;
  3. Design a pretty bootstrap card
    1. Elements
      1. Bootstrap Alert
      2. pretty text input
      3. a scoreboard
    2. Behavior
      1. The Alert shows a random word (Q: how to use JS to produce random words? (可以 google))
      2. When typing the word within 5 seconds: (a) score += 1; (b) clear the text input; (c) show a new random word
      3. When 5 seconds elapsed and the user has not typed the word: (a) score--; (b) clear the text input; (c) show a new random word

更多資料

https://www.google.com/search?q=frontend+challenges https://reactjs.org/community/courses.html https://hackr.io/tutorials/learn-react https://www.codementor.io/collections/learn-reactjs-online-bwc6wg9jg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment