2.8 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 619665c9abd72906f3ad30f9 | Passo 1 | 0 | step-1 |
--description--
Você criará um Flappy Penguin feliz e explorará ainda mais transformações e animações em CSS no processo.
Comece com o boilerplate padrão do HTML. Inclua a declaração DOCTYPE, o elemento html, as tags meta apropriadas, os elementos head, body e title. Além disso, vincule a folha de estilos à página.
--hints--
O código deve ter uma declaração <!DOCTYPE html>.
assert(code.match(/<!DOCTYPE html>/i));
O código deve ter um elemento html.
assert.equal(document.querySelectorAll('html')?.length, 1);
O código deve ter um elemento head dentro do elemento html.
assert.equal(document.querySelectorAll('head')?.length, 1);
O código deve ter um elemento body dentro do elemento html.
assert.equal(document.querySelectorAll('body')?.length, 1);
O elemento head deve vir antes do elemento body.
assert.equal(document.querySelector('body')?.previousElementSibling?.tagName, 'HEAD');
Você deve ter dois elementos meta.
const meta = document.querySelectorAll('meta');
assert.equal(meta?.length, 2);
Um elemento meta deve ter o atributo name definido como viewport e o atributo content definido como width=device-width, initial-scale=1.0.
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => m?.getAttribute('name') === 'viewport' && m?.getAttribute('content') === 'width=device-width, initial-scale=1.0' && !m?.getAttribute('charset'));
assert.exists(target);
O outro elemento meta deve ter o atributo charset com o valor UTF-8.
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => !m?.getAttribute('name') && !m?.getAttribute('content') && m?.getAttribute('charset')?.toLowerCase() === 'utf-8');
assert.exists(target);
O código deve ter um elemento title.
const title = document.querySelector('title');
assert.exists(title);
O elemento title deve ter algum texto.
const title = document.querySelector('title');
assert.isAtLeast(title?.textContent?.length, 1);
O código deve ter um elemento link.
assert(/<link/.test(code))
O elemento link deve estar dentro do elemento head.
assert(code.match(/<head>[\w\W\s]*<link[\w\W\s]*\/>[\w\W\s]*<\/head>/i))
O elemento link deve ter o atributo rel com o valor stylesheet.
assert.match(code, /<link[\s\S]*?rel=('|"|`)stylesheet\1/)
O elemento link deve ter o atributo href com o valor styles.css.
assert.match(code, /<link[\s\S]*?href=('|"|`)(\.\/)?styles\.css\1/)
--seed--
--seed-contents--
--fcc-editable-region--
--fcc-editable-region--