chore(i18n,learn): processed translations (#44851)

This commit is contained in:
camperbot
2022-01-21 01:00:18 +05:30
committed by GitHub
parent f866718a3d
commit 5c868af2b8
1696 changed files with 159426 additions and 69 deletions

View File

@ -1,6 +1,6 @@
---
id: 587d824c367417b2b2512c4f
title: Test if a Value Falls within a Specific Range
title: Compueba si un valor está dentro de un rango específico
challengeType: 2
forumTopicId: 301598
dashedName: test-if-a-value-falls-within-a-specific-range
@ -8,23 +8,23 @@ dashedName: test-if-a-value-falls-within-a-specific-range
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Como recordatorio, este proyecto está siendo construido con base en el siguiente proyecto inicial [Repl.it](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonado desde [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
```javascript
.approximately(actual, expected, delta, [message])
```
Asserts that the `actual` is equal to `expected`, to within a +/- `delta` range.
Comprueba que `actual` es igual a `expected`, dentro de un rango +/- `delta`.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#10` in the `Comparisons` suite, change each `assert` to `assert.approximately` to make the test pass (should evaluate to `true`).
Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada `#10` en `Comparisons` suite, cambiar cada `assert` a `assert.approximately` para que el test sea superado (debe evaluarse a `true`).
Choose the minimum range (3rd parameter) to make the test always pass. It should be less than 1.
Elija el rango mínimo (3er parámetro), para hacer que la prueba sea superada. Esto debe ser inferior a 1.
# --hints--
All tests should pass.
Todas las pruebas deben pasar.
```js
(getUserInput) =>
@ -38,7 +38,7 @@ All tests should pass.
);
```
You should choose the correct range for the first assertion - `approximately(actual, expected, range)`.
Debe elegir el rango correcto para la primera aserción - `approximately(actual, expected, range)`.
```js
(getUserInput) =>
@ -57,7 +57,7 @@ You should choose the correct range for the first assertion - `approximately(act
);
```
You should choose the correct range for the second assertion - `approximately(actual, expected, range)`.
Debe elegir el rango correcto para la segunda aserción - `approximately(actual, expected, range)`.
```js
(getUserInput) =>

View File

@ -1,6 +1,6 @@
---
id: 5e601c0d5ac9d0ecd8b94afe
title: American British Translator
title: Traductor británico americano
challengeType: 4
forumTopicId: 462358
dashedName: american-british-translator
@ -8,62 +8,62 @@ dashedName: american-british-translator
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://american-british-translator.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods:
Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://american-british-translator.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/) and complete your project locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator) to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/) y completa tu proyecto localmente.
- Usa [nuestro proyecto inicial de Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator) para completar tu proyecto.
- Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field.
Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, ingresa la URL en el campo `Solution Link`. Opcionalmente, también ingresa un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions--
- All logic can go into `/components/translator.js`
- Complete the `/api/translate` route in `/routes/api.js`
- Create all of the unit/functional tests in `tests/1_unit-tests.js` and `tests/2_functional-tests.js`
- See the JavaScript files in `/components` for the different spelling and terms your application should translate
- To run the tests on Replit, set `NODE_ENV` to `test` without quotes in the `.env` file
- To run the tests in the console, use the command `npm run test`. To open the Replit console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell"
- Toda la lógica puede ir en `/components/translator.js`
- Completa la ruta `/api/translate` en `/routes/api.js`
- Crea todas las pruebas unitarias/funcionales en `tests/1_unit-tests.js` y `tests/2_functional-tests.js`
- Consulta los archivos de JavaScript en `/components` para ver las diferentes ortografías y términos que debe traducir tu aplicación
- Para ejecutar las pruebas en Replit, establece a `test` `NODE_ENV` sin comillas en el archivo `.env`
- Para ejecutar las pruebas en la consola, usa el comando `npm run test`. Para abrir la consola de Replit presiona Ctrl+Shift+P (Cmd si estas en Mac) y escribe "open shell"
Write the following tests in `tests/1_unit-tests.js`:
Escribe las siguientes pruebas en `tests/1_unit-tests.js`:
- Translate `Mangoes are my favorite fruit.` to British English
- Translate `I ate yogurt for breakfast.` to British English
- Translate `We had a party at my friend's condo.` to British English
- Translate `Can you toss this in the trashcan for me?` to British English
- Translate `The parking lot was full.` to British English
- Translate `Like a high tech Rube Goldberg machine.` to British English
- Translate `To play hooky means to skip class or work.` to British English
- Translate `No Mr. Bond, I expect you to die.` to British English
- Translate `Dr. Grosh will see you now.` to British English
- Translate `Lunch is at 12:15 today.` to British English
- Translate `We watched the footie match for a while.` to American English
- Translate `Paracetamol takes up to an hour to work.` to American English
- Translate `First, caramelise the onions.` to American English
- Translate `I spent the bank holiday at the funfair.` to American English
- Translate `I had a bicky then went to the chippy.` to American English
- Translate `I've just got bits and bobs in my bum bag.` to American English
- Translate `The car boot sale at Boxted Airfield was called off.` to American English
- Translate `Have you met Mrs Kalyani?` to American English
- Translate `Prof Joyner of King's College, London.` to American English
- Translate `Tea time is usually around 4 or 4.30.` to American English
- Highlight translation in `Mangoes are my favorite fruit.`
- Highlight translation in `I ate yogurt for breakfast.`
- Highlight translation in `We watched the footie match for a while.`
- Highlight translation in `Paracetamol takes up to an hour to work.`
- Traduce `Mangoes are my favorite fruit.` al inglés británico
- Traduce `I ate yogurt for breakfast.` al inglés británico
- Traduce `We had a party at my friend's condo.` al inglés británico
- Traduce `Can you toss this in the trashcan for me?` al inglés británico
- Traduce `The parking lot was full.` a Inglés británico
- Traduce `Like a high tech Rube Goldberg machine.` al inglés británico
- Traduce `To play hooky means to skip class or work.` al inglés británico
- Traduce `No Mr. Bond, I expect you to die.` a Inglés británico
- Traduce `Dr. Grosh will see you now.` a Inglés británico
- Traduce `Lunch is at 12:15 today.` al inglés británico
- Traduce `We watched the footie match for a while.` al inglés americano
- Traduce `Paracetamol takes up to an hour to work.` al inglés americano
- Traduce `First, caramelise the onions.` al inglés americano
- Traduce `I spent the bank holiday at the funfair.` al inglés americano
- Traduce `I had a bicky then went to the chippy.` a Inglés Americano
- Traduce `I've just got bits and bobs in my bum bag.` al inglés americano
- Traduce `The car boot sale at Boxted Airfield was called off.` al inglés americano
- Traduce `Have you met Mrs Kalyani?` al inglés americano
- Traduce `Prof Joyner of King's College, London.` al inglés americano
- Traduce `Tea time is usually around 4 or 4.30.` al inglés americano
- Resalta la traducción en `Mangoes are my favorite fruit.`
- Resalta la traducción en `I ate yogurt for breakfast.`
- Resalta la traducción en `We watched the footie match for a while.`
- Resalta la traducción en `Paracetamol takes up to an hour to work.`
Write the following tests in `tests/2_functional-tests.js`:
Escribe las siguientes pruebas en `tests/2_functional-tests.js`:
- Translation with text and locale fields: POST request to `/api/translate`
- Translation with text and invalid locale field: POST request to `/api/translate`
- Translation with missing text field: POST request to `/api/translate`
- Translation with missing locale field: POST request to `/api/translate`
- Translation with empty text: POST request to `/api/translate`
- Translation with text that needs no translation: POST request to `/api/translate`
- Traducción con campos de texto y configuración regional: solicitud POST a `/api/translate`
- Traducción con texto y campo de configuración regional no válido: solicitud POST a `/api/translate`
- Traducción con campo de texto faltante: solicitud POST a `/api/translate`
- Traducción sin campo de configuración regional: solicitud POST a `/api/translate`
- Traducción con texto vacío: solicitud POST a `/api/translate`
- Traducción con texto que no necesita traducción: solicitud POST a `/api/translate`
# --hints--
I can provide my own project, not the example URL.
Puedo proporcionar mi propio proyecto, no la URL de ejemplo.
```js
(getUserInput) => {
@ -75,7 +75,7 @@ I can provide my own project, not the example URL.
};
```
You can `POST` to `/api/translate` with a body containing `text` with the text to translate and `locale` with either `american-to-british` or `british-to-american`. The returned object should contain the submitted `text` and `translation` with the translated text.
Puedes `POST` a `/api/translate` con un cuerpo que contenga `text` con el texto para traducir y `locale` con `american-to-british` o `british-to-american`. El objeto devuelto debe contener el `text` agregado y la `translation` con el texto traducido.
```js
async (getUserInput) => {
@ -103,7 +103,7 @@ async (getUserInput) => {
};
```
The `/api/translate` route should handle the way time is written in American and British English. For example, ten thirty is written as "10.30" in British English and "10:30" in American English. The `span` element should wrap the entire time string, i.e. `<span class="highlight">10:30</span>`.
La ruta `/api/translate` debe manejar la forma en que se escribe la hora en inglés americano y británico. Por ejemplo, diez treinta se escribe como "10.30" en inglés británico y "10:30" en inglés americano. El elemento `span` debe envolver toda la cadena de tiempo, es decir, `<span class="highlight">10:30</span>`.
```js
async (getUserInput) => {
@ -130,7 +130,7 @@ async (getUserInput) => {
};
```
The `/api/translate` route should also handle the way titles/honorifics are abbreviated in American and British English. For example, Doctor Wright is abbreviated as "Dr Wright" in British English and "Dr. Wright" in American English. See `/components/american-to-british-titles.js` for the different titles your application should handle.
La ruta `/api/translate` también debe manejar la forma en que los títulos/honoríficos se abrevian en inglés americano y británico. Por ejemplo, Doctor Wright es abreviado como "Dr Wright" en inglés británico y "Dr. Wright" en inglés americano. Consulta `/components/american-to-british-titles.js` para los diferentes títulos que tu aplicación debe manejar.
```js
async (getUserInput) => {
@ -157,7 +157,7 @@ async (getUserInput) => {
};
```
Wrap any translated spelling or terms with `<span class="highlight">...</span>` tags so they appear in green.
Envuelve cualquier ortografía traducida o término con las etiquetas `<span class="highlight">...</span>` para que aparezcan en verde.
```js
async (getUserInput) => {
@ -185,7 +185,7 @@ async (getUserInput) => {
};
```
If one or more of the required fields is missing, return `{ error: 'Required field(s) missing' }`.
Si faltan uno o más de los campos requeridos, devuelve `{ error: 'Required field(s) missing' }`.
```js
async (getUserInput) => {
@ -206,7 +206,7 @@ async (getUserInput) => {
};
```
If `text` is empty, return `{ error: 'No text to translate' }`
Si `text` está vacío, devuelve `{ error: 'No text to translate' }`
```js
async (getUserInput) => {
@ -227,7 +227,7 @@ async (getUserInput) => {
};
```
If `locale` does not match one of the two specified locales, return `{ error: 'Invalid value for locale field' }`.
Si `locale` no coincide con uno de los dos locales especificados, devuelve `{ error: 'Invalid value for locale field' }`.
```js
async (getUserInput) => {
@ -249,7 +249,7 @@ async (getUserInput) => {
};
```
If `text` requires no translation, return `"Everything looks good to me!"` for the `translation` value.
Si `text` no requiere traducción, devuelve `"Everything looks good to me!"` para el valor `translation`.
```js
async (getUserInput) => {
@ -276,7 +276,7 @@ async (getUserInput) => {
};
```
All 24 unit tests are complete and passing. See `/tests/1_unit-tests.js` for the expected behavior you should write tests for.
Las 24 unidades de prueba están completas y pasan. Consulta `/tests/1_unit-tests.js` para el comportamiento esperado del cual debes escribir pruebas.
```js
async (getUserInput) => {
@ -301,7 +301,7 @@ async (getUserInput) => {
};
```
All 6 functional tests are complete and passing. See `/tests/2_functional-tests.js` for the functionality you should write tests for.
Las 6 pruebas funcionales están completas y pasan. Consulta `/tests/2_functional-tests.js` para conocer la funcionalidad de la cual debes escribir pruebas.
```js
async (getUserInput) => {

View File

@ -0,0 +1,22 @@
---
id: 561add10cb82ac38a17523bc
title: バックエンド開発と API 認定証
certification: back-end-development-and-apis
challengeType: 7
isPrivate: true
tests:
-
id: bd7158d8c443edefaeb5bdef
title: タイムスタンプ マイクロサービス
-
id: bd7158d8c443edefaeb5bdff
title: リクエストヘッダーパーサー マイクロサービス
-
id: bd7158d8c443edefaeb5bd0e
title: URL 短縮マイクロサービス
-
id: 5a8b073d06fa14fcfde687aa
title: エクササイズ記録アプリ
-
id: bd7158d8c443edefaeb5bd0f
title: ファイルメタデータ マイクロサービス

View File

@ -0,0 +1,23 @@
---
id: 5e46fc95ac417301a38fb934
title: Python によるデータ解析認定証
certification: data-analysis-with-python
challengeType: 7
isPrivate: true
tests:
-
id: 5e46f7e5ac417301a38fb928
title: 平均・分散・標準偏差計算プログラム
-
id: 5e46f7e5ac417301a38fb929
title: 人口統計データ分析プログラム
-
id: 5e46f7f8ac417301a38fb92a
title: 医療データの可視化プログラム
-
id: 5e46f802ac417301a38fb92b
title: ページビュー時系列の可視化プログラム
-
id: 5e4f5c4b570f7e3a4949899f
title: 海面水位の予測プログラム

View File

@ -0,0 +1,22 @@
---
id: 5a553ca864b52e1d8bceea14
title: データ可視化認定証
certification: data-visualization
challengeType: 7
isPrivate: true
tests:
-
id: bd7168d8c242eddfaeb5bd13
title: 棒グラフでデータを可視化する
-
id: bd7178d8c242eddfaeb5bd13
title: 散布図でデータを可視化する
-
id: bd7188d8c242eddfaeb5bd13
title: ヒートマップでデータを可視化する
-
id: 587d7fa6367417b2b2512bbf
title: 階級区分図でデータを可視化する
-
id: 587d7fa6367417b2b2512bc0
title: ツリーマップ図でデータを可視化する

View File

@ -0,0 +1,22 @@
---
id: 561acd10cb82ac38a17513bc
title: フロントエンド開発ライブラリ認定証
certification: front-end-development-libraries
challengeType: 7
isPrivate: true
tests:
-
id: bd7158d8c442eddfaeb5bd13
title: ランダムクォートマシンを作成する
-
id: bd7157d8c242eddfaeb5bd13
title: マークダウンプレビューアを作成する
-
id: 587d7dbc367417b2b2512bae
title: ドラムマシンを作成する
-
id: bd7158d8c442eddfaeb5bd17
title: JavaScript 電卓を作成する
-
id: bd7158d8c442eddfaeb5bd0f
title: 25 + 5 クロックを作成する

View File

@ -0,0 +1,22 @@
---
id: 5e6021435ac9d0ecd8b94b00
title: 情報セキュリティ認定証
certification: information-security
challengeType: 7
isPrivate: true
tests:
-
id: 587d824a367417b2b2512c44
title: 株価チェッカー
-
id: 587d824a367417b2b2512c45
title: 匿名メッセージボード
-
id: 5e46f979ac417301a38fb932
title: ポートスキャナー
-
id: 5e46f983ac417301a38fb933
title: SHA-1 パスワードクラッカー
-
id: 5e601c775ac9d0ecd8b94aff
title: セキュアなリアルタイムマルチプレイヤーゲーム

View File

@ -0,0 +1,22 @@
---
id: 561abd10cb81ac38a17513bc
title: JavaScript のアルゴリズムとデータ構造認定証
certification: javascript-algorithms-and-data-structures
challengeType: 7
isPrivate: true
tests:
-
id: aaa48de84e1ecc7c742e1124
title: 回文チェッカー
-
id: a7f4d8f2483413a6ce226cac
title: ローマ数字への変換
-
id: 56533eb9ac21ba0edf2244e2
title: シーザー暗号
-
id: aff0395860f5d3034dc0bfc9
title: 電話番号の検証
-
id: aa2e6f85cab2ab736c9a9b24
title: キャッシュレジスター

View File

@ -0,0 +1,37 @@
---
id: 660add10cb82ac38a17513be
title: レガシーバックエンド認定証
certification: legacy-back-end
challengeType: 7
isPrivate: true
tests:
-
id: bd7158d8c443edefaeb5bdef
title: タイムスタンプ マイクロサービス
-
id: bd7158d8c443edefaeb5bdff
title: リクエストヘッダーパーサー マイクロサービス
-
id: bd7158d8c443edefaeb5bd0e
title: URL 短縮マイクロサービス
-
id: bd7158d8c443edefaeb5bdee
title: 画像検索抽象化レイヤー
-
id: bd7158d8c443edefaeb5bd0f
title: ファイルメタデータ マイクロサービス
-
id: bd7158d8c443eddfaeb5bdef
title: 投票アプリを作成する
-
id: bd7158d8c443eddfaeb5bdff
title: ナイトライフ調整アプリを作成する
-
id: bd7158d8c443eddfaeb5bd0e
title: 株式市場のチャート
-
id: bd7158d8c443eddfaeb5bd0f
title: 書籍交換クラブを運営する
-
id: bd7158d8c443eddfaeb5bdee
title: Pinterest のクローンを作成する

View File

@ -0,0 +1,37 @@
---
id: 561add10cb82ac39a17513bc
title: レガシーデータ可視化認定証
certification: legacy-data-visualization
challengeType: 7
isPrivate: true
tests:
-
id: bd7157d8c242eddfaeb5bd13
title: マークダウンプレビューアを作成する
-
id: bd7156d8c242eddfaeb5bd13
title: Camper Leaderboard を作成する
-
id: bd7155d8c242eddfaeb5bd13
title: レシピボックスを作成する
-
id: bd7154d8c242eddfaeb5bd13
title: ライフゲームを作成する
-
id: bd7153d8c242eddfaeb5bd13
title: ダンジョン探索ローグライクゲームを作成する
-
id: bd7168d8c242eddfaeb5bd13
title: 棒グラフでデータを可視化する
-
id: bd7178d8c242eddfaeb5bd13
title: 散布図でデータを可視化する
-
id: bd7188d8c242eddfaeb5bd13
title: ヒートマップでデータを可視化する
-
id: bd7198d8c242eddfaeb5bd13
title: 力学モデルによるグラフで国の隣接関係を表示する
-
id: bd7108d8c242eddfaeb5bd13
title: 世界地図にデータをマッピングする

View File

@ -0,0 +1,37 @@
---
id: 561add10cb82ac38a17513be
title: レガシーフロントエンド認定証
certification: legacy-front-end
challengeType: 7
isPrivate: true
tests:
-
id: bd7158d8c242eddfaeb5bd13
title: 個人ポートフォリオのウェブページを作成する
-
id: bd7158d8c442eddfaeb5bd13
title: ランダムクォートマシンを作成する
-
id: bd7158d8c442eddfaeb5bd0f
title: 25 + 5 クロックを作成する
-
id: bd7158d8c442eddfaeb5bd17
title: JavaScript 電卓を作成する
-
id: bd7158d8c442eddfaeb5bd10
title: 現在地の天気を表示する
-
id: bd7158d8c442eddfaeb5bd1f
title: Twitch JSON API を使用する
-
id: bd7158d8c442eddfaeb5bd18
title: Camper News のストーリーのスタイルを設定する
-
id: bd7158d8c442eddfaeb5bd19
title: ウィキペディアビューアを作成する
-
id: bd7158d8c442eedfaeb5bd1c
title: まるばつゲームを作成する
-
id: bd7158d8c442eddfaeb5bd1c
title: サイモンゲームを作成する

View File

@ -0,0 +1,25 @@
---
id: 561add10cb82ac38a17213bd
title: レガシーフルスタック認定証
certification: legacy-full-stack
challengeType: 7
isPrivate: true
tests:
-
id: 561add10cb82ac38a17513bc
title: レスポンシブウェブデザイン認定証
-
id: 561abd10cb81ac38a17513bc
title: JavaScript のアルゴリズムとデータ構造認定証
-
id: 561acd10cb82ac38a17513bc
title: フロントエンドライブラリ認定証
-
id: 5a553ca864b52e1d8bceea14
title: データ可視化認定証
-
id: 561add10cb82ac38a17523bc
title: API およびマイクロサービス認定証
-
id: 561add10cb82ac38a17213bc
title: 従来の情報セキュリティと品質保証認定証

View File

@ -0,0 +1,22 @@
---
id: 561add10cb82ac38a17213bc
title: 従来の情報セキュリティと品質保証認定証
certification: legacy-information-security-and-quality-assurance
challengeType: 7
isPrivate: true
tests:
-
id: 587d8249367417b2b2512c41
title: メートル法とヤード・ポンド法の換算機
-
id: 587d8249367417b2b2512c42
title: 課題トラッカー
-
id: 587d824a367417b2b2512c43
title: 個人図書館
-
id: 587d824a367417b2b2512c44
title: 株価チェッカー
-
id: 587d824a367417b2b2512c45
title: 匿名メッセージボード

View File

@ -0,0 +1,23 @@
---
id: 5e46fc95ac417301a38fb935
title: Python による機械学習認定証
certification: machine-learning-with-python
challengeType: 7
isPrivate: true
tests:
-
id: 5e46f8d6ac417301a38fb92d
title: じゃんけん
-
id: 5e46f8dcac417301a38fb92e
title: 猫と犬の画像分類プログラム
-
id: 5e46f8e3ac417301a38fb92f
title: KNN を使用した書籍推薦エンジン
-
id: 5e46f8edac417301a38fb930
title: 線形回帰による医療費の計算プログラム
-
id: 5e46f8edac417301a38fb931
title: ニューラルネットワークによる SMS テキスト分類プログラム

View File

@ -0,0 +1,23 @@
---
id: 5e611829481575a52dc59c0e
title: 品質保証認定証
certification: quality-assurance
challengeType: 7
isPrivate: true
tests:
-
id: 587d8249367417b2b2512c41
title: メートル法とヤード・ポンド法の換算機
-
id: 587d8249367417b2b2512c42
title: 課題トラッカー
-
id: 587d824a367417b2b2512c43
title: 個人図書館
-
id: 5e601bf95ac9d0ecd8b94afd
title: 数独ソルバー
-
id: 5e601c0d5ac9d0ecd8b94afe
title: アメリカ英語とイギリス英語の変換機

View File

@ -0,0 +1,22 @@
---
id: 606243f50267e718b1e755f4
title: リレーショナルデータベース認定証
certification: relational-databases
challengeType: 7
isPrivate: true
tests:
-
id: 5f1a4ef5d5d6b5ab580fc6ae
title: 天体データベース
-
id: 5f9771307d4d22b9d2b75a94
title: ワールドカップデータベース
-
id: 5f87ac112ae598023a42df1a
title: サロン予約スケジューラー
-
id: 602d9ff222201c65d2a019f2
title: 周期表データベース
-
id: 602da04c22201c65d2a019f4
title: 数当てゲーム

View File

@ -0,0 +1,22 @@
---
id: 561add10cb82ac38a17513bc
title: レスポンシブウェブデザイン認定証
certification: responsive-web-design
challengeType: 7
isPrivate: true
tests:
-
id: bd7158d8c442eddfaeb5bd18
title: トリビュートページを作成する
-
id: 587d78af367417b2b2512b03
title: アンケートフォームを作成する
-
id: 587d78af367417b2b2512b04
title: プロダクトのランディングページを作成する
-
id: 587d78b0367417b2b2512b05
title: テクニカルドキュメントページを作成する
-
id: bd7158d8c242eddfaeb5bd13
title: 個人ポートフォリオのウェブページを作成する

View File

@ -0,0 +1,22 @@
---
id: 5e44431b903586ffb414c951
title: Python による科学計算認定証
certification: scientific-computing-with-python
challengeType: 7
isPrivate: true
tests:
-
id: 5e44412c903586ffb414c94c
title: 計算の縦書き整形プログラム
-
id: 5e444136903586ffb414c94d
title: 時刻計算プログラム
-
id: 5e44413e903586ffb414c94e
title: 予算アプリ
-
id: 5e444147903586ffb414c94f
title: 四角形の面積計算プログラム
-
id: 5e44414f903586ffb414c950
title: 確率計算プログラム

View File

@ -0,0 +1,46 @@
---
id: 587d774c367417b2b2512a9c
title: 視覚障害者のアクセシビリティのために画像の代替テキストを追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cPp7VfD'
forumTopicId: 16628
dashedName: add-a-text-alternative-to-images-for-visually-impaired-accessibility
---
# --description--
他のチャレンジで、`img` タグに `alt` 属性があるのを見たことがあるでしょう。 `alt` テキストは画像の内容を説明するもので、画像に対する代替テキストを提供します。 `alt` 属性は、画像の読み込みに失敗したり、ユーザーがそれを見ることができない場合に役立ちます。 また、検索エンジンが検索結果の画像に含まれているものを理解するためにも使用されます。 例:
```html
<img src="importantLogo.jpeg" alt="Company logo">
```
視覚障害を持つ人々は、ウェブコンテンツをオーディオインターフェースへ変換するためにスクリーンリーダーを利用しています。 視覚的にしか表示されていない場合、彼らは情報を取得できません。 画像の場合、核心となる情報を伝えるために、スクリーンリーダーは `alt` 属性にアクセスしてその内容を読み上げることができます。
良い `alt` テキストは、画像の簡単な説明を読者に提供します。 画像には `alt` 属性を常に含めるようにしましょう。 HTML5 仕様では、これは必須と考えられています。
# --instructions--
Camper Cat はコーディング忍者かつ実際の忍者でもあり、その知識を共有するためにウェブサイトを作成しています。 彼が使用したいプロフィール画像は彼のスキルを表すものなので、すべてのサイト訪問者に認識されるべきです。 `img` タグに `alt` 属性を追加し、Camper Cat が空手をしている様子だと説明してください。 (画像の `src` は実際のファイルにリンクされていないため、`alt` テキストが表示されることが確認できるでしょう。)
# --hints--
`img` タグは空ではない `alt` 属性を持つ必要があります。
```js
assert($('img').attr('alt'));
```
# --seed--
## --seed-contents--
```html
<img src="doingKarateWow.jpeg">
```
# --solutions--
```html
<img src="doingKarateWow.jpeg" alt="Someone doing karate">
```

View File

@ -0,0 +1,105 @@
---
id: 587d778b367417b2b2512aa8
title: 使いやすい日付選択フィールドを追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cR3bRbCV'
forumTopicId: 301008
dashedName: add-an-accessible-date-picker
---
# --description--
フォームはしばしば `input` フィールドをもちます。これにより様々なフォームコントロールを作成することができます。 この要素の `type` 属性は、どの種類の `input` 要素が作成されるかを表します。
`text``submit` タイプには以前のチャレンジで気づいたかもしれません。そして HTML5 では新しい指定オプションとして `date` フィールドが導入されました。 ブラウザのサポート状況に応じて、`input` にフォーカスがある場合、全てのユーザーにとってフォームへの記入が簡単になる日付選択フィールドが表示されます。
古いブラウザでは、このタイプはデフォルトで `text` になるため、念の為 `label``placeholder` を使って期待する日付フォーマットをユーザーに伝えるといいでしょう。
例:
```html
<label for="input1">Enter a date:</label>
<input type="date" id="input1" name="input1">
```
# --instructions--
Camper Cat は Mortal Kombatトーナメントを実施しており、競技参加者にどの日付が最も良いか尋ねたいと思っています。 `input` タグを追加しましょう。`type` 属性には `date` を、`id` 属性には `pickdate`を、`name` 属性には `date` を設定してください。
# --hints--
日付選択フィールドとして `input` タグを追加します。
```js
assert($('input').length == 2);
```
`input` タグは `date` 値が設定された `type` 属性を持つ必要があります。
```js
assert($('input').attr('type') == 'date');
```
`input` タグは `pickdate` 値が設定された `id` 属性を持つ必要があります。
```js
assert($('input').attr('id') == 'pickdate');
```
`input` タグは `date` 値が設定された `name` 属性を持つ必要があります。
```js
assert($('input').attr('name') == 'date');
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Tournaments</h1>
</header>
<main>
<section>
<h2>Mortal Kombat Tournament Survey</h2>
<form>
<p>Tell us the best date for the competition</p>
<label for="pickdate">Preferred Date:</label>
<!-- Only change code below this line -->
<!-- Only change code above this line -->
<input type="submit" name="submit" value="Submit">
</form>
</section>
</main>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Tournaments</h1>
</header>
<main>
<section>
<h2>Mortal Kombat Tournament Survey</h2>
<form>
<p>Tell us the best date for the competition</p>
<label for="pickdate">Preferred Date:</label>
<input type="date" id="pickdate" name="date">
<input type="submit" name="submit" value="Submit">
</form>
</section>
</main>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,74 @@
---
id: 587d778f367417b2b2512aad
title: >-
情報を伝達する色を慎重に選択して色覚の問題を回避する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c437as3'
forumTopicId: 301011
dashedName: >-
avoid-colorblindness-issues-by-carefully-choosing-colors-that-convey-information
---
# --description--
色弱には様々なタイプがあります。 これらには、特定の波長に対する感度が低下するタイプから色が全く見えないタイプまで幅があります。 最も多いタイプは、緑を認識する感度が低下するものです。
例えば、似たような 2 つの緑色をコンテンツの前景色と背景色に使用した場合、色弱者のユーザーはそれを区別できないかもしれません。 近い色はカラーホイール上の隣り合った色として考えることができます。重要な情報を伝える際にはその組み合わせは避けるべきです。
**注:** オンラインカラーピッキングツールには、異なるタイプの色弱者にとってそれらの色がどのように見えるかを視覚的にシミュレーションするものがあります。 オンラインのコントラストチェックツールに加えて、これらは素晴らしいリソースです。
# --instructions--
Camper Cat は重要なボタンにおける異なるスタイルをテストしています。しかし、黄色(`#FFFF33`) の背景色 `background-color` と緑 (`#33FF33`) の文字色 `color` はカラーホイールで隣接した色相なので、一部の色弱者にとってほとんど区別できません。 (これらの色は明度も近く、コントラスト比チェックでも失敗します) テキストの `color` をダークブルー (`#003366`) に変更して、両方の問題を解決します。
# --hints--
`button` のテキストの `color` をダークブルーに変更してください。
```js
assert($('button').css('color') == 'rgb(0, 51, 102)');
```
# --seed--
## --seed-contents--
```html
<head>
<style>
button {
color: #33FF33;
background-color: #FFFF33;
font-size: 14px;
padding: 10px;
}
</style>
</head>
<body>
<header>
<h1>Danger!</h1>
</header>
<button>Delete Internet</button>
</body>
```
# --solutions--
```html
<head>
<style>
button {
color: #003366;
background-color: #FFFF33;
font-size: 14px;
padding: 10px;
}
</style>
</head>
<body>
<header>
<h1>Danger!</h1>
</header>
<button>Delete Internet</button>
</body>
```

View File

@ -0,0 +1,84 @@
---
id: 587d778f367417b2b2512aac
title: 十分なコントラストを使用して色覚の問題を回避する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cmzMEUw'
forumTopicId: 301012
dashedName: avoid-colorblindness-issues-by-using-sufficient-contrast
---
# --description--
色はビジュアルデザインの大部分を占めていますが、アクセシビリティの問題が 2 つあります。 第一に、スクリーンリーダーのユーザーには色が見えないので、重要な情報を伝える唯一の方法として色だけを使用するべきではありません。 第二に、色弱者のユーザーが前景色と背景色の違いを区別できるためには十分なコントラストが必要です。
以前のチャレンジでは、1 つ目の問題に対処するため代替テキストを使う方法を紹介しました。 前回のチャレンジでは、2 つ目の問題の対応に役立つコントラストチェックツールを導入しました。 WCAG 推奨のコントラスト比は 4.5:1 で、カラーでもグレースケールの組み合わせでも適用されます。
色弱者のユーザーは、ある色を他の色と区別するのに苦労することがあります。色相が問題になることが多いですが、時には明度も関係します。 コントラスト比は、前景色と背景色の相対輝度 (または明度) の値を使用して計算されることを覚えているかと思います。
実際には、4.5:1 のコントラスト比は、暗い色にシェーディング (黒を加えること)、明るい色にティンティング (白を加えること) することで達成できます。 カラーホイール上では、暗い色合いはブルー、バイオレット、マゼンタ、レッドだと考えられ、一方で明るい色合いはオレンジ、イエロー、グリーン、ブルーグリーンなどです。
# --instructions--
Camper Cat は、ブログのテキストと背景に色を使うテストを行っています。しかし、緑がかった `background-color` とくり色のテキスト `color` の組み合わせのコントラスト比は 2.5:1 です。 CSSの `hsl()` プロパティ (hue 色相、saturation 彩度、lightness 明度の略) を使用して宣言しているため、3 つ目の引数の値を変えることで色の明度を簡単に調整できます。 `background-color` の明度の値を 35% から 55% に増やし、`color` の明度の値を 20% から 15% に減らします。 これにより、コントラストが 5.9:1 に向上します。
# --hints--
テキストの `color` プロパティの明度の値だけを 15% に変更してください。
```js
assert(code.match(/color:\s*?hsl\(0,\s*?55%,\s*?15%\)/gi));
```
`background-color` プロパティの明度の値だけを 55% に変更してください。
```js
assert(code.match(/background-color:\s*?hsl\(120,\s*?25%,\s*?55%\)/gi));
```
# --seed--
## --seed-contents--
```html
<head>
<style>
body {
color: hsl(0, 55%, 20%);
background-color: hsl(120, 25%, 35%);
}
</style>
</head>
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2>A Word on the Recent Catnip Doping Scandal</h2>
<p>The influence that catnip has on feline behavior is well-documented, and its use as an herbal supplement in competitive ninja circles remains controversial. Once again, the debate to ban the substance is brought to the public's attention after the high-profile win of Kittytron, a long-time proponent and user of the green stuff, at the Claw of Fury tournament.</p>
<p>As I've stated in the past, I firmly believe a true ninja's skills must come from within, with no external influences. My own catnip use shall continue as purely recreational.</p>
</article>
</body>
```
# --solutions--
```html
<head>
<style>
body {
color: hsl(0, 55%, 15%);
background-color: hsl(120, 25%, 55%);
}
</style>
</head>
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2>A Word on the Recent Catnip Doping Scandal</h2>
<p>The influence that catnip has on feline behavior is well-documented, and its use as an herbal supplement in competitive ninja circles remains controversial. Once again, the debate to ban the substance is brought to the public's attention after the high-profile win of Kittytron, a long-time proponent and user of the green stuff, at the Claw of Fury tournament.</p>
<p>As I've stated in the past, I firmly believe a true ninja's skills must come from within, with no external influences. My own catnip use shall continue as purely recreational.</p>
</article>
</body>
```

View File

@ -0,0 +1,75 @@
---
id: 587d778f367417b2b2512aae
title: 説明的なリンクテキストを使用してリンクに意味を与える
challengeType: 0
videoUrl: 'https://scrimba.com/c/c437DcV'
forumTopicId: 301013
dashedName: give-links-meaning-by-using-descriptive-link-text
---
# --description--
スクリーンリーダーのユーザーには、デバイスがどの種類のコンテンツを読み上げるかに関するさまざまなオプションがあります。 これらのオプションには、ランドマーク要素まで (またはその先に) スキップする、メインコンテンツへのジャンプ、見出しからページの要約を取得するなどがあります。 他に、ページで利用可能なリンクだけを聞くこともできます。
この場合、スクリーンリーダーはリンクテキスト、つまりアンカー (`a`) タグの間にあるテキストを読み上げます。 「click here (ここをクリック)」や「read more (詳細を読む)」というリンクの一覧があっても役に立ちません。 代わりに、これらのユーザーにより多くの意味を提供するために、`a` タグ内では簡潔で説明的なテキストを使用してください。
# --instructions--
Camper Cat が使用しているリンクテキストは、周囲のコンテキストがなければあまり意味を成しません。 アンカー (`a`) タグを移動して、`Click here` の代わりに `information about batteries` の周りを囲うようにします。
# --hints--
コードでは、アンカーの `a` タグを `Click here` という単語の周りから `information about batteries` という単語の周りを囲うように移動させる必要があります。
```js
assert(
$('a')
.text()
.match(/^(information about batteries)$/g)
);
```
`a` 要素は空文字列の値 `""` が指定された `href` 属性を持たなければなりません。
```js
assert($('a').attr('href') === '');
```
`a` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/a>/g) &&
code.match(/<\/a>/g).length === code.match(/<a href=(''|"")>/g).length
);
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near. <a href="">Click here</a> for information about batteries</p>
</article>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near. Click here for <a href="">information about batteries</a></p>
</article>
</body>
```

View File

@ -0,0 +1,115 @@
---
id: 587d7789367417b2b2512aa4
title: audio 要素を使用してオーディオコンテンツのアクセシビリティを向上させる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJVkcZ'
forumTopicId: 301014
dashedName: improve-accessibility-of-audio-content-with-the-audio-element
---
# --description--
HTML5 の `audio` 要素は、サウンドやオーディオストリームコンテンツを囲み、セマンティックな意味を与えます。 オーディオコンテンツには、耳が不自由であったり聞こえづらい人々がアクセスできる代替テキストも必要です。 これは、オーディオ要素の近くのテキストや、文字起こしへのリンクで実現できます。
`audio` タグは `controls` 属性をサポートします。 controls 属性により、ブラウザのデフォルトの再生、一時停止、その他のコントロールが表示され、キーボードによる操作ができるようになります。 controls は真偽値属性なので、値は必要ありません。タグ上にこれが存在することで設定がオンになります。
例:
```html
<audio id="meowClip" controls>
<source src="audio/meow.mp3" type="audio/mpeg">
<source src="audio/meow.ogg" type="audio/ogg">
</audio>
```
**注:** 一般的に、マルチメディアコンテンツは視覚的要素と聴覚的要素の両方を持ちます。 視覚障害や聴覚障害を持つユーザーがそれにアクセスできるように、コンテンツに同期したキャプション (字幕) とトランスクリプト (文字起こし) が必要です。 一般に、Web 開発者はキャプションやトランスクリプトを作成する責任を負いませんが、それらを含めることを知っておく必要があります。
# --instructions--
Camper Cat から少し離れる時間を取って、アクセシビリティの達人でありスクリーンリーダーのユーザーでもあるキャンパー仲間、Zersiax (@zersiax) をご紹介します。 彼のスクリーンリーダーが動作する様子の音声を聴くには、`p` の後ろに `audio` 要素を追加します。 `controls` 属性を含めましょう。 次に `audio` タグの中に、`src` 属性に `https://s3.amazonaws.com/freecodecamp/screen-reader.mp3` を、`type` 属性に `"audio/mpeg"` を設定した `source` タグを配置します。
**注:** 音声が高速に聞こえて理解しにくいかもしれませんが、これはスクリーンリーダーのユーザーにとっては通常の速度です。
# --hints--
コードには `audio` タグが 1 つ必要です。
```js
assert($('audio').length === 1);
```
`audio` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/audio>/g).length === 1 &&
code.match(/<audio.*>[\s\S]*<\/audio>/g)
);
```
`audio` タグは `controls` 属性を持つ必要があります。
```js
assert($('audio').attr('controls'));
```
コードには `source` タグが 1 つ必要です。
```js
assert($('source').length === 1);
```
`source` タグは `audio` タグの内側にあるようにしてください。
```js
assert($('audio').children('source').length === 1);
```
`source` タグの `src` 属性の値は、指示内のリンクと正確に一致させる必要があります。
```js
assert(
$('source').attr('src') ===
'https://s3.amazonaws.com/freecodecamp/screen-reader.mp3'
);
```
コードには `source` タグの `type` 属性として audio/mpeg という値を含める必要があります。
```js
assert($('source').attr('type') === 'audio/mpeg');
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Real Coding Ninjas</h1>
</header>
<main>
<p>A sound clip of Zersiax's screen reader in action.</p>
</main>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Real Coding Ninjas</h1>
</header>
<main>
<p>A sound clip of Zersiax's screen reader in action.</p>
<audio controls>
<source src="https://s3.amazonaws.com/freecodecamp/screen-reader.mp3" type="audio/mpeg"/>
</audio>
</main>
</body>
```

View File

@ -0,0 +1,161 @@
---
id: 587d778a367417b2b2512aa5
title: figure 要素を使ってチャートのアクセシビリティを向上させる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cGJMqtE'
forumTopicId: 301015
dashedName: improve-chart-accessibility-with-the-figure-element
---
# --description--
HTML5 では `figure` 要素と、これに関連した `figcaption` が導入されました。 これらを使うことで、視覚的な表現 (画像、図形、チャートなど) をキャプション (説明文) と一緒に囲むことができます。 これにより、意味的に関連するコンテンツをグループ化し、`figure` を説明する代替テキストを提供することもできるため、アクセシビリティを二重に向上させることができます。
チャートなどのデータビジュアライゼーションでは、視覚障害のあるユーザーのために、傾向や結論を簡潔に記したキャプションを使うことができます。 別のチャレンジで、スクリーンリーダーユーザーのために (CSSを利用して) 表形式のチャートデータを画面外に移動させる方法を学びます。
こちらの例を見てください。`figure` タグの中に `figcaption` があり、他の要素と組み合わせることができます。
```html
<figure>
<img src="roundhouseDestruction.jpeg" alt="Photo of Camper Cat executing a roundhouse kick">
<br>
<figcaption>
Master Camper Cat demonstrates proper form of a roundhouse kick.
</figcaption>
</figure>
```
# --instructions--
Camper Cat は、一週間あたりに隠密行動、戦闘、武器のトレーニングへどれだけの時間を費やしたかを示す積み上げ棒グラフの作成に励んでいます。 彼が使用していた `div` タグを `figure` タグに変更し、キャプションを囲んでいる `p` タグを `figcaption` タグに変更することで、彼のページがより良い構造になるよう手伝ってください。
# --hints--
コードには `figure` タグが 1 つ必要です。
```js
assert($('figure').length == 1);
```
コードには `figcaption` タグが 1 つ必要です。
```js
assert($('figcaption').length == 1);
```
コードに `div` タグを含めないでください。
```js
assert($('div').length == 0);
```
コードに `p` タグを含めないでください。
```js
assert($('p').length == 0);
```
`figcaption``figure` タグの子要素である必要があります。
```js
assert($('figure').children('figcaption').length == 1);
```
`figure` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/figure>/g) &&
code.match(/<\/figure>/g).length === code.match(/<figure>/g).length
);
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Training</h1>
<nav>
<ul>
<li><a href="#stealth">Stealth &amp; Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</nav>
</header>
<main>
<section>
<!-- Only change code below this line -->
<div>
<!-- Stacked bar chart will go here -->
<br>
<p>Breakdown per week of time to spend training in stealth, combat, and weapons.</p>
</div>
<!-- Only change code above this line -->
</section>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
</main>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Training</h1>
<nav>
<ul>
<li><a href="#stealth">Stealth &amp; Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</nav>
</header>
<main>
<section>
<figure>
<!-- Stacked bar chart will go here -->
<br>
<figcaption>Breakdown per week of time to spend training in stealth, combat, and weapons.</figcaption>
</figure>
</section>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
</main>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,119 @@
---
id: 587d778a367417b2b2512aa6
title: label 要素を使ってフォームフィールドのアクセシビリティを向上させる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cGJMMAN'
forumTopicId: 301016
dashedName: improve-form-field-accessibility-with-the-label-element
---
# --description--
セマンティックな HTML マークアップでアクセシビリティを向上させるには、適切なタグ名と属性を使用する必要があります。 ここからいくつかのチャレンジでは、フォームで属性を使用する主要なシナリオを学びます。
`label` タグは、指定のフォームコントロール (入力フィールド) アイテムのテキストを囲みます。通常は、選択肢の名前またはラベルを囲みます。 これはアイテムと意味を紐付け、フォームをより読みやすくします。 `label` タグの `for` 属性は `label` とフォームコントロールを明示的に関連付けるもので、スクリーンリーダーが使用します。
「HTML と HTML5 の基礎」セクションのレッスンでラジオボタンとそのラベルについて学びました。 あのレッスンではテキストをクリック可能にするために、ラジオボタンの入力要素をラベルテキストと共に `label` 要素の内側に入れました。 同じことを実現するもう一つの方法が、このレッスンで説明する `for` 属性を使うことです。
`for` 属性の値は必ずフォームコントロールの `id` 属性と同じ値でなければなりません。 例:
```html
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
</form>
```
# --instructions--
Camper Cat は彼の示唆に富んだブログ記事に多くの関心が寄せられるだろうと期待しているので、電子メールのサインアップフォームも設置したいと考えています。 電子メール (Email) の `label``for` 属性に、`input` フィールドの `id` と一致する値を追加してください。
# --hints--
`label` タグの `for` 属性は空にしてはいけません。
```js
assert($('label').attr('for'));
```
`for` 属性の値は電子メールの `input``id` 値と一致している必要があります。
```js
assert($('label').attr('for') == 'email');
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<section>
<form>
<p>Sign up to receive Camper Cat's blog posts by email here!</p>
<label>Email:</label>
<input type="text" id="email" name="email">
<input type="submit" name="submit" value="Submit">
</form>
</section>
<article>
<h2>The Garfield Files: Lasagna as Training Fuel?</h2>
<p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Is Chuck Norris a Cat Person?</h2>
<p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
</article>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<section>
<form>
<p>Sign up to receive Camper Cat's blog posts by email here!</p>
<label for="email">Email:</label>
<input type="text" id="email" name="email">
<input type="submit" name="submit" value="Submit">
</form>
</section>
<article>
<h2>The Garfield Files: Lasagna as Training Fuel?</h2>
<p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Is Chuck Norris a Cat Person?</h2>
<p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
</article>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,80 @@
---
id: 587d778e367417b2b2512aab
title: 高コントラストのテキストで読みやすさを向上させる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cKb3nCq'
forumTopicId: 301017
dashedName: improve-readability-with-high-contrast-text
---
# --description--
前景色と背景色間でコントラストが低いと、テキストが読みづらくなります。 十分なコントラストはコンテンツの可読性を向上させますが、「十分」とは何を意味するのでしょうか?
ウェブコンテンツアクセシビリティガイドライン (Web Content Accessibility Guidelines, WCAG) では、通常のテキストに対して少なくとも 4.5 〜 1 のコントラスト比を推奨しています。 この比率は 2 色の相対輝度値を比較することで算出します。 その範囲は、比率が 1:1 で同じ色だったりコントラストがない場合から、白に対する黒の比率 21:1、つまり最も大きなコントラストがある場合までの値を取ります。 オンラインで利用可能な多くのコントラストチェックツールがあり、この比率を計算できます。
# --instructions--
Camper Cat の最近のブログ記事では明るいグレーに白い背景色を使っていますが、このコントラスト比は 1.5:1 で読み辛くなっています。 テキストの `color` を現在のグレー (`#D3D3D3`) から濃いグレー (`#636363`) に変更し、コントラスト比を 6:1 に改善してください。
# --hints--
`body` のテキストの `color` を濃いグレーに変更してください。
```js
assert($('body').css('color') == 'rgb(99, 99, 99)');
```
`body``background-color` は変更しないでください。
```js
assert($('body').css('background-color') == 'rgb(255, 255, 255)');
```
# --seed--
## --seed-contents--
```html
<head>
<style>
body {
color: #D3D3D3;
background-color: #FFF;
}
</style>
</head>
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2>A Word on the Recent Catnip Doping Scandal</h2>
<p>The influence that catnip has on feline behavior is well-documented, and its use as an herbal supplement in competitive ninja circles remains controversial. Once again, the debate to ban the substance is brought to the public's attention after the high-profile win of Kittytron, a long-time proponent and user of the green stuff, at the Claw of Fury tournament.</p>
<p>As I've stated in the past, I firmly believe a true ninja's skills must come from within, with no external influences. My own catnip use shall continue as purely recreational.</p>
</article>
</body>
```
# --solutions--
```html
<head>
<style>
body {
color: #636363;
background-color: #FFF;
}
</style>
</head>
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2>A Word on the Recent Catnip Doping Scandal</h2>
<p>The influence that catnip has on feline behavior is well-documented, and its use as an herbal supplement in competitive ninja circles remains controversial. Once again, the debate to ban the substance is brought to the public's attention after the high-profile win of Kittytron, a long-time proponent and user of the green stuff, at the Claw of Fury tournament.</p>
<p>As I've stated in the past, I firmly believe a true ninja's skills must come from within, with no external influences. My own catnip use shall continue as purely recreational.</p>
</article>
</body>
```

View File

@ -0,0 +1,62 @@
---
id: 587d774e367417b2b2512a9f
title: main 要素を使用してコンテンツに直接ジャンプする
challengeType: 0
videoUrl: 'https://scrimba.com/c/cPp7zuE'
forumTopicId: 301018
dashedName: jump-straight-to-the-content-using-the-main-element
---
# --description--
HTML5 では、より多くの選択肢を開発者に提供すると同時にアクセシビリティ機能も組み込んだ新しい要素が導入されました。 それらのタグとして特に `main``header``footer``nav``article``section` があります。
デフォルトでは、ブラウザはこれらの要素を特に装飾のない `div` と同じように表示します。 しかし、これらを適切に使用することでマークアップに追加の意味を与えることができます。 タグ名だけでそこに含まれる情報の種類を示すことができるので、そのコンテンツにセマンティックな意味を追加することができます。 アシスティブ・テクノロジー (支援技術) はこの情報にアクセスして、より良いページ要約やナビゲーションオプションをユーザーに提供することができます。
`main` 要素は (名前から推測できる通り) メインコンテンツを囲うために使用されます。この要素は各ページに1つだけであるべきです。 これはページの中心的なトピックに関連する情報を囲むためのものです。 ナビゲーションリンクやバナーなど、ページをまたいで繰り返す項目を含めるべきではありません。
`main` タグには、支援技術でメインコンテンツに素早く移動できるようにするための目印となる機能も埋め込まれています。 ページの上部に「メインコンテンツへ移動」といったリンクがあるのを見たことがあるでしょうか。`main` タグを使用すれば、自動的に支援機器にその機能を提供することができます。
# --instructions--
Camper Cat は忍者の武器に関するページのアイデアを持っています。 (他のチャレンジで説明する) `header``footer` の間に、`main` の開始タグと終了タグを追加して、彼のマークアップ作業を手伝ってあげてください。 今のところ `main` タグは空のままにしておいてください。
# --hints--
コードには `main` タグが1つ必要です。
```js
assert($('main').length == 1);
```
`main` タグは、`header` の終了タグと `footer` の開始タグの間でなければなりません。
```js
assert(code.match(/<\/header>\s*?<main>\s*?<\/main>/gi));
```
# --seed--
## --seed-contents--
```html
<header>
<h1>Weapons of the Ninja</h1>
</header>
<footer></footer>
```
# --solutions--
```html
<header>
<h1>Weapons of the Ninja</h1>
</header>
<main>
</main>
<footer></footer>
```

View File

@ -0,0 +1,76 @@
---
id: 587d774c367417b2b2512a9d
title: 代替テキストを空白のままにする必要がある場合を知る
challengeType: 0
videoUrl: 'https://scrimba.com/c/cM9P4t2'
forumTopicId: 301019
dashedName: know-when-alt-text-should-be-left-blank
---
# --description--
前回のチャレンジでは、`img` タグを使用する際に `alt` 属性の指定が必須であることを学びました。 ただし、既に画像を説明するキャプションとグループ化されていたり、装飾のみに使用されていたりする画像の場合もあります。 これらの場合、`alt` テキストは冗長、もしくは不要かもしれません。
画像が既にテキストコンテンツによって説明されている、もしくは特に意味を持たない画像である場合、`img` には `alt` 属性は引き続き必要ですが、空の文字列が設定可能です。 例:
```html
<img src="visualDecoration.jpeg" alt="">
```
背景画像は通常、「装飾用」画像に分類されます。 ただし、通常これらは CSS ルールによって適用されるため、スクリーンリーダーが処理するマークアップの一部ではありません。
**注:** キャプション付きの画像の場合、サーチエンジンが画像コンテンツの内容を分類するのに役立つので、`alt` テキストを含めると良いでしょう。
# --instructions--
Camper Cat は彼のウェブサイトのブログ部分の骨組みとなるコードを書きました。 二つの記事の間に日本刀の装飾画像を追加し、視覚的な切れ目を入れようとしています。 `img` タグに `alt` 属性を追加し、空の文字列に設定してください。 (注: `src` は実際のファイルとリンクしていません。ディスプレイに刀が表示されていなくても心配ありません。)
# --hints--
`img` 要素には `alt` 属性が必要です。
```js
assert(!($('img').attr('alt') == undefined));
```
`alt` 属性は空文字列に設定する必要があります。
```js
assert($('img').attr('alt') == '');
```
# --seed--
## --seed-contents--
```html
<h1>Deep Thoughts with Master Camper Cat</h1>
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>To Come...</p>
</article>
<img src="samuraiSwords.jpeg">
<article>
<h2>Is Chuck Norris a Cat Person?</h2>
<p>To Come...</p>
</article>
```
# --solutions--
```html
<h1>Deep Thoughts with Master Camper Cat</h1>
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>To Come...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Is Chuck Norris a Cat Person?</h2>
<p>To Come...</p>
</article>
```

View File

@ -0,0 +1,244 @@
---
id: 587d778d367417b2b2512aaa
title: カスタム CSS でスクリーンリーダーにのみ認識される要素を作成する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cJ8QGkhJ'
forumTopicId: 301020
dashedName: make-elements-only-visible-to-a-screen-reader-by-using-custom-css
---
# --description--
応用アクセシビリティでのこれまでチャレンジでは、CSS を一切使用していないことに気付きましたか? これは視覚的な要素を導入するより前に、論理的なドキュメントの概要とコンテンツの周りを意味のあるタグで囲むことの方が重要であることを示しています。
一方で、スクリーンリーダー専用のコンテンツを視覚的に隠したい場合には、CSS のマジックによってページのアクセシビリティを向上させることが可能です。 この状況は、情報が視覚的なフォーマット (チャートなど) である場合に発生します。スクリーンリーダーユーザーがデータにアクセスするためには別の表現 (表など) が必要になります。 CSS は、スクリーンリーダー専用の要素をブラウザ画面の可視エリア以外の場所に配置するために使用されます。
以下はこれを達成するための CSS ルールの例です。
```css
.sr-only {
position: absolute;
left: -10000px;
width: 1px;
height: 1px;
top: auto;
overflow: hidden;
}
```
**注:** 以下の CSS によるアプローチでは同じことができません。
<ul>
<li><code>display: none;</code> または <code>visibility: hidden;</code> はスクリーンリーダーユーザーを含むすべての人からコンテンツを非表示にします。</li>
<li><code>width: 0px; height: 0px;</code> といったピクセルサイズが0の値は、ドキュメントの構成からその要素を取り除くため、スクリーンリーダーもこれを無視することを意味します。</li>
</ul>
# --instructions--
Camper Cat は、トレーニングページ用の非常にクールな積み上げ棒グラフを作成し、視覚障害のあるユーザー用の表データも用意しました。 テーブルには既に `sr-only` クラスがありますが、まだ CSS ルールは入力されていません。 `position``absolute` の値、`left``-10000px` の値、`width``height` 両方に `1px` の値を設定してください。
# --hints--
`sr-only` クラスの `position` プロパティに値 `absolute` を設定する必要があります。
```js
assert($('.sr-only').css('position') == 'absolute');
```
`sr-only` クラスの `left` プロパティに値 `-10000px` を設定する必要があります。
```js
assert($('.sr-only').css('left') == '-10000px');
```
`sr-only` クラスの `width` プロパティに値 `1` ピクセルを設定する必要があります。
```js
assert(code.match(/width:\s*?1px/gi));
```
`sr-only` クラスの `height` プロパティに値 `1` ピクセルを設定する必要があります。
```js
assert(code.match(/height:\s*?1px/gi));
```
# --seed--
## --seed-contents--
```html
<head>
<style>
.sr-only {
position: ;
left: ;
width: ;
height: ;
top: auto;
overflow: hidden;
}
</style>
</head>
<body>
<header>
<h1>Training</h1>
<nav>
<ul>
<li><a href="#stealth">Stealth &amp; Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</nav>
</header>
<section>
<h2>Master Camper Cat's Beginner Three Week Training Program</h2>
<figure>
<!-- Stacked bar chart of weekly training -->
<p>[Stacked bar chart]</p>
<br />
<figcaption>Breakdown per week of time to spend training in stealth, combat, and weapons.</figcaption>
</figure>
<table class="sr-only">
<caption>Hours of Weekly Training in Stealth, Combat, and Weapons</caption>
<thead>
<tr>
<th></th>
<th scope="col">Stealth &amp; Agility</th>
<th scope="col">Combat</th>
<th scope="col">Weapons</th>
<th scope="col">Total</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Week One</th>
<td>3</td>
<td>5</td>
<td>2</td>
<td>10</td>
</tr>
<tr>
<th scope="row">Week Two</th>
<td>4</td>
<td>5</td>
<td>3</td>
<td>12</td>
</tr>
<tr>
<th scope="row">Week Three</th>
<td>4</td>
<td>6</td>
<td>3</td>
<td>13</td>
</tr>
</tbody>
</table>
</section>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye, world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```
# --solutions--
```html
<head>
<style>
.sr-only {
position: absolute;
left: -10000px;
width: 1px;
height: 1px;
top: auto;
overflow: hidden;
}
</style>
</head>
<body>
<header>
<h1>Training</h1>
<nav>
<ul>
<li><a href="#stealth">Stealth &amp; Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</nav>
</header>
<section>
<h2>Master Camper Cat's Beginner Three Week Training Program</h2>
<figure>
<!-- Stacked bar chart of weekly training -->
<p>[Stacked bar chart]</p>
<br />
<figcaption>Breakdown per week of time to spend training in stealth, combat, and weapons.</figcaption>
</figure>
<table class="sr-only">
<caption>Hours of Weekly Training in Stealth, Combat, and Weapons</caption>
<thead>
<tr>
<th></th>
<th scope="col">Stealth &amp; Agility</th>
<th scope="col">Combat</th>
<th scope="col">Weapons</th>
<th scope="col">Total</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Week One</th>
<td>3</td>
<td>5</td>
<td>2</td>
<td>10</td>
</tr>
<tr>
<th scope="row">Week Two</th>
<td>4</td>
<td>5</td>
<td>3</td>
<td>12</td>
</tr>
<tr>
<th scope="row">Week Three</th>
<td>4</td>
<td>6</td>
<td>3</td>
<td>13</td>
</tr>
</tbody>
</table>
</section>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye, world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,106 @@
---
id: 587d7790367417b2b2512aaf
title: HTML アクセスキーでリンクをナビゲーション可能にする
challengeType: 0
videoUrl: 'https://scrimba.com/c/cQvmaTp'
forumTopicId: 301021
dashedName: make-links-navigable-with-html-access-keys
---
# --description--
HTML は要素をアクティブ化したりフォーカスを与えるショートカットキーを指定する `accesskey` 属性を提供します。 `accesskey` 属性を追加することで、キーボードだけを使用するユーザーのナビゲーションがより効率的になります。
HTML5 ではこの属性を任意の要素に使用することができますが、これを対話型の要素に使用すると特に有益です。 これにはリンク、ボタン、フォームコントロールが含まれます。
例:
```html
<button accesskey="b">Important Button</button>
```
# --instructions--
Camper Cat は、2 つのブログ記事タイトル周りのリンクがキーボードショートカットを持つことで、サイトのユーザーがすぐに記事全体のページへ移動できるようにしたいと思っています。 両方のリンクに `accesskey` 属性を追加し、1 番目のものに `g` (Garfield の g) に、2 番目のものに `c` (Chuck Norris の c) を設定します。
# --hints--
コードは `id``first` 値を持つ `a` タグに `accesskey` 属性を追加する必要があります。
```js
assert($('#first').attr('accesskey'));
```
コードは `id``second` 値を持つ `a` タグに `accesskey` 属性を追加する必要があります。
```js
assert($('#second').attr('accesskey'));
```
コードには `id``first` 値を持つ `a` タグに `accesskey` 属性として `g` を設定する必要があります。 大文字・小文字が区別されることに注意してください。
```js
assert($('#first').attr('accesskey') == 'g');
```
コードには `id``second` 値を持つ `a` タグに `accesskey` 属性として `c` を設定する必要があります。 大文字・小文字が区別されることに注意してください。
```js
assert($('#second').attr('accesskey') == 'c');
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2><a id="first" href="#">The Garfield Files: Lasagna as Training Fuel?</a></h2>
<p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
</article>
<article>
<h2><a id="second" href="#">Is Chuck Norris a Cat Person?</a></h2>
<p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
</article>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2><a id="first" accesskey="g" href="#">The Garfield Files: Lasagna as Training Fuel?</a></h2>
<p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
</article>
<article>
<h2><a id="second" accesskey="c" href="#">Is Chuck Norris a Cat Person?</a></h2>
<p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
</article>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,116 @@
---
id: 587d7788367417b2b2512aa3
title: footer の目印でスクリーンリーダーのナビゲーションを容易にする
challengeType: 0
videoUrl: 'https://scrimba.com/c/crVrDh8'
forumTopicId: 301022
dashedName: make-screen-reader-navigation-easier-with-the-footer-landmark
---
# --description--
`header``nav` と同じように、`footer` 要素にも目印になる機能が備わっており、支援機器がそこへ素早く移動することを可能にします。 これは主に著作権情報や関連ドキュメントへのリンクをページの下部に含めるために使用されます。
# --instructions--
Camper Cat のトレーニングページ作成は順調に進んでいます。 彼がページの下部にある著作権情報を囲むために使用した `div``footer` 要素に変更してください。
# --hints--
コードには `footer` タグが 1 つ必要です。
```js
assert($('footer').length == 1);
```
コードに `div` タグを含めないでください。
```js
assert($('div').length == 0);
```
コードには `footer` の開始タグと終了タグが必要です。
```js
assert(code.match(/<footer>\s*&copy; 2018 Camper Cat\s*<\/footer>/g));
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Training</h1>
<nav>
<ul>
<li><a href="#stealth">Stealth &amp; Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</nav>
</header>
<main>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
</main>
<div>&copy; 2018 Camper Cat</div>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Training</h1>
<nav>
<ul>
<li><a href="#stealth">Stealth &amp; Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</nav>
</header>
<main>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
</main>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,111 @@
---
id: 587d7787367417b2b2512aa1
title: header の目印でスクリーンリーダーのナビゲーションを容易にする
challengeType: 0
videoUrl: 'https://scrimba.com/c/cB76vtv'
forumTopicId: 301023
dashedName: make-screen-reader-navigation-easier-with-the-header-landmark
---
# --description--
次の HTML5 要素は、セマンティックな意味を加えてアクセシビリティを向上させる `header` タグです。 これは導入的な情報や、親タグ内のコンテンツのナビゲーションリンクを囲むために使われることが多く、複数ページのトップに繰り返し表示するようなコンテンツを囲むのに役立ちます。
`header``main`でも取り上げた目印を埋め込む機能を共有しており、支援技術がそのコンテンツに素早く移動できるようにします。
**注:** `header` は HTML ドキュメントの `body` タグ内で使用するためのものです。 これはページのタイトルやメタ情報などを含む `head` 要素とは異なるものです。
# --instructions--
Camper Cat は忍者の訓練についてのすばらしい記事を書いていて、そのためのページをサイトに加えたいと思っています。 現在 `h1` を囲んでいる先頭の `div``header` タグへ変更してください。
# --hints--
コードには `header` タグが 1 つ必要です。
```js
assert($('header').length == 1);
```
`header` タグは `h1` 要素を囲む必要があります。
```js
assert($('header').children('h1').length == 1);
```
コードに `div` タグを含めないでください。
```js
assert($('div').length == 0);
```
`header` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/header>/g) &&
code.match(/<\/header>/g).length === code.match(/<header>/g).length
);
```
# --seed--
## --seed-contents--
```html
<body>
<div>
<h1>Training with Camper Cat</h1>
</div>
<main>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
</main>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Training with Camper Cat</h1>
</header>
<main>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
</main>
</body>
```

View File

@ -0,0 +1,121 @@
---
id: 587d7788367417b2b2512aa2
title: nav の目印でスクリーンリーダーのナビゲーションを容易にする
challengeType: 0
videoUrl: 'https://scrimba.com/c/czVwWSv'
forumTopicId: 301024
dashedName: make-screen-reader-navigation-easier-with-the-nav-landmark
---
# --description--
`nav` 要素もまた、スクリーンリーダーのナビゲーションを容易にするために目印を埋め込む機能を持つ HTML5 アイテムです。 このタグはページ内のメインナビゲーションリンクを囲うためのものです。
ページ下部に繰り返し表示されるサイトリンクがある場合は、さらにこれらを `nav` タグでマークアップする必要はありません。 (次のチャレンジで取り上げる) `footer` を使用するだけで十分です。
# --instructions--
Camper Cat はトレーニングページの上部にナビゲーションリンクを設置しましたが、それを `div` で囲っています。 ページのアクセシビリティが向上させるために、`div` タグを `nav` タグに変更してください。
# --hints--
コードには `nav` タグが 1 つ必要です。
```js
assert($('nav').length == 1);
```
`nav` タグは `ul` とそのリストの項目を囲む必要があります。
```js
assert($('nav').children('ul').length == 1);
```
コードに `div` タグを含めないでください。
```js
assert($('div').length == 0);
```
`nav` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/nav>/g) &&
code.match(/<\/nav>/g).length === code.match(/<nav>/g).length
);
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Training with Camper Cat</h1>
<div>
<ul>
<li><a href="#stealth">Stealth &amp; Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</div>
</header>
<main>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
</main>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Training with Camper Cat</h1>
<nav>
<ul>
<li><a href="#stealth">Stealth &amp; Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</nav>
</header>
<main>
<section id="stealth">
<h2>Stealth &amp; Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
</main>
</body>
```

View File

@ -0,0 +1,132 @@
---
id: 587d778c367417b2b2512aa9
title: HTML5 の datetime 属性で時刻を標準化する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cmzMgtz'
forumTopicId: 301025
dashedName: standardize-times-with-the-html5-datetime-attribute
---
# --description--
日付に関する話題を続けます。HTML5 では時刻を標準化する `time` 要素と `datetime` 属性が導入されました。 `time` 要素は、ページ上の日付や時刻をラップできるインライン要素です。 `datetime` 属性は、その日付の有効なフォーマットを保持します。 支援デバイスがこの値にアクセスします。 テキスト中で時刻が非公式または口語的な形式で記載されている場合であっても、標準化された形式の時刻を記述することで混乱を避けることができます。
例:
```html
<p>Master Camper Cat officiated the cage match between Goro and Scorpion <time datetime="2013-02-13">last Wednesday</time>, which ended in a draw.</p>
```
# --instructions--
Camper Cat の Mortal Kombat の調査結果が出ました! `Thursday, September 15<sup>th</sup>` というテキストの周りを `time` タグでラップし、`2016-09-15` が設定された `datetime` 属性を追加してください。
# --hints--
コードには `Thank you to everyone for responding to Master Camper Cat's survey.` のテキストを持つ `p` 要素と、`time` 要素が必要です。
```js
assert(timeElement);
```
追加された `time` タグは `Thursday, September 15<sup>th</sup>` テキストをラップしなければなりません。
```js
assert(
timeElement &&
timeElement?.innerHTML?.trim() === 'Thursday, September 15<sup>th</sup>'
);
```
`time` タグは空ではない `datetime` 属性を持つ必要があります。
```js
assert(datetimeAttr && datetimeAttr?.length);
```
追加された `datetime` 属性には `2016-09-15` の値を設定する必要があります。
```js
assert(datetimeAttr === '2016-09-15');
```
# --seed--
## --after-user-code--
```html
<script>
const pElement = [...document.querySelectorAll("article > p")]
.filter(x => x?.textContent?.includes("Thank you to everyone for responding to Master Camper Cat's survey."));
const timeElement = pElement[0] ? pElement[0].querySelector("time") : null;
const datetimeAttr = timeElement?.getAttribute("datetime");
</script>
```
## --seed-contents--
```html
<body>
<header>
<h1>Tournaments</h1>
</header>
<article>
<h2>Mortal Kombat Tournament Survey Results</h2>
<!-- Only change code below this line -->
<p>Thank you to everyone for responding to Master Camper Cat's survey. The best day to host the vaunted Mortal Kombat tournament is Thursday, September 15<sup>th</sup>. May the best ninja win!</p>
<!-- Only change code above this line -->
<section>
<h3>Comments:</h3>
<article>
<p>Posted by: Sub-Zero on <time datetime="2016-08-13T20:01Z">August 13<sup>th</sup></time></p>
<p>Johnny Cage better be there, I'll finish him!</p>
</article>
<article>
<p>Posted by: Doge on <time datetime="2016-08-15T08:12Z">August 15<sup>th</sup></time></p>
<p>Wow, much combat, so mortal.</p>
</article>
<article>
<p>Posted by: The Grim Reaper on <time datetime="2016-08-16T00:00Z">August 16<sup>th</sup></time></p>
<p>Looks like I'll be busy that day.</p>
</article>
</section>
</article>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Tournaments</h1>
</header>
<article>
<h2>Mortal Kombat Tournament Survey Results</h2>
<p>Thank you to everyone for responding to Master Camper Cat's survey. The best day to host the vaunted Mortal Kombat tournament is <time datetime="2016-09-15">Thursday, September 15<sup>th</sup></time>. May the best ninja win!</p>
<section>
<h3>Comments:</h3>
<article>
<p>Posted by: Sub-Zero on <time datetime="2016-08-13T20:01Z">August 13<sup>th</sup></time></p>
<p>Johnny Cage better be there, I'll finish him!</p>
</article>
<article>
<p>Posted by: Doge on <time datetime="2016-08-15T08:12Z">August 15<sup>th</sup></time></p>
<p>Wow, much combat, so mortal.</p>
</article>
<article>
<p>Posted by: The Grim Reaper on <time datetime="2016-08-16T00:00Z">August 16<sup>th</sup></time></p>
<p>Looks like I'll be busy that day.</p>
</article>
</section>
</article>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,92 @@
---
id: 587d774d367417b2b2512a9e
title: 見出しを使用してコンテンツの階層関係を表す
challengeType: 0
videoUrl: 'https://scrimba.com/c/cqVEktm'
forumTopicId: 301026
dashedName: use-headings-to-show-hierarchical-relationships-of-content
---
# --description--
見出し (`h1` から `h6` 要素) はコンテンツに構造とラベルを付けるのに役立つタグです。 スクリーンリーダーは、ユーザーが概略を把握するためページの見出しのみを読み上げるように設定することができます。 これは、マークアップ内の見出しタグがセマンティック (semantic) な意味を持ち、互いの関係を表していることが重要であることを意味します。大きさだけで見出しを選ぶべきではありません。
*セマンティックな意味*とは、コンテンツを囲むタグがその中にある情報の種類を表していることを意味します。
もしあなたが序論、本文、結論という構成で記事を書いていた場合、本文のサブセクションとして結論を置くことは適切ではないでしょう。 結論は独立したセクションであるべきです。 同様に、ウェブページ内の見出しタグも順番に並べてコンテンツの階層関係を示す必要があります。
同じランク (または上位) の見出しは新しい暗黙的なセクションを開始し、下位ランクの見出しは前のセクションのサブセクションを開始します。
たとえば、いくつかのサブセクションが `h4` 要素でラベル付けされ、`h2` 要素の後につづいているページは、スクリーンリーダーの利用者には分かりにくくなるでしょう。 6 つも選択肢があれば、ブラウザ上の見栄えが良いタグを使いたくなるでしょう。しかし、相対的なサイズを編集するには CSS を使うことができます。
最後のポイントとして、各ページは常に (かつ、たった一つの) `h1` 要素を持たなければなりません。この要素がコンテンツの主題を表します。 この見出しや他の見出しは、検索エンジンがページのトピックを理解するために部分的に使用されます。
# --instructions--
Camper Cat は忍者になる方法についての専用ページをサイト上に作りたいと考えています。 マークアップがコンテンツにセマンティックな意味を与え、セクションの適切な親子関係を表すように、見出しの修正を手伝ってあげてください。 全ての `h5` タグを、`h2` タグのサブセクションであることを示す適切な見出しレベルに変更してください。 そのためには `h3` タグを使用してください。
# --hints--
コードには `h3` 要素が 6 つ必要です。
```js
assert($('h3').length === 6);
```
コードには `h3` の終了タグが 6 つ必要です。
```js
assert((code.match(/\/h3/g) || []).length === 6);
```
コードに `h5` 要素を含めないでください。
```js
assert($('h5').length === 0);
```
コードに `h5` の終了タグを含めないでください。
```js
assert(/\/h5/.test(code) === false);
```
# --seed--
## --seed-contents--
```html
<h1>How to Become a Ninja</h1>
<main>
<h2>Learn the Art of Moving Stealthily</h2>
<h5>How to Hide in Plain Sight</h5>
<h5>How to Climb a Wall</h5>
<h2>Learn the Art of Battle</h2>
<h5>How to Strengthen your Body</h5>
<h5>How to Fight like a Ninja</h5>
<h2>Learn the Art of Living with Honor</h2>
<h5>How to Breathe Properly</h5>
<h5>How to Simplify your Life</h5>
</main>
```
# --solutions--
```html
<h1>How to Become a Ninja</h1>
<main>
<h2>Learn the Art of Moving Stealthily</h2>
<h3>How to Hide in Plain Sight</h3>
<h3>How to Climb a Wall</h3>
<h2>Learn the Art of Battle</h2>
<h3>How to Strengthen your Body</h3>
<h3>How to Fight like a Ninja</h3>
<h2>Learn the Art of Living with Honor</h2>
<h3>How to Breathe Properly</h3>
<h3>How to Simplify your Life</h3>
</main>
```

View File

@ -0,0 +1,144 @@
---
id: 587d7790367417b2b2512ab0
title: tabindex を使用して要素にキーボードフォーカスを追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cmzMDHW'
forumTopicId: 301027
dashedName: use-tabindex-to-add-keyboard-focus-to-an-element
---
# --description--
HTML の `tabindex` 属性は要素のキーボードフォーカスに関連した 3 つの異なる機能を持っています。 これがタグ上にある場合、要素にフォーカス可能なことを示します。 値 (正、負、またはゼロの整数) によって動作が決まります。
リンクやフォームコントロールなどの特定の要素は、ユーザーがページをタブで移動する際、自動的にキーボードフォーカスを受け取ります。 これは要素が HTML ソース上でマークアップされたものと同じ順序です。 これと同じ機能を `div``span``p` といった他の要素に対しても、`tabindex="0"` 属性を配置することで与えることができます。 例:
```html
<div tabindex="0">I need keyboard focus!</div>
```
**注:** 負の `tabindex` 値 (通常 -1) は、要素がフォーカス可能であるものの、キーボードからは到達できないことを示します。 この手法は一般的に、プログラム的にコンテンツへのフォーカスを与えるために使用されます (ポップアップウィンドウで使用される `div` をアクティブにする場合など)。これはこのチャレンジの範囲外です。
# --instructions--
Camper Cat は、ユーザーに関する情報を収集するための新しい調査を作成しました。 彼は入力フィールドが自動的にキーボードフォーカスを得ることを知っていますが、キーボードユーザーがタブで移動する間に説明文で一時停止したいと思っています。 `tabindex` 属性を `p` タグに追加し、値を `0` に設定してください。 ボーナス - `tabindex` を使用することで、CSS の疑似クラス `:focus``p` タグで動作するようになります。
# --hints--
コードではフォームの説明文を保持する `p` タグに `tabindex` 属性を追加してください。
```js
assert($('p').attr('tabindex'));
```
コードには `p` タグの `tabindex` 属性として 0 を設定する必要があります。
```js
assert($('p').attr('tabindex') == '0');
```
# --seed--
## --seed-contents--
```html
<head>
<style>
p:focus {
background-color: yellow;
}
</style>
</head>
<body>
<header>
<h1>Ninja Survey</h1>
</header>
<section>
<form>
<p>Instructions: Fill in ALL your information then click <b>Submit</b></p>
<label for="username">Username:</label>
<input type="text" id="username" name="username"><br>
<fieldset>
<legend>What level ninja are you?</legend>
<input id="newbie" type="radio" name="levels" value="newbie">
<label for="newbie">Newbie Kitten</label><br>
<input id="intermediate" type="radio" name="levels" value="intermediate">
<label for="intermediate">Developing Student</label><br>
<input id="master" type="radio" name="levels" value="master">
<label for="master">9th Life Master</label>
</fieldset>
<br>
<fieldset>
<legend>Select your favorite weapons:</legend>
<input id="stars" type="checkbox" name="weapons" value="stars">
<label for="stars">Throwing Stars</label><br>
<input id="nunchucks" type="checkbox" name="weapons" value="nunchucks">
<label for="nunchucks">Nunchucks</label><br>
<input id="sai" type="checkbox" name="weapons" value="sai">
<label for="sai">Sai Set</label><br>
<input id="sword" type="checkbox" name="weapons" value="sword">
<label for="sword">Sword</label>
</fieldset>
<br>
<input type="submit" name="submit" value="Submit">
</form><br>
</section>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```
# --solutions--
```html
<head>
<style>
p:focus {
background-color: yellow;
}
</style>
</head>
<body>
<header>
<h1>Ninja Survey</h1>
</header>
<section>
<form>
<p tabindex="0">Instructions: Fill in ALL your information then click <b>Submit</b></p>
<label for="username">Username:</label>
<input type="text" id="username" name="username"><br>
<fieldset>
<legend>What level ninja are you?</legend>
<input id="newbie" type="radio" name="levels" value="newbie">
<label for="newbie">Newbie Kitten</label><br>
<input id="intermediate" type="radio" name="levels" value="intermediate">
<label for="intermediate">Developing Student</label><br>
<input id="master" type="radio" name="levels" value="master">
<label for="master">9th Life Master</label>
</fieldset>
<br>
<fieldset>
<legend>Select your favorite weapons:</legend>
<input id="stars" type="checkbox" name="weapons" value="stars">
<label for="stars">Throwing Stars</label><br>
<input id="nunchucks" type="checkbox" name="weapons" value="nunchucks">
<label for="nunchucks">Nunchucks</label><br>
<input id="sai" type="checkbox" name="weapons" value="sai">
<label for="sai">Sai Set</label><br>
<input id="sword" type="checkbox" name="weapons" value="sword">
<label for="sword">Sword</label>
</fieldset>
<br>
<input type="submit" name="submit" value="Submit">
</form><br>
</section>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,160 @@
---
id: 587d7790367417b2b2512ab1
title: tabindex を使用して複数の要素のキーボードフォーカスの順序を指定する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cmzRRcb'
forumTopicId: 301028
dashedName: use-tabindex-to-specify-the-order-of-keyboard-focus-for-several-elements
---
# --description--
`tabindex` 属性は要素をタブ移動する順序も指定することができます。 これは、属性の値が 1 以上の正の数に設定されている場合に行われます。
`tabindex="1"` を設定すると、最初にその要素へキーボードがフォーカスします。 次に、指定された `tabindex` 値 (2、3、など) のシーケンスを循環してから、デフォルトと `tabindex="0"` の項目に移動します。
タブの順序がこのように設定されている場合、(HTML ソースを使用した) デフォルトの順序を上書きすることに注意することが重要です。 これは、ページの上部からナビゲーションが開始すると思っているユーザーを混乱させる可能性があります。 この手法は特定の状況によっては必要になる場合があるかもしれませんが、アクセシビリティの観点からは、これを採用する前に注意してください。
例:
```html
<div tabindex="1">I get keyboard focus, and I get it first!</div>
```
```html
<div tabindex="2">I get keyboard focus, and I get it second!</div>
```
# --instructions--
Camper Cat の Inspirational Quotes のページには検索フィールドがあり、CSS で右上隅に配置させる予定です。 彼は、検索 (search) の `input` と送信 (submit) の `input` のフォームコントロールを、タブで移動する順の最初の 2 つのアイテムにしたいと考えています。 `tabindex` 属性に `1` をセットしたものを `search` `input` に追加し、`tabindex` 属性に `2` をセットしたものを `submit` `input` に追加してください。
もう一つ注意すべきことは、ブラウザーによっては、要素がクリックされるとタブ移動が順序の途中から始まるようになるかもしれないことです。 このページには、常にタブの順序の先頭から始まるようにするための要素が追加してあります。
# --hints--
コードは `search` `input` タグに `tabindex` 属性を追加する必要があります。
```js
assert($('#search').attr('tabindex'));
```
コードは `submit` `input` タグに `tabindex` 属性を追加する必要があります。
```js
assert($('#submit').attr('tabindex'));
```
コードは `search` `input` タグの `tabindex` 属性として 1 を設定する必要があります。
```js
assert($('#search').attr('tabindex') == '1');
```
コードは `submit` `input` タグの`tabindex`属性として 2 を設定する必要があります。
```js
assert($('#submit').attr('tabindex') == '2');
```
# --seed--
## --seed-contents--
```html
<body>
<div tabindex="1" class="overlay"></div>
<header>
<h1>Even Deeper Thoughts with Master Camper Cat</h1>
<nav>
<ul>
<li><a href="">Home</a></li>
<li><a href="">Blog</a></li>
<li><a href="">Training</a></li>
</ul>
</nav>
</header>
<form>
<label for="search">Search:</label>
<input type="search" name="search" id="search">
<input type="submit" name="submit" value="Submit" id="submit">
</form>
<h2>Inspirational Quotes</h2>
<blockquote>
<p>&ldquo;There's no Theory of Evolution, just a list of creatures I've allowed to live.&rdquo;<br>
- Chuck Norris</p>
</blockquote>
<blockquote>
<p>&ldquo;Wise men say forgiveness is divine, but never pay full price for late pizza.&rdquo;<br>
- TMNT</p>
</blockquote>
<footer>&copy; 2018 Camper Cat</footer>
</body>
<style>
body {
height: 100%;
margin: 0 !important;
padding: 8px;
}
.overlay {
margin: -8px;
position: absolute;
width: 100%;
height: 100%;
}
</style>
```
# --solutions--
```html
<body>
<div tabindex="1" class="overlay"></div>
<header>
<h1>Even Deeper Thoughts with Master Camper Cat</h1>
<nav>
<ul>
<li><a href="">Home</a></li>
<li><a href="">Blog</a></li>
<li><a href="">Training</a></li>
</ul>
</nav>
</header>
<form>
<label for="search">Search:</label>
<input tabindex="1" type="search" name="search" id="search">
<input tabindex="2" type="submit" name="submit" value="Submit" id="submit">
</form>
<h2>Inspirational Quotes</h2>
<blockquote>
<p>&ldquo;There's no Theory of Evolution, just a list of creatures I've allowed to live.&rdquo;<br>
- Chuck Norris</p>
</blockquote>
<blockquote>
<p>&ldquo;Wise men say forgiveness is divine, but never pay full price for late pizza.&rdquo;<br>
- TMNT</p>
</blockquote>
<footer>&copy; 2018 Camper Cat</footer>
</body>
<style>
body {
height: 100%;
margin: 0 !important;
padding: 8px;
}
.overlay {
margin: -8px;
position: absolute;
width: 100%;
height: 100%;
}
</style>
```

View File

@ -0,0 +1,92 @@
---
id: 587d774e367417b2b2512aa0
title: コンテンツを article 要素でラップする
challengeType: 0
videoUrl: 'https://scrimba.com/c/cPp79S3'
forumTopicId: 301029
dashedName: wrap-content-in-the-article-element
---
# --description--
`article` は、マークアップにセマンティックな意味を追加する新しい HTML5 要素の 1 つです。 `article` はセクショニング (区分け) 要素であり、独立した自己完結型コンテンツをラップするために使用されます。 このタグはブログのエントリ、フォーラムの投稿、ニュース記事でうまく機能します。
コンテンツが単独で成り立つかどうかは、通常は主観的に判断するしかありませんが、いくつかの簡単なテストを行うこともできます。 全ての周辺コンテキストを削除しても、そのコンテンツはまだ意味を成すでしょうか? 同様に、テキストの場合、それが RSS フィードに流れてきた場合でも意味を成す内容でしょうか。
支援技術を使っている人々は、あなたのサイトをより深く理解するために、系統だって整理された意味的に重要なマークアップに頼っていることを忘れないでください。
**注:** `section` 要素は HTML5 で新たに登場したもので、`article` と少し意味が異なります。 `article` は独立したコンテンツ用で、`section` はテーマに関連するコンテンツをグループ化するためのものです。 必要に応じて、これらはお互いの要素の中で使用することもできます。 例えば、もし本が `article` だとすると、各章は `section` になります。 コンテンツグループ間に関連性がない場合は `div` を使用します。
`<div>` - コンテンツをグループ化する `<section>` - 関連があるコンテンツをグループ化する `<article>` - 独立した、自己完結型コンテンツをグループ化する
# --instructions--
Camper Cat は `article` タグを使ってブログページの投稿を囲いましたが、一番上の投稿にはそれを使うのを忘れてしまいました。 `div` タグを変更し、代わりに `article` タグを使用してください。
# --hints--
コードには `article` タグが3つ必要です。
```js
assert($('article').length == 3);
```
コードに `div` タグを含めないでください。
```js
assert($('div').length == 0);
```
# --seed--
## --seed-contents--
```html
<h1>Deep Thoughts with Master Camper Cat</h1>
<main>
<div>
<h2>The Garfield Files: Lasagna as Training Fuel?</h2>
<p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
</div>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Is Chuck Norris a Cat Person?</h2>
<p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
</article>
</main>
```
# --solutions--
```html
<h1>Deep Thoughts with Master Camper Cat</h1>
<main>
<article>
<h2>The Garfield Files: Lasagna as Training Fuel?</h2>
<p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Is Chuck Norris a Cat Person?</h2>
<p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
</article>
</main>
```

View File

@ -0,0 +1,165 @@
---
id: 587d778b367417b2b2512aa7
title: ラジオボタンを fieldset 要素で囲んでアクセシビリティを向上させる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJVefw'
forumTopicId: 301030
dashedName: wrap-radio-buttons-in-a-fieldset-element-for-better-accessibility
---
# --description--
フォームの次のトピックとして、ラジオボタンのアクセシビリティについて説明します。 前回のチャレンジで説明したように、それぞれの選択肢には対応する項目の `id` に結び付く `for` 属性を持つ `label` が与えられます。 ラジオボタンは、ユーザーがどれか 1 つを選択する必要があるグループ内にあることが多いため、その選択肢がセットの一部であることを意味的に明示する方法があります。
`fieldset` タグでラジオボタンのグループ全体を囲むのがその方法です。 `legend` タグはグループの説明を提供するために使用され、スクリーンリーダーは `fieldset` 要素内の各選択肢と一緒にこの説明を読み上げます。
`fieldset` ラッパーと `legend` タグは、性別のように選択肢から選択内容が自明である場合には必須ではありません。 `label` で各ラジオボタンに `for` 属性を設定して使用するだけで十分です。
例:
```html
<form>
<fieldset>
<legend>Choose one of these three items:</legend>
<input id="one" type="radio" name="items" value="one">
<label for="one">Choice One</label><br>
<input id="two" type="radio" name="items" value="two">
<label for="two">Choice Two</label><br>
<input id="three" type="radio" name="items" value="three">
<label for="three">Choice Three</label>
</fieldset>
</form>
```
# --instructions--
Camper Cat は、ユーザーがメールリストに登録するとき、忍者レベル情報を知りたいと考えています。 彼は前回のチャレンジで、各選択肢に対する `for` 属性を持つ `label` タグを使用してラジオボタンのセットを追加することを学びました。 がんばれ Camper Cat しかし、彼のコードはまだ助けを必要としています。 ラジオボタンを囲む `div` タグを `fieldset` タグに変更し、その中の `p` タグを `legend` タグに変更してください。
# --hints--
ラジオボタンセットの周りに `fieldset` タグがなければなりません。
```js
assert($('fieldset').length == 1);
```
`fieldset` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/fieldset>/g) &&
code.match(/<\/fieldset>/g).length === code.match(/<fieldset>/g).length
);
```
コードには、ユーザーがどのレベルの忍者かを尋ねるテキストの周りに `legend` タグが必要です。
```js
assert($('legend').length == 1);
```
コードに `div` タグを含めないでください。
```js
assert($('div').length == 0);
```
コードには、ユーザーがどのレベルの忍者かを尋ねるテキストの周りの `p` タグが無いようにしてください。
```js
assert($('p').length == 4);
```
# --seed--
## --seed-contents--
```html
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<section>
<form>
<p>Sign up to receive Camper Cat's blog posts by email here!</p>
<label for="email">Email:</label>
<input type="text" id="email" name="email">
<!-- Only change code below this line -->
<div>
<p>What level ninja are you?</p>
<input id="newbie" type="radio" name="levels" value="newbie">
<label for="newbie">Newbie Kitten</label><br>
<input id="intermediate" type="radio" name="levels" value="intermediate">
<label for="intermediate">Developing Student</label><br>
<input id="master" type="radio" name="levels" value="master">
<label for="master">Master</label>
</div>
<!-- Only change code above this line -->
<input type="submit" name="submit" value="Submit">
</form>
</section>
<article>
<h2>The Garfield Files: Lasagna as Training Fuel?</h2>
<p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Is Chuck Norris a Cat Person?</h2>
<p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
</article>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```
# --solutions--
```html
<body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<section>
<form>
<p>Sign up to receive Camper Cat's blog posts by email here!</p>
<label for="email">Email:</label>
<input type="text" id="email" name="email">
<fieldset>
<legend>What level ninja are you?</legend>
<input id="newbie" type="radio" name="levels" value="newbie">
<label for="newbie">Newbie Kitten</label><br>
<input id="intermediate" type="radio" name="levels" value="intermediate">
<label for="intermediate">Developing Student</label><br>
<input id="master" type="radio" name="levels" value="master">
<label for="master">Master</label>
</fieldset>
<input type="submit" name="submit" value="Submit">
</form>
</section>
<article>
<h2>The Garfield Files: Lasagna as Training Fuel?</h2>
<p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near...</p>
</article>
<img src="samuraiSwords.jpeg" alt="">
<article>
<h2>Is Chuck Norris a Cat Person?</h2>
<p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
</article>
<footer>&copy; 2018 Camper Cat</footer>
</body>
```

View File

@ -0,0 +1,154 @@
---
id: 587d781b367417b2b2512abe
title: カードのような要素にボックスシャドウを追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cvVZdUd'
forumTopicId: 301031
dashedName: add-a-box-shadow-to-a-card-like-element
---
# --description--
`box-shadow` プロパティは要素に 1 つ以上の影をつけます。
`box-shadow` プロパティは以下の値をとります。
<ul>
<li><code>offset-x</code> (要素から水平方向に影を押しやる距離),</li>
<li><code>offset-y</code> (要素から垂直方向に影を押しやる距離),</li>
<li><code>blur-radius</code> (ぼかしの半径),</li>
<li><code>spread-radius</code> (影の広がりの半径) と</li>
<li><code>color</code> を、この順で。</li>
</ul>
`blur-radius``spread-radius` の値は省略可能です。
カンマで各 `box-shadow` 要素のプロパティを区切ることで、複数の box-shadow を作成できます。
下記は、複数の影を作る CSS の例です。それぞれの影には、ほとんど透明な黒に多少のぼかしを加えています。
```css
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
```
# --instructions--
要素に `thumbnail` の ID が追加されました。 このセレクターと、上記で例示した CSS の値を使用して、カードに `box-shadow` を追加してください。
# --hints--
`thumbnail` という id に `box-shadow` プロパティを追加する必要があります。
```js
assert(code.match(/#thumbnail\s*?{\s*?box-shadow/g));
```
指定された CSS を `box-shadow` の値に使用してください。
```js
assert(
code.match(
/box-shadow:\s*?0\s+?10px\s+?20px\s+?rgba\(\s*?0\s*?,\s*?0\s*?,\s*?0\s*?,\s*?0?\.19\)\s*?,\s*?0\s+?6px\s+?6px\s+?rgba\(\s*?0\s*?,\s*?0\s*?,\s*?0\s*?,\s*?0?\.23\)/gi
)
);
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
background-color: rgba(45, 45, 45, 0.1);
padding: 10px;
font-size: 27px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard" id="thumbnail">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
background-color: rgba(45, 45, 45, 0.1);
padding: 10px;
font-size: 27px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
#thumbnail {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard" id="thumbnail">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,146 @@
---
id: 587d781b367417b2b2512abc
title: テキストの background-color プロパティを調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cEDqwA6'
forumTopicId: 301032
dashedName: adjust-the-background-color-property-of-text
---
# --description--
前面のテキストを読みやすくするには、全体的な背景やテキストの色を調整する代わりに、強調したいテキストを持つ要素に `background-color` を追加することもできます。 このチャレンジでは `hex` (16進数) コードや通常の `rgb()` ではなく、`rgba()` を使います。
<blockquote>rgba は以下の略です:<br>  r = red<br>  g = green<br>  b = blue<br>  a = alpha/不透明度のレベル</blockquote>
RGB 値は 0255 の範囲の値を取ることができます。 アルファ値は、完全に不透明である 1 から、完全に透明な 0 までの範囲の値を取ることができます。 `rgba()` を使うと不透明度を調整できるため、このチャレンジでの使い方に最適です。 背景を完全にブロックしなくても良いということです。
このチャレンジでは `background-color: rgba(45, 45, 45, 0.1)` を使用します。 不透明度が 0.1 と低いので、ほぼ透明な濃い灰色になります。
# --instructions--
テキストをより目立たせるために、`h4` 要素の `background-color` を与えられた `rgba()` の値に設定してください。
更に `h4` について、`height` プロパティを削除し、10px の `padding` を追加してください。
# --hints--
`h4` 要素に `background-color` プロパティを追加し `rgba(45, 45, 45, 0.1)` に設定してください。
```js
assert(
/(background-color|background):rgba\(45,45,45,0?\.1\)(;?}|;)/gi.test(
code.replace(/\s/g, '')
)
);
```
`h4` 要素に `padding` プロパティを追加し、10 ピクセルに設定してください。
```js
assert(
$('h4').css('padding-top') == '10px' &&
$('h4').css('padding-right') == '10px' &&
$('h4').css('padding-bottom') == '10px' &&
$('h4').css('padding-left') == '10px'
);
```
`h4` 要素の `height` プロパティを削除する必要があります。
```js
assert(!($('h4').css('height') == '25px'));
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
padding: 10px;
background-color: rgba(45, 45, 45, 0.1);
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,130 @@
---
id: 587d78a4367417b2b2512ad3
title: 様々な要素の色を補色に調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cWmPpud'
forumTopicId: 301033
dashedName: adjust-the-color-of-various-elements-to-complementary-colors
---
# --description--
補色のチャレンジでは、色相環の反対側にある色を並べて配置するとお互いがより鮮やかに見えることを示しました。 しかし、強い視覚的コントラストはウェブサイト上で過度に使われると目障りになることもあり、補色の背景色の上にテキストを配置すると読み辛くなることもあります。 実際には、いずれかの色が通常は支配的であり、ページ上の特定のコンテンツに視覚的な注意を引くために補色が使われます。
# --instructions--
このページではティール (青緑)(`#09A7A1`) を支配的に使い、補色であるオレンジ (`#FF790E`) を、サインアップボタンを視覚的にハイライトするために使います。 `header``footer``background-color` をどちらも黒からティールに変更してください。 次に、`h2` のテキストの `color` もティールに変更してください。 最後に、`button``background-color` をオレンジに変更してください。
# --hints--
`header` 要素は `background-color`#09A7A1 に設定されている必要があります。
```js
assert($('header').css('background-color') == 'rgb(9, 167, 161)');
```
`footer` 要素は `background-color`#09A7A1 に設定されている必要があります。
```js
assert($('footer').css('background-color') == 'rgb(9, 167, 161)');
```
`h2` 要素は `color`#09A7A1 に設定されている必要があります。
```js
assert($('h2').css('color') == 'rgb(9, 167, 161)');
```
`button` 要素は `background-color`#FF790E に設定されている必要があります。
```js
assert($('button').css('background-color') == 'rgb(255, 121, 14)');
```
# --seed--
## --seed-contents--
```html
<style>
body {
background-color: white;
}
header {
background-color: black;
color: white;
padding: 0.25em;
}
h2 {
color: black;
}
button {
background-color: white;
}
footer {
background-color: black;
color: white;
padding: 0.5em;
}
</style>
<header>
<h1>Cooking with FCC!</h1>
</header>
<main>
<article>
<h2>Machine Learning in the Kitchen</h2>
<p>Join this two day workshop that walks through how to implement cutting-edge snack-getting algorithms with a command line interface. Coding usually involves writing exact instructions, but sometimes you need your computer to execute flexible commands, like <code>fetch Pringles</code>.</p>
<button>Sign Up</button>
</article>
<article>
<h2>Bisection Vegetable Chopping</h2>
<p>This week-long retreat will level-up your coding ninja skills to actual ninja skills. No longer is the humble bisection search limited to sorted arrays or coding interview questions, applying its concepts in the kitchen will have you chopping carrots in O(log n) time before you know it.</p>
<button>Sign Up</button>
</article>
</main>
<br>
<footer>&copy; 2018 FCC Kitchen</footer>
```
# --solutions--
```html
<style>
body {
background-color: white;
}
header {
background-color: #09A7A1;
color: white;
padding: 0.25em;
}
h2 {
color: #09A7A1;
}
button {
background-color: #FF790E;
}
footer {
background-color: #09A7A1;
color: white;
padding: 0.5em;
}
</style>
<header>
<h1>Cooking with FCC!</h1>
</header>
<main>
<article>
<h2>Machine Learning in the Kitchen</h2>
<p>Join this two day workshop that walks through how to implement cutting-edge snack-getting algorithms with a command line interface. Coding usually involves writing exact instructions, but sometimes you need your computer to execute flexible commands, like <code>fetch Pringles</code>.</p>
<button>Sign Up</button>
</article>
<article>
<h2>Bisection Vegetable Chopping</h2>
<p>This week-long retreat will level-up your coding ninja skills to actual ninja skills. No longer is the humble bisection search limited to sorted arrays or coding interview questions, applying its concepts in the kitchen will have you chopping carrots in O(log n) time before you know it.</p>
<button>Sign Up</button>
</article>
</main>
<br>
<footer>&copy; 2018 FCC Kitchen</footer>
```

View File

@ -0,0 +1,118 @@
---
id: 587d7791367417b2b2512ab5
title: height プロパティで要素の高さを調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cEDaDTN'
forumTopicId: 301034
dashedName: adjust-the-height-of-an-element-using-the-height-property
---
# --description--
`width` プロパティと同様に、CSSでは `height` プロパティを使用して要素の高さを指定できます。 下記は画像の高さを 20px に変更する例です:
```css
img {
height: 20px;
}
```
# --instructions--
`height` プロパティを `h4` タグに追加し、25px に設定してください。
**注:** このチャレンジのテストをパスするには、ブラウザのズーム設定を 100% にする必要がある場合があります。
# --hints--
`h4``height` プロパティを 25 ピクセルに変更する必要があります。
```js
assert(
Math.round(document.querySelector('h4').getBoundingClientRect().height) ===
25 &&
/h4{\S*height:25px(;\S*}|})/.test($('style').text().replace(/\s/g, ''))
);
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
}
p {
text-align: justify;
}
.links {
margin-right: 20px;
text-align: left;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
margin-right: 20px;
text-align: left;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,72 @@
---
id: 587d781d367417b2b2512ac8
title: アンカータグのホバー状態を調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cakRGcm'
forumTopicId: 301035
dashedName: adjust-the-hover-state-of-an-anchor-tag
---
# --description--
このチャレンジでは疑似クラスの使い方について触れます。 疑似クラスは、セレクターに追加して要素の特定の状態を選択することができるキーワードです。
例えば、`:hover` という疑似クラスセレクターを使用して、ホバー状態のアンカータグのスタイルを変更することができます。 アンカータグがホバー状態の間だけ `color` を変更する CSS は次の通りです。
```css
a:hover {
color: red;
}
```
# --instructions--
コードエディタに全ての `a` タグを黒に設定する CSS ルールが書かれています。 ユーザーが `a` タグにマウスカーソルを合わせた時には `color` が青になるようルールを追加してください。
# --hints--
アンカータグの `color` は黒のままで、`:hover` 状態に対する CSS ルールを追加してください。
```js
assert($('a').css('color') == 'rgb(0, 0, 0)');
```
アンカータグがホバー状態の時、`color` は青である必要があります。
```js
assert(
code.match(
/a:hover\s*?{\s*?color:\s*?(blue|rgba\(\s*?0\s*?,\s*?0\s*?,\s*?255\s*?,\s*?1\s*?\)|#00F|rgb\(\s*?0\s*?,\s*?0\s*?,\s*?255\s*?\))\s*?;\s*?}/gi
)
);
```
# --seed--
## --seed-contents--
```html
<style>
a {
color: #000;
}
</style>
<a href="https://freecatphotoapp.com/" target="_blank">CatPhotoApp</a>
```
# --solutions--
```html
<style>
a {
color: #000;
}
a:hover {
color: rgba(0,0,255,1);
}
</style>
<a href="https://freecatphotoapp.com/" target="_blank">CatPhotoApp</a>
```

View File

@ -0,0 +1,129 @@
---
id: 587d78a4367417b2b2512ad4
title: 色の色相を調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cPp38TZ'
forumTopicId: 301036
dashedName: adjust-the-hue-of-a-color
---
# --description--
色は色相、彩度、明度など、いくつかの特性を持っています。 CSS3 はこれらの特性を直接指定して色を選択する方法として `hsl()` プロパティを導入しました。
**Hue** (色相) は一般的に人々が「色」と考えるものです。 左端が赤から始まり、真ん中が緑、右端が青の色のスペクトルを思い浮かべた時、ある色がこの線のどこに位置するかを表すのが色相です。 `hsl()` では、色相はスペクトルの代わりに色相環の概念を使用し、円上のその色の角度が 0 から 360 の間の値として与えられます。
**Saturation** (彩度) は色の中のグレーの量です。 彩度が最大の色にはグレーの成分がなく、彩度が最小の色はほぼ完全なグレーです。 これは、最大の彩度を 100% とするパーセンテージで与えられます。
**Lightness** (明度) は色の中の白または黒の量です。 パーセンテージは 0% (黒) から 100% (白) の範囲で与えられ、50% は標準の色になります。
こちらは彩度が最大、明度が標準の色を `hsl()` を使って表した例です。
<table class='table table-striped'><thead><tr><th></th><th>HSL</th></tr></thead><tbody><tr><td></td><td>hsl(0, 100%, 50%)</td></tr><tr><td>黄色</td><td>hsl(60, 100%, 50%)</td></tr><tr><td></td><td>hsl(120, 100%, 50%)</td></tr><tr><td>シアン</td><td>hsl(180, 100%, 50%)</td></tr><tr><td></td><td>hsl(240, 100%, 50%)</td></tr><tr><td>マゼンタ</td><td>hsl(300, 100%, 50%)</td></tr></tbody></table>
# --instructions--
`div` 要素の `background-color` を、クラス名 (`green`, `cyan`, `blue`) に従うように `hsl()` を使って変更してください。 三色とも彩度は最大、明度は標準にしてください。
# --hints--
`hsl()` プロパティを使って、`green` の色を宣言してください。
```js
assert(code.match(/\.green\s*?{\s*?background-color\s*:\s*?hsl/gi));
```
`hsl()` プロパティを使って、`cyan` の色を宣言してください。
```js
assert(code.match(/\.cyan\s*?{\s*?background-color\s*:\s*?hsl/gi));
```
`hsl()` プロパティを使って、`blue` の色を宣言してください。
```js
assert(code.match(/\.blue\s*?{\s*?background-color\s*:\s*?hsl/gi));
```
クラスが `green``div` 要素の `background-color` は緑である必要があります。
```js
assert($('.green').css('background-color') == 'rgb(0, 255, 0)');
```
クラスが `cyan``div` 要素の `background-color` はシアンである必要があります。
```js
assert($('.cyan').css('background-color') == 'rgb(0, 255, 255)');
```
クラスが `blue``div` 要素の `background-color` は青である必要があります。
```js
assert($('.blue').css('background-color') == 'rgb(0, 0, 255)');
```
# --seed--
## --seed-contents--
```html
<style>
body {
background-color: #FFFFFF;
}
.green {
background-color: #000000;
}
.cyan {
background-color: #000000;
}
.blue {
background-color: #000000;
}
div {
display: inline-block;
height: 100px;
width: 100px;
}
</style>
<div class="green"></div>
<div class="cyan"></div>
<div class="blue"></div>
```
# --solutions--
```html
<style>
body {
background-color: #FFFFFF;
}
.green {
background-color: hsl(120, 100%, 50%);
}
.cyan {
background-color: hsl(180, 100%, 50%);
}
.blue {
background-color: hsl(240, 100%, 50%);
}
div {
display: inline-block;
height: 100px;
width: 100px;
}
</style>
<div class="green"></div>
<div class="cyan"></div>
<div class="blue"></div>
```

View File

@ -0,0 +1,119 @@
---
id: 587d781b367417b2b2512abd
title: 段落要素と対比して見出し要素のサイズを調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c3bRPTz'
forumTopicId: 301037
dashedName: adjust-the-size-of-a-heading-element-versus-a-paragraph-element
---
# --description--
見出し要素 (`h1` から `h6`) のフォントサイズは、通常は段落タグのフォントサイズより大きくなるべきです。 そうすることにより、ページ上のあらゆる物のレイアウトと重要度がユーザーにとって視覚的に理解しやすくなります。 要素内のテキストのサイズを調整するには `font-size` プロパティを使用します。
# --instructions--
見出しを段落よりも大幅に大きくするために、`h4` 要素の `font-size` を 27 ピクセルに変更してください。
# --hints--
`h4` 要素に、27 ピクセルに設定した `font-size` プロパティを追加してください。
```js
assert($('h4').css('font-size') == '27px');
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
background-color: rgba(45, 45, 45, 0.1);
padding: 10px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
background-color: rgba(45, 45, 45, 0.1);
padding: 10px;
font-size: 27px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,119 @@
---
id: 587d78a4367417b2b2512ad5
title: 色のトーンを調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cEDJvT7'
forumTopicId: 301038
dashedName: adjust-the-tone-of-a-color
---
# --description--
CSS の `hsl()` オプションでは、色のトーンも簡単に調整することができます。 純粋な色に白を混ぜると淡い色が作れ、黒を加えると暗い色を作れます。 あるいは、グレーを追加したり濃淡の両方によって色調が作られます。 `hsl()` の 's' と 'l' はそれぞれ saturation (彩度) と lightness (明度) を表していることを思い出してください。 彩度のパーセントはグレーの量を変え、明度のパーセントは色の中に白か黒がどれくらいあるかを決定します。 これは、あなたが好きな色のベースの色相があり、そのバリエーションが必要な時に役立ちます。
# --instructions--
すべての要素は `background-color` のデフォルト値として `transparent` を持っています。 私達の `nav` 要素の背景色は今 `cyan` になっているように見えます。その後ろにある要素の `background-color``cyan` に設定されているからです。 `nav` 要素に `background-color` を追加して、同じ `cyan` の色相で、彩度は `80%`、明度は `25%` の値を設定して色調と暗さを変えましょう。
# --hints--
`nav` 要素の `background-color` は、`hsl()` プロパティを使ってトーンを調整されたシアンである必要があります。
```js
assert(
code.match(/nav\s*?{\s*?background-color:\s*?hsl\(180,\s*?80%,\s*?25%\)/gi)
);
```
# --seed--
## --seed-contents--
```html
<style>
header {
background-color: hsl(180, 90%, 35%);
color: #FFFFFF;
}
nav {
}
h1 {
text-indent: 10px;
padding-top: 10px;
}
nav ul {
margin: 0px;
padding: 5px 0px 5px 30px;
}
nav li {
display: inline;
margin-right: 20px;
}
a {
text-decoration: none;
color: inherit;
}
</style>
<header>
<h1>Cooking with FCC!</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Classes</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
```
# --solutions--
```html
<style>
header {
background-color: hsl(180, 90%, 35%);
color: #FFFFFF;
}
nav {
background-color: hsl(180, 80%, 25%);
}
h1 {
text-indent: 10px;
padding-top: 10px;
}
nav ul {
margin: 0px;
padding: 5px 0px 5px 30px;
}
nav li {
display: inline;
margin-right: 20px;
}
a {
text-decoration: none;
color: inherit;
}
</style>
<header>
<h1>Cooking with FCC!</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Classes</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
```

View File

@ -0,0 +1,115 @@
---
id: 587d7791367417b2b2512ab4
title: width プロパティで要素の幅を調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cvVLPtN'
forumTopicId: 301039
dashedName: adjust-the-width-of-an-element-using-the-width-property
---
# --description--
CSS では `width` プロパティを使用して要素の幅を指定できます。 値は相対単位 (`em` など) や、絶対単位 (`px` など)、または親要素に対するパーセンテージなどで指定することができます。 下記は画像の幅を 220px に変更する例です:
```css
img {
width: 220px;
}
```
# --instructions--
カード全体に `width` プロパティを追加して、値を絶対単位 245px に設定してください。 要素の選択には `fullCard` クラスを使用してください。
# --hints--
`fullCard` クラスセレクターを使用して、カードの `width` プロパティを 245 ピクセルに変更する必要があります。
```js
const fullCard = code.match(/\.fullCard\s*{[\s\S]+?[^}]}/g);
assert(
fullCard &&
/width\s*:\s*245px\s*(;|})/gi.test(fullCard[0]) &&
$('.fullCard').css('maxWidth') === 'none'
);
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
}
p {
text-align: justify;
}
.links {
margin-right: 20px;
text-align: left;
}
.fullCard {
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
}
p {
text-align: justify;
}
.links {
margin-right: 20px;
text-align: left;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,141 @@
---
id: 587d78a8367417b2b2512ae5
title: 要素を可変レートでアニメーションさせる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cZ89WA4'
forumTopicId: 301040
dashedName: animate-elements-at-variable-rates
---
# --description--
似たようなアニメーション要素のアニメーション速度を変更する方法は様々です。 これまでは、`animation-iteration-count` プロパティを適用し、`@keyframes` ルールを設定することでそれが実現されていました。
例えば、右のアニメーションは 2 つの星で構成されており、それぞれ `@keyframes` ルールの 20% 時点でサイズと不透明度を縮小・減少させることで、星のまたたきを表現しています。 いずれかの要素に対して `@keyframes` ルールを変更することで、異なる速度で星を輝かせることができます。
# --instructions--
クラス名 `star-1` の要素のアニメーション速度を変更するために、`@keyframes` ルールを 50% に変更します。
# --hints--
`star-1` クラスの `@keyframes` ルールは 50% でなければなりません。
```js
assert(code.match(/twinkle-1\s*?{\s*?50%/g));
```
# --seed--
## --seed-contents--
```html
<style>
.stars {
background-color: white;
height: 30px;
width: 30px;
border-radius: 50%;
animation-iteration-count: infinite;
}
.star-1 {
margin-top: 15%;
margin-left: 60%;
animation-name: twinkle-1;
animation-duration: 1s;
}
.star-2 {
margin-top: 25%;
margin-left: 25%;
animation-name: twinkle-2;
animation-duration: 1s;
}
@keyframes twinkle-1 {
20% {
transform: scale(0.5);
opacity: 0.5;
}
}
@keyframes twinkle-2 {
20% {
transform: scale(0.5);
opacity: 0.5;
}
}
#back {
position: fixed;
padding: 0;
margin: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(black, #000099, #66c2ff, #ffcccc, #ffeee6);
}
</style>
<div id="back"></div>
<div class="star-1 stars"></div>
<div class="star-2 stars"></div>
```
# --solutions--
```html
<style>
.stars {
background-color: white;
height: 30px;
width: 30px;
border-radius: 50%;
animation-iteration-count: infinite;
}
.star-1 {
margin-top: 15%;
margin-left: 60%;
animation-name: twinkle-1;
animation-duration: 1s;
}
.star-2 {
margin-top: 25%;
margin-left: 25%;
animation-name: twinkle-2;
animation-duration: 1s;
}
@keyframes twinkle-1 {
50% {
transform: scale(0.5);
opacity: 0.5;
}
}
@keyframes twinkle-2 {
20% {
transform: scale(0.5);
opacity: 0.5;
}
}
#back {
position: fixed;
padding: 0;
margin: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(black, #000099, #66c2ff, #ffcccc, #ffeee6);
}
</style>
<div id="back"></div>
<div class="star-1 stars"></div>
<div class="star-2 stars"></div>
```

View File

@ -0,0 +1,107 @@
---
id: 587d78a8367417b2b2512ae3
title: アニメーション回数を無限にして要素のアニメーションを継続させる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJDVfq'
forumTopicId: 301041
dashedName: animate-elements-continually-using-an-infinite-animation-count
---
# --description--
これまでのチャレンジでは、アニメーションプロパティのいくつかと `@keyframes` ルールの使用方法について説明しました。 もう一つのアニメーションプロパティとして `animation-iteration-count` があり、これはアニメーションをループさせたい回数を制御できます。 例:
```css
animation-iteration-count: 3;
```
この場合、アニメーションは 3 回実行されると停止します。 しかし、この値を `infinite` に設定することで、アニメーションを継続的に実行させることができます。
# --instructions--
右側の跳ね回るボールのループを繰り返させるには、`animation-iteration-count` プロパティを `infinite` に変更します。
# --hints--
`animation-iteration-count` プロパティの値は `infinite` でなければなりません。
```js
assert($('#ball').css('animation-iteration-count') == 'infinite');
```
# --seed--
## --seed-contents--
```html
<style>
#ball {
width: 100px;
height: 100px;
margin: 50px auto;
position: relative;
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
animation-name: bounce;
animation-duration: 1s;
animation-iteration-count: 3;
}
@keyframes bounce{
0% {
top: 0px;
}
50% {
top: 249px;
width: 130px;
height: 70px;
}
100% {
top: 0px;
}
}
</style>
<div id="ball"></div>
```
# --solutions--
```html
<style>
#ball {
width: 100px;
height: 100px;
margin: 50px auto;
position: relative;
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
animation-name: bounce;
animation-duration: 1s;
animation-iteration-count: infinite;
}
@keyframes bounce{
0% {
top: 0px;
}
50% {
top: 249px;
width: 130px;
height: 70px;
}
100% {
top: 0px;
}
}
</style>
<div id="ball"></div>
```

View File

@ -0,0 +1,155 @@
---
id: 587d78a8367417b2b2512ae6
title: 複数の要素を可変レートでアニメーションさせる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cnpWZc9'
forumTopicId: 301042
dashedName: animate-multiple-elements-at-variable-rates
---
# --description--
前回のチャレンジでは、`@keyframes` ルールを操作することで、2つのよく似たアニメーションの要素に対するアニメーション速度を変更しました。 複数の要素の `animation-duration` を操作することで、同じ目標を達成することができます。
コードエディタで実行されているアニメーションでは、空に3つの星が同じ速度で連続ループでまたたいています。 これらが異なる速度で輝くようにするには、各要素に対して `animation-duration` プロパティを異なる値で設定します。
# --instructions--
`star-1``star-2``star-3` のクラスに属する要素に対して、`animation-duration` の値としてそれぞれ 1s、0.9s、1.1s をセットします。
# --hints--
`star-1` クラスの星が持つ `animation-duration` プロパティは、1 秒のままにします。
```js
assert($('.star-1').css('animation-duration') == '1s');
```
`star-2` クラスの星が持つ `animation-duration` プロパティは、0.9 秒でなければなりません。
```js
assert($('.star-2').css('animation-duration') == '0.9s');
```
`star-3` クラスの星が持つ `animation-duration` プロパティは、1.1 秒でなければなりません。
```js
assert($('.star-3').css('animation-duration') == '1.1s');
```
# --seed--
## --seed-contents--
```html
<style>
.stars {
background-color: white;
height: 30px;
width: 30px;
border-radius: 50%;
animation-iteration-count: infinite;
}
.star-1 {
margin-top: 15%;
margin-left: 60%;
animation-duration: 1s;
animation-name: twinkle;
}
.star-2 {
margin-top: 25%;
margin-left: 25%;
animation-duration: 1s;
animation-name: twinkle;
}
.star-3 {
margin-top: 10%;
margin-left: 50%;
animation-duration: 1s;
animation-name: twinkle;
}
@keyframes twinkle {
20% {
transform: scale(0.5);
opacity: 0.5;
}
}
#back {
position: fixed;
padding: 0;
margin: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(black, #000099, #66c2ff, #ffcccc, #ffeee6);
}
</style>
<div id="back"></div>
<div class="star-1 stars"></div>
<div class="star-2 stars"></div>
<div class="star-3 stars"></div>
```
# --solutions--
```html
<style>
.stars {
background-color: white;
height: 30px;
width: 30px;
border-radius: 50%;
animation-iteration-count: infinite;
}
.star-1 {
margin-top: 15%;
margin-left: 60%;
animation-duration: 1s;
animation-name: twinkle;
}
.star-2 {
margin-top: 25%;
margin-left: 25%;
animation-duration: 0.9s;
animation-name: twinkle;
}
.star-3 {
margin-top: 10%;
margin-left: 50%;
animation-duration: 1.1s;
animation-name: twinkle;
}
@keyframes twinkle {
20% {
transform: scale(0.5);
opacity: 0.5;
}
}
#back {
position: fixed;
padding: 0;
margin: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(black, #000099, #66c2ff, #ffcccc, #ffeee6);
}
</style>
<div id="back"></div>
<div class="star-1 stars"></div>
<div class="star-2 stars"></div>
<div class="star-3 stars"></div>
```

View File

@ -0,0 +1,56 @@
---
id: 587d78a3367417b2b2512ad0
title: margin プロパティで要素を水平方向の中央に配置する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cyLJqU4'
forumTopicId: 301043
dashedName: center-an-element-horizontally-using-the-margin-property
---
# --description--
次のテクニックは、ブロック要素を水平方向の中央に配置する方法です。 これを行う一つの方法は、`margin` の値を auto に設定することです。
この方法は画像に対しても使うことができます。 画像はデフォルトではインライン要素ですが、`display` プロパティを `block` に設定すると、ブロック要素に変更できます。
# --instructions--
値が `auto``margin` プロパティを追加して、`div` を中央に表示させてください。
# --hints--
`div``margin` の値は `auto` に設定される必要があります。
```js
assert(new __helpers.CSSHelp(document).getStyle('div')?.margin === 'auto');
```
# --seed--
## --seed-contents--
```html
<style>
div {
background-color: blue;
height: 100px;
width: 100px;
}
</style>
<div></div>
```
# --solutions--
```html
<style>
div {
background-color: blue;
height: 100px;
width: 100px;
margin: auto;
}
</style>
<div></div>
```

View File

@ -0,0 +1,77 @@
---
id: 587d781e367417b2b2512ac9
title: 要素の相対位置を変更する
challengeType: 0
videoUrl: 'https://scrimba.com/c/czVmMtZ'
forumTopicId: 301044
dashedName: change-an-elements-relative-position
---
# --description--
CSS は各 HTML 要素を独自のボックスとして扱います。これは一般に <dfn>CSS ボックスモデル</dfn> と呼ばれます。 ブロックレベル要素 (見出し、段落、div 要素など) は自動的に新しい行から始まりますが、インライン要素 (画像、span 要素など) は周囲のコンテンツの間にとどまります。 このような要素のデフォルトのレイアウトはドキュメントの <dfn>通常フロー</dfn> と呼ばれますが、CSS にはそれをオーバーライドする position プロパティがあります。
ある要素の position が `relative` に設定されていると、その要素を今の通常フローでの位置を基準に *相対的に* どのように CSS で動かすかを指定することができます。 これは CSS のオフセットプロパティの `left` または `right`, および `top` または `bottom` とセットで使います。 これらは要素を通常の位置から何ピクセル、何 %、または何 em *離す* かを表しています。 下記の例は、段落を下から 10 ピクセル離すように移動します。
```css
p {
position: relative;
bottom: 10px;
}
```
要素の position を relative に変更しても、その要素は通常フローからは削除されません。周りにある要素は、その要素がデフォルトの位置にあるかのように動作します。
**注:** position の変更により、ページの視覚的なレイアウトを柔軟にそして強力に変更できます。 要素の位置がどうであれ、基礎となる HTML のマークアップは整理され、上から下に向かって読んだときに意味が通るようになっているべきであることを覚えておくと良いでしょう。 視覚障害を持つユーザー (スクリーンリーダーのような支援機器を頼りにしているユーザー) があなたのコンテンツにアクセスする際、そのように読みます。
# --instructions--
`h2``position``relative` に変更し、CSS オフセットを使用して、通常フローでの位置の `top` から 15 ピクセル離すように移動させましょう。 周りにある h1 と p 要素の位置には影響がないことを確認してください。
# --hints--
`h2` 要素の `position` プロパティを `relative` に設定してください。
```js
assert($('h2').css('position') == 'relative');
```
CSS オフセットを使用して、`h2` を通常の位置の `top` から相対的に 15px 離して配置する必要があります。
```js
assert($('h2').css('top') == '15px');
```
# --seed--
## --seed-contents--
```html
<style>
h2 {
}
</style>
<body>
<h1>On Being Well-Positioned</h1>
<h2>Move me!</h2>
<p>I still think the h2 is where it normally sits.</p>
</body>
```
# --solutions--
```html
<style>
h2 {
position: relative;
top: 15px;
}
</style>
<body>
<h1>On Being Well-Positioned</h1>
<h2>Move me!</h2>
<p>I still think the h2 is where it normally sits.</p>
</body>
```

View File

@ -0,0 +1,127 @@
---
id: 587d78a8367417b2b2512ae7
title: キーワードでアニメーションのタイミングを変更する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cJKvwCM'
forumTopicId: 301045
dashedName: change-animation-timing-with-keywords
---
# --description--
CSS アニメーションでは、`animation-timing-function` プロパティにより、アニメーション要素がアニメーションの継続時間中に変化する速度を制御します。 車が A 地点から B 地点へ与えられた時間 (`animation-duration` の値) で移動するアニメーションであれば、`animation-timing-function` は車がドライブの過程でどのように加減速するかを示します。
よく使われるオプションに対しては、あらかじめ定義されたキーワードがいくつか用意されています。 たとえば、デフォルト値は `ease` で、これは最初はゆっくりスタートし、途中でスピードを上げ、最終的に再び減速します。 他のオプションとしては、速く始まって減速する `ease-out`、遅く始まって最終的に加速する `ease-in`、全体を通じて一定速度のアニメーションが適用される `linear` が含まれます。
# --instructions--
id `ball1``ball2` の要素に対してそれぞれ `animation-timing-function` プロパティを追加し、`#ball1` に対しては `linear` を、`#ball2` に対しては `ease-out` を設定します。 アニメーション中の要素の動き方の違いに注目してください。`animation-duration` 2 秒の設定は共通しているため、アニメーションは同じタイミングで終了します。
# --hints--
id `ball1` 要素の `animation-timing-function` プロパティの値は `linear` でなければなりません。
```js
const ball1Animation = __helpers.removeWhiteSpace(
$('#ball1').css('animation-timing-function')
);
assert(ball1Animation == 'linear' || ball1Animation == 'cubic-bezier(0,0,1,1)');
```
id `ball2` 要素の `animation-timing-function` プロパティの値は `ease-out` でなければなりません。
```js
const ball2Animation = __helpers.removeWhiteSpace(
$('#ball2').css('animation-timing-function')
);
assert(
ball2Animation == 'ease-out' || ball2Animation == 'cubic-bezier(0,0,0.58,1)'
);
```
# --seed--
## --seed-contents--
```html
<style>
.balls {
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
position: fixed;
width: 50px;
height: 50px;
margin-top: 50px;
animation-name: bounce;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#ball1 {
left:27%;
}
#ball2 {
left:56%;
}
@keyframes bounce {
0% {
top: 0px;
}
100% {
top: 249px;
}
}
</style>
<div class="balls" id="ball1"></div>
<div class="balls" id="ball2"></div>
```
# --solutions--
```html
<style>
.balls {
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
position: fixed;
width: 50px;
height: 50px;
margin-top: 50px;
animation-name: bounce;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#ball1 {
left:27%;
animation-timing-function: linear;
}
#ball2 {
left:56%;
animation-timing-function: ease-out;
}
@keyframes bounce {
0% {
top: 0px;
}
100% {
top: 249px;
}
}
</style>
<div class="balls" id="ball1"></div>
<div class="balls" id="ball2"></div>
```

View File

@ -0,0 +1,81 @@
---
id: 587d78a3367417b2b2512acf
title: 重なっている要素の位置を z-index プロパティで変更する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cM94aHk'
forumTopicId: 301046
dashedName: change-the-position-of-overlapping-elements-with-the-z-index-property
---
# --description--
要素が重なり合うように配置されたとき (例: `position: absolute | relative | fixed | sticky` を使う場合)、HTML マークアップのより後にある要素は、デフォルトでは他の要素の上に表示されます。 ところが、`z-index` プロパティで要素が重なり合う順番を指定することができます。 値は整数でなければならず (小数は不可)、`z-index` プロパティの値が高いほど、低い値を持つ要素よりも上に重ねられます。
# --instructions--
`z-index` プロパティをクラス名 `first` の要素 (赤色の長方形) に追加し、値を 2 に設定して、他の要素 (青色の長方形) の上に重なるようにしてください。
# --hints--
クラスが `first` の要素の `z-index` の値は 2 である必要があります。
```js
assert($('.first').css('z-index') == '2');
```
# --seed--
## --seed-contents--
```html
<style>
div {
width: 60%;
height: 200px;
margin-top: 20px;
}
.first {
background-color: red;
position: absolute;
}
.second {
background-color: blue;
position: absolute;
left: 40px;
top: 50px;
z-index: 1;
}
</style>
<div class="first"></div>
<div class="second"></div>
```
# --solutions--
```html
<style>
div {
width: 60%;
height: 200px;
margin-top: 20px;
}
.first {
background-color: red;
position: absolute;
z-index: 2;
}
.second {
background-color: blue;
position: absolute;
left: 40px;
top: 50px;
z-index: 1;
}
</style>
<div class="first"></div>
<div class="second"></div>
```

View File

@ -0,0 +1,76 @@
---
id: 587d78a5367417b2b2512ad6
title: CSS の線形グラデーションを作成する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cg4dpt9'
forumTopicId: 301047
dashedName: create-a-gradual-css-linear-gradient
---
# --description--
HTML 要素に適用できる色は 1 色のフラットな色相だけではありません。 CSS では、グラデーションとも呼ばれる色の移り変わりを要素の色に使う機能を提供しています。 そのためには `background` プロパティの `linear-gradient()` 関数を使用します。 一般的な構文は次のとおりです:
```css
background: linear-gradient(gradient_direction, color 1, color 2, color 3, ...);
```
最初の引数は、色の遷移が始まる方向を指定します。角度で記述することができ、`90deg` なら水平方向のグラデーションを (左から右に) 作り、`45deg` なら斜めのグラデーションを (左下から右上に) 作ります。 その後に続く引数はグラデーションで使用される色の順序を指定します。
例:
```css
background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));
```
# --instructions--
`div` 要素の `background``linear-gradient()` を使用し、35 度の方向に色が `#CCFFFF` から `#FFCCCC` に変わるように設定してください。
# --hints--
`div` 要素は、指定の方向と色の `linear-gradient``background` を持つ必要があります。
```js
assert(
$('div')
.css('background-image')
.match(
/linear-gradient\(35deg, rgb\(204, 255, 255\), rgb\(255, 204, 204\)\)/gi
)
);
```
# --seed--
## --seed-contents--
```html
<style>
div {
border-radius: 20px;
width: 70%;
height: 400px;
margin: 50px auto;
}
</style>
<div></div>
```
# --solutions--
```html
<style>
div {
border-radius: 20px;
width: 70%;
height: 400px;
margin: 50px auto;
background: linear-gradient(35deg, #CCFFFF, #FFCCCC);
}
</style>
<div></div>
```

View File

@ -0,0 +1,89 @@
---
id: 587d78a6367417b2b2512add
title: CSS を使ってグラフィックを作成する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cEDWPs6'
forumTopicId: 301048
dashedName: create-a-graphic-using-css
---
# --description--
さまざまなセレクターやプロパティを操作することで、面白い形を作ることができます。 比較的簡単に試せるものの一つは三日月の形です。 このチャレンジでは、要素に影を設定する `box-shadow` プロパティと、要素の角の丸みをコントロールする `border-radius` プロパティを使います。
あなたは、透明な丸いオブジェクトと、少し横にずれたくっきりした影を作ります。実際にはこの影が目に見える月の形になります。
丸いオブジェクトを作るには、`border-radius` プロパティが 50% に設定される必要があります。
以前のチャレンジで学んだことを覚えているかもしれませんが、`box-shadow` プロパティは `offset-x`, `offset-y`, `blur-radius`, `spread-radius` そして色の値を、この順番で取ります。 `blur-radius``spread-radius` の値は省略可能です。
# --instructions--
エディタに表示されている正方形の要素を操作して、月の形を作りましょう。 まず `background-color``transparent` に変更し、次に `border-radius` プロパティを 50% に設定し、円の形を作ります。 最後に、`box-shadow` プロパティを変更して `offset-x` を 25px、`offset-y` を 10px、`blur-radius` を 0、`spread-radius` を 0、色を `blue` に設定してください。
# --hints--
`background-color` プロパティの値は `transparent` に設定されている必要があります。
```js
assert(code.match(/background-color:\s*?transparent;/gi));
```
`border-radius` プロパティの値は `50%` に設定されている必要があります。
```js
assert(code.match(/border-radius:\s*?50%;/gi));
```
`box-shadow` プロパティの値は `offset-x` が 25px、`offset-y` が 10px、`blur-radius` が 0、`spread-radius` が 0、最後に色が `blue` に設定されている必要があります。
```js
assert(
code.match(/box-shadow:\s*?25px\s+?10px\s+?0(px)?\s+?0(px)?\s+?blue\s*?;/gi)
);
```
# --seed--
## --seed-contents--
```html
<style>
.center {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100px;
height: 100px;
background-color: blue;
border-radius: 0px;
box-shadow: 25px 10px 10px 10px green;
}
</style>
<div class="center"></div>
```
# --solutions--
```html
<style>
.center {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100px;
height: 100px;
background-color: transparent;
border-radius: 50%;
box-shadow: 25px 10px 0 0 blue;
}
</style>
<div class="center"></div>
```

View File

@ -0,0 +1,122 @@
---
id: 587d781b367417b2b2512abb
title: hr 要素で水平線を作成する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c3bR8t7'
forumTopicId: 301049
dashedName: create-a-horizontal-line-using-the-hr-element
---
# --description--
`hr` タグを使用すると、それを囲む要素の幅を横切る水平線を追加できます。 これは、トピックの変更を表したり、コンテンツをグループごとに視覚的に区切ったりするために使用できます。
# --instructions--
カードのタイトルを含んでいる `h4` の下に、`hr` タグを追加してください。
**注:** HTML では `hr` は自己終了タグであり、終了タグは必要ありません。
# --hints--
コード内でマークアップに `hr` タグを 1 つ追加する必要があります。
```js
assert($('hr').length == 1);
```
`hr` タグはタイトルと段落の間にある必要があります。
```js
assert(code.match(/<\/h4>\s*?<hr(>|\s*?\/>)\s*?<p>/gi));
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4><s>Google</s>Alphabet</h4>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4><s>Google</s>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,146 @@
---
id: 587d78a6367417b2b2512ade
title: CSS と HTML を使ってより複雑な形を作る
challengeType: 0
videoUrl: 'https://scrimba.com/c/cPpz4fr'
forumTopicId: 301050
dashedName: create-a-more-complex-shape-using-css-and-html
---
# --description--
世界で最もポピュラーな形の一つはハート形でしょう。このチャレンジでは純粋な CSS を使ってハート形を作ります。 まず、疑似要素の `::before``::after` を理解する必要があります。 `::before` は選択された要素の最初の子要素である疑似要素を作成し、`::after` は選択された要素の最後の子要素である疑似要素を作成します。 下記の例では、クラス `heart` を持つ要素に長方形を追加するのに `::before` 疑似要素が使われています。
```css
.heart::before {
content: "";
background-color: yellow;
border-radius: 25%;
position: absolute;
height: 50px;
width: 70px;
top: -50px;
left: 5px;
}
```
`::before``::after` の疑似要素が正しく機能するためには、`content` プロパティの定義が必要です。 このプロパティは通常、写真やテキストなどを選択された要素に追加するために使用されます。 `::before``::after` の疑似要素が図形を作るために使われるときにも `content` プロパティは必要ですが、空文字列に設定します。 上の例では、クラス `heart` の要素は、高さ `50px``70px` の黄色の長方形を生成する `::before` 疑似要素を持っています。 この長方形は、25% の `border-radius` が設定されているので丸い角を持っています。また、左端から `5px`、上端より `50px` 上に絶対位置指定で配置されています。
# --instructions--
画面に表示されている要素をハート形に変換しましょう。 `heart::after` セレクターで、`background-color``pink` に、`border-radius` を 50% に変更してください。
次に、クラス `heart` (`heart` のみ) の要素に対し、`transform` プロパティを入力します。 `rotate()` 関数を -45deg を指定して使用してください。
最後に、`heart::before` セレクターの中で `content` プロパティを空文字列に設定してください。
# --hints--
`heart::after` セレクターの `background-color` プロパティは `pink` である必要があります。
```js
const heartAfter = code.match(/\.heart::after\s*{[\s\S]+?[^\}]}/g)[0];
assert(
/({|;)\s*background-color\s*:\s*pink\s*(;|})/g.test(heartAfter)
);
```
`heart::after` セレクターの `border-radius` は 50% である必要があります。
```js
assert(code.match(/border-radius\s*?:\s*?50%/gi).length == 2);
```
`heart` クラスの `transform` プロパティは `rotate()` 関数を使用し、-45deg に設定されている必要があります。
```js
assert(code.match(/transform\s*?:\s*?rotate\(\s*?-45deg\s*?\)/gi));
```
`heart::before` セレクターの `content` は空文字列である必要があります。
```js
assert(code.match(/\.heart::before\s*?{\s*?content\s*?:\s*?("|')\1\s*?;/gi));
```
# --seed--
## --seed-contents--
```html
<style>
.heart {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: pink;
height: 50px;
width: 50px;
transform: ;
}
.heart::after {
background-color: blue;
content: "";
border-radius: 25%;
position: absolute;
width: 50px;
height: 50px;
top: 0px;
left: 25px;
}
.heart::before {
content: ;
background-color: pink;
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: -25px;
left: 0px;
}
</style>
<div class="heart"></div>
```
# --solutions--
```html
<style>
.heart {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: pink;
height: 50px;
width: 50px;
transform: rotate(-45deg);
}
.heart::after {
background-color: pink;
content: "";
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: 0px;
left: 25px;
}
.heart::before {
content: "";
background-color: pink;
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: -25px;
left: 0px;
}
</style>
<div class="heart"></div>
```

View File

@ -0,0 +1,136 @@
---
id: 587d78a7367417b2b2512ae1
title: CSS アニメーションを使って動きを作る
challengeType: 0
videoUrl: 'https://scrimba.com/c/c7amZfW'
forumTopicId: 301051
dashedName: create-movement-using-css-animation
---
# --description--
要素に `fixed``relative` のような `position` が指定されているとき、CSS オフセットプロパティ `right``left``top``bottom` を使ってアニメーションのルールで動きを付けることができます。
下記の例のように、`50%` のキーフレームで `top` プロパティを 50px に設定し、最初 (`0%`) と最後 (`100%`) のキーフレームでは 0px を設定することで、要素を上下に動かすことができます。
```css
@keyframes rainbow {
0% {
background-color: blue;
top: 0px;
}
50% {
background-color: green;
top: 50px;
}
100% {
background-color: yellow;
top: 0px;
}
}
```
# --instructions--
`div` のアニメーションに水平方向の動きを追加しましょう。 `@keyframes` ルールに `left` オフセットプロパティを追加し、rainbow のアニメーションが `0%` で 0 ピクセルから始まり、`50%` で 25 ピクセルになり、`100%` で -25 ピクセルで終わるようにしてください。 エディタにある `top` プロパティは書き換えないようにしてください。アニメーションは垂直方向と水平方向両方の動きを持つ必要があります。
# --hints--
`0%``@keyframes` ルールは、`left` オフセットが 0px である必要があります。
```js
assert(code.match(/[^50]0%\s*?{[\s\S]*?left:\s*?0px(;[\s\S]*?|\s*?)}/gi));
```
`50%``@keyframes` ルールは、`left` オフセットが 25px である必要があります。
```js
assert(code.match(/50%\s*?{[\s\S]*?left:\s*?25px(;[\s\S]*?|\s*?)}/gi));
```
`100%``@keyframes` ルールは、`left` オフセットが -25px である必要があります。
```js
assert(code.match(/100%\s*?{[\s\S]*?left:\s*?-25px(;[\s\S]*?|\s*?)}/gi));
```
# --seed--
## --seed-contents--
```html
<style>
div {
height: 40px;
width: 70%;
background: black;
margin: 50px auto;
border-radius: 5px;
position: relative;
}
#rect {
animation-name: rainbow;
animation-duration: 4s;
}
@keyframes rainbow {
0% {
background-color: blue;
top: 0px;
}
50% {
background-color: green;
top: 50px;
}
100% {
background-color: yellow;
top: 0px;
}
}
</style>
<div id="rect"></div>
```
# --solutions--
```html
<style>
div {
height: 40px;
width: 70%;
background: black;
margin: 50px auto;
border-radius: 5px;
position: relative;
}
#rect {
animation-name: rainbow;
animation-duration: 4s;
}
@keyframes rainbow {
0% {
background-color: blue;
top: 0px;
left: 0px;
}
50% {
background-color: green;
top: 50px;
left: 25px;
}
100% {
background-color: yellow;
top: 0px;
left: -25px;
}
}
</style>
<div id="rect"></div>
```

View File

@ -0,0 +1,50 @@
---
id: 587d78a5367417b2b2512ad8
title: 背景画像としてかすかなパターンを追加してテクスチャを作る
challengeType: 0
videoUrl: 'https://scrimba.com/c/cQdwJC8'
forumTopicId: 301052
dashedName: create-texture-by-adding-a-subtle-pattern-as-a-background-image
---
# --description--
背景に質感やおもしろさを加えて目立つようにする一つの方法は、かすかなパターンを追加することです。 鍵となるのはバランスです。背景が目立ちすぎて前面から注意がそれることは避けたいでしょう。 `background` プロパティは、テクスチャやパターンの画像にリンクするための `url()` 関数をサポートしています。 リンクアドレスは引用符で囲んで括弧内に入れます。
# --instructions--
`https://cdn-media-1.freecodecamp.org/imgr/MJAkxbh.png` の URL を使用して、ページ全体の `background``body` セレクターに設定してください。
# --hints--
`body` 要素の `background` プロパティを、与えられたリンクとともに `url()` で設定してください。
```js
assert(
code.match(
/background(-image)?:\s*?url\(\s*("|'|)https:\/\/cdn-media-1\.freecodecamp\.org\/imgr\/MJAkxbh\.png\2\s*\)/gi
)
);
```
# --seed--
## --seed-contents--
```html
<style>
body {
}
</style>
```
# --solutions--
```html
<style>
body {
background: url("https://cdn-media-1.freecodecamp.org/imgr/MJAkxbh.png");
}
</style>
```

View File

@ -0,0 +1,118 @@
---
id: 587d7791367417b2b2512ab3
title: text-align プロパティで見た目のバランスを作成する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c3b4EAp'
forumTopicId: 301053
dashedName: create-visual-balance-using-the-text-align-property
---
# --description--
本カリキュラムのこのセクションでは、ビジュアルデザインの応用に焦点を当てます。 最初のいくつかのチャレンジでは、例として与えられたカードのレイアウトを見ながらいくつかの原則を説明します。
テキストは多くの場合、ウェブコンテンツの大部分を占めます。 CSS には、テキストをどのように整列させるかによって `text-align` プロパティにいくつかのオプションがあります。
`text-align: justify;` は、各行が等しい幅になるようにテキストの語間を開けます。
`text-align: center;` は、テキストを中央揃えにします。
`text-align: right;` は、テキストを右揃えにします。
そして `text-align: left;` (デフォルト) は、テキストを左揃えにします。
# --instructions--
`h4` タグのテキスト "Google" を中央揃えにしてください。 次に、Google の設立についての情報が書かれた段落タグを両端揃え (justify) にしてください。
# --hints--
`h4` タグの text-align プロパティを使用し、`center` に設定してください。
```js
assert($('h4').css('text-align') == 'center');
```
`p` タグの text-align プロパティを使用し、`justify` に設定してください。
```js
assert($('p').css('text-align') == 'justify');
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
}
p {
}
.links {
margin-right: 20px;
}
.fullCard {
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
}
p {
text-align: justify;
}
.links {
margin-right: 20px;
}
.fullCard {
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,95 @@
---
id: 587d78a7367417b2b2512ae2
title: 要素を左から右にフェードアウトさせて視覚的な方向を表現する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cGJqqAE'
forumTopicId: 301054
dashedName: create-visual-direction-by-fading-an-element-from-left-to-right
---
# --description--
このチャレンジでは、アニメーションされている要素の `opacity` を変更し、画面の右側に行くにつれて徐々に薄くなるようにします。
このアニメーションでは、グラデーション背景の丸い要素は、`@keyframes` ルールに従ってアニメーションの 50% 時点まで右に移動します。
# --instructions--
`ball` という id を持つ要素を対象に、`50%` 時点の `opacity` プロパティを 0.1 に設定して、要素が右に動く際にフェードするようにします。
# --hints--
fade 用の `keyframes` ルールは、50 の時点で `opacity` プロパティを 0.1 に設定します。
```js
assert(
code.match(
/@keyframes fade\s*?{\s*?50%\s*?{\s*?(?:left:\s*?60%;\s*?opacity:\s*?0?\.1;|opacity:\s*?0?\.1;\s*?left:\s*?60%;)/gi
)
);
```
# --seed--
## --seed-contents--
```html
<style>
#ball {
width: 70px;
height: 70px;
margin: 50px auto;
position: fixed;
left: 20%;
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
animation-name: fade;
animation-duration: 3s;
}
@keyframes fade {
50% {
left: 60%;
}
}
</style>
<div id="ball"></div>
```
# --solutions--
```html
<style>
#ball {
width: 70px;
height: 70px;
margin: 50px auto;
position: fixed;
left: 20%;
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
animation-name: fade;
animation-duration: 3s;
}
@keyframes fade {
50% {
left: 60%;
opacity: 0.1;
}
}
</style>
<div id="ball"></div>
```

View File

@ -0,0 +1,134 @@
---
id: 587d781c367417b2b2512abf
title: 要素の不透明度を下げる
challengeType: 0
videoUrl: 'https://scrimba.com/c/c7aKqu4'
forumTopicId: 301055
dashedName: decrease-the-opacity-of-an-element
---
# --description--
CSSの `opacity` プロパティは、アイテムの不透明度を調整したり、逆に透明度を調整するために使用されます。
<blockquote>値 1 は完全に不透明です。<br>値 0.5 は半分透過します。<br>値 0 は完全に透明です。</blockquote>
与えられた値は、元々透明度のある画像であろうと、テキストの文字色や背景の色であろうと関係なく、要素全体に適用されます。
# --instructions--
`links` クラスを使用してアンカータグを選択し、その `opacity` を 0.7 に設定してください。
# --hints--
`links` のクラスを選択して、アンカータグの `opacity` プロパティを 0.7 に設定する必要があります。
```js
assert(
/\.links\s*{([\s\S]*?;)*\s*opacity\s*:\s*0*\.70*\s*(;[\s\S]*?|\s*)}/.test(
$('style').text()
)
);
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
background-color: rgba(45, 45, 45, 0.1);
padding: 10px;
font-size: 27px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
#thumbnail {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard" id="thumbnail">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
background-color: rgba(45, 45, 45, 0.1);
padding: 10px;
font-size: 27px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
opacity: 0.7;
}
#thumbnail {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard" id="thumbnail">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,90 @@
---
id: 587d78a3367417b2b2512ad1
title: 補色について学ぶ
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MD3Tr'
forumTopicId: 301056
dashedName: learn-about-complementary-colors
---
# --description--
色彩理論とそのデザインへの影響は深い話であり、このチャレンジでは基礎のみを取り上げます。 ウェブサイトでは、色を使ってコンテンツに注意を引いたり、感情を呼び起こしたり、視覚的な調和を作ったりすることができます。 異なる色の組み合わせを使うとウェブサイトの外観を大きく変えることができるため、あなたのコンテンツに合うカラーパレットを選ぶには多くのことを考慮することになるでしょう。
色相環は、似たような色相を持つ色は近く、異なる色相を持つ色は遠くに配置された円で、色がお互いにどのような関係にあるかを視覚化するのに便利なツールです。 二つの色が円の反対側にあるとき、それらは補色と呼ばれます。 その二色は混合するとお互いを打ち消し灰色になるという特徴を持っています。 しかし、並べて配置するとより鮮やかに見え、強力な視覚的コントラストを作り出します。
いくつかの補色とその 16 進数コードの例:
<blockquote>赤 (#FF0000) とシアン (#00FFFF)<br>緑 (#00FF00) とマゼンタ (#FF00FF)<br>青 (#0000FF) と黄色 (#FFFF00)</blockquote>
これは、私達の多くが学校で教えられた旧式の RYB カラーモデルとは原色や補色が異なります。 現代の色彩理論では、加法混合の RGB モデル (コンピュータ画面など) や減法混合の CMY(K) モデル (印刷など) を使います。 これは複雑な話になるので詳しくは [こちら](https://en.wikipedia.org/wiki/Color_model) を参照してください。
補色を見つけるための機能を持ったカラーピッキングツールがオンラインでもたくさんあります。
**注:** 色を使うことはページに視覚的なおもしろさを加える強力な方法です。 しかし、色だけで重要な情報を伝えるような使い方をするべきではありません。視覚障害を持つユーザーが内容を理解できない可能性があるためです。 この問題は、応用アクセシビリティのチャレンジで詳しく取り上げます。
# --instructions--
`blue``yellow` のクラスの `background-color` プロパティを、それぞれ対応した色に変更してください。 これらの色を並べると、白い背景と比べた時と見え方が違うことに注目してください。
# --hints--
クラスが `blue``div` 要素の `background-color` は青である必要があります。
```js
assert($('.blue').css('background-color') == 'rgb(0, 0, 255)');
```
クラスが `yellow``div` 要素の `background-color` は黄色である必要があります。
```js
assert($('.yellow').css('background-color') == 'rgb(255, 255, 0)');
```
# --seed--
## --seed-contents--
```html
<style>
body {
background-color: #FFFFFF;
}
.blue {
background-color: #000000;
}
.yellow {
background-color: #000000;
}
div {
display: inline-block;
height: 100px;
width: 100px;
}
</style>
<div class="blue"></div>
<div class="yellow"></div>
```
# --solutions--
```html
<style>
body {
background-color: #FFFFFF;
}
.blue {
background-color: blue;
}
.yellow {
background-color: yellow;
}
div {
display: inline-block;
height: 100px;
width: 100px;
}
</style>
<div class="blue"></div>
<div class="yellow"></div>
```

View File

@ -0,0 +1,114 @@
---
id: 587d78a4367417b2b2512ad2
title: 三次色について学ぶ
challengeType: 0
forumTopicId: 301057
dashedName: learn-about-tertiary-colors
---
# --description--
コンピュータのモニタやデバイスの画面は、赤、緑、青の光の量を組み合わせることによって異なる色を生成します。 これは現代の色彩理論では RGB 加法カラーモデルとして知られています。 赤 (R)、緑 (G)、青 (B) は原色と呼ばれます。 2 つの原色を混合すると、シアン (G + B)、マゼンタ (R + B)、黄色 (R + G) が生成されます。 これらの色は補色のチャレンジに出てきました。 これら二次色は、その色を作る時に使わなかった原色の補色にあたり、色相環ではその原色の反対側に位置します。 例えばマゼンタは赤と青でできており、緑の補色です。
三次色は、ある原色と色相環上で隣合う二次色のどちらかを混合した結果です。 例えば、RGB カラーモデルでは、赤 (原色) と黄色 (二次色) でオレンジ (三次色) が作られます。 これでシンプルな色相環に更に 6 色を加え、12 色になります。
デザインに調和のとれた組み合わせをもたらす色を選択する方法は色々あります。 三次色を使用する一つの例は分裂補色配色 (スプリットコンプリメンタリー) と呼ばれます。 この方法はあるベースカラーから始まり、その補色と隣り合う 2 色とペアにします。 その三色はデザインに強い視覚的コントラストを与えますが、2 つの補色を使うよりも繊細になります。
こちらが分裂補色配色を使用して作成した三色です。
<table class='table table-striped'><thead><tr><th></th><th>16 進数カラーコード</th></tr></thead><thead></thead><tbody><tr><td>オレンジ</td><td>#FF7F00</td></tr><tr><td>シアン</td><td>#00FFFF</td></tr><tr><td>ラズベリー</td><td>#FF007F</td></tr></tbody></table>
# --instructions--
`orange`, `cyan`, `raspberry` クラスの `background-color` プロパティをそれぞれ対応した色に変更してください。 色の名前ではなく、16 進数コードを使用するようにしてください。
# --hints--
クラスが `orange``div` 要素の `background-color` はオレンジである必要があります。
```js
assert($('.orange').css('background-color') == 'rgb(255, 127, 0)');
```
クラスが `cyan``div` 要素の `background-color` はシアンである必要があります。
```js
assert($('.cyan').css('background-color') == 'rgb(0, 255, 255)');
```
クラスが `raspberry``div` 要素の `background-color` はラズベリーである必要があります。
```js
assert($('.raspberry').css('background-color') == 'rgb(255, 0, 127)');
```
色を表すクラスの全ての `background-color` の値は、色の名前ではなく 16 進数コードである必要があります。
```js
assert(!/background-color:\s(orange|cyan|raspberry)/.test(code));
```
# --seed--
## --seed-contents--
```html
<style>
body {
background-color: #FFFFFF;
}
.orange {
background-color: #000000;
}
.cyan {
background-color: #000000;
}
.raspberry {
background-color: #000000;
}
div {
height: 100px;
width: 100px;
margin-bottom: 5px;
}
</style>
<div class="orange"></div>
<div class="cyan"></div>
<div class="raspberry"></div>
```
# --solutions--
```html
<style>
body {
background-color: #FFFFFF;
}
.orange {
background-color: #FF7F00;
}
.cyan {
background-color: #00FFFF;
}
.raspberry {
background-color: #FF007F;
}
div {
height: 100px;
width: 100px;
margin-bottom: 5px;
}
</style>
<div class="orange"></div>
<div class="cyan"></div>
<div class="raspberry"></div>
```

View File

@ -0,0 +1,136 @@
---
id: 587d78a9367417b2b2512ae8
title: ベジェ曲線の仕組みを学ぶ
challengeType: 0
videoUrl: 'https://scrimba.com/c/c9bDrs8'
forumTopicId: 301058
dashedName: learn-how-bezier-curves-work
---
# --description--
前回のチャレンジでは、`animation-timing-function` プロパティと、アニメーションのスピードを時間に伴って変更するキーワードをいくつか紹介しました。 CSS はキーワード以外のオプションも提供しており、ベジェ曲線を使用してアニメーションの動作を細かく制御できます。
CSS アニメーションでは、ベジェ曲線は `cubic-bezier` 関数とともに使用されます。 曲線の形状は、アニメーションがどのように再生されるかを表します。 曲線は、1 × 1 の座標系に配置されます。 この座標系の X 軸はアニメーションの持続時間です (時間軸と考えてください)。そして、Y 軸はアニメーションの変化です。
`cubic-bezier` 関数は 1 × 1 グリッド上の `p0``p1``p2``p3` の 4 つの点で構成されます。 `p0``p3` は固定されています。これらは開始点と終了点であり、常に原点 (0, 0) と (1, 1) にそれぞれ配置されます。 あなたが設定するのは残りの2点の x, y の値です。これらをグリッド上のどこに配置するかでアニメーションの曲線の形状が決まります。 CSSでこの設定を行うには、「アンカー」ポイントと呼ばれる 2 点 `p1``p2` の x, y の値を次の形式で宣言します: `(x1, y1, x2, y2)`。 まとめると、CSS コードにおけるベジェ曲線の例はこのようになります。
```css
animation-timing-function: cubic-bezier(0.25, 0.25, 0.75, 0.75);
```
上の例では、x と y の値は点ごとに等価です (x1 = 0.25 = y1, x2 = 0.75 = y2)。もし幾何学の授業を覚えているなら、これは原点から点 (1, 1) までの直線になることが分かります。 このアニメーションは、アニメーションの継続時間全体を通して要素を線形変化させるもので、`linear` キーワードを使用するのと同じです。 言い換えると、一定の速度で変化するということです。
# --instructions--
id が `ball1` の要素について、`animation-timing-function` プロパティの値を `linear` から、 同等の `cubic-bezier` 関数の値に変更してください。 上記の例で与えられた値を使用してください。
# --hints--
id `ball1` を持つ要素の `animation-timing-function` プロパティの値は、線形 (linear) と等価の `cubic-bezier` 関数でなければなりません。
```js
assert(
$('#ball1').css('animation-timing-function') ==
'cubic-bezier(0.25, 0.25, 0.75, 0.75)'
);
```
id `ball2` を持つ要素の `animation-timing-function` プロパティの値は変更しないでください。
```js
const ball2Animation = __helpers.removeWhiteSpace(
$('#ball2').css('animation-timing-function')
);
assert(
ball2Animation == 'ease-out' || ball2Animation == 'cubic-bezier(0,0,0.58,1)'
);
```
# --seed--
## --seed-contents--
```html
<style>
.balls{
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
position: fixed;
width: 50px;
height: 50px;
margin-top: 50px;
animation-name: bounce;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#ball1 {
left: 27%;
animation-timing-function: linear;
}
#ball2 {
left: 56%;
animation-timing-function: ease-out;
}
@keyframes bounce {
0% {
top: 0px;
}
100% {
top: 249px;
}
}
</style>
<div class="balls" id="ball1"></div>
<div class="balls" id="ball2"></div>
```
# --solutions--
```html
<style>
.balls{
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
position: fixed;
width: 50px;
height: 50px;
margin-top: 50px;
animation-name: bounce;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#ball1 {
left: 27%;
animation-timing-function: cubic-bezier(0.25, 0.25, 0.75, 0.75);
}
#ball2 {
left: 56%;
animation-timing-function: ease-out;
}
@keyframes bounce {
0% {
top: 0px;
}
100% {
top: 249px;
}
}
</style>
<div class="balls" id="ball1"></div>
<div class="balls" id="ball2"></div>
```

View File

@ -0,0 +1,136 @@
---
id: 587d78a7367417b2b2512adf
title: CSS の @keyframes とアニメーションプロパティの仕組みを学ぶ
challengeType: 0
videoUrl: 'https://scrimba.com/c/cakprhv'
forumTopicId: 301059
dashedName: learn-how-the-css-keyframes-and-animation-properties-work
---
# --description--
要素をアニメーションさせるには、アニメーションプロパティと `@keyframes` のルールについて知る必要があります。 アニメーションプロパティはアニメーションがどのように振る舞うべきかを制御し、`@keyframes` ルールはそのアニメーション中に何が起こるかを制御します。 アニメーションプロパティは全部で 8 つあります。 このチャレンジではシンプルな内容にとどめ、最も重要な 2 つのプロパティを取り上げます。
`animation-name` はアニメーションの名前を設定します。この名前は後に続く `@keyframes` で、どのルールがどのアニメーションに適用されるかを CSS に伝えるために使われます。
`animation-duration` はアニメーションの時間の長さを設定します。
`@keyframes` はアニメーション内で時間の経過とともに何が起こるかを指定する方法です。 これは、0% から 100% の範囲で表されるアニメーション中の特定の「フレーム」に対し、CSS プロパティを与えることによって行われます。 これを映画で考えると、0 の CSS プロパティは要素がオーニングのシーンでどのように表示されるかにあたります。 100% の CSS プロパティは最後、エンドロールの直前に要素がどのように表示されるかです。 そして、CSS は魔法のように要素を与えられた時間の長さを通して変化させ、シーンを再生します。 以下は `@keyframes` とアニメーションプロパティの使い方を説明する例です:
```css
#anim {
animation-name: colorful;
animation-duration: 3s;
}
@keyframes colorful {
0% {
background-color: blue;
}
100% {
background-color: yellow;
}
}
```
`anim` という id を持つ要素に対し、上記のコードスニペットは `animation-name``colorful` に、`animation-duration` を 3 秒に設定します。 次に、`@keyframes` のルールが `colorful` という名前のアニメーションプロパティにリンクされています。 このルールでアニメーションの開始時点 (0%) での色は青に設定されており、終了時点 (100%) までに黄色に移り変わります。 設定できるのは最初と最後の変化だけではなく、0% から 100% の任意のパーセンテージで要素のプロパティを設定できます。
# --instructions--
`rect` という id をもつ要素に対し、`animation-name``rainbow` に、`animation-duration` を 4 秒に設定してアニメーションを作成しましょう。 次に、`@keyframes` ルールを宣言します。アニメーション開始時点 (`0%`) の `background-color` は青、中間時点 (`50%`) では緑、終了時点 (`100%`) では黄色に設定してください。
# --hints--
id が `rect` の要素には、値が `rainbow``animation-name` プロパティが必要です。
```js
assert($('#rect').css('animation-name') == 'rainbow');
```
id が `rect` の要素には、値が 4s の `animation-duration` プロパティが必要です。
```js
assert($('#rect').css('animation-duration') == '4s');
```
`@keyframes` ルールは `rainbow` という `animation-name` を使う必要があります。
```js
assert(code.match(/@keyframes\s+?rainbow\s*?{/g));
```
`rainbow` に対する `@keyframes` ルールは、0% 時点で `blue``background-color` を使っている必要があります。
```js
assert(code.match(/0%\s*?{\s*?background-color:\s*?blue;\s*?}/gi));
```
`rainbow` に対する `@keyframes` ルールは、50% 時点で `green``background-color` を使っている必要があります。
```js
assert(code.match(/50%\s*?{\s*?background-color:\s*?green;\s*?}/gi));
```
rainbow に対する `@keyframes` ルールは、100% 時点で `yellow``background-color` を使っている必要があります。
```js
assert(code.match(/100%\s*?{\s*?background-color:\s*?yellow;\s*?}/gi));
```
# --seed--
## --seed-contents--
```html
<style>
div {
height: 40px;
width: 70%;
background: black;
margin: 50px auto;
border-radius: 5px;
}
#rect {
}
</style>
<div id="rect"></div>
```
# --solutions--
```html
<style>
div {
height: 40px;
width: 70%;
background: black;
margin: 50px auto;
border-radius: 5px;
}
#rect {
animation-name: rainbow;
animation-duration: 4s;
}
@keyframes rainbow {
0% {
background-color: blue;
}
50% {
background-color: green;
}
100% {
background-color: yellow;
}
}
</style>
<div id="rect"></div>
```

View File

@ -0,0 +1,90 @@
---
id: 587d781e367417b2b2512acb
title: 絶対位置指定で要素を親要素に固定する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cyLJ7c3'
forumTopicId: 301060
dashedName: lock-an-element-to-its-parent-with-absolute-positioning
---
# --description--
CSS の `position` プロパティの次のオプションは `absolute` です。これは、要素を親コンテナからの相対的な位置に固定します。 `relative` の配置と異なり、このオプションは要素をドキュメントの通常フローから削除するため、周りの項目はその要素を無視します。 CSS オフセットプロパティ (top または bottom および left または right) は位置を調整するために使われます。
絶対位置指定の注意点の一つは、最も近い *position 指定がされている* 祖先要素に対して固定されることです。 親となる項目に position ルールを追加する (一般的に `position: relative;` が使われます) ことをもし忘れると、ブラウザは一連の要素を辿って探し続け、最終的には `body` タグがデフォルトとして使われます。
# --instructions--
`#searchbar` 要素の `position``absolute` と宣言して、親の `section` の右上に固定してください。 `top``right` にそれぞれ 50 ピクセルのオフセットを設定してください。
# --hints--
`#searchbar` 要素の `position``absolute` に設定してください。
```js
assert($('#searchbar').css('position') == 'absolute');
```
50 ピクセルの `top` CSS オフセットを `#searchbar` 要素に使用する必要があります。
```js
assert($('#searchbar').css('top') == '50px');
```
50 ピクセルの `right` CSS オフセットを `#searchbar` 要素に使用する必要があります。
```js
assert($('#searchbar').css('right') == '50px');
```
# --seed--
## --seed-contents--
```html
<style>
#searchbar {
}
section {
position: relative;
}
</style>
<body>
<h1>Welcome!</h1>
<section>
<form id="searchbar">
<label for="search">Search:</label>
<input type="search" id="search" name="search">
<input type="submit" name="submit" value="Go!">
</form>
</section>
</body>
```
# --solutions--
```html
<style>
#searchbar {
position: absolute;
top: 50px;
right: 50px;
}
section {
position: relative;
}
</style>
<body>
<h1>Welcome!</h1>
<section>
<form id="searchbar">
<label for="search">Search:</label>
<input type="search" id="search" name="search">
<input type="submit" name="submit" value="Go!">
</form>
</section>
</body>
```

View File

@ -0,0 +1,120 @@
---
id: 587d781e367417b2b2512acc
title: 固定位置指定で要素をブラウザウィンドウに固定する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MDNUR'
forumTopicId: 301061
dashedName: lock-an-element-to-the-browser-window-with-fixed-positioning
---
# --description--
CSS が提供する次のレイアウトスキームは `fixed` ポジションです。これは絶対位置指定の一種で、要素をブラウザウィンドウに対して相対的に固定します。 絶対位置指定と同様に、固定位置指定も CSS オフセットプロパティとともに使用され、要素をドキュメントの通常フローから削除します。 他のアイテムは固定位置指定された要素がどこに配置されているか知ることができないため、何か他の方法でレイアウトを調整することが必要になる場合があります。
`fixed``absolute` ポジションの重要な違いは、ユーザーがスクロールしたときに、固定位置指定された要素は移動しないことです。
# --instructions--
コード内のナビゲーションバーに `navbar` という id が付けられています。 その `position``fixed` に変更し、オフセットを `top` から 0 ピクセル、`left` から 0 ピクセルに設定してください。 コードを追加したら、プレビューウィンドウをスクロールしてナビゲーションが同じ位置にとどまることを確認してください。
# --hints--
`#navbar` 要素の `position``fixed` に設定してください。
```js
assert($('#navbar').css('position') == 'fixed');
```
0 ピクセルの `top` CSS オフセットを `#navbar` 要素に使用する必要があります。
```js
assert($('#navbar').css('top') == '0px');
```
0 ピクセルの `left` CSS オフセットを `#navbar` 要素に使用する必要があります。
```js
assert($('#navbar').css('left') == '0px');
```
# --seed--
## --seed-contents--
```html
<style>
body {
min-height: 150vh;
}
#navbar {
width: 100%;
background-color: #767676;
}
nav ul {
margin: 0px;
padding: 5px 0px 5px 30px;
}
nav li {
display: inline;
margin-right: 20px;
}
a {
text-decoration: none;
}
</style>
<body>
<header>
<h1>Welcome!</h1>
<nav id="navbar">
<ul>
<li><a href="">Home</a></li>
<li><a href="">Contact</a></li>
</ul>
</nav>
</header>
<p>I shift up when the #navbar is fixed to the browser window.</p>
</body>
```
# --solutions--
```html
<style>
body {
min-height: 150vh;
}
#navbar {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #767676;
}
nav ul {
margin: 0px;
padding: 5px 0px 5px 30px;
}
nav li {
display: inline;
margin-right: 20px;
}
a {
text-decoration: none;
}
</style>
<body>
<header>
<h1>Welcome!</h1>
<nav id="navbar">
<ul>
<li><a href="">Home</a></li>
<li><a href="">Contact</a></li>
</ul>
</nav>
</header>
<p>I shift up when the #navbar is fixed to the browser window.</p>
</body>
```

View File

@ -0,0 +1,181 @@
---
id: 587d78a8367417b2b2512ae4
title: アニメーションの回数を無限にして CSS でハートを鼓動させる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cDZpDUr'
forumTopicId: 301062
dashedName: make-a-css-heartbeat-using-an-infinite-animation-count
---
# --description--
`animation-iteration-count` プロパティを使った連続アニメーションの例として、前回のチャレンジで作成したハートを使う例を紹介します。
長さ 1 秒のハートビートアニメーションは、2 つのアニメーションで構成されています。 `heart` 要素 (`:before``:after` 部分も含む) は `transform` を使ってサイズの変更をアニメーションし、背景の `div``background` プロパティを使って背景色の変更をアニメーションします。
# --instructions--
`back` クラスと `heart` クラス両方に `animation-iteration-count` プロパティを追加し、値に `infinite` を設定することで、ハートを鼓動させ続けましょう。 `heart:before``heart:after` セレクターにはアニメーションプロパティは必要ありません。
# --hints--
`heart` クラスの `animation-iteration-count` プロパティは `infinite` の値を持つ必要があります。
```js
assert($('.heart').css('animation-iteration-count') == 'infinite');
```
`back` クラスの `animation-iteration-count` プロパティは `infinite` の値を持つ必要があります。
```js
assert($('.back').css('animation-iteration-count') == 'infinite');
```
# --seed--
## --seed-contents--
```html
<style>
.back {
position: fixed;
padding: 0;
margin: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: white;
animation-name: backdiv;
animation-duration: 1s;
}
.heart {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: pink;
height: 50px;
width: 50px;
transform: rotate(-45deg);
animation-name: beat;
animation-duration: 1s;
}
.heart:after {
background-color: pink;
content: "";
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: 0px;
left: 25px;
}
.heart:before {
background-color: pink;
content: "";
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: -25px;
left: 0px;
}
@keyframes backdiv {
50% {
background: #ffe6f2;
}
}
@keyframes beat {
0% {
transform: scale(1) rotate(-45deg);
}
50% {
transform: scale(0.6) rotate(-45deg);
}
}
</style>
<div class="back"></div>
<div class="heart"></div>
```
# --solutions--
```html
<style>
.back {
position: fixed;
padding: 0;
margin: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: white;
animation-name: backdiv;
animation-duration: 1s;
animation-iteration-count: infinite;
}
.heart {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: pink;
height: 50px;
width: 50px;
transform: rotate(-45deg);
animation-name: beat;
animation-duration: 1s;
animation-iteration-count: infinite;
}
.heart:after {
background-color: pink;
content: "";
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: 0px;
left: 25px;
}
.heart:before {
background-color: pink;
content: "";
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: -25px;
left: 0px;
}
@keyframes backdiv {
50% {
background: #ffe6f2;
}
}
@keyframes beat {
0% {
transform: scale(1) rotate(-45deg);
}
50% {
transform: scale(0.6) rotate(-45deg);
}
}
</style>
<div class="back"></div>
<div class="heart"></div>
```

View File

@ -0,0 +1,121 @@
---
id: 587d78a9367417b2b2512aea
title: ベジェ曲線を使用して動きをもっと自然にする
challengeType: 0
videoUrl: 'https://scrimba.com/c/c7akWUv'
forumTopicId: 301063
dashedName: make-motion-more-natural-using-a-bezier-curve
---
# --description--
このチャレンジでは、ボールがジャグリングされている様子を再現する要素をアニメーション化します。 ここまでのチャレンジでは `linear``ease-out` の三次ベジェ曲線を取り上げましたが、どちらも投げ上げる動きを正確に表現できていません。 このためにベジェ曲線をカスタマイズする必要があります。
`animation-iteration-count` が infinite に設定されていると、`animation-timing-function` は各キーフレームで自動的にループします。 アニメーション時間の真ん中 (`50%` 時点) にキーフレームルールが設定されているので、ボールの上向きと下向きの動きは同じように進行します。
次の三次ベジェ曲線はジャグリングの動きをシミュレートします。
```css
cubic-bezier(0.3, 0.4, 0.5, 1.6);
```
y2 の値が 1 より大きいことに注意してください。 三次ベジェ曲線は 1×1 の座標系にマッピングされていて、x の値は 0〜1 までしか設定できませんが、y の値は1以上の数値も設定することができます。 これでジャグリングボールをシミュレーションするのに最適なはずむ動きになります。
# --instructions--
id `green` の要素の `animation-timing-function` プロパティを、x1, y1, x2, y2 の値がそれぞれ 0.311, 0.441, 0.444, 1.649 である `cubic-bezier` 関数に変更します。
# --hints--
id `green` の要素の `animation-timing-function` プロパティは、指定の x1, y1, x2, y2 の値を持つ `cubic-bezier` 関数でなければなりません。
```js
assert(
$('#green').css('animation-timing-function') ==
'cubic-bezier(0.311, 0.441, 0.444, 1.649)'
);
```
# --seed--
## --seed-contents--
```html
<style>
.balls {
border-radius: 50%;
position: fixed;
width: 50px;
height: 50px;
top: 60%;
animation-name: jump;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#red {
background: red;
left: 25%;
animation-timing-function: linear;
}
#blue {
background: blue;
left: 50%;
animation-timing-function: ease-out;
}
#green {
background: green;
left: 75%;
animation-timing-function: cubic-bezier(0.69, 0.1, 1, 0.1);
}
@keyframes jump {
50% {
top: 10%;
}
}
</style>
<div class="balls" id="red"></div>
<div class="balls" id="blue"></div>
<div class="balls" id="green"></div>
```
# --solutions--
```html
<style>
.balls {
border-radius: 50%;
position: fixed;
width: 50px;
height: 50px;
top: 60%;
animation-name: jump;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#red {
background: red;
left: 25%;
animation-timing-function: linear;
}
#blue {
background: blue;
left: 50%;
animation-timing-function: ease-out;
}
#green {
background: green;
left: 75%;
animation-timing-function: cubic-bezier(0.311, 0.441, 0.444, 1.649);
}
@keyframes jump {
50% {
top: 10%;
}
}
</style>
<div class="balls" id="red"></div>
<div class="balls" id="blue"></div>
<div class="balls" id="green"></div>
```

View File

@ -0,0 +1,92 @@
---
id: 58a7a6ebf9a6318348e2d5aa
title: アニメーションの Fill モードを変更する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJDmcE'
forumTopicId: 301064
dashedName: modify-fill-mode-of-an-animation
---
# --description--
素晴らしい!でも、まだうまくいきませんね。 `500ms` が過ぎるとアニメーションがリセットされ、ボタンが元の色に戻ることに注目してください。 ボタンをハイライト表示のままにしたいと思うでしょう。
`animation-fill-mode` プロパティを `forwards` に設定すると、そのようにできます。 `animation-fill-mode` は、アニメーションが終わった時に要素に適用されるスタイルを指定します。 次のように設定できます:
```css
animation-fill-mode: forwards;
```
# --instructions--
`button:hover``animation-fill-mode` プロパティを `forwards` に設定して、ユーザーがボタンにホバーするとボタンがハイライトされたままになるようにしましょう。
# --hints--
`button:hover` は、値が `forwards``animation-fill-mode` プロパティを持つ必要があります。
```js
assert(
code.match(
/button\s*?:\s*?hover\s*?{[\s\S]*animation-fill-mode\s*?:\s*?forwards\s*?;[\s\S]*}/gi
) &&
code.match(
/button\s*?:\s*?hover\s*?{[\s\S]*animation-name\s*?:\s*?background-color\s*?;[\s\S]*}/gi
) &&
code.match(
/button\s*?:\s*?hover\s*?{[\s\S]*animation-duration\s*?:\s*?500ms\s*?;[\s\S]*}/gi
)
);
```
# --seed--
## --seed-contents--
```html
<style>
button {
border-radius: 5px;
color: white;
background-color: #0F5897;
padding: 5px 10px 8px 10px;
}
button:hover {
animation-name: background-color;
animation-duration: 500ms;
/* Only change code below this line */
/* Only change code above this line */
}
@keyframes background-color {
100% {
background-color: #4791d0;
}
}
</style>
<button>Register</button>
```
# --solutions--
```html
<style>
button {
border-radius: 5px;
color: white;
background-color: #0F5897;
padding: 5px 10px 8px 10px;
}
button:hover {
animation-name: background-color;
animation-duration: 500ms;
animation-fill-mode: forwards;
}
@keyframes background-color {
100% {
background-color: #4791d0;
}
}
</style>
<button>Register</button>
```

View File

@ -0,0 +1,70 @@
---
id: 587d781e367417b2b2512aca
title: 相対位置指定要素を CSS オフセットで移動させる
challengeType: 0
videoUrl: 'https://scrimba.com/c/c9bQEA4'
forumTopicId: 301065
dashedName: move-a-relatively-positioned-element-with-css-offsets
---
# --description--
`top` または `bottom`, および `left` または `right` の CSS オフセットは、あるアイテムが通常フローで配置される位置から相対的にオフセットする距離をブラウザに伝えます。 要素を指定された場所から離れるようにオフセットしているので、要素は指定された側から離れるように (事実上、反対方向に) 動きます。 ひとつ前のチャレンジで、`top` オフセットを使うと `h2` は下方向に動くことを確認しました。 同様に、`left` のオフセットを使うとアイテムは右に移動します。
# --instructions--
CSS オフセットを使用して、`h2` を 15 ピクセル右方向に、10 ピクセル上方向に移動してください。
# --hints--
`h2` を相対的に 10px 上に配置する CSS オフセットを使用する必要があります。 言い換えれば、通常配置される場所の `bottom` から 10px 離れたところに移動させてください。
```js
assert($('h2').css('bottom') == '10px');
```
`h2` を相対的に 15px 右に配置する CSS オフセットを使用する必要があります。 言い換えれば、通常配置される場所の `left` から 15px 離れたところに移動させてください。
```js
assert($('h2').css('left') == '15px');
```
# --seed--
## --seed-contents--
```html
<head>
<style>
h2 {
position: relative;
}
</style>
</head>
<body>
<h1>On Being Well-Positioned</h1>
<h2>Move me!</h2>
<p>I still think the h2 is where it normally sits.</p>
</body>
```
# --solutions--
```html
<head>
<style>
h2 {
position: relative;
left: 15px;
bottom: 10px;
}
</style>
</head>
<body>
<h1>On Being Well-Positioned</h1>
<h2>Move me!</h2>
<p>I still think the h2 is where it normally sits.</p>
</body>
```

View File

@ -0,0 +1,100 @@
---
id: 587d78a3367417b2b2512ace
title: float プロパティで要素を左右に押しやる
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MDqu2'
forumTopicId: 301066
dashedName: push-elements-left-or-right-with-the-float-property
---
# --description--
次の位置指定の方法では `position` は使用せず、要素の `float` プロパティを設定します。 フローティング要素はドキュメントの通常フローから削除され、その要素を内包する親要素の `left` または `right` に押しやられます。 フローティング要素が必要とする水平方向の幅を指定するために、よく `width` プロパティと共に使用されます。
# --instructions--
与えられた HTML のマークアップは、`section``aside` の要素が隣り合うように 2 カラムレイアウトにするのが良さそうです。 `#left` の要素の `float``left` に、`#right` の要素の `float``right` に設定してください。
# --hints--
id が `left` の要素の `float` の値は `left` に設定してください。
```js
assert($('#left').css('float') == 'left');
```
id が `right` の要素の `float` の値は `right` に設定してください。
```js
assert($('#right').css('float') == 'right');
```
# --seed--
## --seed-contents--
```html
<head>
<style>
#left {
width: 50%;
}
#right {
width: 40%;
}
aside, section {
padding: 2px;
background-color: #ccc;
}
</style>
</head>
<body>
<header>
<h1>Welcome!</h1>
</header>
<section id="left">
<h2>Content</h2>
<p>Good stuff</p>
</section>
<aside id="right">
<h2>Sidebar</h2>
<p>Links</p>
</aside>
</body>
```
# --solutions--
```html
<head>
<style>
#left {
float: left;
width: 50%;
}
#right {
float: right;
width: 40%;
}
aside, section {
padding: 2px;
background-color: #ccc;
}
</style>
</head>
<body>
<header>
<h1>Welcome!</h1>
</header>
<section id="left">
<h2>Content</h2>
<p>Good stuff</p>
</section>
<aside id="right">
<h2>Sidebar</h2>
<p>Links</p>
</aside>
</body>
```

View File

@ -0,0 +1,119 @@
---
id: 587d781c367417b2b2512ac2
title: 複数の見出し要素の font-size を設定する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cPpQNT3'
forumTopicId: 301067
dashedName: set-the-font-size-for-multiple-heading-elements
---
# --description--
`font-size` プロパティは、指定された要素内のテキストの大きさを指定するために使われます。 このルールは色々な要素に使うことができ、ページ上のテキストの視覚的な一貫性を作成するために使われます。 このチャレンジでは、見出しのサイズのバランスをとるために `h1` から `h6` タグすべての値を設定してみましょう。
# --instructions-- <p><code>style</code> タグの中で、以下の <code>font-size</code> を設定してください。</p>
<ul>
<li><code>h1</code> タグを 68px に</li>
<li><code>h2</code> タグを 52px に</li>
<li><code>h3</code> タグを 40px に</li>
<li><code>h4</code> タグを 32px に</li>
<li><code>h5</code> タグを 21px に</li>
<li><code>h6</code> タグを 14px に</li>
</ul>
# --hints--
`h1` タグの `font-size` プロパティを 68 ピクセルに設定してください。
```js
const fontSizeOfh1 = new __helpers.CSSHelp(document).getStyle('h1')?.getPropertyValue('font-size');
assert(fontSizeOfh1 === '68px');
```
`h2` タグの `font-size` プロパティを 52 ピクセルに設定してください。
```js
const fontSizeOfh2 = new __helpers.CSSHelp(document).getStyle('h2')?.getPropertyValue('font-size');
assert(fontSizeOfh2 === '52px');
```
`h3` タグの `font-size` プロパティを 40 ピクセルに設定してください。
```js
const fontSizeOfh3 = new __helpers.CSSHelp(document).getStyle('h3')?.getPropertyValue('font-size');
assert(fontSizeOfh3 === '40px');
```
`h4` タグの `font-size` プロパティを 32 ピクセルに設定してください。
```js
const fontSizeOfh4 = new __helpers.CSSHelp(document).getStyle('h4')?.getPropertyValue('font-size');
assert(fontSizeOfh4 === '32px');
```
`h5` タグの `font-size` プロパティを 21 ピクセルに設定してください。
```js
const fontSizeOfh5 = new __helpers.CSSHelp(document).getStyle('h5')?.getPropertyValue('font-size');
assert(fontSizeOfh5 === '21px');
```
`h6` タグの `font-size` プロパティを 14 ピクセルに設定してください。
```js
const fontSizeOfh6 = new __helpers.CSSHelp(document).getStyle('h6')?.getPropertyValue('font-size');
assert(fontSizeOfh6 === '14px');
```
# --seed--
## --seed-contents--
```html
<style>
</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>
```
# --solutions--
```html
<style>
h1 {
font-size: 68px;
}
h2 {
font-size: 52px;
}
h3 {
font-size: 40px;
}
h4 {
font-size: 32px;
}
h5 {
font-size: 21px;
}
h6 {
font-size: 14px;
}
</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>
```

View File

@ -0,0 +1,52 @@
---
id: 587d781c367417b2b2512ac4
title: 段落テキストの font-size を設定する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJ36Cr'
forumTopicId: 301068
dashedName: set-the-font-size-of-paragraph-text
---
# --description--
CSS の `font-size` プロパティは見出しだけでなく、テキストを含むあらゆる要素に適用できます。
# --instructions--
段落の `font-size` プロパティの値を 16px に変更し、読みやすくしましょう。
# --hints--
`p` タグの `font-size` は 16 ピクセルに設定されている必要があります。
```js
assert($('p').css('font-size') == '16px');
```
# --seed--
## --seed-contents--
```html
<style>
p {
font-size: 10px;
}
</style>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</p>
```
# --solutions--
```html
<style>
p {
font-size: 16px;
}
</style>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</p>
```

View File

@ -0,0 +1,132 @@
---
id: 587d781c367417b2b2512ac3
title: 複数の見出し要素の font-weight を設定する
challengeType: 0
videoUrl: 'https://scrimba.com/c/crVWRHq'
forumTopicId: 301069
dashedName: set-the-font-weight-for-multiple-heading-elements
---
# --description--
ひとつ前のチャレンジでは各見出しタグの `font-size` を設定しました。次は `font-weight` を調整してみましょう。
`font-weight` プロパティは、文字の太さまたは細さを設定します。
# --instructions--
<ul><li><code>h1</code> タグの <code>font-weight</code> を 800 に設定してください。</li><li><code>h2</code> タグの <code>font-weight</code> を 600 に設定してください。</li><li><code>h3</code> タグの <code>font-weight</code> を 500 に設定してください。</li><li><code>h4</code> タグの <code>font-weight</code> を 400 に設定してください。</li><li><code>h5</code> タグの <code>font-weight</code> を 300 に設定してください。</li><li><code>h6</code> タグの <code>font-weight</code> を 200 に設定してください。</li></ul>
# --hints--
`h1` タグの `font-weight` プロパティは 800 に設定される必要があります。
```js
assert($('h1').css('font-weight') == '800');
```
`h2` タグの `font-weight` プロパティは 600 に設定される必要があります。
```js
assert($('h2').css('font-weight') == '600');
```
`h3` タグの `font-weight` プロパティは 500 に設定される必要があります。
```js
assert($('h3').css('font-weight') == '500');
```
`h4` タグの `font-weight` プロパティは 400 に設定される必要があります。
```js
assert($('h4').css('font-weight') == '400');
```
`h5` タグの `font-weight` プロパティは 300 に設定される必要があります。
```js
assert($('h5').css('font-weight') == '300');
```
`h6` タグの `font-weight` プロパティは 200 に設定される必要があります。
```js
assert($('h6').css('font-weight') == '200');
```
# --seed--
## --seed-contents--
```html
<style>
h1 {
font-size: 68px;
}
h2 {
font-size: 52px;
}
h3 {
font-size: 40px;
}
h4 {
font-size: 32px;
}
h5 {
font-size: 21px;
}
h6 {
font-size: 14px;
}
</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>
```
# --solutions--
```html
<style>
h1 {
font-size: 68px;
font-weight: 800;
}
h2 {
font-size: 52px;
font-weight: 600;
}
h3 {
font-size: 40px;
font-weight: 500;
}
h4 {
font-size: 32px;
font-weight: 400;
}
h5 {
font-size: 21px;
font-weight: 300;
}
h6 {
font-size: 14px;
font-weight: 200;
}
</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>
```

View File

@ -0,0 +1,54 @@
---
id: 587d781d367417b2b2512ac5
title: 段落の line-height を設定する
challengeType: 0
videoUrl: 'https://scrimba.com/c/crVWdcv'
forumTopicId: 301070
dashedName: set-the-line-height-of-paragraphs
---
# --description--
CSS でテキストブロック内の各行の高さを変更するために `line-height` プロパティが提供されています。 名前が示すように、テキストの各行が取る垂直方向のスペースの量を変更するプロパティです。
# --instructions--
`line-height` プロパティを `p` タグに追加し、25px に設定してください。
# --hints--
`p` タグの `line-height` を 25 ピクセルに設定してください。
```js
assert($('p').css('line-height') == '25px');
```
# --seed--
## --seed-contents--
```html
<style>
p {
font-size: 16px;
}
</style>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</p>
```
# --solutions--
```html
<style>
p {
font-size: 16px;
line-height: 25px;
}
</style>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</p>
```

View File

@ -0,0 +1,128 @@
---
id: 587d78a9367417b2b2512ae9
title: ベジェ曲線を使ってグラフィックを動かす
challengeType: 0
videoUrl: 'https://scrimba.com/c/c6bnRCK'
forumTopicId: 301071
dashedName: use-a-bezier-curve-to-move-a-graphic
---
# --description--
前回の課題では、アニメーションの変更を記述した `ease-out` キーワードについて説明しました。このキーワードは、最初にスピードを上げ、アニメーションの終わりにスローダウンします。 右側に `ease-out` キーワード (青色の要素用) と `linear` キーワード (赤色の要素用) の違いを示します。 `ease-out` キーワードと同様のアニメーションの動きは、カスタム三次ベジェ曲線関数を使用することで実現できます。
一般的に、`p1``p2` のアンカーポイントを変更すると異なるベジェ曲線が作成され、時間の経過と共にアニメーションがどのように進むかを制御します。 以下は、ease-out スタイルを模倣する値を使用したベジェ曲線の例です。
```css
animation-timing-function: cubic-bezier(0, 0, 0.58, 1);
```
`cubic-bezier` 関数はすべて始点 `p0` が (0, 0) から始まり、終点 `p3` が (1, 1) で終わることを思い出してください。 この例では、ベジェ曲線は Y 軸方向 (0 から開始して `p1` の y の値 0 へ移動し、 `p2` で 1 に移動する) の方が、X 軸方向 (0から開始して `p1` で 0、`p2` で 0.58 に移動する) よりも速く変化します。 その結果、アニメーションされる要素の変化は、その区間のアニメーションの時間よりも速く進行します。 カーブの終わりに向かって x と y の値の変化の関係は逆になります。y の値は (変わらず) 1 から 1 へ移動しますが、x の値は 0.58 から 1 に移動し、アニメーションの進行時間に比べて変化が遅くなります。
# --instructions--
このベジェ曲線の効果を確認するには `red` の id を持つ要素の `animation-timing-function``cubic-bezier` 関数に変更し、x1, y1, x2, y2 の値をそれぞれ 0, 0, 0.58, 1 に設定します。 これで両方の要素のアニメーションが同じように進行します。
# --hints--
id `red` の要素の `animation-timing-function` プロパティは x1, y1, x2, y2 の値がそれぞれ 0, 0, 0.58, 1 に設定された `cubic-bezier` 関数でなければなりません。
```js
assert(
$('#red').css('animation-timing-function') == 'cubic-bezier(0, 0, 0.58, 1)'
);
```
id `red` の要素は `animation-timing-function` のプロパティとして `linear` を持たないようにします。
```js
assert($('#red').css('animation-timing-function') !== 'linear');
```
id `blue` の要素の `animation-timing-function` プロパティの値は変更しないでください。
```js
const blueBallAnimation = __helpers.removeWhiteSpace(
$('#blue').css('animation-timing-function')
);
assert(
blueBallAnimation == 'ease-out' ||
blueBallAnimation == 'cubic-bezier(0,0,0.58,1)'
);
```
# --seed--
## --seed-contents--
```html
<style>
.balls{
border-radius: 50%;
position: fixed;
width: 50px;
height: 50px;
margin-top: 50px;
animation-name: bounce;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#red {
background: red;
left: 27%;
animation-timing-function: linear;
}
#blue {
background: blue;
left: 56%;
animation-timing-function: ease-out;
}
@keyframes bounce {
0% {
top: 0px;
}
100% {
top: 249px;
}
}
</style>
<div class="balls" id= "red"></div>
<div class="balls" id= "blue"></div>
```
# --solutions--
```html
<style>
.balls{
border-radius: 50%;
position: fixed;
width: 50px;
height: 50px;
margin-top: 50px;
animation-name: bounce;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#red {
background: red;
left: 27%;
animation-timing-function: cubic-bezier(0, 0, 0.58, 1);
}
#blue {
background: blue;
left: 56%;
animation-timing-function: ease-out;
}
@keyframes bounce {
0% {
top: 0px;
}
100% {
top: 249px;
}
}
</style>
<div class="balls" id= "red"></div>
<div class="balls" id= "blue"></div>
```

View File

@ -0,0 +1,113 @@
---
id: 587d78a5367417b2b2512ad7
title: CSS の線形グラデーションでストライプを作成する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c6bmQh2'
forumTopicId: 301072
dashedName: use-a-css-linear-gradient-to-create-a-striped-element
---
# --description--
`repeating-linear-gradient()` 関数は `linear-gradient()` とよく似ており、大きな違いは指定のグラデーションのパターンを繰り返すことです。 `repeating-linear-gradient()` は様々な値を受け付けますが、簡略化のために、このチャレンジでは角度の値と色経由点の値を扱います。
角度の値はグラデーションの方向です。 色経由点は、色が変化する場所を指定する幅の値のようなもので、パーセンテージまたはピクセルで与えられます。
コードエディタに表示されている例では、グラデーションは `yellow` の色で 0 ピクセルの位置からスタートし、溶け込んでスタートから 40 ピクセルの位置で 2 つ目の色 `blue` になります。 次の色経由点が同じ 40 ピクセルの位置にあるため、グラデーションはすぐに 3 つ目の色 `green` に変わり、溶け込んでグラデーションの開始位置から 80 ピクセルの場所で 4 つ目の色 `red` になります。
この例では、色経由点をペアとしてそれぞれ二つの色が混ざりあう場所と考えるのが役立つでしょう。
```css
0px [yellow -- blend -- blue] 40px [green -- blend -- red] 80px
```
2 個ごとの色経由点が同じ色ならば、色の混合は同じ色同士になるため目に見えず、次の色にすぐに変わることでストライプが作れます。
# --instructions--
`repeating-linear-gradient()` を変更して `45deg` のグラデーションの角度を設定し、最初の二つの色経由点を `yellow` に、 次の 2 つの色経由点を `black` に設定してストライプを作りましょう。
# --hints--
`repeating-linear-gradient()` の角度は 45deg である必要があります。
```js
assert(code.match(/background:\s*?repeating-linear-gradient\(\s*?45deg/gi));
```
`repeating-linear-gradient()` の角度が 90deg ではないようにしてください。
```js
assert(!code.match(/90deg/gi));
```
0 ピクセルの色経由点の色は `yellow` である必要があります。
```js
assert(code.match(/yellow\s+?0(px)?/gi));
```
40 ピクセルの 1 つめの色経由点の色は `yellow` である必要があります。
```js
assert(code.match(/yellow\s+?40px/gi));
```
40 ピクセルの 2 つめの色経由点の色は `black` である必要があります。
```js
assert(code.match(/yellow\s+?40px,\s*?black\s+?40px/gi));
```
最後の、80 ピクセルの色経由点の色は `black` である必要があります。
```js
assert(code.match(/black\s+?80px/gi));
```
# --seed--
## --seed-contents--
```html
<style>
div{
border-radius: 20px;
width: 70%;
height: 400px;
margin: 50 auto;
background: repeating-linear-gradient(
90deg,
yellow 0px,
blue 40px,
green 40px,
red 80px
);
}
</style>
<div></div>
```
# --solutions--
```html
<style>
div{
border-radius: 20px;
width: 70%;
height: 400px;
margin: 50 auto;
background: repeating-linear-gradient(
45deg,
yellow 0px,
yellow 40px,
black 40px,
black 80px
);
}
</style>
<div></div>
```

View File

@ -0,0 +1,103 @@
---
id: 587d78a7367417b2b2512ae0
title: CSS アニメーションを使用してボタンのホバー状態を変更する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cg4vZAa'
forumTopicId: 301073
dashedName: use-css-animation-to-change-the-hover-state-of-a-button
---
# --description--
CSS の `@keyframes` を使ってホバー状態の時にボタンの色を変えることができます。
下記は画像の幅をホバー時に変更する例です:
```html
<style>
img {
width: 30px;
}
img:hover {
animation-name: width;
animation-duration: 500ms;
}
@keyframes width {
100% {
width: 40px;
}
}
</style>
<img src="https://cdn.freecodecamp.org/curriculum/applied-visual-design/google-logo.png" alt="Google's Logo" />
```
# --instructions--
`ms` はミリ秒を表すので、1000 ms で 1 秒となることに注意してください。
CSS の `@keyframes` を使用して `button` 要素の `background-color` を変更し、ユーザーがボタンにホバーすると `#4791d0` になるようにしてください。 `@keyframes` ルールには `100%` の項目のみ記載されているようにしてください。
# --hints--
@keyframes ルールは background-color という `animation-name` を使う必要があります。
```js
assert(code.match(/@keyframes\s+?background-color\s*?{/g));
```
`@keyframes` には、100% 時点で `background-color``#4791d0` に変更するルール 1 つだけがあるようにしてください。
```js
assert(code.match(/100%\s*?{\s*?background-color:\s*?#4791d0;\s*?}/gi));
```
# --seed--
## --seed-contents--
```html
<style>
button {
border-radius: 5px;
color: white;
background-color: #0F5897;
padding: 5px 10px 8px 10px;
}
button:hover {
animation-name: background-color;
animation-duration: 500ms;
}
</style>
<button>Register</button>
```
# --solutions--
```html
<style>
button {
border-radius: 5px;
color: white;
background-color: #0F5897;
padding: 5px 10px 8px 10px;
}
button:hover {
animation-name: background-color;
animation-duration: 500ms;
}
@keyframes background-color {
100% {
background-color: #4791d0;
}
}
</style>
<button>Register</button>
```

View File

@ -0,0 +1,77 @@
---
id: 587d78a6367417b2b2512adb
title: CSS の Transform プロパティ skewX を使用して要素を X 軸に沿ってゆがめる
challengeType: 0
videoUrl: 'https://scrimba.com/c/cyLP8Sr'
forumTopicId: 301074
dashedName: use-the-css-transform-property-skewx-to-skew-an-element-along-the-x-axis
---
# --description--
`transform` プロパティの次の関数は `skewX()` です。これは選択された要素を X 軸 (水平方向) に沿って指定された角度だけゆがめます。
次のコードは、段落要素を X 軸に沿って -32 度傾けます。
```css
p {
transform: skewX(-32deg);
}
```
# --instructions--
`transform` プロパティを使って、id `bottom` を持つ要素を X 軸に沿って 24 度傾けてください。
# --hints--
id が `bottom` の要素は X 軸に沿って 24 度傾けられている必要があります。
```js
assert(code.match(/#bottom\s*?{\s*?.*?\s*?transform:\s*?skewX\(24deg\);/g));
```
# --seed--
## --seed-contents--
```html
<style>
div {
width: 70%;
height: 100px;
margin: 50px auto;
}
#top {
background-color: red;
}
#bottom {
background-color: blue;
}
</style>
<div id="top"></div>
<div id="bottom"></div>
```
# --solutions--
```html
<style>
div {
width: 70%;
height: 100px;
margin: 50px auto;
}
#top {
background-color: red;
}
#bottom {
background-color: blue;
transform: skewX(24deg);
}
</style>
<div id="top"></div>
<div id="bottom"></div>
```

View File

@ -0,0 +1,71 @@
---
id: 587d78a6367417b2b2512adc
title: CSS の Transform プロパティ skewY を使用して要素を Y 軸に沿ってゆがめる
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MZ2uB'
forumTopicId: 301075
dashedName: use-the-css-transform-property-skewy-to-skew-an-element-along-the-y-axis
---
# --description--
`skewX()` 関数が要素を X 軸に沿って指定の度数だけ傾けるのであれば、`skewY()` プロパティが要素を Y 軸 (垂直方向) に沿って傾けることは当然に思えるでしょう。
# --instructions--
`transform` プロパティを使って、id `top` の要素を Y 軸に沿って -10 度傾けてください。
# --hints--
id が `top` の要素は Y 軸に沿って -10 度傾けられている必要があります。
```js
assert(code.match(/#top\s*?{\s*?.*?\s*?transform:\s*?skewY\(-10deg\);/g));
```
# --seed--
## --seed-contents--
```html
<style>
div {
width: 70%;
height: 100px;
margin: 50px auto;
}
#top {
background-color: red;
}
#bottom {
background-color: blue;
transform: skewX(24deg);
}
</style>
<div id="top"></div>
<div id="bottom"></div>
```
# --solutions--
```html
<style>
div {
width: 70%;
height: 100px;
margin: 50px auto;
}
#top {
background-color: red;
transform: skewY(-10deg);
}
#bottom {
background-color: blue;
transform: skewX(24deg);
}
</style>
<div id="top"></div>
<div id="bottom"></div>
```

View File

@ -0,0 +1,95 @@
---
id: 587d78a5367417b2b2512ad9
title: CSS の Transform scale プロパティを使用して要素のサイズを変更する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MZVSg'
forumTopicId: 301076
dashedName: use-the-css-transform-scale-property-to-change-the-size-of-an-element
---
# --description--
要素の大きさを変更するために、CSS には `transform` プロパティと `scale()` 関数があります。 以下のコードの例は、ページ上のすべての段落要素のサイズを 2 倍にします。
```css
p {
transform: scale(2);
}
```
# --instructions--
id が `ball2` の要素のサイズを、元のサイズの 1.5 倍の大きさにしてください。
# --hints--
`#ball2``transform` プロパティを、サイズが 1.5 倍に拡大するように設定してください。
```js
assert(
code.match(
/#ball2\s*?{\s*?left:\s*?65%;\s*?transform:\s*?scale\(1\.5\);\s*?}|#ball2\s*?{\s*?transform:\s*?scale\(1\.5\);\s*?left:\s*?65%;\s*?}/gi
)
);
```
# --seed--
## --seed-contents--
```html
<style>
.ball {
width: 40px;
height: 40px;
margin: 50 auto;
position: fixed;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
border-radius: 50%;
}
#ball1 {
left: 20%;
}
#ball2 {
left: 65%;
}
</style>
<div class="ball" id= "ball1"></div>
<div class="ball" id= "ball2"></div>
```
# --solutions--
```html
<style>
.ball {
width: 40px;
height: 40px;
margin: 50 auto;
position: fixed;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
border-radius: 50%;
}
#ball1 {
left: 20%;
}
#ball2 {
left: 65%;
transform: scale(1.5);
}
</style>
<div class="ball" id= "ball1"></div>
<div class="ball" id= "ball2"></div>
```

View File

@ -0,0 +1,79 @@
---
id: 587d78a5367417b2b2512ada
title: CSS の Transform scale プロパティを使用してホバー時に要素を拡大する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cyLPJuM'
forumTopicId: 301077
dashedName: use-the-css-transform-scale-property-to-scale-an-element-on-hover
---
# --description--
`transform` プロパティは要素の拡大縮小、移動、回転、傾斜などができる様々な関数を備えています。 要素の特定の状態を指定する `:hover` のような疑似クラスと一緒に使えば、`transform` プロパティは簡単にあなたの要素にインタラクティブ性を追加することができます。
ユーザーがカーソルを合わせたとき、段落要素を元のサイズの 2.1 倍に拡大する例をこちらに示します:
```css
p:hover {
transform: scale(2.1);
}
```
**注:** transform を `div` 要素に適用すると、その div 要素に含まれる子要素にも影響します。
# --instructions--
`div``hover` 状態用の CSS ルールを追加し、`transform` プロパティを使用して、ユーザーがカーソルを合わせたときに `div` 要素が 1.1 倍に拡大されるようにしてください。
# --hints--
`div` 要素のサイズは、ユーザーがその上にカーソルを置いた時に 1.1 倍になる必要があります。
```js
assert(code.match(/div:hover\s*?{\s*?transform:\s*?scale\(1\.1\);/gi));
```
# --seed--
## --seed-contents--
```html
<style>
div {
width: 70%;
height: 100px;
margin: 50px auto;
background: linear-gradient(
53deg,
#ccfffc,
#ffcccf
);
}
</style>
<div></div>
```
# --solutions--
```html
<style>
div {
width: 70%;
height: 100px;
margin: 50px auto;
background: linear-gradient(
53deg,
#ccfffc,
#ffcccf
);
}
div:hover {
transform: scale(1.1);
}
</style>
<div></div>
```

View File

@ -0,0 +1,118 @@
---
id: 587d781a367417b2b2512ab9
title: em タグでテキストを斜体にする
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJRBtp'
forumTopicId: 301078
dashedName: use-the-em-tag-to-italicize-text
---
# --description--
テキストを強調するには `em` タグを使用します。 これによりブラウザは CSS の `font-style: italic;` を要素に適用し、テキストを斜体で表示します。
# --instructions--
段落タグの内容を `em` タグで囲み、強調表示してください。
# --hints--
コード内でマークアップに `em` タグを 1 つ追加する必要があります。
```js
assert($('em').length == 1);
```
`em` タグは `p` タグの内容を囲む必要がありますが、`p` タグ自体は含めないようにしてください。
```js
assert($('p').children().length == 1 && $('em').children().length == 2);
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,135 @@
---
id: 587d781b367417b2b2512aba
title: s タグでテキストに取り消し線を引く
challengeType: 0
videoUrl: ''
forumTopicId: 301079
dashedName: use-the-s-tag-to-strikethrough-text
---
# --description--
テキストの文字を水平線で横切って取り消し線を引くには `s` タグを使用することができます。 これは、テキストのその部分が無効になったことを示します。 `s` タグを使うと、ブラウザは CSS の `text-decoration: line-through;` を要素に適用します。
# --instructions--
`h4` タグの中の `Google` の周りを `s` タグで囲んでください。次にその隣に、`Alphabet` という文字を取り消し線が無い状態で追加してください。
# --hints--
コード内でマークアップに `s` タグを 1 つ追加する必要があります。
```js
assert($('s').length == 1);
```
`s` タグは `h4` タグ内の `Google` のテキストを囲む必要があります。 これには単語 `Alphabet` を含めないでください。
```js
assert(
$('h4 > s')
.text()
.match(/Google/gi) &&
!$('h4 > s')
.text()
.match(/Alphabet/gi)
);
```
`h4` タグの中に、`Alphabet` という単語が取り消し線がない状態で含まれている必要があります。
```js
assert(
$('h4')
.html()
.match(/Alphabet/gi)
);
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4><s>Google</s> Alphabet</h4>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,128 @@
---
id: 587d781a367417b2b2512ab7
title: strong タグでテキストを太字にする
challengeType: 0
videoUrl: 'https://scrimba.com/c/ceJNBSb'
forumTopicId: 301080
dashedName: use-the-strong-tag-to-make-text-bold
---
# --description--
テキストを太字にするには `strong` タグを使用します。 これは、テキストに注目させ、重要であることを示すためによく使われます。 `strong` タグを使うと、ブラウザは CSS の `font-weight: bold;` を要素に適用します。
# --instructions--
`p` タグの中のテキスト `Stanford University` を、`strong` タグで囲みましょう (ピリオドは含まないようにしてください)。
# --hints--
コード内でマークアップに `strong` タグを 1 つ追加する必要があります。
```js
assert($('strong').length == 1);
```
`strong` タグは `p` タグの内側にあるようにしてください。
```js
assert($('p').children('strong').length == 1);
```
`strong` タグが `Stanford University` の語句を囲むようにしてください。
```js
assert(
$('strong')
.text()
.match(/^Stanford University\.?$/gi)
);
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at <strong>Stanford University</strong>.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,138 @@
---
id: 587d781c367417b2b2512ac0
title: text-transform プロパティでテキストを大文字にする
challengeType: 0
videoUrl: 'https://scrimba.com/c/cvVZQSP'
forumTopicId: 301081
dashedName: use-the-text-transform-property-to-make-text-uppercase
---
# --description--
CSS の `text-transform` プロパティはテキストの外観を変更するために使用されます。 実際の HTML 要素のテキストを変更することなく、ウェブページ上のテキストが一貫した形で表示されるようにするための便利な方法です。
以下の表は、異なる `text-transform` の値がどのように "Transform me" の例文を変化させるかを示しています。
<table class='table table-striped'><thead><tr><th></th><th>結果</th></tr></thead><tbody><tr><td><code>lowercase</code></td><td>"transform me"</td></tr><tr><td><code>uppercase</code></td><td>"TRANSFORM ME"</td></tr><tr><td><code>capitalize</code></td><td>"Transform Me"</td></tr><tr><td><code>initial</code></td><td>デフォルト値が使用される</td></tr><tr><td><code>inherit</code></td><td>親要素の <code>text-transform</code> の値が使用される</td></tr><tr><td><code>none</code></td><td><strong>デフォルト:</strong> 元のテキストを使用する</td></tr></tbody></table>
# --instructions--
`h4` のテキストを、`text-transform` プロパティを使用して大文字に変換してください。
# --hints--
`h4` のテキストは `uppercase` でなければなりません。
```js
assert($('h4').css('text-transform') === 'uppercase');
```
h4 の元のテキストは変更しないようにしてください。
```js
assert($('h4').text() !== $('h4').text().toUpperCase());
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
background-color: rgba(45, 45, 45, 0.1);
padding: 10px;
font-size: 27px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
opacity: 0.7;
}
#thumbnail {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard" id="thumbnail">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
background-color: rgba(45, 45, 45, 0.1);
padding: 10px;
font-size: 27px;
text-transform: uppercase;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
opacity: 0.7;
}
#thumbnail {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard" id="thumbnail">
<div class="cardContent">
<div class="cardText">
<h4>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,120 @@
---
id: 587d781a367417b2b2512ab8
title: u タグでテキストに下線を引く
challengeType: 0
videoUrl: 'https://scrimba.com/c/cN6aQCL'
forumTopicId: 301082
dashedName: use-the-u-tag-to-underline-text
---
# --description--
テキストに下線を引くには `u` タグを使用します。 これは、テキストの一部が重要であること、または覚えておくべきであることを示すためによく用いられます。 `u` タグを使うと、ブラウザは CSS の `text-decoration: underline;` を要素に適用します。
# --instructions--
`u` タグで `Ph.D. students` のテキストだけを囲んでください。
**注:** リンクと混同する可能性がある場合には、`u` タグを使うのは避けるようにしましょう。 アンカータグもデフォルトで下線付きで表示されるためです。
# --hints--
コード内でマークアップに `u` タグを 1 つ追加する必要があります。
```js
assert($('u').length === 1);
```
`u` タグが `Ph.D. students` のテキストを囲むようにしてください。
```js
assert($('u').text() === 'Ph.D. students');
```
# --seed--
## --seed-contents--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at <strong>Stanford University</strong>.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```
# --solutions--
```html
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
```

View File

@ -0,0 +1,115 @@
---
id: bad87fee1348bd9aedf08823
title: 要素に負の値のマージンを追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cnpyGs3'
forumTopicId: 16166
dashedName: add-a-negative-margin-to-an-element
---
# --description--
要素の `margin` は、要素の `border` とその外側の要素の間のスペースを制御します。
要素の `margin` を負の値に設定すると、要素は大きくなります。
# --instructions--
`margin` を赤い四角の値のように負の値に設定してみましょう。
青い四角の `margin``-15px` に変更し、黄色い四角の横幅いっぱい広がるようにしてください。
# --hints--
`blue-box` クラスは、要素に `-15px``margin` を与える必要があります。
```js
assert($('.blue-box').css('margin-top') === '-15px');
```
# --seed--
## --seed-contents--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
padding: 20px;
margin: -15px;
}
.blue-box {
background-color: blue;
color: #fff;
padding: 20px;
margin: 20px;
}
</style>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```
# --solutions--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
padding: 20px;
margin: -15px;
}
.blue-box {
background-color: blue;
color: #fff;
padding: 20px;
margin: 20px;
margin-top: -15px;
}
</style>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```

View File

@ -0,0 +1,190 @@
---
id: bad87fee1348bd9bedf08813
title: 要素の周りに境界線を追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MvnHZ'
forumTopicId: 16630
dashedName: add-borders-around-your-elements
---
# --description--
CSSの border には `style``color` および `width` のようなプロパティがあります。
例えば、ある HTML 要素の周りに赤色の5ピクセルの境界線を作成したい場合、次のようなクラスを使えます:
```html
<style>
.thin-red-border {
border-color: red;
border-width: 5px;
border-style: solid;
}
</style>
```
# --instructions--
`thick-green-border` というクラスを作成しましょう。 このクラスは HTML 要素の周りに 10px、実線 (solid)、緑色の境界線を追加するようにしてください。 猫の写真にこのクラスを適用してください。
1 つの要素に複数のクラスを適用するには、`class` 属性に各クラス名を半角スペースで区切って指定することを覚えておいてください。 例えば次のようになります:
```html
<img class="class1 class2">
```
# --hints--
`img` 要素にはクラス `smaller-image` が必要です。
```js
assert($('img').hasClass('smaller-image'));
```
`img` 要素にはクラス `thick-green-border` が必要です。
```js
assert($('img').hasClass('thick-green-border'));
```
画像の境界線の幅は `10px` である必要があります。
```js
assert(
$('img').hasClass('thick-green-border') &&
parseInt($('img').css('border-top-width'), 10) >= 8 &&
parseInt($('img').css('border-top-width'), 10) <= 12
);
```
画像の境界線のスタイルは `solid` である必要があります。
```js
assert($('img').css('border-right-style') === 'solid');
```
`img` 要素の周りの境界線は緑色でなければなりません。
```js
assert($('img').css('border-left-color') === 'rgb(0, 128, 0)');
```
# --seed--
## --seed-contents--
```html
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, monospace;
}
p {
font-size: 16px;
font-family: monospace;
}
.smaller-image {
width: 100px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
<form action="https://freecatphotoapp.com/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
```
# --solutions--
```html
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, monospace;
}
p {
font-size: 16px;
font-family: monospace;
}
.smaller-image {
width: 100px;
}
.thick-green-border {
border-width: 10px;
border-color: green;
border-style: solid;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image thick-green-border" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
<form action="https://freecatphotoapp.com/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
```

View File

@ -0,0 +1,136 @@
---
id: bad87fee1248bd9aedf08824
title: 要素の四辺に異なるマージンを追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cg4RWh4'
forumTopicId: 16633
dashedName: add-different-margins-to-each-side-of-an-element
---
# --description--
それぞれの側で異なる `margin` を持つように要素をカスタマイズしたい場合もあるでしょう。
CSS では `margin-top`, `margin-right`, `margin-bottom`, `margin-left` のプロパティを使用して、要素の 4 つの辺それぞれの `margin` を制御することができます。
# --instructions--
青い四角の `margin` を上側と左側は `40px`、下側と右側は `20px` に設定してください。
# --hints--
`blue-box` クラスは、要素の上側に `40px``margin` を与える必要があります。
```js
assert($('.blue-box').css('margin-top') === '40px');
```
`blue-box` クラスは、要素の右側に `20px``margin` を与える必要があります。
```js
assert($('.blue-box').css('margin-right') === '20px');
```
`blue-box` クラスは、要素の下側に `20px``margin` を与える必要があります。
```js
assert($('.blue-box').css('margin-bottom') === '20px');
```
`blue-box` クラスは、要素の左側に `40px``margin` を与える必要があります。
```js
assert($('.blue-box').css('margin-left') === '40px');
```
# --seed--
## --seed-contents--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
margin-top: 40px;
margin-right: 20px;
margin-bottom: 20px;
margin-left: 40px;
}
.blue-box {
background-color: blue;
color: #fff;
}
</style>
<h5 class="injected-text">margin</h5>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```
# --solutions--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
margin-top: 40px;
margin-right: 20px;
margin-bottom: 20px;
margin-left: 40px;
}
.blue-box {
background-color: blue;
color: #fff;
margin-top: 40px;
margin-right: 20px;
margin-bottom: 20px;
margin-left: 40px;
}
</style>
<h5 class="injected-text">margin</h5>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```

View File

@ -0,0 +1,136 @@
---
id: bad87fee1348bd9aedf08824
title: 要素の四辺に異なるパディングを追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cB7mwUw'
forumTopicId: 16634
dashedName: add-different-padding-to-each-side-of-an-element
---
# --description--
それぞれの側で異なる `padding` の値を持つように要素をカスタマイズしたい場合もあるでしょう。
CSS では `padding-top`, `padding-right`, `padding-bottom`, `padding-left` のプロパティを使用して、要素の 4 つの辺それぞれの `padding` を制御することができます。
# --instructions--
青い四角の `padding` を上側と左側は `40px`、下側と右側は `20px` に設定してください。
# --hints--
`blue-box` クラスは、要素の上側に `40px``padding` を与える必要があります。
```js
assert($('.blue-box').css('padding-top') === '40px');
```
`blue-box` クラスは、要素の右側に `20px``padding` を与える必要があります。
```js
assert($('.blue-box').css('padding-right') === '20px');
```
`blue-box` クラスは、要素の下側に `20px``padding` を与える必要があります。
```js
assert($('.blue-box').css('padding-bottom') === '20px');
```
`blue-box` クラスは、要素の左側に `40px``padding` を与える必要があります。
```js
assert($('.blue-box').css('padding-left') === '40px');
```
# --seed--
## --seed-contents--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
padding-top: 40px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 40px;
}
.blue-box {
background-color: blue;
color: #fff;
}
</style>
<h5 class="injected-text">margin</h5>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```
# --solutions--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
padding-top: 40px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 40px;
}
.blue-box {
background-color: blue;
color: #fff;
padding-top: 40px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 40px;
}
</style>
<h5 class="injected-text">margin</h5>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```

View File

@ -0,0 +1,164 @@
---
id: bad87fee1348bd9aedf08814
title: border-radius で角を丸くする
challengeType: 0
videoUrl: 'https://scrimba.com/c/cbZm2hg'
forumTopicId: 16649
dashedName: add-rounded-corners-with-border-radius
---
# --description--
今、猫の写真の角はとがっています。 `border-radius` という CSS プロパティで、この角を丸くすることができます。
# --instructions--
`border-radius` はピクセルで指定できます。 猫の写真の `border-radius``10px` にしましょう。
**注:** このチャレンジは、複数の解答が考えられます。 例えば、`border-radius``.thick-green-border` クラスと `.smaller-image` クラスのどちらに追加しても差し支えありません。
# --hints--
画像要素には `thick-green-border` クラスが必要です。
```js
assert($('img').hasClass('thick-green-border'));
```
画像の境界線の角の半径は `10px` に設定されている必要があります。
```js
assert(
$('img').css('border-top-left-radius') === '10px' &&
$('img').css('border-top-right-radius') === '10px' &&
$('img').css('border-bottom-left-radius') === '10px' &&
$('img').css('border-bottom-right-radius') === '10px'
);
```
# --seed--
## --seed-contents--
```html
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, monospace;
}
p {
font-size: 16px;
font-family: monospace;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
}
.smaller-image {
width: 100px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image thick-green-border" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
<form action="https://freecatphotoapp.com/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
```
# --solutions--
```html
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, monospace;
}
p {
font-size: 16px;
font-family: monospace;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
}
.smaller-image {
width: 100px;
border-radius: 10px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image thick-green-border" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
<form action="https://freecatphotoapp.com/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
```

View File

@ -0,0 +1,116 @@
---
id: bad87fee1348bd9aedf08822
title: 要素のマージンを調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJarHW'
forumTopicId: 16654
dashedName: adjust-the-margin-of-an-element
---
# --description--
要素の `margin` は、要素の `border` とその外側の要素の間のスペースを制御します。
ここでは、青い四角と赤い四角が黄色い四角の中に入れ子になっています。 赤い四角は青い四角より大きい `margin` を持っており、そのため小さく表示されていることに注目してください。
青い四角の `margin` を増やすと、その枠線と周囲の要素の間の距離が増えます。
# --instructions--
青い四角の `margin` が赤い四角と同じになるように変更してください。
# --hints--
`blue-box` クラスは、要素に `20px``margin` を与える必要があります。
```js
assert($('.blue-box').css('margin-top') === '20px');
```
# --seed--
## --seed-contents--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
padding: 20px;
margin: 20px;
}
.blue-box {
background-color: blue;
color: #fff;
padding: 20px;
margin: 10px;
}
</style>
<h5 class="injected-text">margin</h5>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```
# --solutions--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
padding: 20px;
margin: 20px;
}
.blue-box {
background-color: blue;
color: #fff;
padding: 20px;
margin: 20px;
}
</style>
<h5 class="injected-text">margin</h5>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```

View File

@ -0,0 +1,118 @@
---
id: bad88fee1348bd9aedf08825
title: 要素のパディングを調整する
challengeType: 0
videoUrl: 'https://scrimba.com/c/cED8ZC2'
forumTopicId: 301083
dashedName: adjust-the-padding-of-an-element
---
# --description--
では猫の写真アプリは一旦置いておいて、HTML のスタイル調整についてもっと学びましょう。
すでに気づいているかもしれませんが、すべての HTML 要素は基本的に小さな長方形です。
3 つの重要なプロパティが、各 HTML 要素を囲むスペースを制御します。`padding``border`、そして `margin` です。
要素の `padding` は、要素の中身と `border` の間のスペースを制御します。
ここでは、青い四角と赤い四角が黄色い四角の中に入れ子になっています。 赤い四角は青い四角よりも `padding` が多いことに注目してください。
青い四角の `padding` を増やすと、テキストと枠線の間の距離 (`padding`) が増えます。
# --instructions--
青い四角の `padding` が赤い四角と同じになるように変更してください。
# --hints--
`blue-box` クラスは、要素に `20px``padding` を与える必要があります。
```js
assert($('.blue-box').css('padding-top') === '20px');
```
# --seed--
## --seed-contents--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
padding: 20px;
}
.blue-box {
background-color: blue;
color: #fff;
padding: 10px;
}
</style>
<h5 class="injected-text">margin</h5>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```
# --solutions--
```html
<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}
.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}
.yellow-box {
background-color: yellow;
padding: 10px;
}
.red-box {
background-color: crimson;
color: #fff;
padding: 20px;
}
.blue-box {
background-color: blue;
color: #fff;
padding: 20px;
}
</style>
<h5 class="injected-text">margin</h5>
<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>
```

View File

@ -0,0 +1,272 @@
---
id: 5a9d7286424fe3d0e10cad13
title: CSS 変数にフォールバック値を追加する
challengeType: 0
videoUrl: 'https://scrimba.com/c/c6bDNfp'
forumTopicId: 301084
dashedName: attach-a-fallback-value-to-a-css-variable
---
# --description--
CSS プロパティの値として変数を使用する場合、指定された変数が無効な場合にブラウザが代わりに使用するフォールバック値を付けることができます。
**注:** このフォールバックはブラウザの互換性を高めるためのものではなく、また IE では動作しません。 むしろ、ブラウザが変数を見つけられない場合に表示する色を持つようにするために使用されます。
方法は次のとおりです:
```css
background: var(--penguin-skin, black);
```
これで、もし変数が設定されていなかった場合に背景色を `black` にすることができます。 これがデバッグに役立つことに注目してください。
# --instructions--
`.penguin-top` クラスと `.penguin-bottom` クラスに与えられている変数に問題があるようですね。 誤字を直すのではなく、`.penguin-top` クラスと `.penguin-bottom` クラスの `background` プロパティにフォールバック値 `black` を追加してみましょう。
# --hints--
`penguin-top` クラスの `background` プロパティのフォールバック値に `black` を使用してください。
```js
assert(
code.match(
/.penguin-top\s*?{[\s\S]*background\s*?:\s*?var\(\s*?--pengiun-skin\s*?,\s*?black\s*?\)\s*?;[\s\S]*}[\s\S]*.penguin-bottom\s{/gi
)
);
```
`penguin-bottom` クラスの `background` プロパティのフォールバック値に `black` を使用してください。
```js
assert(
code.match(
/.penguin-bottom\s*?{[\s\S]*background\s*?:\s*?var\(\s*?--pengiun-skin\s*?,\s*?black\s*?\)\s*?;[\s\S]*}/gi
)
);
```
# --seed--
## --seed-contents--
```html
<style>
.penguin {
--penguin-skin: black;
--penguin-belly: gray;
--penguin-beak: yellow;
position: relative;
margin: auto;
display: block;
margin-top: 5%;
width: 300px;
height: 300px;
}
.penguin-top {
top: 10%;
left: 25%;
/* Change code below this line */
background: var(--pengiun-skin);
/* Change code above this line */
width: 50%;
height: 45%;
border-radius: 70% 70% 60% 60%;
}
.penguin-bottom {
top: 40%;
left: 23.5%;
/* Change code below this line */
background: var(--pengiun-skin);
/* Change code above this line */
width: 53%;
height: 45%;
border-radius: 70% 70% 100% 100%;
}
.right-hand {
top: 0%;
left: -5%;
background: var(--penguin-skin, black);
width: 30%;
height: 60%;
border-radius: 30% 30% 120% 30%;
transform: rotate(45deg);
z-index: -1;
}
.left-hand {
top: 0%;
left: 75%;
background: var(--penguin-skin, black);
width: 30%;
height: 60%;
border-radius: 30% 30% 30% 120%;
transform: rotate(-45deg);
z-index: -1;
}
.right-cheek {
top: 15%;
left: 35%;
background: var(--penguin-belly, white);
width: 60%;
height: 70%;
border-radius: 70% 70% 60% 60%;
}
.left-cheek {
top: 15%;
left: 5%;
background: var(--penguin-belly, white);
width: 60%;
height: 70%;
border-radius: 70% 70% 60% 60%;
}
.belly {
top: 60%;
left: 2.5%;
background: var(--penguin-belly, white);
width: 95%;
height: 100%;
border-radius: 120% 120% 100% 100%;
}
.right-feet {
top: 85%;
left: 60%;
background: var(--penguin-beak, orange);
width: 15%;
height: 30%;
border-radius: 50% 50% 50% 50%;
transform: rotate(-80deg);
z-index: -2222;
}
.left-feet {
top: 85%;
left: 25%;
background: var(--penguin-beak, orange);
width: 15%;
height: 30%;
border-radius: 50% 50% 50% 50%;
transform: rotate(80deg);
z-index: -2222;
}
.right-eye {
top: 45%;
left: 60%;
background: black;
width: 15%;
height: 17%;
border-radius: 50%;
}
.left-eye {
top: 45%;
left: 25%;
background: black;
width: 15%;
height: 17%;
border-radius: 50%;
}
.sparkle {
top: 25%;
left: 15%;
background: white;
width: 35%;
height: 35%;
border-radius: 50%;
}
.blush-right {
top: 65%;
left: 15%;
background: pink;
width: 15%;
height: 10%;
border-radius: 50%;
}
.blush-left {
top: 65%;
left: 70%;
background: pink;
width: 15%;
height: 10%;
border-radius: 50%;
}
.beak-top {
top: 60%;
left: 40%;
background: var(--penguin-beak, orange);
width: 20%;
height: 10%;
border-radius: 50%;
}
.beak-bottom {
top: 65%;
left: 42%;
background: var(--penguin-beak, orange);
width: 16%;
height: 10%;
border-radius: 50%;
}
body {
background: #c6faf1;
}
.penguin * {
position: absolute;
}
</style>
<div class="penguin">
<div class="penguin-bottom">
<div class="right-hand"></div>
<div class="left-hand"></div>
<div class="right-feet"></div>
<div class="left-feet"></div>
</div>
<div class="penguin-top">
<div class="right-cheek"></div>
<div class="left-cheek"></div>
<div class="belly"></div>
<div class="right-eye">
<div class="sparkle"></div>
</div>
<div class="left-eye">
<div class="sparkle"></div>
</div>
<div class="blush-right"></div>
<div class="blush-left"></div>
<div class="beak-top"></div>
<div class="beak-bottom"></div>
</div>
</div>
```
# --solutions--
```html
<style>
.penguin-top {
background: var(--pengiun-skin, black);
}
.penguin-bottom {
background: var(--pengiun-skin, black);
}
</style>
```

Some files were not shown because too many files have changed in this diff Show More