- JavaScript 的基礎
- HTML + CSS 的基礎
- 前提:用終端機來控制電腦~ (英文關鍵字:
terminal
,command prompt
)- 如何在 Windows 上面打開 terminal?
- Windows 還要多走一個步驟: 安裝 Git (+ cygwin command line tools)
- 如何在 MAC 上面打開 terminal?
- 如何在 Windows 上面打開 terminal?
- Windows: 安裝
choco
node
包含一個幫我們整理所有的套件的軟體叫做npm
node
也包含一個可以執行任何套件裡面的執行檔的工具叫做npx
- 平常準備好了一個
node
的程式之後,就可以用npm start
來執行它
- Start with
create-react-app
npx create-react-app my-app
cd my-app
npm start
- Test it out~
- (Read the create-react-app docs)
- In VSCode:
File
->New Window
- ->
Add Folder to WorkSpace
- ->
Save Workspace as...
- check out file structure~
- 每個
node
的專案都有:node_modules
的資料夾:所有我們在套用的套件都在這裡面package.json
的檔案:就是設定我們的專案package-lock.json
的檔案:不用管他~�
- 我們的
src
的資料夾: 放我們所有程式碼的地方 - 我們的
public
的資料夾放:html
,圖片
還有其他的非程式碼的檔案。 public/index.html
只是我們空的html
架構src/index.js
反而是我們啟動整個網站的起點。- 啟動 app 的時候,
index.html
+index.js
會自動被融合起來。
- 每個
- Learn es6 (新版 JavaScript):
- Learn React
- Add
react-router
- Add reactstrap (includes bootstrap)
- Getting data
- fetch
- Codecademy 線上課程:Asynchronous JS [1h]
- Design 基礎
- CSS 的專用字: https://css-tricks.com/css-ruleset-terminology/
:active
selector:就是當你『按下去』的時候成立的transition
property:讓任何兩個 CSS 狀態之間加動畫,等幾秒後才要完成的動畫(而不是馬上改過來)- 排版 (Layout)
- 現代 CSS 都用 flexbox 來處理排版
- 學習 Flexbox 的遊戲
- Cheatsheets
- 更多工具🔧
- 很多個 layout 的範例: 30 Free Beautiful CSS Layouts for User Interface Designers
- 任務:把東西放在正中間
- Buttons
- 3D Animated Button
font-size
-> 改 button 的大小box-shadow
-> 邊邊的 3D 特效border-radius
-> 角落要圓滑一點:active
-> 減少box-shadow
的大小transition: all 0.2s;
-> 按下去的時候慢慢會有個變化發生
- 挑選了幾個很棒的 button:
- 更多的 button:
- 3D Animated Button
- Timeline
- Galleries
-
接下來的步驟
- reactstrap -> bootstrap, bootstrap button + bootstrap list
- react-router -> Pages, routing + navigation; bootstrap navbar;
-
更多
- https://www.codecademy.com/learn/complex-data-structures
npx create-react-app my-app
- Design a pretty button that creates more buttons which create more buttons
- When clicking the button the first time, add a new button and disable this button
- When clicking the next button the first time, add a new button and disable this button
- repeat...
- Design a pretty timer
- Start by googling: https://www.google.com/search?q=css+pretty+timer
- Elements:
- pretty text display: display amount of elapsed seconds (一開始可以不需要分鐘之類的~)
- start button
- Pause/resume button
- reset button
- JS 提示:
var start = Date.now(); /* ............. */ var end = Date.now(); var elapsedSeconds = (end - start)/1000;
- Design a pretty bootstrap card
- Elements
- Bootstrap Alert
- pretty text input
- a scoreboard
- Behavior
- The Alert shows a random word (Q: how to use JS to produce random words? (可以 google))
- When typing the word within 5 seconds: (a) score += 1; (b) clear the text input; (c) show a new random word
- 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
- Elements
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