or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
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.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
設定背景與顯示名稱
設計理念
一般來說,若要製作設定可自訂化的設計,我們需要儲存使用者之前留下的設定,那便得用到Local Storage或是JSON檔案;但在這一篇章,我們主要目標放在將設定值渲染到畫面上,因此不對於資料儲存進行實作,但基於本篇的程式再搭配Local Storage概念,就可達到自訂化設計。
因此,讓我們先加入以下物件:
如此一來,我們便能用以下程式取得設定值:
更新頁面上的名字:renderName()
更新背景主題:renderBackground()
getSetting()
這裡要取得我們目前所儲存的設定,設定可在localStorage尋找
呼叫畫面更新函式:updateWindow()
呼叫前面所寫的兩個畫面更新函式。
邁向自訂化設定的一步:透過getSetting函式讀取資料,並將資料傳入兩個畫面更新函式。