diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.md
index a86b2c6c58..cf88f38338 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.md
@@ -20,13 +20,17 @@ The `order` property is used to tell CSS the order of how flex items appear in t
`#box-1` 元素應具有 `order` 屬性,其屬性值應爲 `2`。
```js
-assert($('#box-1').css('order') == '2');
+const boxOne = document.querySelector('#box-1');
+const order = window.getComputedStyle(boxOne)['order'];
+assert.strictEqual(order, '2');
```
`#box-2` 元素應具有 `order` 屬性,其屬性值應爲 `1`。
```js
-assert($('#box-2').css('order') == '1');
+const boxTwo = document.querySelector('#box-2');
+const order = window.getComputedStyle(boxTwo)['order'];
+assert.strictEqual(order, '1');
```
# --seed--
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.md
index 1aec16cadc..03053ef6fd 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.md
@@ -29,7 +29,10 @@ Simply creating a grid element doesn't get you very far. You need to define the
class 爲 `container` 的元素應具有 `grid-template-columns` 屬性,該屬性應有三個屬性值,均爲 `100px`。
```js
-assert(new __helpers.CSSHelp(document).getStyle('.container')?.gridTemplateColumns === '100px 100px 100px');
+const templateColumns = new __helpers.CSSHelp(document).getStyle(
+ '.container'
+)?.gridTemplateColumns;
+assert.strictEqual(templateColumns, '100px 100px 100px');
```
# --seed--
@@ -38,11 +41,21 @@ assert(new __helpers.CSSHelp(document).getStyle('.container')?.gridTemplateColum
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-gaps-faster-with-grid-gap.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-gaps-faster-with-grid-gap.md
index feae1f80ac..7fc2986288 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-gaps-faster-with-grid-gap.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-gaps-faster-with-grid-gap.md
@@ -20,10 +20,9 @@ dashedName: add-gaps-faster-with-grid-gap
`container` class 應該有一個 `grid-gap` 屬性,在行之間設置 `10px` 的間距,在列之間設置 `20px` 的間距。
```js
-assert(
- code.match(
- /.container\s*?{[\s\S]*grid-gap\s*?:\s*?10px\s+?20px\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*grid-gap\s*?:\s*?10px\s+?20px\s*?;[\s\S]*}/gi
);
```
@@ -33,11 +32,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-rows-with-grid-template-rows.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-rows-with-grid-template-rows.md
index 14d7ff5ec1..ed2d7af66f 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-rows-with-grid-template-rows.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/add-rows-with-grid-template-rows.md
@@ -20,10 +20,9 @@ The grid you created in the last challenge will set the number of rows automatic
類爲 `container` 的元素應具有 `grid-template-rows` 屬性,且該屬性的兩個屬性值均爲 `50px`。
```js
-assert(
- code.match(
- /.container\s*?{[\s\S]*grid-template-rows\s*?:\s*?50px\s*?50px\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*grid-template-rows\s*?:\s*?50px\s*?50px\s*?;[\s\S]*}/gi
);
```
@@ -33,11 +32,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-all-items-horizontally-using-justify-items.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-all-items-horizontally-using-justify-items.md
index cc2697ed78..a6142eec1f 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-all-items-horizontally-using-justify-items.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-all-items-horizontally-using-justify-items.md
@@ -20,10 +20,9 @@ Sometimes you want all the items in your CSS Grid to share the same alignment. Y
class 爲 `container` 的元素應具有 `justify-items` 屬性且屬性值應爲 `center`。
```js
-assert(
- code.match(
- /.container\s*?{[\s\S]*justify-items\s*?:\s*?center\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*justify-items\s*?:\s*?center\s*?;[\s\S]*}/gi
);
```
@@ -33,11 +32,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-all-items-vertically-using-align-items.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-all-items-vertically-using-align-items.md
index 3a4c8598c3..50e17b74f9 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-all-items-vertically-using-align-items.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-all-items-vertically-using-align-items.md
@@ -20,8 +20,9 @@ Using the `align-items` property on a grid container will set the vertical align
class 爲 `container` 的元素應具有 `align-items` 屬性且屬性值應爲 `end`。
```js
-assert(
- code.match(/.container\s*?{[\s\S]*align-items\s*?:\s*?end\s*?;[\s\S]*}/gi)
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*align-items\s*?:\s*?end\s*?;[\s\S]*}/gi
);
```
@@ -31,11 +32,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-an-item-horizontally-using-justify-self.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-an-item-horizontally-using-justify-self.md
index 415df5aa4c..3f8503a359 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-an-item-horizontally-using-justify-self.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-an-item-horizontally-using-justify-self.md
@@ -26,8 +26,9 @@ In CSS Grid, the content of each item is located in a box which is referred to a
class 爲 `item2` 的元素應具有 `justify-self` 屬性且屬性值應爲 `center`。
```js
-assert(
- code.match(/.item2\s*?{[\s\S]*justify-self\s*?:\s*?center\s*?;[\s\S]*}/gi)
+assert.match(
+ code,
+ /.item2\s*?{[\s\S]*justify-self\s*?:\s*?center\s*?;[\s\S]*}/gi
);
```
@@ -37,7 +38,9 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-an-item-vertically-using-align-self.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-an-item-vertically-using-align-self.md
index e9ca111c59..486b39387d 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-an-item-vertically-using-align-self.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/align-an-item-vertically-using-align-self.md
@@ -20,7 +20,7 @@ Just as you can align an item horizontally, there's a way to align an item verti
class 爲 `item3` 的元素應具有 `align-self` 屬性且屬性值應爲 `end`。
```js
-assert(code.match(/.item3\s*?{[\s\S]*align-self\s*?:\s*?end\s*?;[\s\S]*}/gi));
+assert.match(code, /.item3\s*?{[\s\S]*align-self\s*?:\s*?end\s*?;[\s\S]*}/gi);
```
# --seed--
@@ -29,8 +29,12 @@ assert(code.match(/.item3\s*?{[\s\S]*align-self\s*?:\s*?end\s*?;[\s\S]*}/gi));
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-a-column-gap-using-grid-column-gap.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-a-column-gap-using-grid-column-gap.md
index 752bd51baa..7027ead150 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-a-column-gap-using-grid-column-gap.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-a-column-gap-using-grid-column-gap.md
@@ -26,10 +26,9 @@ grid-column-gap: 10px;
class 爲 `container` 的元素應具有 `grid-column-gap` 屬性且屬性值應爲 `20px`。
```js
-assert(
- code.match(
- /.container\s*?{[\s\S]*grid-column-gap\s*?:\s*?20px\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*grid-column-gap\s*?:\s*?20px\s*?;[\s\S]*}/gi
);
```
@@ -39,11 +38,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-a-row-gap-using-grid-row-gap.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-a-row-gap-using-grid-row-gap.md
index 989a5054ef..ed7023d4d7 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-a-row-gap-using-grid-row-gap.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-a-row-gap-using-grid-row-gap.md
@@ -20,8 +20,9 @@ You can add a gap in between the rows of a grid using `grid-row-gap` in the same
class 爲 `container` 的元素應具有 `grid-row-gap` 屬性且屬性值應爲 `5px`。
```js
-assert(
- code.match(/.container\s*?{[\s\S]*grid-row-gap\s*?:\s*?5px\s*?;[\s\S]*}/gi)
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*grid-row-gap\s*?:\s*?5px\s*?;[\s\S]*}/gi
);
```
@@ -31,11 +32,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fill.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fill.md
index 5e328c4891..6df043a965 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fill.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fill.md
@@ -26,10 +26,9 @@ repeat(auto-fill, minmax(60px, 1fr));
class 爲 `container` 的元素應具有 `grid-template-columns` 屬性,且屬性值應使用 `repeat` 和 `auto-fill`,以便將最小寬度爲 `60px`、最大寬度爲 `1fr` 的列填充至網格。
```js
-assert(
- code.match(
- /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?auto-fill\s*?,\s*?minmax\s*?\(\s*?60px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?auto-fill\s*?,\s*?minmax\s*?\(\s*?60px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi
);
```
@@ -39,11 +38,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-grids-within-grids.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-grids-within-grids.md
index 47ca6f4c67..ed77d32eb0 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-grids-within-grids.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-grids-within-grids.md
@@ -21,17 +21,16 @@ Turning an element into a grid only affects the behavior of its direct descendan
class 爲 `item3` 的元素應具有 `grid-template-columns` 屬性且屬性值應爲 `auto` 和 `1fr`。
```js
-assert(
- code.match(
- /.item3\s*?{[\s\S]*grid-template-columns\s*?:\s*?auto\s*?1fr\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.item3\s*?{[\s\S]*grid-template-columns\s*?:\s*?auto\s*?1fr\s*?;[\s\S]*}/gi
);
```
class 爲 `item3` 的元素應具有 `display` 屬性且屬性值應爲 `grid`。
```js
-assert(code.match(/.item3\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi));
+assert.match(code, /.item3\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi);
```
# --seed--
@@ -50,9 +49,9 @@ assert(code.match(/.item3\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi));
grid-template-rows: auto 1fr auto;
grid-gap: 10px;
grid-template-areas:
- "advert header"
- "advert content"
- "advert footer";
+ 'advert header'
+ 'advert content'
+ 'advert footer';
}
.item1 {
background: LightSkyBlue;
@@ -85,7 +84,6 @@ assert(code.match(/.item3\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi));
.itemTwo {
background: BlanchedAlmond;
}
-
@@ -102,5 +100,10 @@ assert(code.match(/.item3\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi));
# --solutions--
```html
-
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-your-first-css-grid.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-your-first-css-grid.md
index 4aad99ccea..60ce101824 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-your-first-css-grid.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/create-your-first-css-grid.md
@@ -22,7 +22,7 @@ Turn any HTML element into a grid container by setting its `display` property to
`container` class 應具有 `display` 屬性,屬性值應爲 `grid`。
```js
-assert(code.match(/.container\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi));
+assert.match(code, /.container\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi);
```
# --seed--
@@ -31,11 +31,21 @@ assert(code.match(/.container\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi));
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/divide-the-grid-into-an-area-template.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/divide-the-grid-into-an-area-template.md
index 9da696a638..30a193131d 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/divide-the-grid-into-an-area-template.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/divide-the-grid-into-an-area-template.md
@@ -12,9 +12,9 @@ You can group cells of your grid together into an
area and give the a
```css
grid-template-areas:
- "header header header"
- "advert content content"
- "advert footer footer";
+ 'header header header'
+ 'advert content content'
+ 'advert footer footer';
```
上面的代碼將網格單元格分成四個區域:`header`、`advert`、`content` 和 `footer`。 每個單詞代表一個單元格,每對引號代表一行。
@@ -28,12 +28,9 @@ grid-template-areas:
class 爲 `container` 的元素應具有 `grid-template-areas` 屬性,和示例類似,但是 `footer` 區域跨越整個底部行。
```js
-assert(
- __helpers
- .removeCssComments(code)
- .match(
- /.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?"\s*?header\s*?header\s*?header\s*?"\s*?"\s*?advert\s*?content\s*?content\s*?"\s*?"\s*?footer\s*?footer\s*?footer\s*?"\s*?;[\s\S]*}/gi
- )
+assert.match(
+ __helpers.removeCssComments(code),
+ /.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?["|']\s*?header\s*?header\s*?header\s*?["|']\s*?["|']\s*?advert\s*?content\s*?content\s*?["|']\s*?["|']\s*?footer\s*?footer\s*?footer\s*?["|']\s*?;[\s\S]*}/gi
);
```
@@ -43,11 +40,21 @@ assert(
```html
@@ -80,11 +87,21 @@ assert(
```html
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/limit-item-size-using-the-minmax-function.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/limit-item-size-using-the-minmax-function.md
index 39472c0f76..5e1b4fa5c9 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/limit-item-size-using-the-minmax-function.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/limit-item-size-using-the-minmax-function.md
@@ -26,10 +26,9 @@ grid-template-columns: 100px minmax(50px, 200px);
class 爲 `container` 的元素應使用 `grid-template-columns` 屬性設置 3 列,其中,每列最小寬度應爲 `90px`,最大寬度應爲 `1fr`。
```js
-assert(
- code.match(
- /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?3\s*?,\s*?minmax\s*?\(\s*?90px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?3\s*?,\s*?minmax\s*?\(\s*?90px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi
);
```
@@ -39,11 +38,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.md
index 5491dc8115..bb5b2f6c2d 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.md
@@ -28,10 +28,9 @@ After creating an area template for your grid container, as shown in the previou
class 爲 `item5` 的元素應具有 `grid-area` 屬性且屬性值應爲 `footer`。
```js
-assert(
- __helpers
- .removeCssComments(code)
- .match(/.item5\s*?{[\s\S]*grid-area\s*?:\s*?footer\s*?;[\s\S]*}/gi)
+assert.match(
+ __helpers.removeCssComments(code),
+ /.item5\s*?{[\s\S]*grid-area\s*?:\s*?footer\s*?;[\s\S]*}/gi
);
```
@@ -41,10 +40,18 @@ assert(
```html
@@ -82,5 +89,9 @@ assert(
# --solutions--
```html
-
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/reduce-repetition-using-the-repeat-function.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/reduce-repetition-using-the-repeat-function.md
index c7c7d40c00..8bd6fdc8ca 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/reduce-repetition-using-the-repeat-function.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/reduce-repetition-using-the-repeat-function.md
@@ -42,10 +42,9 @@ grid-template-columns: 1fr 50px 1fr 50px 20px;
class 爲 `container` 的元素應具有 `grid-template-columns` 屬性,其屬性值應設置爲重複 3 列,且每列寬度爲 `1fr`。
```js
-assert(
- code.match(
- /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?3\s*?,\s*?1fr\s*?\)\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?3\s*?,\s*?1fr\s*?\)\s*?;[\s\S]*}/gi
);
```
@@ -55,11 +54,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.md
index 2b568b5db6..a96c366169 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.md
@@ -34,10 +34,9 @@ grid-template-columns: auto 50px 10% 2fr 1fr;
`container` 類應該有一個 `grid-template-columns` 屬性,該屬性具有以下寬度的三列:`1fr`、`100px` 和 `2fr`。
```js
-assert(
- code.match(
- /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?1fr\s*?100px\s*?2fr\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?1fr\s*?100px\s*?2fr\s*?;[\s\S]*}/gi
);
```
@@ -47,11 +46,21 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-grid-area-without-creating-an-areas-template.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-grid-area-without-creating-an-areas-template.md
index 16c7ec6069..cfc74b5764 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-grid-area-without-creating-an-areas-template.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-grid-area-without-creating-an-areas-template.md
@@ -12,13 +12,16 @@ dashedName: use-grid-area-without-creating-an-areas-template
The `grid-area` property you learned in the last challenge can be used in another way. If your grid doesn't have an areas template to reference, you can create an area on the fly for an item to be placed like this:
```css
-item1 { grid-area: 1/1/2/4; }
+item1 {
+ grid-area: 1/1/2/4;
+}
```
這裏使用了你之前學習的網格線編號來定義網格項的區域。 上例中數字代表這些值:
```css
-grid-area: horizontal line to start at / vertical line to start at / horizontal line to end at / vertical line to end at;
+grid-area: horizontal line to start at / vertical line to start at / horizontal
+ line to end at / vertical line to end at;
```
因此,示例中的網格項將佔用第 1 條水平網格線(起始)和第 2 條水平網格線(終止)之間的行,及第 1 條垂直網格線(起始)和第 4 條垂直網格線(終止)之間的列。
@@ -32,10 +35,9 @@ grid-area: horizontal line to start at / vertical line to start at / horizontal
class 爲 `item5` 的元素應具有 `grid-area` 屬性,且位於水平第三和第四條線、垂直第一和第四條線之間的區域。
```js
-assert(
- code.match(
- /.item5\s*?{[\s\S]*grid-area\s*?:\s*?3\s*?\/\s*?1\s*?\/\s*?4\s*?\/\s*?4\s*?;[\s\S]*}/gi
- )
+assert.match(
+ code,
+ /.item5\s*?{[\s\S]*grid-area\s*?:\s*?3\s*?\/\s*?1\s*?\/\s*?4\s*?\/\s*?4\s*?;[\s\S]*}/gi
);
```
@@ -45,10 +47,18 @@ assert(
```html
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-grid-column-to-control-spacing.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-grid-column-to-control-spacing.md
index 27fe9db01d..69f3797bdf 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-grid-column-to-control-spacing.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-grid-column-to-control-spacing.md
@@ -36,18 +36,19 @@ grid-column: 1 / 3;
class 爲 `item5` 的元素應具有 `grid-column` 屬性。
```js
-assert(
- __helpers
- .removeWhiteSpace($('style').text())
- .match(/\.item5{.*grid-column:.*}/g)
+const styleElement = document.querySelector('style:not(.fcc-hide-header)');
+assert.match(
+ __helpers.removeWhiteSpace(styleElement.textContent),
+ /\.item5{.*grid-column:.*}/g
);
```
class 爲 `item5` 的元素應具有 `grid-column` 屬性,其屬性值應將元素設置爲佔用網格的最後兩列。
```js
-const colStart = getComputedStyle($('.item5')[0]).gridColumnStart;
-const colEnd = getComputedStyle($('.item5')[0]).gridColumnEnd;
+const itemFive = document.querySelector('.item5');
+const colStart = getComputedStyle(itemFive).gridColumnStart;
+const colEnd = getComputedStyle(itemFive).gridColumnEnd;
const result = colStart.toString() + colEnd.toString();
const correctResults = [
'24',
@@ -60,7 +61,7 @@ const correctResults = [
'span 2auto',
'autospan 2'
];
-assert(correctResults.includes(result));
+assert.include(correctResults, result);
```
# --seed--
@@ -69,10 +70,18 @@ assert(correctResults.includes(result));
```html
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.md
index 7d09ebc2c1..d7cc73d06f 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.md
@@ -16,13 +16,17 @@ Media Queries are a new technique introduced in CSS3 that change the presentatio
下面是一個媒體查詢的例子,當設備寬度小於或等於 `100px` 時返回內容:
```css
-@media (max-width: 100px) { /* CSS Rules */ }
+@media (max-width: 100px) {
+ /* CSS Rules */
+}
```
以下定義的媒體查詢,是當設備高度大於或等於 `350px` 時返回內容:
```css
-@media (min-height: 350px) { /* CSS Rules */ }
+@media (min-height: 350px) {
+ /* CSS Rules */
+}
```
注意,只有當媒體類型與所使用的設備的類型匹配時,媒體查詢中定義的 CSS 才生效。
@@ -37,21 +41,30 @@ Media Queries are a new technique introduced in CSS3 that change the presentatio
```js
const media = new __helpers.CSSHelp(document).getCSSRules('media');
-assert(media.some(x => x.media?.mediaText?.includes('(max-height: 800px)')));
+assert.isTrue(
+ media.some(x => x.media?.mediaText?.includes('(max-height: 800px)'))
+);
```
當設備 `height` 小於等於 `800px` 時,`p` 元素的 `font-size` 應爲 `10px`。
```js
-const rules = new __helpers.CSSHelp(document).getRuleListsWithinMedia('(max-height: 800px)');
-assert(rules?.find(x => x.selectorText === 'p')?.style?.fontSize === "10px");
+const rules = new __helpers.CSSHelp(document).getRuleListsWithinMedia(
+ '(max-height: 800px)'
+);
+assert.strictEqual(
+ rules?.find(x => x.selectorText === 'p')?.style?.fontSize,
+ '10px'
+);
```
當設備 `height` 大於 `800px` 時,`p` 元素的 `font-size` 應爲 `20px`。
```js
-const ifPFirst = new __helpers.CSSHelp(document).getCSSRules()?.find(x => x?.selectorText === 'p' || x?.media);
-assert(ifPFirst?.style?.fontSize === '20px');
+const ifPFirst = new __helpers.CSSHelp(document)
+ .getCSSRules()
+ ?.find(x => x?.selectorText === 'p' || x?.media);
+assert.strictEqual(ifPFirst?.style?.fontSize, '20px');
```
# --seed--
@@ -69,7 +82,14 @@ assert(ifPFirst?.style?.fontSize === '20px');
/* Only change code above this line */
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus
+ massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet
+ lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac
+ habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem.
+ Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida
+ consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.
+
```
# --solutions--
@@ -87,5 +107,12 @@ assert(ifPFirst?.style?.fontSize === '20px');
}
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus
+ massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet
+ lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac
+ habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem.
+ Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida
+ consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/make-an-image-responsive.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/make-an-image-responsive.md
index ef8e8847fb..3fc99ad403 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/make-an-image-responsive.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/make-an-image-responsive.md
@@ -28,13 +28,13 @@ img {
`responsive-img` 類應將 `max-width` 設置爲 `100%`。
```js
-assert(getComputedStyle($('.responsive-img')[0]).maxWidth === '100%');
+assert.strictEqual(getComputedStyle(document.querySelector('.responsive-img')).maxWidth, '100%');
```
`responsive-img` 類應將 `height` 設置爲 `auto`。
```js
-assert(code.match(/height:\s*?auto;/g));
+assert.match(code, /height:\s*?auto;/g);
```
# --seed--
@@ -53,24 +53,38 @@ img {
}
-
![freeCodeCamp stickers set](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickerPack.jpg)
-
![freeCodeCamp stickers set](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickerPack.jpg)
+
![freeCodeCamp stickers set](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickerPack.jpg)
+
![freeCodeCamp stickers set](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickerPack.jpg)
```
# --solutions--
```html
-
![freeCodeCamp stickers set](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickerPack.jpg)
-
![freeCodeCamp stickers set](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickerPack.jpg)
+
![freeCodeCamp stickers set](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickerPack.jpg)
+
![freeCodeCamp stickers set](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickerPack.jpg)
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/make-typography-responsive.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/make-typography-responsive.md
index 48cd5adfed..f034ff33e7 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/make-typography-responsive.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/make-typography-responsive.md
@@ -18,7 +18,9 @@ Instead of using `em` or `px` to size text, you can use viewport units for respo
下面這個例子是設置 `body` 標籤的寬度爲視窗寬度的 30%。
```css
-body { width: 30vw; }
+body {
+ width: 30vw;
+}
```
# --instructions--
@@ -30,20 +32,18 @@ body { width: 30vw; }
`h2` 元素的 `width` 應爲 80vw。
```js
-assert(
- __helpers
- .removeCssComments(code)
- .match(/h2\s*?{\s*?width:\s*?80vw;\s*?}/g)
+assert.match(
+ __helpers.removeCssComments(code),
+ /h2\s*?{\s*?width:\s*?80vw;\s*?}/g
);
```
`p` 元素的 `width` 應爲 75vmin。
```js
-assert(
- __helpers
- .removeCssComments(code)
- .match(/p\s*?{\s*?width:\s*?75vmin;\s*?}/g)
+assert.match(
+ __helpers.removeCssComments(code),
+ /p\s*?{\s*?width:\s*?75vmin;\s*?}/g
);
```
@@ -57,7 +57,14 @@ assert(
Importantus Ipsum
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus
+ massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet
+ lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac
+ habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem.
+ Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida
+ consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.
+
```
# --solutions--
@@ -65,13 +72,20 @@ assert(
```html
Importantus Ipsum
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus
+ massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet
+ lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac
+ habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem.
+ Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida
+ consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.
+
```
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays.md
index 6eed2fc0b6..49c5a3161d 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays.md
@@ -15,9 +15,12 @@ With the increase of internet connected devices, their sizes and specifications
```html
-
![A most excellent picture](coolPic500x500)
+
![A most excellent picture](coolPic500x500)
```
# --instructions--
@@ -29,13 +32,13 @@ With the increase of internet connected devices, their sizes and specifications
`img` 標籤的 `width` 屬性值應爲 100px。
```js
-assert(document.querySelector('img').width === 100);
+assert.strictEqual(document.querySelector('img').width, 100);
```
`img` 標籤的 `height` 屬性值應爲 100px。
```js
-assert(document.querySelector('img').height === 100);
+assert.strictEqual(document.querySelector('img').height, 100);
```
# --seed--
@@ -43,22 +46,26 @@ assert(document.querySelector('img').height === 100);
## --seed-contents--
```html
-
+
-
![freeCodeCamp sticker that says 'Because CamperBot Cares'](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickers-CamperBot200x200.jpg)
+
![freeCodeCamp sticker that says 'Because CamperBot Cares'](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickers-CamperBot200x200.jpg)
```
# --solutions--
```html
-
![freeCodeCamp sticker that says 'Because CamperBot Cares'](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickers-CamperBot200x200.jpg)
+
![freeCodeCamp sticker that says 'Because CamperBot Cares'](https://cdn.freecodecamp.org/curriculum/responsive-web-design-principles/FCCStickers-CamperBot200x200.jpg)
```
diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md
index d5fda67c89..3a4891fa49 100644
--- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md
+++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md
@@ -72,7 +72,7 @@ dashedName: build-a-25--5-clock
**用戶故事 #28:** 音頻元素帶有id爲 `beep` 必須停止播放並且倒退回開頭,當id爲 `reset` 的元素被點擊時.
-你可以構建你的項目通過
使用這個codepen模板 並且點擊`Save` 去創建你自己的作品. 或者你可以使用這個CDN鏈接去運行測試在你喜歡的任何環境: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`
+你可以構建你的項目通過
使用這個codepen模板 並且點擊`Save` 去創建你自己的作品. If you prefer to use another environment, then put this ``
一旦你完成了,提交你通過所有測試的工作項目URL.
diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md
index f8d4f065ab..9dd196f391 100644
--- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md
+++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md
@@ -41,7 +41,7 @@ dashedName: build-a-drum-machine
- [Kick](https://cdn.freecodecamp.org/testable-projects-fcc/audio/RP4_KICK_1.mp3)
- [Closed-HH](https://cdn.freecodecamp.org/testable-projects-fcc/audio/Cev_H2.mp3)
-你可以通過
使用此 CodePen 模板 並單擊 `Save` 來創建你自己的筆,從而構建你的項目。 或者你可以使用此 CDN 鏈接在你喜歡的任何環境中運行測試:`https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`
+你可以通過
使用此 CodePen 模板 並單擊 `Save` 來創建你自己的筆,從而構建你的項目。 If you prefer to use another environment, then put this ``
完成項目並通過所有測試後,請輸入你的項目在 CodePen 上的鏈接並提交。
diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md
index ec468c0f72..386f861030 100644
--- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md
+++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md
@@ -52,7 +52,7 @@ dashedName: build-a-javascript-calculator
- **Immediate Execution Logic:** `11.5`
- **公式/表達式邏輯:** `32.5`
-你可以
使用 CodePen 模版創建你的新項目,點擊 `Save` 即可創建你的新項目。 或者你可以在任何你喜歡的環境中使用以下 CDN 鏈接來運行測試:`https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`.
+You can build your project by
using this CodePen template and clicking `Save` to create your own pen. If you prefer to use another environment, then put this ``
當你完成了本項目,並且該項目所有測試運行通過,請提交項目的 URL。
diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md
index 5f407848ca..c8857ad870 100644
--- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md
+++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md
@@ -29,7 +29,7 @@ dashedName: build-a-markdown-previewer
**可選獎勵(你不需要通過此測試):** 我的 markdown 預覽器解釋回車符並將其呈現爲 `br`(換行符)元素。
-你可以通過
使用此 CodePen 模板 並單擊 `Save` 來創建你自己的筆,從而構建你的項目。 或者你可以在任何你喜歡的環境中使用以下 CDN 鏈接來運行測試:`https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`。
+You can build your project by
using this CodePen template and clicking `Save` to create your own pen. If you prefer to use another environment, then put this ``
當你完成了本項目,並且項目通過所有測試,請提交項目的 URL。
diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md
index 5bd04a5775..428982885b 100644
--- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md
+++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md
@@ -37,7 +37,7 @@ dashedName: build-a-random-quote-machine
**用戶故事 #11:** `#quote-box` 包裝元素應水平居中。 請在瀏覽器縮放級別爲 100% 且頁面最大化的情況下運行測試。
-你可以
使用這份 CodePen 模版來創建你的新項目,點擊 `Save` 即可創建屬於你自己的項目。 或者你可以在任何你喜歡的環境中使用以下 CDN 鏈接來運行測試:`https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`.
+You can build your project by
using this CodePen template and clicking `Save` to create your own pen. If you prefer to use another environment, then put this ``
當你完成了本項目並且該項目所有測試運行通過,請提交項目的 URL。
diff --git a/curriculum/challenges/chinese-traditional/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md b/curriculum/challenges/chinese-traditional/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md
index 2af2ac1b09..721fa81284 100644
--- a/curriculum/challenges/chinese-traditional/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md
+++ b/curriculum/challenges/chinese-traditional/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md
@@ -22,6 +22,8 @@ fetch('/json/cats.json')
```
+Note: The `fetch()` method uses `GET` as the default `HTTP` method. This means you don’t need to specify it explicitly for basic data retrieval.
+
逐行解釋一下代碼。
第一行是發起請求。 `fetch(URL)` 向指定的 URL 發起 `GET` 請求。 這個方法返回一個 Promise。
diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md
index 5617bf6496..0833450179 100644
--- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md
+++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md
@@ -212,15 +212,29 @@ async (getUserInput) => {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01`
});
- if (addRes.ok) {
- const actual = await addRes.json();
- assert.deepEqual(actual, expected);
- assert.isString(actual.description);
- assert.isNumber(actual.duration);
- assert.isString(actual.date);
- } else {
+ assert.isTrue(addRes.ok);
+ if (!addRes.ok) {
throw new Error(`${addRes.status} ${addRes.statusText}`);
}
+ const responseBody = await addRes.json();
+ assert.isString(responseBody.description);
+ assert.isNumber(responseBody.duration);
+ assert.isString(responseBody.date);
+ assert.equal(responseBody._id, expected._id);
+ assert.equal(responseBody.username, expected.username);
+ assert.equal(responseBody.description, expected.description);
+ assert.equal(responseBody.duration, expected.duration);
+ const receivedDate = new Date(responseBody.date);
+ const expectedDate = new Date(expected.date); // Jan 1, 1990
+ const allowedPreviousDate = new Date(expectedDate);
+ allowedPreviousDate.setDate(expectedDate.getDate() - 1); // Dec 31, 1989
+ const isValidDate =
+ receivedDate.toDateString() === expectedDate.toDateString() ||
+ receivedDate.toDateString() === allowedPreviousDate.toDateString();
+ assert.isTrue(
+ isValidDate,
+ `Expected date to be ${expectedDate.toDateString()} or ${allowedPreviousDate.toDateString()}, but got ${receivedDate.toDateString()}`
+ );
} else {
throw new Error(`${res.status} ${res.statusText}`);
}
@@ -495,26 +509,38 @@ async(getUserInput) => {
The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API.
```js
-async(getUserInput) => {
+async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
- body: `username=fcc_test_${Date.now()}`.substring(0,29)
+ body: `username=fcc_test_${Date.now()}`.substring(0, 29)
});
- if(res.ok) {
- const {_id, username} = await res.json();
+
+ if (res.ok) {
+ const { _id, username } = await res.json();
+ const currentDate = new Date();
+ const expectedDates = [
+ new Date(currentDate.setDate(currentDate.getDate() - 1)).toLocaleDateString("en-US", {
+ timeZone: "UTC", weekday: "short", month: "short",
+ day: "2-digit", year: "numeric"
+ }).replaceAll(',', ''),
+ new Date().toLocaleDateString("en-US", {
+ timeZone: "UTC", weekday: "short", month: "short",
+ day: "2-digit", year: "numeric"
+ }).replaceAll(',', ''),
+ new Date(currentDate.setDate(currentDate.getDate() + 1)).toLocaleDateString("en-US", {
+ timeZone: "UTC", weekday: "short", month: "short",
+ day: "2-digit", year: "numeric"
+ }).replaceAll(',', '')
+ ];
const expected = {
username,
description: 'test',
duration: 60,
_id,
- date: new Date().toLocaleDateString("en-US", {
- timeZone: "UTC", weekday: "short", month: "short",
- day: "2-digit", year: "numeric"
- }).replaceAll(',', '')
};
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
@@ -523,13 +549,13 @@ async(getUserInput) => {
},
body: `description=${expected.description}&duration=${expected.duration}`
});
- if(addRes.ok) {
+ if (addRes.ok) {
const logRes = await fetch(url + `/api/users/${_id}/logs`);
- if(logRes.ok){
- const {log} = await logRes.json();
+ if (logRes.ok) {
+ const { log } = await logRes.json();
const exercise = log[0];
assert.isString(exercise.date);
- assert.equal(exercise.date, expected.date);
+ assert.include(expectedDates, exercise.date); // Check if date matches any valid dates
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
diff --git a/curriculum/challenges/chinese-traditional/07-scientific-computing-with-python/build-a-budget-app-project/budget-app.md b/curriculum/challenges/chinese-traditional/07-scientific-computing-with-python/build-a-budget-app-project/budget-app.md
index 2b21c51155..eccbf1c3ec 100644
--- a/curriculum/challenges/chinese-traditional/07-scientific-computing-with-python/build-a-budget-app-project/budget-app.md
+++ b/curriculum/challenges/chinese-traditional/07-scientific-computing-with-python/build-a-budget-app-project/budget-app.md
@@ -711,6 +711,358 @@ t.result.wasSuccessful()
})
```
+Title at the top of `create_spend_chart` chart should say `Percentage spent by category`.
+
+```js
+({
+ test: () => {
+ pyodide.FS.writeFile('/home/pyodide/budget.py', code);
+ pyodide.FS.writeFile('/home/pyodide/test_module.py',`
+import unittest
+import budget
+from importlib import reload
+
+reload(budget)
+class UnitTests(unittest.TestCase):
+ maxDiff = None
+ def setUp(self):
+ self.food = budget.Category("Food")
+
+ def test_create_spend_chart(self):
+ self.food.deposit(900, "deposit")
+ self.food.withdraw(105.55)
+ chart = budget.create_spend_chart([self.food])
+ expected = "Percentage spent by category"
+ self.assertEqual(chart.split("\\n")[0], expected, "Chart should have correct title.")
+`);
+
+ const testCode = `
+from unittest import main
+from importlib import reload
+import test_module
+reload(test_module)
+t = main(module='test_module', exit=False)
+t.result.wasSuccessful()
+`;
+ const out = runPython(testCode);
+ assert(out);
+ }
+})
+```
+
+`create_spend_chart` chart should have correct percentages down the left side.
+
+```js
+({
+ test: () => {
+ pyodide.FS.writeFile('/home/pyodide/budget.py', code);
+ pyodide.FS.writeFile('/home/pyodide/test_module.py',`
+import unittest
+import budget
+from importlib import reload
+
+reload(budget)
+class UnitTests(unittest.TestCase):
+ maxDiff = None
+ def setUp(self):
+ self.food = budget.Category("Food")
+
+ def test_create_spend_chart(self):
+ self.food.deposit(900, "deposit")
+ self.food.withdraw(105.55)
+ chart = budget.create_spend_chart([self.food])
+ percentages = ["100|", " 90|", " 80|", " 70|", " 60|", " 50|", " 40|", " 30|", " 20|", " 10|", " 0|"]
+ for line, percent in zip(chart.split("\\n")[1:], percentages):
+ self.assertTrue(line.startswith(percent), "Chart correct percentages in the vertical axis.")
+`);
+
+ const testCode = `
+from unittest import main
+from importlib import reload
+import test_module
+reload(test_module)
+t = main(module='test_module', exit=False)
+t.result.wasSuccessful()
+`;
+ const out = runPython(testCode);
+ assert(out);
+ }
+})
+```
+
+The height of each bar on the `create_spend_chart` chart should be rounded down to the nearest 10.
+
+```js
+({
+ test: () => {
+ pyodide.FS.writeFile('/home/pyodide/budget.py', code);
+ pyodide.FS.writeFile('/home/pyodide/test_module.py',`
+import unittest
+import budget
+from importlib import reload
+
+reload(budget)
+class UnitTests(unittest.TestCase):
+ maxDiff = None
+ def setUp(self):
+ self.food = budget.Category("Food")
+ self.entertainment = budget.Category("Entertainment")
+ self.business = budget.Category("Business")
+ self.food.deposit(900, "deposit")
+ self.entertainment.deposit(900, "deposit")
+ self.business.deposit(900, "deposit")
+ self.food.withdraw(78)
+ self.entertainment.withdraw(22)
+ self.business.withdraw(8)
+
+ def test_create_spend_chart_rounding_close_to_upper_and_lower_ten(self):
+ chart_lines = budget.create_spend_chart([self.food, self.entertainment]).split("\\n")[1:12]
+ result_lines = '''100|
+ 90|
+ 80|
+ 70| o
+ 60| o
+ 50| o
+ 40| o
+ 30| o
+ 20| o o
+ 10| o o
+ 0| o o'''.split("\\n")
+
+ self.assertEqual(len(chart_lines), len(result_lines), "Lines missing in chart.")
+ for actual, expected in zip(chart_lines, result_lines):
+ self.assertTrue(actual.startswith(expected), "Expected different rounding of bars.")
+
+
+ def test_create_spend_chart_rounding_single_digit(self):
+ chart_lines = budget.create_spend_chart([self.business, self.food, self.entertainment]).split("\\n")[1:12]
+ result_lines = '''100|
+ 90|
+ 80|
+ 70| o
+ 60| o
+ 50| o
+ 40| o
+ 30| o
+ 20| o o
+ 10| o o
+ 0| o o o'''.split("\\n")
+
+ self.assertEqual(len(chart_lines), len(result_lines), "Lines missing in chart.")
+ for actual, expected in zip(chart_lines, result_lines):
+ self.assertTrue(actual.startswith(expected), "Expected different rounding of bars.")
+`);
+
+ const testCode = `
+from unittest import main
+from importlib import reload
+import test_module
+reload(test_module)
+t = main(module='test_module', exit=False)
+t.result.wasSuccessful()
+`;
+ const out = runPython(testCode);
+ assert(out);
+ }
+})
+```
+
+Each line in `create_spend_chart` chart should have the same length. Bars for different categories should be separated by two spaces, with additional two spaces after the final bar.
+
+```js
+({
+ test: () => {
+ pyodide.FS.writeFile('/home/pyodide/budget.py', code);
+ pyodide.FS.writeFile('/home/pyodide/test_module.py',`
+import unittest
+import budget
+from importlib import reload
+
+reload(budget)
+class UnitTests(unittest.TestCase):
+ maxDiff = None
+ def setUp(self):
+ self.food = budget.Category("Food")
+ self.entertainment = budget.Category("Entertainment")
+ self.business = budget.Category("Business")
+ self.food.deposit(900, "deposit")
+ self.entertainment.deposit(900, "deposit")
+ self.business.deposit(900, "deposit")
+ self.food.withdraw(78)
+ self.entertainment.withdraw(22)
+ self.business.withdraw(8)
+
+
+ def test_create_spend_chart_chart_lines_have_expected_length(self):
+ chart_categories = [[self.food, self.entertainment], [self.business, self.food, self.entertainment]]
+
+ expected_lengths = [len(line) for line in [" 0| o o ", " 0| o o o "]]
+ expected_chart_lines = 11
+
+ for categories, expected_length in zip(chart_categories, expected_lengths):
+ chart_lines = budget.create_spend_chart(categories).split("\\n")[1:12]
+
+ self.assertEqual(len(chart_lines), expected_chart_lines, "Lines missing in chart.")
+ for actual in chart_lines:
+ self.assertEqual(len(actual), expected_length, "Expected different length of the chart line. Check that all spacing is exact.")
+`);
+ const testCode = `
+from unittest import main
+from importlib import reload
+import test_module
+reload(test_module)
+t = main(module='test_module', exit=False)
+t.result.wasSuccessful()
+`;
+ const out = runPython(testCode);
+ assert(out);
+ }
+})
+```
+
+`create_spend_chart` should correctly show horizontal line below the bars. Using three `-` characters for each category, and in total going two characters past the final bar.
+
+```js
+({
+ test: () => {
+ pyodide.FS.writeFile('/home/pyodide/budget.py', code);
+ pyodide.FS.writeFile('/home/pyodide/test_module.py',`
+import unittest
+import budget
+from importlib import reload
+
+reload(budget)
+class UnitTests(unittest.TestCase):
+ maxDiff = None
+ def setUp(self):
+ self.food = budget.Category("Food")
+ self.entertainment = budget.Category("Entertainment")
+ self.business = budget.Category("Business")
+ self.food.deposit(900, "deposit")
+ self.entertainment.deposit(900, "deposit")
+ self.business.deposit(900, "deposit")
+ self.food.withdraw(105.55)
+ self.entertainment.withdraw(33.40)
+ self.business.withdraw(10.99)
+
+ def test_create_spend_chart_horizontal_bar(self):
+ chart_categories = [[self.business], [self.business, self.food], [self.business, self.food, self.entertainment]]
+ horizontal_lines = [" ----", " -------", " ----------"]
+ for categories, expected in zip(chart_categories, horizontal_lines):
+ actual = budget.create_spend_chart(categories).split("\\n")[12]
+ self.assertEqual(actual, expected, "Expected different horizontal bar. Check that all spacing is exact.")
+`);
+
+ const testCode = `
+from unittest import main
+from importlib import reload
+import test_module
+reload(test_module)
+t = main(module='test_module', exit=False)
+t.result.wasSuccessful()
+`;
+ const out = runPython(testCode);
+ assert(out);
+ }
+})
+```
+
+`create_spend_chart` chart should not have new line character at the end.
+
+```js
+({
+ test: () => {
+ pyodide.FS.writeFile('/home/pyodide/budget.py', code);
+ pyodide.FS.writeFile('/home/pyodide/test_module.py',`
+import unittest
+import budget
+from importlib import reload
+
+reload(budget)
+class UnitTests(unittest.TestCase):
+ maxDiff = None
+ def setUp(self):
+ self.food = budget.Category("Food")
+ self.entertainment = budget.Category("Entertainment")
+ self.business = budget.Category("Business")
+
+ def test_create_spend_chart_no_ending_new_line(self):
+ self.food.deposit(900, "deposit")
+ self.entertainment.deposit(900, "deposit")
+ self.business.deposit(900, "deposit")
+ self.food.withdraw(105.55)
+ self.entertainment.withdraw(33.40)
+ self.business.withdraw(10.99)
+ actual = budget.create_spend_chart([self.business, self.food, self.entertainment])
+ self.assertFalse(actual.endswith("\\n"), "Expected chart to not have new line at the end.")
+`);
+
+ const testCode = `
+from unittest import main
+from importlib import reload
+import test_module
+reload(test_module)
+t = main(module='test_module', exit=False)
+t.result.wasSuccessful()
+`;
+ const out = runPython(testCode);
+ assert(out);
+ }
+})
+```
+
+`create_spend_chart` chart should have each category name written vertically below the bar. Each line should have the same length, each category should be separated by two spaces, with additional two spaces after the final category.
+
+```js
+({
+ test: () => {
+ pyodide.FS.writeFile('/home/pyodide/budget.py', code);
+ pyodide.FS.writeFile('/home/pyodide/test_module.py',`
+import unittest
+import budget
+from importlib import reload
+
+reload(budget)
+class UnitTests(unittest.TestCase):
+ maxDiff = None
+ def setUp(self):
+ self.food = budget.Category("Food")
+ self.entertainment = budget.Category("Entertainment")
+ self.business = budget.Category("Business")
+ self.food.deposit(900, "deposit")
+ self.entertainment.deposit(900, "deposit")
+ self.business.deposit(900, "deposit")
+ self.food.withdraw(105.55)
+ self.entertainment.withdraw(33.40)
+ self.business.withdraw(10.99)
+
+ def test_create_spend_chart_names_two_categories(self):
+ chart = budget.create_spend_chart([self.food, self.entertainment])
+ actual = "\\n".join(chart.split("\\n")[13:]).rstrip("\\n")
+ expected = " F E \\n o n \\n o t \\n d e \\n r \\n t \\n a \\n i \\n n \\n m \\n e \\n n \\n t "
+ self.assertEqual(actual, expected, "Expected different category names written vertically below the bar. Check that all spacing is exact.")
+
+ def test_create_spend_chart_names_three_categories(self):
+ chart = budget.create_spend_chart([self.business, self.food, self.entertainment])
+ actual = "\\n".join(chart.split("\\n")[13:]).rstrip("\\n")
+ expected = " B F E \\n u o n \\n s o t \\n i d e \\n n r \\n e t \\n s a \\n s i \\n n \\n m \\n e \\n n \\n t "
+ self.assertEqual(actual, expected, "Expected different category names written vertically below the bar. Check that all spacing is exact.")
+`);
+
+ const testCode = `
+from unittest import main
+from importlib import reload
+import test_module
+reload(test_module)
+t = main(module='test_module', exit=False)
+t.result.wasSuccessful()
+`;
+ const out = runPython(testCode);
+ assert(out);
+ }
+})
+```
+
`create_spend_chart` should print a different chart representation. Check that all spacing is exact. Open your browser console with F12 for more details.
```js
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-personal-portfolio-webpage-project/build-a-personal-portfolio-webpage.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-personal-portfolio-webpage-project/build-a-personal-portfolio-webpage.md
index 278f93b305..de9a174b6c 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-personal-portfolio-webpage-project/build-a-personal-portfolio-webpage.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-personal-portfolio-webpage-project/build-a-personal-portfolio-webpage.md
@@ -8,12 +8,11 @@ dashedName: build-a-personal-portfolio-webpage
# --description--
-**Objective:** Build an app that is functionally similar to
https://personal-portfolio.freecodecamp.rocks. **Do not copy this demo project**.
-
+**目標:** 構建一個功能類似於
https://personal-portfolio.freecodecamp.rocks 的應用程序。 **請勿複製此演示項目**。
**用戶需求:**
-1. Your portfolio should have a welcome section with an `id` of `welcome-section`
+1. 你的作品集應該有一個歡迎部分,其 `id` 爲 `welcome-section`
1. 歡迎部分應該有一個包含文本的 `h1` 元素
1. 你的作品集應該有一個 `id` 爲 `projects` 的項目部分
1. 項目部分應該包含至少一個 `class` 爲 `project-tile` 的元素來保存項目
@@ -34,8 +33,8 @@ dashedName: build-a-personal-portfolio-webpage
你的作品集應該有一個 `id` 爲 `welcome-section` 的歡迎部分。
```js
-const el = document.getElementById('welcome-section')
-assert(!!el);
+const el = document.getElementById('welcome-section');
+assert.isNotNull(el);
```
你的 `#welcome-section` 元素應該包含一個 `h1` 元素。
@@ -54,25 +53,21 @@ assert.isAbove(
assert.isAbove(
document.querySelectorAll('#welcome-section h1')?.[0]?.innerText?.length,
0,
- 'h1 element in welcome section should contain your name or camper ' +
- 'name '
+ 'h1 element in welcome section should contain your name or camper ' + 'name '
);
```
你應該有一個 `id` 爲 `projects` 的項目部分。
```js
-const el = document.getElementById('projects')
-assert(!!el);
+const el = document.getElementById('projects');
+assert.isNotNull(el);
```
你的作品集應該包含至少一個 class 爲 `project-tile` 的元素。
```js
-assert.isAbove(
- document.querySelectorAll('#projects .project-tile').length,
- 0
-);
+assert.isAbove(document.querySelectorAll('#projects .project-tile').length, 0);
```
你的 `#projects` 元素應該包含至少一個 `a` 元素。
@@ -85,35 +80,33 @@ assert.isAbove(document.querySelectorAll('#projects a').length, 0);
```js
const el = document.getElementById('navbar');
-assert(!!el);
+assert.isNotNull(el);
```
你的 `#navbar` 元素應該包含至少一個 `a` 元素,它的 `href` 屬性以 `#` 開頭。
```js
const links = [...document.querySelectorAll('#navbar a')].filter(
- (nav) => (nav?.getAttribute('href') || '').substring(0, 1) === '#'
+ nav => (nav?.getAttribute('href') || '').substring(0, 1) === '#'
);
-assert.isAbove(
- links.length,
- 0,
- 'Navbar should contain an anchor link '
-);
+assert.isAbove(links.length, 0, 'Navbar should contain an anchor link ');
```
你的作品集應該有一個 `id` 爲 `profile-link` 的 `a` 元素。
```js
const el = document.getElementById('profile-link');
-assert(!!el && el.tagName === 'A')
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'A');
```
你的 `#profile-link` 元素應該有一個值爲 `_blank` 的 `target` 屬性。
```js
const el = document.getElementById('profile-link');
-assert(!!el && el.target === '_blank')
+assert.isNotNull(el);
+assert.strictEqual(el.target, '_blank');
```
你的作品集應該至少有一個媒體查詢。
@@ -121,14 +114,15 @@ assert(!!el && el.target === '_blank')
```js
const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el => el.getAttribute('media'))
const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media')
-assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
+assert.isTrue(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
你的 `#navbar` 元素應該始終位於視口的頂部。
```js
(async () => {
- const timeout = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
+ const timeout = milliseconds =>
+ new Promise(resolve => setTimeout(resolve, milliseconds));
const navbar = document.getElementById('navbar');
assert.approximately(
@@ -136,7 +130,7 @@ assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
0,
15,
"Navbar's parent should be body and it should be at the top of " +
- 'the viewport '
+ 'the viewport '
);
window.scroll(0, 500);
@@ -147,8 +141,7 @@ assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
navbar?.getBoundingClientRect().top,
0,
15,
- 'Navbar should be at the top of the viewport even after ' +
- 'scrolling '
+ 'Navbar should be at the top of the viewport even after ' + 'scrolling '
);
window.scroll(0, 0);
})();
@@ -223,7 +216,7 @@ assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
```css
-nav{
+nav {
position: fixed;
width: 100%;
text-align: right;
@@ -233,37 +226,37 @@ nav{
background-color: #000000;
color: #ffffff;
}
-@media (max-width: 500px){
- nav{
+@media (max-width: 500px) {
+ nav {
display: none;
}
}
-a{
+a {
color: #ffffff;
}
-main{
+main {
text-align: center;
background-color: black;
- font-family:Pacifico
+ font-family: Pacifico;
}
-h1{
+h1 {
font-size: 48pt;
}
-h2{
+h2 {
font-size: 24pt;
}
-p{
+p {
font-size: 12pt;
}
-#welcome-section{
- background-color:#251a4a;
- color: #FFFFFF;
+#welcome-section {
+ background-color: #251a4a;
+ color: #ffffff;
display: table-cell;
vertical-align: middle;
width: 100vw;
height: 100vh;
}
-#projects{
+#projects {
background-color: #060a9c;
color: #ffffff;
display: table-cell;
@@ -271,7 +264,7 @@ p{
width: 100vw;
height: 100vh;
}
-#contact{
+#contact {
background-color: #03300b;
color: #ffffff;
display: table-cell;
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-product-landing-page-project/build-a-product-landing-page.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-product-landing-page-project/build-a-product-landing-page.md
index 8fc3f62fa0..1e23e7869f 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-product-landing-page-project/build-a-product-landing-page.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-product-landing-page-project/build-a-product-landing-page.md
@@ -8,7 +8,7 @@ dashedName: build-a-product-landing-page
# --description--
-**Objective:** Build an app that is functionally similar to
https://product-landing-page.freecodecamp.rocks. **Do not copy this demo project**.
+**Objective:** Build an app that is functionally similar to
https://product-landing-page.freecodecamp.rocks. **請勿複製此演示項目**。
**用戶需求:**
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-survey-form-project/build-a-survey-form.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-survey-form-project/build-a-survey-form.md
index 4325031341..317c4bf399 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-survey-form-project/build-a-survey-form.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-survey-form-project/build-a-survey-form.md
@@ -8,7 +8,7 @@ dashedName: build-a-survey-form
# --description--
-**Objective:** Build an app that is functionally similar to
https://survey-form.freecodecamp.rocks. **Do not copy this demo project**.
+**Objective:** Build an app that is functionally similar to
https://survey-form.freecodecamp.rocks. **請勿複製此演示項目**。
**用戶需求:**
@@ -38,327 +38,368 @@ dashedName: build-a-survey-form
你應該有一個 `id` 爲 `title` 的 `h1` 元素。
```js
-const el = document.getElementById('title')
-assert(!!el && el.tagName === 'H1')
+const el = document.getElementById('title');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'H1');
```
你的 `#title` 元素不應爲空。
```js
-const el = document.getElementById('title')
-assert(!!el && el.innerText.length > 0)
+const el = document.getElementById('title');
+assert.isNotNull(el);
+assert.isAbove(el.innerText.length, 0);
```
你應該有一個 `id` 爲 `description` 的 `p` 元素。
```js
-const el = document.getElementById('description')
-assert(!!el && el.tagName === 'P')
+const el = document.getElementById('description');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'P');
```
你的 `#description` 不應爲空。
```js
-const el = document.getElementById('description')
-assert(!!el && el.innerText.length > 0)
+const el = document.getElementById('description');
+assert.isNotNull(el);
+assert.isAbove(el.innerText.length, 0);
```
你應該有一個 `id` 爲 `survey-form` 的 `form` 元素。
```js
-const el = document.getElementById('survey-form')
-assert(!!el && el.tagName === 'FORM')
+const el = document.getElementById('survey-form');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'FORM');
```
你應該有一個 `id` 爲 `name` 的 `input` 元素。
```js
-const el = document.getElementById('name')
-assert(!!el && el.tagName === 'INPUT')
+const el = document.getElementById('name');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'INPUT');
```
你的 `#name` 元素應該具有 `type` 爲 `text`。
```js
-const el = document.getElementById('name')
-assert(!!el && el.type === 'text')
+const el = document.getElementById('name');
+assert.isNotNull(el);
+assert.strictEqual(el.type, 'text');
```
你的 `#name` 元素應該在表單中是必填項。
```js
-const el = document.getElementById('name')
-assert(!!el && el.required)
+const el = document.getElementById('name');
+assert.isNotNull(el);
+assert.isTrue(el.required);
```
你的 `#name` 元素應該是 `#survey-form` 元素的子元素。
```js
-const el = document.querySelector('#survey-form #name')
-assert(!!el)
+const el = document.querySelector('#survey-form #name');
+assert.isNotNull(el);
```
你應該有一個 `id` 爲 `email` 的 `input` 元素。
```js
-const el = document.getElementById('email')
-assert(!!el && el.tagName === 'INPUT')
+const el = document.getElementById('email');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'INPUT');
```
你的 `#email` 元素應該具有 `type` 爲 `email`。
```js
-const el = document.getElementById('email')
-assert(!!el && el.type === 'email')
+const el = document.getElementById('email');
+assert.isNotNull(el);
+assert.strictEqual(el.type, 'email');
```
你的 `#email` 元素應該需要輸入。
```js
-const el = document.getElementById('email')
-assert(!!el && el.required)
+const el = document.getElementById('email');
+assert.isNotNull(el);
+assert.isTrue(el.required);
```
你的 `#email` 元素應該是 `#survey-form` 元素的子元素。
```js
-const el = document.querySelector('#survey-form #email')
-assert(!!el)
+const el = document.querySelector('#survey-form #email');
+assert.isNotNull(el);
```
你應該有一個 `id` 爲 `number` 的 `input` 元素。
```js
-const el = document.getElementById('number')
-assert(!!el && el.tagName === 'INPUT')
+const el = document.getElementById('number');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'INPUT');
```
你的 `#number` 元素應該是 `#survey-form` 元素的子元素。
```js
-const el = document.querySelector('#survey-form #number')
-assert(!!el)
+const el = document.querySelector('#survey-form #number');
+assert.isNotNull(el);
```
你的 `#number` 元素應該具有 `type` 爲 `number`。
```js
-const el = document.getElementById('number')
-assert(!!el && el.type === 'number')
+const el = document.getElementById('number');
+assert.isNotNull(el);
+assert.strictEqual(el.type, 'number');
```
你的 `#number` 應該有一個值爲數字的 `min` 屬性。
```js
-const el = document.getElementById('number')
-assert(!!el && el.min && isFinite(el.min))
+const el = document.getElementById('number');
+assert.isNotNull(el);
+assert.isNotEmpty(el.min);
+assert.isTrue(isFinite(el.min));
```
你的 `#number` 應該有一個值爲數字的 `max` 屬性。
```js
-const el = document.getElementById('number')
-assert(!!el && el.max && isFinite(el.max))
+const el = document.getElementById('number');
+assert.isNotNull(el);
+assert.isNotEmpty(el.max);
+assert.isTrue(isFinite(el.max));
```
你應該有一個 `id` 爲 `name-label` 的 `label` 元素。
```js
-const el = document.getElementById('name-label')
-assert(!!el && el.tagName === 'LABEL')
+const el = document.getElementById('name-label');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'LABEL');
```
你應該有一個 `id` 爲 `email-label` 的 `label` 元素。
```js
-const el = document.getElementById('email-label')
-assert(!!el && el.tagName === 'LABEL')
+const el = document.getElementById('email-label');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'LABEL');
```
你應該有一個 `id` 爲 `number-label` 的 `label` 元素。
```js
-const el = document.getElementById('number-label')
-assert(!!el && el.tagName === 'LABEL')
+const el = document.getElementById('number-label');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'LABEL');
```
你的 `#name-label` 應包含描述輸入的文本。
```js
-const el = document.getElementById('name-label')
-assert(!!el && el.innerText.length > 0)
+const el = document.getElementById('name-label');
+assert.isNotNull(el);
+assert.isAbove(el.innerText.length, 0);
```
你的 `#email-label` 應包含描述輸入的文本。
```js
-const el = document.getElementById('email-label')
-assert(!!el && el.innerText.length > 0)
+const el = document.getElementById('email-label');
+assert.isNotNull(el);
+assert.isAbove(el.innerText.length, 0);
```
你的 `#number-label` 應該包含描述輸入的文本。
```js
-const el = document.getElementById('number-label')
-assert(!!el && el.innerText.length > 0)
+const el = document.getElementById('number-label');
+assert.isNotNull(el);
+assert.isAbove(el.innerText.length, 0);
```
你的 `#name-label` 元素應該是 `#survey-form` 元素的子元素。
```js
-const el = document.querySelector('#survey-form #name-label')
-assert(!!el)
+const el = document.querySelector('#survey-form #name-label');
+assert.isNotNull(el);
```
你的 `#email-label` 元素應該是 `#survey-form` 元素的子元素。
```js
-const el = document.querySelector('#survey-form #email-label')
-assert(!!el)
+const el = document.querySelector('#survey-form #email-label');
+assert.isNotNull(el);
```
你的 `#number-label` 元素應該是 `#survey-form` 元素的子元素。
```js
-const el = document.querySelector('#survey-form #number-label')
-assert(!!el)
+const el = document.querySelector('#survey-form #number-label');
+assert.isNotNull(el);
```
你的 `#name` 元素應該有 `placeholder` 屬性與佔位符文本。
```js
-const el = document.getElementById('name')
-assert(!!el && !!el.placeholder && el.placeholder.length > 0)
+const el = document.getElementById('name');
+assert.isNotNull(el);
+assert.isNotNull(el.placeholder);
+assert.isAbove(el.placeholder.length, 0);
```
你的 `#email` 元素應該有 `placeholder` 屬性與佔位符文本。
```js
-const el = document.getElementById('email')
-assert(!!el && !!el.placeholder && el.placeholder.length > 0)
+const el = document.getElementById('email');
+assert.isNotNull(el);
+assert.isNotNull(el.placeholder);
+assert.isAbove(el.placeholder.length, 0);
```
你的 `#number` 元素應該有 `placeholder` 屬性與佔位符文本。
```js
-const el = document.getElementById('number')
-assert(!!el && !!el.placeholder && el.placeholder.length > 0)
+const el = document.getElementById('number');
+assert.isNotNull(el);
+assert.isNotNull(el.placeholder);
+assert.isAbove(el.placeholder.length, 0);
```
你應該有一個 `id` 爲 `dropdown` 的 `select` 元素。
```js
-const el = document.getElementById('dropdown')
-assert(!!el && el.tagName === 'SELECT')
+const el = document.getElementById('dropdown');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'SELECT');
```
你的 `#dropdown` 應該至少有兩個可選擇(未禁用)`option` 元素。
```js
-const els = document.querySelectorAll('#dropdown option:not([disabled])')
-assert(els.length >= 2)
+const els = document.querySelectorAll('#dropdown option:not([disabled])');
+assert.isAtLeast(els.length, 2);
```
你的 `#dropdown` 元素應該是 `#survey-form` 元素的子元素。
```js
-const el = document.querySelector('#survey-form #dropdown')
-assert(!!el)
+const el = document.querySelector('#survey-form #dropdown');
+assert.isNotNull(el);
```
你應該有至少兩個 `input` 元素,`type` 爲 `radio`(單選按鈕)。
```js
-const els = document.querySelectorAll('input[type="radio"]')
-assert(els.length >= 2)
+const els = document.querySelectorAll('input[type="radio"]');
+assert.isAtLeast(els.length, 2);
```
你至少應該有兩個單選按鈕,是 `#survey-form` 的子元素。
```js
-const els = document.querySelectorAll('#survey-form input[type="radio"]')
-assert(els.length >= 2)
+const els = document.querySelectorAll('#survey-form input[type="radio"]');
+assert.isAtLeast(els.length, 2);
```
你所有的單選按鈕都應該有一個 `value` 屬性和值。
```js
-const els1 = document.querySelectorAll('input[type="radio"]')
-const els2 = document.querySelectorAll('input[type="radio"][value=""], input[type="radio"]:not([value])')
-assert(els1.length > 0 && els2.length === 0)
+const els1 = document.querySelectorAll('input[type="radio"]');
+const els2 = document.querySelectorAll(
+ 'input[type="radio"][value=""], input[type="radio"]:not([value])'
+);
+assert.isAbove(els1.length, 0);
+assert.lengthOf(els2, 0);
```
你所有的單選按鈕都應該有一個 `name` 屬性和值。
```js
-const els1 = document.querySelectorAll('input[type="radio"]')
-const els2 = document.querySelectorAll('input[type="radio"][name=""], input[type="radio"]:not([name])')
-assert(els1.length > 0 && els2.length === 0)
+const els1 = document.querySelectorAll('input[type="radio"]');
+const els2 = document.querySelectorAll(
+ 'input[type="radio"][name=""], input[type="radio"]:not([name])'
+);
+assert.isAbove(els1.length, 0);
+assert.lengthOf(els2, 0);
```
每個單選按鈕組應至少有 2 個單選按鈕。
```js
const radioButtons = document.querySelectorAll('input[type="radio"]');
-const groups = {}
+const groups = {};
if (radioButtons) {
radioButtons.forEach(el => {
- if (!groups[el.name]) groups[el.name] = []
- groups[el.name].push(el)
- })
+ if (!groups[el.name]) groups[el.name] = [];
+ groups[el.name].push(el);
+ });
}
-const groupKeys = Object.keys(groups)
+const groupKeys = Object.keys(groups);
groupKeys.forEach(key => {
- if (groups[key].length < 2) assert(false)
-})
+ if (groups[key].length < 2) assert(false);
+});
-assert(groupKeys.length > 0)
+assert.isAbove(groupKeys.length, 0);
```
你應該至少有兩個 `input` 元素,`type` 爲 `checkbox`(複選框),它們是 `#survey-form` 的子元素。
```js
const els = document.querySelectorAll('#survey-form input[type="checkbox"]');
-assert(els.length >= 2)
+assert.isAtLeast(els.length, 2);
```
你在 `#survey-form` 中的所有複選框都應該有 `value` 屬性和值。
```js
-const els1 = document.querySelectorAll('#survey-form input[type="checkbox"]')
-const els2 = document.querySelectorAll('#survey-form input[type="checkbox"][value=""], #survey-form input[type="checkbox"]:not([value])')
-assert(els1.length > 0 && els2.length === 0)
+const els1 = document.querySelectorAll('#survey-form input[type="checkbox"]');
+const els2 = document.querySelectorAll(
+ '#survey-form input[type="checkbox"][value=""], #survey-form input[type="checkbox"]:not([value])'
+);
+assert.isAbove(els1.length, 0);
+assert.lengthOf(els2, 0);
```
你至少應該有一個 `textarea` 元素,它是 `#survey-form` 的子元素。
```js
-const el = document.querySelector('#survey-form textarea')
-assert(!!el)
+const el = document.querySelector('#survey-form textarea');
+assert.isNotNull(el);
```
你應該有一個 `id` 爲 `submit` 的 `input` 或 `button` 元素。
```js
-const el = document.getElementById('submit')
-assert(!!el && (el.tagName === 'INPUT' || el.tagName === 'BUTTON'))
+const el = document.getElementById('submit');
+assert.isNotNull(el);
+assert.isTrue(el.tagName === 'INPUT' || el.tagName === 'BUTTON');
```
你的 `#submit` 元素應該具有 `type` 爲 `submit`。
```js
-const el = document.getElementById('submit')
-assert(!!el && el.type === 'submit')
+const el = document.getElementById('submit');
+assert.isNotNull(el);
+assert.strictEqual(el.type, 'submit');
```
你的 `#submit` 元素應該是 `#survey-form` 元素的子元素。
```js
-const el = document.querySelector('#survey-form #submit')
-assert(!!el)
+const el = document.querySelector('#survey-form #submit');
+assert.isNotNull(el);
```
# --seed--
@@ -508,7 +549,10 @@ body {
background: #3a3240;
color: white;
}
-input, textarea, select, button {
+input,
+textarea,
+select,
+button {
background: #3a3240;
color: white;
}
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-technical-documentation-page-project/build-a-technical-documentation-page.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-technical-documentation-page-project/build-a-technical-documentation-page.md
index 35a106af0f..cc46c9ced3 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-technical-documentation-page-project/build-a-technical-documentation-page.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-technical-documentation-page-project/build-a-technical-documentation-page.md
@@ -8,7 +8,7 @@ dashedName: build-a-technical-documentation-page
# --description--
-**Objective:** Build an app that is functionally similar to
https://technical-documentation-page.freecodecamp.rocks. **Do not copy this demo project**.
+**Objective:** Build an app that is functionally similar to
https://technical-documentation-page.freecodecamp.rocks. **請勿複製此演示項目**。
**用戶需求:**
@@ -37,141 +37,147 @@ dashedName: build-a-technical-documentation-page
你應該有一個 `id` 爲 `main-doc` 的 `main` 元素。
```js
-const el = document.getElementById('main-doc')
-assert(!!el)
+const el = document.getElementById('main-doc');
+assert.isNotNull(el);
```
你至少應該有 5 個 class 爲 `main-section` 的 `section` 元素。
```js
-const els = document.querySelectorAll('#main-doc section')
-assert(els.length >= 5)
+const els = document.querySelectorAll('#main-doc section');
+assert.isAtLeast(els.length, 5);
```
你所有的 `.main-section` 元素都應該是 `section` 元素。
```js
-const els = document.querySelectorAll('.main-section')
+const els = document.querySelectorAll('.main-section');
els.forEach(el => {
- if (el.tagName !== 'SECTION') assert(false)
-})
-assert(els.length > 0)
+ if (el.tagName !== 'SECTION') {
+ assert.fail();
+ }
+});
+assert.isAbove(els.length, 0);
```
你至少應該有 5 個 `.main-section` 元素,它們是 `#main-doc` 的子元素。
```js
-const els = document.querySelectorAll('#main-doc .main-section')
-assert(els.length >= 5)
+const els = document.querySelectorAll('#main-doc .main-section');
+assert.isAtLeast(els.length, 5);
```
每個 `.main-section` 的第一個子元素都應該是一個 `header` 元素。
```js
-const els = document.querySelectorAll('.main-section')
+const els = document.querySelectorAll('.main-section');
els.forEach(el => {
- if(el.firstElementChild?.tagName !== 'HEADER') assert(false)
-})
-assert(els.length > 0)
+ if (el.firstElementChild?.tagName !== 'HEADER') assert.fail();
+});
+assert.isNotEmpty(els);
```
你的 `header` 元素不應爲空。
```js
-const els = document.querySelectorAll('header')
+const els = document.querySelectorAll('header');
els.forEach(el => {
- if (el.innerText?.length <= 0) assert(false)
-})
-assert(els.length > 0)
+ if (el.innerText?.length <= 0) assert.fail();
+});
+assert.isNotEmpty(els);
```
你所有的 `.main-section` 元素都應該有 `id`。
```js
-const els = document.querySelectorAll('.main-section')
+const els = document.querySelectorAll('.main-section');
els.forEach(el => {
- if (!el.id || el.id === '') assert(false)
-})
-assert(els.length > 0)
+ if (!el.id || el.id === '') assert.fail();
+});
+assert.isNotEmpty(els);
```
每個 `.main-section` 都應該有一個與其第一個子元素的文本匹配的 `id`,把子元素的文本中的空格都替換爲下劃線(`_`)用於 id。
```js
-const els = document.querySelectorAll('.main-section')
+const els = document.querySelectorAll('.main-section');
els.forEach(el => {
- const text = el.firstElementChild?.innerText?.replaceAll(' ', '_')
- if (el.id?.toUpperCase() !== text?.toUpperCase()) assert(false)
-})
-assert(els.length > 0)
+ const text = el.firstElementChild?.innerText?.replaceAll(' ', '_');
+ if (el.id?.toUpperCase() !== text?.toUpperCase()) assert.fail();
+});
+assert.isNotEmpty(els);
```
在你的 `.main-section` 元素中總計應有至少 10 個 `p` 元素
```js
-const els = document.querySelectorAll('.main-section p')
-assert(els.length >= 10)
+const els = document.querySelectorAll('.main-section p');
+assert.isAtLeast(els.length, 10);
```
所有 `.main-section` 元素內總計應有至少 5 個 `code` 元素。
```js
-const els = document.querySelectorAll('.main-section code')
-assert(els.length >= 5)
+const els = document.querySelectorAll('.main-section code');
+assert.isAtLeast(els.length, 5);
```
所有 `.main-section` 元素內總計應有至少 5 個 `li` 元素。
```js
-const els = document.querySelectorAll('.main-section li')
-assert(els.length >= 5)
+const els = document.querySelectorAll('.main-section li');
+assert.isAtLeast(els.length, 5);
```
你應該有一個 `id` 爲 `navbar` 的 `nav` 元素。
```js
-const el = document.getElementById('navbar')
-assert(!!el && el.tagName === 'NAV')
+const el = document.getElementById('navbar');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'NAV');
```
你的 `#navbar` 應該只有一個 `header` 元素。
```js
-const els = document.querySelectorAll('#navbar header')
-assert(els.length === 1)
+const els = document.querySelectorAll('#navbar header');
+assert.lengthOf(els, 1);
```
你應該至少有一個 class 爲 `nav-link` 的 `a` 元素。
```js
-const els = document.querySelectorAll('a.nav-link')
-assert(els.length >= 1)
+const els = document.querySelectorAll('a.nav-link');
+assert.isAtLeast(els.length, 1);
```
你所有的 `.nav-link` 元素都應該是錨元素(`a`)。
```js
-const els = document.querySelectorAll('.nav-link')
+const els = document.querySelectorAll('.nav-link');
els.forEach(el => {
- if (el.tagName !== 'A') assert(false)
-})
-assert(els.length > 0)
+ if (el.tagName !== 'A') assert.fail();
+});
+assert.isNotEmpty(els);
```
你所有的 `.nav-link` 元素都應該在 `#navbar` 中。
```js
-const els1 = document.querySelectorAll('.nav-link')
-const els2 = document.querySelectorAll('#navbar .nav-link')
-assert(els2.length > 0 && els1.length === els2.length)
+const els1 = document.querySelectorAll('.nav-link');
+const els2 = document.querySelectorAll('#navbar .nav-link');
+assert.isNotEmpty(els2);
+assert.strictEqual(els1.length, els2.length);
```
你應該有相同數量的 `.nav-link` 和 `.main-section` 元素。
```js
-const els1 = document.querySelectorAll('.main-section')
-const els2 = document.querySelectorAll('.nav-link')
-assert(els1.length > 0 && els2.length > 0 && els1.length === els2.length)
+const els1 = document.querySelectorAll('.main-section');
+const els2 = document.querySelectorAll('.nav-link');
+assert.isNotEmpty(els1);
+assert.isNotEmpty(els2);
+assert.strictEqual(els1.length, els2.length);
```
`#navbar` 中的 `header` 元素必須在 `#navbar` 中的任何鏈接(`a`)之前。
@@ -179,54 +185,66 @@ assert(els1.length > 0 && els2.length > 0 && els1.length === els2.length)
```js
const navLinks = document.querySelectorAll('#navbar a.nav-link');
const header = document.querySelector('#navbar header');
-navLinks.forEach((navLink) => {
+navLinks.forEach(navLink => {
if (
- (
- header.compareDocumentPosition(navLink) &
- Node.DOCUMENT_POSITION_PRECEDING
- )
- ) assert(false)
+ header.compareDocumentPosition(navLink) & Node.DOCUMENT_POSITION_PRECEDING
+ )
+ assert.fail();
});
-assert(!!header)
+assert.isNotNull(header);
```
每個 `.nav-link` 應該有與其相關 `section` 的 `header` 文本相對應的文本(例如,如果你有一個 “Hello world” 部分/標題,你的 `#navbar` 應該有一個 `.nav-link` 包含文本 “Hello world”)。
```js
-const headerText = Array.from(document.querySelectorAll('.main-section')).map(el =>
- el.firstElementChild?.innerText?.trim().toUpperCase()
-)
+const headerText = Array.from(document.querySelectorAll('.main-section')).map(
+ el => el.firstElementChild?.innerText?.trim().toUpperCase()
+);
const linkText = Array.from(document.querySelectorAll('.nav-link')).map(el =>
el.innerText?.trim().toUpperCase()
-)
-const remainder = headerText.filter(str => linkText.indexOf(str) === -1)
-assert(headerText.length > 0 && linkText.length > 0 && remainder.length === 0)
+);
+const remainder = headerText.filter(str => linkText.indexOf(str) === -1);
+
+assert.isNotEmpty(headerText);
+assert.isNotEmpty(linkText);
+assert.isEmpty(remainder);
```
每個 `.nav-link` 都應該有一個 `href` 屬性,該屬性鏈接到其對應的 `.main-section`(例如,如果你單擊包含文本 “Hello world” 的 `.nav-link` 元素,頁面導航到具有該 id 的 `section` 元素)。
```js
-const hrefValues = Array.from(document.querySelectorAll('.nav-link')).map(el => el.getAttribute('href'))
-const mainSectionIDs = Array.from(document.querySelectorAll('.main-section')).map(el => el.id)
-const missingHrefValues = mainSectionIDs.filter(str => hrefValues.indexOf('#' + str) === -1)
-assert(hrefValues.length > 0 && mainSectionIDs.length > 0 && missingHrefValues.length === 0)
+const hrefValues = Array.from(document.querySelectorAll('.nav-link')).map(el =>
+ el.getAttribute('href')
+);
+const mainSectionIDs = Array.from(
+ document.querySelectorAll('.main-section')
+).map(el => el.id);
+const missingHrefValues = mainSectionIDs.filter(
+ str => hrefValues.indexOf('#' + str) === -1
+);
+assert.isNotEmpty(hrefValues);
+assert.isNotEmpty(mainSectionIDs);
+assert.isEmpty(missingHrefValues, 0);
```
你的 `#navbar` 元素應該始終位於視口的頂部。
```js
-const el = document.getElementById('navbar')
-const left1 = el?.offsetLeft
-const left2 = el?.offsetLeft
-assert(!!el && left1 >= -15 && left1 <= 15 && left2 >= -15 && left2 <= 15)
+const el = document.getElementById('navbar');
+const left1 = el?.offsetLeft;
+assert.isNotNull(el);
+assert.isAtLeast(left1, -15);
+assert.isAtMost(left1, 15);
```
你的技術文檔項目應該使用至少一個媒體查詢。
```js
-const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el => el.getAttribute('media'))
-const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media')
-assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
+const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el =>
+ el.getAttribute('media')
+);
+const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media');
+assert.isTrue(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
# --seed--
@@ -501,7 +519,7 @@ a:hover {
left: -5px;
padding: 5px;
text-align: center;
- color: #92869c
+ color: #92869c;
}
@media (min-width: 480px) {
#navbar {
@@ -510,7 +528,7 @@ a:hover {
}
main {
margin-left: 220px;
- color: #92869c
+ color: #92869c;
}
header {
font-size: 20pt;
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-tribute-page-project/build-a-tribute-page.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-tribute-page-project/build-a-tribute-page.md
index ed5362b122..1c77606c65 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-tribute-page-project/build-a-tribute-page.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/build-a-tribute-page-project/build-a-tribute-page.md
@@ -8,8 +8,7 @@ dashedName: build-a-tribute-page
# --description--
-**Objective:** Build an app that is functionally similar to
https://tribute-page.freecodecamp.rocks. **Do not copy this demo project**.
-
+**Objective:** Build an app that is functionally similar to
https://tribute-page.freecodecamp.rocks. **請勿複製此演示項目**。
**用戶需求:**
@@ -32,111 +31,125 @@ dashedName: build-a-tribute-page
你應該有一個 `main` 元素且該元素的 `id` 爲 `main`.
```js
-const el = document.getElementById('main')
-assert(!!el && el.tagName === 'MAIN')
+const el = document.getElementById('main');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'MAIN');
```
你的 `#img-div`、`#image`、`#img-caption`、`#tribute-info` 和 `#tribute-link` 應該是 `#main` 的子元素。
```js
-const el1 = document.querySelector('#main #img-div')
-const el2 = document.querySelector('#main #image')
-const el3 = document.querySelector('#main #img-caption')
-const el4 = document.querySelector('#main #tribute-info')
-const el5 = document.querySelector('#main #tribute-link')
-assert(!!el1 & !!el2 && !!el3 && !!el4 && !!el5)
+const el1 = document.querySelector('#main #img-div');
+const el2 = document.querySelector('#main #image');
+const el3 = document.querySelector('#main #img-caption');
+const el4 = document.querySelector('#main #tribute-info');
+const el5 = document.querySelector('#main #tribute-link');
+assert.isNotNull(el1);
+assert.isNotNull(el2);
+assert.isNotNull(el3);
+assert.isNotNull(el4);
+assert.isNotNull(el5);
```
你應該有一個`id`爲`title`的元素。
```js
-const el = document.getElementById('title')
-assert(!!el)
+const el = document.getElementById('title');
+assert.isNotNull(el);
```
id爲 `#title` 的元素不應爲空。
```js
-const el = document.getElementById('title')
-assert(!!el && el.innerText.length > 0)
-
+const el = document.getElementById('title');
+assert.isNotNull(el);
+assert.isNotEmpty(el.innerText, 0);
```
你應該有一個 `id` 爲 `img-div` 的 `figure` 或 `div` 元素。
```js
-const el = document.getElementById('img-div')
-assert(!!el && (el.tagName === 'DIV' || el.tagName === 'FIGURE'))
+const el = document.getElementById('img-div');
+assert.isNotNull(el);
+assert.isTrue(el.tagName === 'DIV' || el.tagName === 'FIGURE');
```
你應該有一個 `id` 爲 `image` 的 `img` 元素。
```js
-const el = document.getElementById('image')
-assert(!!el && el.tagName === 'IMG')
+const el = document.getElementById('image');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'IMG');
```
你的 `#image` 元素應該是 `#img-div` 元素的子元素。
```js
-const el = document.querySelector('#img-div #image')
-assert(!!el)
+const el = document.querySelector('#img-div #image');
+assert.isNotNull(el);
```
你應該有一個 `id` 爲 `img-caption` 的 `figcaption` 元素或 `div` 元素。
```js
-const el = document.getElementById('img-caption')
-assert(!!el && (el.tagName === 'DIV' || el.tagName === 'FIGCAPTION'))
+const el = document.getElementById('img-caption');
+assert.isNotNull(el);
+assert.isTrue(el.tagName === 'DIV' || el.tagName === 'FIGCAPTION');
```
你的 `#img-caption` 元素應該是 `#img-div` 元素的子元素。
```js
-const el = document.querySelector('#img-div #img-caption')
-assert(!!el)
+const el = document.querySelector('#img-div #img-caption');
+assert.isNotNull(el);
```
id爲 `#img-caption` 的元素不應爲空。
```js
-const el = document.getElementById('img-caption')
-assert(!!el && el.innerText.length > 0)
+const el = document.getElementById('img-caption');
+assert.isNotNull(el);
+assert.isNotEmpty(el.innerText);
```
你應該有一個 `id` 爲 `tribute-info` 的元素。
```js
-const el = document.getElementById('tribute-info')
-assert(!!el)
+const el = document.getElementById('tribute-info');
+assert.isNotNull(el);
```
id爲 `#tribute-info` 的元素不應爲空。
```js
-const el = document.getElementById('tribute-info')
-assert(!!el && el.innerText.length > 0)
+const el = document.getElementById('tribute-info');
+assert.isNotNull(el);
+assert.isNotEmpty(el.innerText);
```
你應該有一個 `id` 爲 `tribute-link` 的 `a` 元素。
```js
-const el = document.getElementById('tribute-link')
-assert(!!el && el.tagName === 'A')
+const el = document.getElementById('tribute-link');
+assert.isNotNull(el);
+assert.strictEqual(el.tagName, 'A');
```
id爲 `#tribute-link` 的元素的 `href` 屬性應該有值。
```js
-const el = document.getElementById('tribute-link')
-assert(!!el && !!el.href && el.href.length > 0)
+const el = document.getElementById('tribute-link');
+assert.isNotNull(el);
+assert.isNotNull(el.href);
+assert.isNotEmpty(el.href);
```
id爲 `#tribute-link` 的元素的 `target` 屬性應該設置爲 `_blank`。
```js
-const el = document.getElementById('tribute-link')
-assert(!!el && el.target === '_blank')
+const el = document.getElementById('tribute-link');
+assert.isNotNull(el);
+assert.strictEqual(el.target, '_blank');
```
`img` 元素應該有 `display` 樣式且值應爲 `block`。
@@ -144,8 +157,8 @@ assert(!!el && el.target === '_blank')
```js
const img = document.getElementById('image');
const imgStyle = window.getComputedStyle(img);
-const style = imgStyle?.getPropertyValue('display')
-assert(style === 'block')
+const style = imgStyle?.getPropertyValue('display');
+assert.strictEqual(style, 'block');
```
id爲 `#image` 的元素應該有 `max-width` 樣式且值爲 `100%`。
@@ -153,8 +166,8 @@ id爲 `#image` 的元素應該有 `max-width` 樣式且值爲 `100%`。
```js
const img = document.getElementById('image');
const imgStyle = window.getComputedStyle(img);
-const style = imgStyle?.getPropertyValue('max-width')
-assert(style === '100%')
+const style = imgStyle?.getPropertyValue('max-width');
+assert.strictEqual(style, '100%');
```
id爲 `#image` 的元素的 `height` 樣式值應爲 `auto`。
@@ -166,9 +179,9 @@ const imgStyle = window.getComputedStyle(img);
const oldDisplayValue = imgStyle.getPropertyValue('display');
const oldDisplayPriority = imgStyle.getPropertyPriority('display');
img?.style.setProperty('display', 'none', 'important');
-const heightValue = imgStyle?.getPropertyValue('height')
+const heightValue = imgStyle?.getPropertyValue('height');
img?.style.setProperty('display', oldDisplayValue, oldDisplayPriority);
-assert(heightValue === 'auto')
+assert.strictEqual(heightValue, 'auto');
```
id爲 `#image` 的元素應該在其父元素內居中。
@@ -183,7 +196,8 @@ const img = document.getElementById('image'),
parentRight = imgParent?.getBoundingClientRect().right,
leftMargin = imgLeft - parentLeft,
rightMargin = parentRight - imgRight;
-assert(leftMargin - rightMargin < 6 && rightMargin - leftMargin < 6)
+assert.isBelow(leftMargin - rightMargin, 6);
+assert.isBelow(rightMargin - leftMargin, 6);
```
# --seed--
@@ -208,12 +222,10 @@ assert(leftMargin - rightMargin < 6 && rightMargin - leftMargin < 6)
Tribute Page
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613e2546d0594208229ada50.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613e2546d0594208229ada50.md
index 186309cbb1..c4cad97a05 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613e2546d0594208229ada50.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613e2546d0594208229ada50.md
@@ -7,7 +7,7 @@ dashedName: step-7
# --description--
-Within the `header`, provide context about the page by nesting one `img`, `h1`, and `nav` element.
+在 `header` 中,通過嵌套一個 `img`、`h1` 和 `nav` 元素來提供有關頁面的上下文。
`img` 標籤應該指向 `https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg`,`id` 屬性值爲 `logo`,`alt` 文本爲 `freeCodeCamp`。
@@ -57,7 +57,7 @@ assert.equal(document.querySelector('img')?.id, 'logo');
assert.equal(document.querySelector('img')?.alt, 'freeCodeCamp');
```
-You should give the `h1` element the text `HTML/CSS Quiz`.
+你應該將 `h1` 元素的文本設置爲 `HTML/CSS Quiz`。
```js
assert.include(document.querySelector('h1')?.innerText?.toLowerCase(), 'html/css quiz');
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613e275749ebd008e74bb62e.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613e275749ebd008e74bb62e.md
index 9a7919d148..956311a19a 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613e275749ebd008e74bb62e.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613e275749ebd008e74bb62e.md
@@ -9,7 +9,7 @@ dashedName: step-8
A useful property of an _SVG_ (scalable vector graphics) is that it contains a `path` attribute which allows the image to be scaled without affecting the resolution of the resultant image.
-Currently, the `img` is assuming its default size, which is too large. CSS has a `max` function which returns the largest of a set of comma-separated values. 例如:
+`img` 當前是默認尺寸,這個尺寸太大。 CSS 提供了一個 `max` 函數,它返回一組由逗號分隔的值中最大的值。 例如:
```css
img {
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614202874ca576084fca625f.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614202874ca576084fca625f.md
index e864b1363e..0fc6594039 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614202874ca576084fca625f.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614202874ca576084fca625f.md
@@ -1,6 +1,6 @@
---
id: 614202874ca576084fca625f
-title: Step 16
+title: 步驟 16
challengeType: 0
dashedName: step-16
---
@@ -9,83 +9,83 @@ dashedName: step-16
Every `region` role requires a label, which helps screen reader users understand the purpose of the region. One method for adding a label is to add a heading element inside the region and then reference it with the `aria-labelledby` attribute.
-Add the following `aria-labelledby` attributes to the `section` elements:
+給 `section` 元素添加以下 `aria-labelledby` 屬性:
- `student-info`
- `html-questions`
- `css-questions`
-Then, within each `section` element, nest one `h2` element with an `id` matching the corresponding `aria-labelledby` attribute. Give each `h2` suitable text content.
+然後,在每個 `section` 元素中,嵌套一個 `h2` 元素,其 `id` 與相應的 `aria-labelledby` 屬性匹配。 給每個 `h2` 添加適當的文本內容。
# --hints--
-You should give the first `section` element an `aria-labelledby` attribute of `student-info`.
+你應該給第一個 `section` 元素添加值爲 `student-info` 的 `aria-labelledby` 屬性。
```js
assert.equal(document.querySelectorAll('section')?.[0]?.getAttribute('aria-labelledby'), 'student-info');
```
-You should give the second `section` element an `aria-labelledby` attribute of `html-questions`.
+你應該給第二個 `section` 元素添加值爲 `html-questions` 的 `aria-labelledby` 屬性。
```js
assert.equal(document.querySelectorAll('section')?.[1]?.getAttribute('aria-labelledby'), 'html-questions');
```
-You should give the third `section` element an `aria-labelledby` attribute of `css-questions`.
+你應該給第三個 `section` 元素添加值爲 `css-questions` 的 `aria-labelledby` 屬性。
```js
assert.equal(document.querySelectorAll('section')?.[2]?.getAttribute('aria-labelledby'), 'css-questions');
```
-You should nest one `h2` element within the first `section` element.
+你應該在第一個 `section` 元素中嵌套一個 `h2` 元素。
```js
assert.equal(document.querySelectorAll('section')?.[0]?.querySelectorAll('h2')?.length, 1);
```
-You should nest one `h2` element within the second `section` element.
+你應該在第二個 `section` 元素中嵌套一個 `h2` 元素。
```js
assert.equal(document.querySelectorAll('section')?.[1]?.querySelectorAll('h2')?.length, 1);
```
-You should nest one `h2` element within the third `section` element.
+你應該在第三個 `section` 元素中嵌套一個 `h2` 元素。
```js
assert.equal(document.querySelectorAll('section')?.[2]?.querySelectorAll('h2')?.length, 1);
```
-You should give the first `h2` element an `id` attribute of `student-info`.
+你應該給第一個 `h2` 元素添加 `id` 爲 `student-info`。
```js
assert.equal(document.querySelectorAll('h2')?.[0]?.id, 'student-info');
```
-You should give the second `h2` element an `id` attribute of `html-questions`.
+你應該給第二個 `h2` 元素添加 `id` 爲 `html-questions`。
```js
assert.equal(document.querySelectorAll('h2')?.[1]?.id, 'html-questions');
```
-You should give the third `h2` element an `id` attribute of `css-questions`.
+你應該給第三個 `h2` 元素添加 `id` 爲 `css-questions`。
```js
assert.equal(document.querySelectorAll('h2')?.[2]?.id, 'css-questions');
```
-You should give the first `h2` element suitable text content. _Hint: I would have chosen `Student Info`_
+你應該給第一個 `h2` 元素添加適當的文本內容。 _提示:我會使用 `Student Info`_
```js
assert.isAtLeast(document.querySelectorAll('h2')?.[0]?.textContent?.length, 1);
```
-You should give the second `h2` element suitable text content. _Hint: I would have chosen `HTML`_
+你應該給第二個 `h2` 元素添加適當的文本內容。 _提示:我會使用 `HTML`_
```js
assert.isAtLeast(document.querySelectorAll('h2')?.[1]?.textContent?.length, 1);
```
-You should give the third `h2` element suitable text content. _Hint: I would have chosen `CSS`_
+你應該給第三個 `h2` 元素添加適當的文本內容。 _提示:我會使用 `CSS`_
```js
assert.isAtLeast(document.querySelectorAll('h2')?.[2]?.textContent?.length, 1);
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614394fb41985e0d2012a93e.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614394fb41985e0d2012a93e.md
index d40c808617..bfef581db7 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614394fb41985e0d2012a93e.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614394fb41985e0d2012a93e.md
@@ -7,7 +7,7 @@ dashedName: step-24
# --description--
-The question numbers are not descriptive enough. This is especially true for visually impaired users. One way to get around such an issue, without having to add visible text to the element, is to add text only a screen reader can read.
+The question numbers are not descriptive enough. 對於視力受損的用戶來說尤其如此。 解決這個問題的方法之一是在元素中添加只有屏幕閱讀器才能讀取的文本,而無需在元素中添加可見文本。
爲每個 `h3` 元素添加一個 `class` 爲 `sr-only` 的 `span` 元素。
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6145e8b5080a5f06bb0223d0.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6145e8b5080a5f06bb0223d0.md
index d649b8298d..32ee22866f 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6145e8b5080a5f06bb0223d0.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6145e8b5080a5f06bb0223d0.md
@@ -9,117 +9,117 @@ dashedName: step-32
Give the `label` elements text such that the `input` comes before the text. Then, give the `input` elements a `value` matching the text.
-The text should either be `True` or `False`.
+文本應爲 `True` 或 `False`。
# --hints--
-You should give the first `label` element text content.
+你應該給第一個 `label` 元素添加文本內容。
```js
assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[0]?.textContent?.trim());
```
-You should give the second `label` element text content.
+你應該給第二個 `label` 元素添加文本內容。
```js
assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[1]?.textContent?.trim());
```
-You should give the third `label` element text content.
+你應該給第三個 `label` 元素添加文本內容。
```js
assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[2]?.textContent?.trim());
```
-You should give the fourth `label` element text content.
+你應該給第四個 `label` 元素添加文本內容。
```js
assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[3]?.textContent?.trim());
```
-You should place the first `label` text content after the `input` element.
+你應該將第一個 `label` 文本內容放在 `input` 元素之後。
```js
assert.match(document.querySelectorAll('ul.answers-list > li > label')?.[0]?.innerHTML, />[\s\S]+[a-zA-Z]/);
```
-You should place the second `label` text content after the `input` element.
+你應該將第二個 `label` 文本內容放在 `input` 元素之後。
```js
assert.match(document.querySelectorAll('ul.answers-list > li > label')?.[1]?.innerHTML, />[\s\S]+[a-zA-Z]/);
```
-You should place the third `label` text content after the `input` element.
+你應該將第三個 `label` 文本內容放在 `input` 元素之後。
```js
assert.match(document.querySelectorAll('ul.answers-list > li > label')?.[2]?.innerHTML, />[\s\S]+[a-zA-Z]/);
```
-You should place the fourth `label` text content after the `input` element.
+你應該將第四個 `label` 文本內容放在 `input` 元素之後。
```js
assert.match(document.querySelectorAll('ul.answers-list > li > label')?.[3]?.innerHTML, />[\s\S]+[a-zA-Z]/);
```
-You should give the first `label` the text `True` or `False`.
+你應該給第一個 `label` 添加文本 `True` 或 `False`。
```js
assert.include(['True', 'False'], document.querySelectorAll('ul.answers-list > li > label')?.[0]?.textContent?.trim());
```
-You should give the second `label` the text `True`.
+你應該給第二個`label` 添加文本 `True`。
```js
const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim();
assert(l(0) === 'False' ? l(1) === 'True' : true);
```
-You should give the second `label` the text `False`.
+你應該給第二個`label` 添加文本 `False`。
```js
const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim();
assert(l(0) === 'True' ? l(1) === 'False' : true);
```
-You should give the third `label` the text `True` or `False`.
+你應該給第三個 `label` 添加文本 `True` 或 `False`。
```js
assert.include(['True', 'False'], document.querySelectorAll('ul.answers-list > li > label')?.[2]?.textContent?.trim());
```
-You should give the fourth `label` the text `True`.
+你應該給第四個`label` 添加文本 `True`。
```js
const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim();
assert(l(2) === 'False' ? l(3) === 'True' : true);
```
-You should give the fourth `label` the text `False`.
+你應該給第四個`label` 添加文本 `False`。
```js
const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim();
assert(l(2) === 'True' ? l(3) === 'False' : true);
```
-You should give the first `input` a `value` matching the `label` text content.
+你應該給第一個 `input` 添加一個與 `label` 文本內容匹配的 `value`。
```js
assert.equal(document.querySelectorAll('ul.answers-list > li > label')?.[0]?.textContent?.trim()?.toLowerCase(), document.querySelectorAll('ul.answers-list > li > label > input')?.[0]?.value?.toLowerCase());
```
-You should give the second `input` a `value` matching the `label` text content.
+你應該給第二個 `input` 添加一個與 `label` 文本內容匹配的 `value`。
```js
assert.equal(document.querySelectorAll('ul.answers-list > li > label')?.[1]?.textContent?.trim()?.toLowerCase(), document.querySelectorAll('ul.answers-list > li > label > input')?.[1]?.value?.toLowerCase());
```
-You should give the third `input` a `value` matching the `label` text content.
+你應該給第三個 `input` 添加一個與 `label` 文本內容匹配的 `value`。
```js
assert.equal(document.querySelectorAll('ul.answers-list > li > label')?.[2]?.textContent?.trim()?.toLowerCase(), document.querySelectorAll('ul.answers-list > li > label > input')?.[2]?.value?.toLowerCase());
```
-You should give the fourth `input` a `value` matching the `label` text content.
+你應該給第四個 `input` 添加一個與 `label` 文本內容匹配的 `value`。
```js
assert.equal(document.querySelectorAll('ul.answers-list > li > label')?.[3]?.textContent?.trim()?.toLowerCase(), document.querySelectorAll('ul.answers-list > li > label > input')?.[3]?.value?.toLowerCase());
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6145fc3707fc3310c277f5c8.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6145fc3707fc3310c277f5c8.md
index fd9231e81c..a30e65b8cd 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6145fc3707fc3310c277f5c8.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6145fc3707fc3310c277f5c8.md
@@ -7,7 +7,7 @@ dashedName: step-45
# --description--
-Back to styling the page. Select the list elements within the navigation bar, and give them the following styles:
+繼續爲頁面添加樣式。 選擇導航欄中的列表元素,並給它們添加下面的樣式:
```css
color: #dfdfe2;
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614796cb8086be482d60e0ac.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614796cb8086be482d60e0ac.md
index e101aa5c81..bac949b793 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614796cb8086be482d60e0ac.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614796cb8086be482d60e0ac.md
@@ -1,6 +1,6 @@
---
id: 614796cb8086be482d60e0ac
-title: Step 46
+title: 步驟 46
challengeType: 0
dashedName: step-46
---
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614878f7a412310647873015.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614878f7a412310647873015.md
index 8b1535e90e..1f000d4b77 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614878f7a412310647873015.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614878f7a412310647873015.md
@@ -1,6 +1,6 @@
---
id: 614878f7a412310647873015
-title: Step 48
+title: 步驟 48
challengeType: 0
dashedName: step-48
---
@@ -9,29 +9,29 @@ dashedName: step-48
Tidy up the `header`, by using _Flexbox_ to put space between the children, and vertically center them.
-Then, fix the `header` to the top of the viewport.
+然後,將 `header` 固定到視口的頂部。
# --hints--
-You should give the `header` a `justify-content` of `space-between`.
+你應該給 `header` 添加 `justify-content` 值爲 `space-between`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('header')?.justifyContent, 'space-between');
```
-You should give the `header` an `align-items` of `center`.
+你應該給 `header` 添加 `align-items` 值爲 `center`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('header')?.alignItems, 'center');
```
-You should give the `header` a `position` of `fixed`.
+你應該給 `header` 添加 `position` 值爲 `fixed`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('header')?.position, 'fixed');
```
-You should give the `header` a `top` of `0`.
+你應該給 `header` 添加 `top` 值爲 `0`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('header')?.top, '0px');
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614883b6fa720e09fb167de9.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614883b6fa720e09fb167de9.md
index 54550b4156..0036adbfcc 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614883b6fa720e09fb167de9.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/614883b6fa720e09fb167de9.md
@@ -1,6 +1,6 @@
---
id: 614883b6fa720e09fb167de9
-title: Step 53
+title: 步驟 53
challengeType: 0
dashedName: step-53
---
@@ -11,31 +11,31 @@ Add padding to the top and left of the `.info` elements, and set the other value
# --hints--
-You should use the `.info` selector.
+你應該使用 `.info` 選擇器。
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.info'));
```
-You should give `.info` a `padding-top` of at least `1px`.
+你應該給 `.info` 添加 `padding-top` 值至少爲 `1px`。
```js
assert.isAtLeast(Number(new __helpers.CSSHelp(document).getStyle('.info')?.paddingTop?.replace(/\D+/, '')), 1);
```
-You should give `.info` a `padding-right` of `0`.
+你應該給 `.info` 添加 `padding-right` 值爲 `0`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.info')?.paddingRight, '0px');
```
-You should give `.info` a `padding-bottom` of `0`.
+你應該給 `.info` 添加 `padding-bottom` 值爲 `0`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.info')?.paddingBottom, '0px');
```
-You should give `.info` a `padding-left` of at least `1px`.
+你應該給 `.info` 添加 `padding-left` 值至少爲 `1px`。
```js
assert.isAtLeast(Number(new __helpers.CSSHelp(document).getStyle('.info')?.paddingLeft?.replace(/\D+/, '')), 1);
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6148dfab9b54c110577de165.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6148dfab9b54c110577de165.md
index c60a777f43..553301a83e 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6148dfab9b54c110577de165.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6148dfab9b54c110577de165.md
@@ -1,6 +1,6 @@
---
id: 6148dfab9b54c110577de165
-title: Step 62
+title: 步驟 62
challengeType: 0
dashedName: step-62
---
@@ -21,31 +21,31 @@ border: 3px solid #3b3b4f;
# --hints--
-You should use the `button` element selector.
+你應該使用 `button` 元素選擇器。
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('button'));
```
-You should give `button` a `display` of `block`.
+你應該給 `button` 添加 `display` 值爲 `block`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('button')?.display, 'block');
```
-You should give `button` a `margin` of `40px auto`.
+你應該給 `button` 添加 `margin` 值爲 `40px auto`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('button')?.margin, '40px auto');
```
-You should give `button` a `width` of `40%`.
+你應該給 `button` 添加 `width` 值爲 `40%`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('button')?.width, '40%');
```
-You should give `button` a `padding` of `15px`.
+你應該給 `button` 添加 `padding` 值爲 `15px`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('button')?.padding, '15px');
@@ -57,13 +57,13 @@ You should give `button` a `font-size` of `1.438rem`.
assert.equal(new __helpers.CSSHelp(document).getStyle('button')?.fontSize, '1.438rem');
```
-You should give `button` a `background` of `#d0d0d5`.
+你應該給 `button` 添加 `background` 值爲 `#d0d0d5`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('button')?.backgroundColor, 'rgb(208, 208, 213)');
```
-You should give `button` a `border` of `3px solid #3b3b4f`.
+你應該給 `button` 添加 `border` 值爲 `3px solid #3b3b4f`。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('button')?.border, '3px solid rgb(59, 59, 79)');
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f332b23c2045fb843337579.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f332b23c2045fb843337579.md
index 08a915b3ee..d14b706d95 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f332b23c2045fb843337579.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f332b23c2045fb843337579.md
@@ -11,31 +11,31 @@ To let visitors know the cafe was founded in 2020, add a `p` element below the `
# --hints--
-You should have an opening `
` tag.
+你應該有一個 `
` 開始標籤。
```js
assert(code.match(/
/i));
```
-You should have a closing `
` tag.
+你應該有一個 `` 結束標籤。
```js
assert(code.match(/<\/p>/i));
```
-You should not change your existing `h1` element. Make sure you did not delete the closing tag.
+你不應該改變你現有的 `h1` 元素。 確認你沒有刪除結束標籤。
```js
assert.lengthOf(document.querySelectorAll('h1'),1);
```
-Your `p` element should be below your `h1` element.
+你的 `p` 元素應該在 `h1` 元素的下面。
```js
assert.equal(document.querySelector('p')?.previousElementSibling?.tagName, 'H1');
```
-Your `p` element should have the text `Est. 2020`.
+你的 `p` 元素應該有文本 `Est. 2020`。
```js
assert(document.querySelector("p").innerText === "Est. 2020");
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f344fad8bf01691e71a30eb.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f344fad8bf01691e71a30eb.md
index 6d62eb9e33..a918299235 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f344fad8bf01691e71a30eb.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f344fad8bf01691e71a30eb.md
@@ -1,29 +1,29 @@
---
id: 5f344fad8bf01691e71a30eb
-title: Step 10
+title: 步驟 10
challengeType: 0
dashedName: step-10
---
# --description--
-Up until now, you have been limited regarding the presentation and appearance of the content you create. To start taking control, add a `style` element within the `head` element.
+到目前爲止,在你創建的內容的演示和外觀方面,你一直受到限制。 To start taking control, add a `style` element within the `head` element.
# --hints--
-Your code should have an opening `` tag.
+你應該有一個 `` 結束標籤。
```js
assert(code.match(/<\/style\s*>/));
```
-Your `style` element should be nested in your `head` element.
+你的 `style` 元素都應嵌套在 `head` 元素中。
```js
assert(code.match(/[\w\W\s]*
-
I meet so many people who are in search of that one trick that will help them work smart. Even if you work smart, you still have to work hard.
+
+ I meet so many people who are in search of that one trick that will help
+ them work smart. Even if you work smart, you still have to work hard.
+
1:32 PM - 12 Jan 2018
-
+