Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

3.0 KiB
Raw Blame History

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
bad87fee1348bd9aedf08719 使用缩写的十六进制编码 0 https://scrimba.com/c/cRkpKAm 18338 use-abbreviated-hex-code

--description--

许多人对超过 1600 万种颜色感到不知所措,并且很难记住十六进制编码。幸运的是,它也提供缩写的方法。

例如,红色的 #FF0000 十六进制编码可以缩写成 #F00。在这种缩写形式里三个数字分别代表着红R、绿G、蓝B三原色。

这样,颜色的数量减少到了大约 4000 种。且在浏览器里 #FF0000#F00 是完全相同的颜色。

--instructions--

接下来,使用缩写的十六进制编码给元素设置正确的颜色。

ColorShort Hex Code
Cyan#0FF
Green#0F0
Red#F00
Fuchsia#F0F

--hints--

文本内容为 I am red!h1 元素的字体颜色应该为红色。

assert($('.red-text').css('color') === 'rgb(255, 0, 0)');

应使用红色的十六进制编码的缩写形式,不应使用 #FF0000

assert(code.match(/\.red-text\s*?{\s*?color:\s*?#F00\s*?;\s*?}/gi));

文本内容为 I am green!h1 元素的字体颜色应该为绿色。

assert($('.green-text').css('color') === 'rgb(0, 255, 0)');

应使用绿色的十六进制编码的缩写形式,不应使用 #00FF00

assert(code.match(/\.green-text\s*?{\s*?color:\s*?#0F0\s*?;\s*?}/gi));

文本内容为 I am cyan!h1 元素的字体颜色应该为蓝绿色。

assert($('.cyan-text').css('color') === 'rgb(0, 255, 255)');

应使用蓝绿色的十六进制编码的缩写形式,不应使用 #00FFFF

assert(code.match(/\.cyan-text\s*?{\s*?color:\s*?#0FF\s*?;\s*?}/gi));

文本内容为 I am fuchsia!h1 元素的字体颜色应该为紫红色。

assert($('.fuchsia-text').css('color') === 'rgb(255, 0, 255)');

应使用紫红色的十六进制编码的缩写形式,不应使用 #FF00FF

assert(code.match(/\.fuchsia-text\s*?{\s*?color:\s*?#F0F\s*?;\s*?}/gi));

--seed--

--seed-contents--

<style>
  .red-text {
    color: #000000;
  }
  .fuchsia-text {
    color: #000000;
  }
  .cyan-text {
    color: #000000;
  }
  .green-text {
    color: #000000;
  }
</style>

<h1 class="red-text">I am red!</h1>

<h1 class="fuchsia-text">I am fuchsia!</h1>

<h1 class="cyan-text">I am cyan!</h1>

<h1 class="green-text">I am green!</h1>

--solutions--

<style>
  .red-text {
    color: #F00;
  }
  .fuchsia-text {
    color: #F0F;
  }
  .cyan-text {
    color: #0FF;
  }
  .green-text {
    color: #0F0;
  }
</style>

<h1 class="red-text">I am red!</h1>

<h1 class="fuchsia-text">I am fuchsia!</h1>

<h1 class="cyan-text">I am cyan!</h1>

<h1 class="green-text">I am green!</h1>