|
|
|
|
@ -50,19 +50,23 @@ The contents of the `body` element should be centered on the page by setting the
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('body')?.height === '100vh' && new __helpers.CSSHelp(document).getStyle('body')?.display === 'flex' && new __helpers.CSSHelp(document).getStyle('body')?.justifyContent === 'center'&& new __helpers.CSSHelp(document).getStyle('body')?.alignItems === 'center');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('body')?.height, '100vh')
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('body')?.display, 'flex');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('body')?.justifyContent, 'center');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('body')?.alignItems, 'center');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You should have a main `div` with the class `space`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(document.querySelector('div')?.getAttribute('class') === 'space');
|
|
|
|
|
assert.strictEqual(document.querySelector('div')?.getAttribute('class'), 'space');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `space` `div` should have a width and height of `200px`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.space')?.width === '200px' && new __helpers.CSSHelp(document).getStyle('.space')?.height === '200px');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.space')?.width, '200px')
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.space')?.height, '200px');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You should have a `div` with the class `earth` inside the `.space` `div`.
|
|
|
|
|
@ -74,34 +78,36 @@ assert.exists(document.querySelector('div.space div.earth'));
|
|
|
|
|
The `earth` div should be the first child of the `space` `div`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(document.querySelector('.space > div')?.getAttribute('class') === 'earth');
|
|
|
|
|
assert.strictEqual(document.querySelector('.space > div')?.getAttribute('class'), 'earth');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `earth` `div` should have a width and height of `100px`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.earth')?.width === '100px' && new __helpers.CSSHelp(document).getStyle('.earth')?.height === '100px');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.earth')?.width, '100px');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.earth')?.height, '100px');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `earth` `div` should use `absolute` positioning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.earth')?.position === 'absolute');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.earth')?.position, 'absolute');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `earth` `div` should have a `top` and `left` position of `50%`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.earth')?.top === '50%' && new __helpers.CSSHelp(document).getStyle('.earth')?.left === '50%');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.earth')?.top, '50%')
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.earth')?.left, '50%');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `earth` `div` should be moved back and up by `50%` by setting the `transform` property to `translate(-50%, -50%)`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.earth')?.transform === 'translate(-50%, -50%)');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.earth')?.transform, 'translate(-50%, -50%)');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You should have a `div` with the class `orbit` inside the `.space` `div`.
|
|
|
|
|
@ -113,25 +119,26 @@ assert.exists(document.querySelector('div.space div.orbit'));
|
|
|
|
|
The `orbit` class `div` should come after the `earth` class `div`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(document.querySelector('.earth')?.nextElementSibling?.classList?.contains('orbit'));
|
|
|
|
|
assert.isTrue(document.querySelector('.earth')?.nextElementSibling?.classList?.contains('orbit'));
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `orbit` `div` should have a width and height of `200px`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.orbit')?.width === '200px' && new __helpers.CSSHelp(document).getStyle('.orbit')?.height === '200px');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.orbit')?.width, '200px')
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.orbit')?.height, '200px');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `orbit` `div` should use `absolute` positioning.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.orbit')?.position === 'absolute');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.orbit')?.position, 'absolute');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `orbit` `div` should be positioned at the center of the `space` `div` using a `transform` property that shifts it by `-50%` on both the vertical and horizontal axes.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.orbit')?.transform === 'translate(-50%, -50%)');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.orbit')?.transform, 'translate(-50%, -50%)');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You should have a `div` with the class `moon` inside the `.orbit` `div`.
|
|
|
|
|
@ -143,99 +150,100 @@ assert.exists(document.querySelector('div.space div.orbit div.moon'));
|
|
|
|
|
The `moon` `div` should have a width and height of `30px`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.moon')?.width === '30px' && new __helpers.CSSHelp(document).getStyle('.moon')?.height === '30px');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.moon')?.width, '30px')
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.moon')?.height, '30px');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `moon` `div` should be positioned using `absolute` positioning.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.moon')?.position === 'absolute');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.moon')?.position, 'absolute');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The top edge of the `.moon` element should be aligned with the top edge of its containing block.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.moon')?.top === '0px');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.moon')?.top, '0px');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You should move the left edge of the `.moon` element to the center of the containing block (`50%` from the left side).
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.moon')?.left === '50%');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.moon')?.left, '50%');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `.moon` `div` should be adjusted horizontally by translating it to `-50%` across the x-axis.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.moon')?.transform === 'translateX(-50%)');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.moon')?.transform, 'translateX(-50%)');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `.earth` `div` element should have a background color.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.earth')?.backgroundColor);
|
|
|
|
|
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.earth')?.backgroundColor);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `.earth` element should have `border-radius` of `50%` to make it look like a circle.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.earth')?.borderRadius === '50%');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.earth')?.borderRadius, '50%');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `.moon` `div` element should have a background color.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.moon')?.backgroundColor);
|
|
|
|
|
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.moon')?.backgroundColor);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `.moon` element should have `border-radius` of `50%` to make it look like a circle.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getStyle('.moon')?.borderRadius === '50%');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.moon')?.borderRadius, '50%');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You should have a `@keyframes` rule.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.length === 1);
|
|
|
|
|
assert.lengthOf(new __helpers.CSSHelp(document).getCSSRules('keyframes'), 1);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your new `@keyframes` rule should be named `orbit`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.name === 'orbit');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.name, 'orbit');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `@keyframes orbit` rule should have a `0%` selector.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
const rules = new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules
|
|
|
|
|
assert(rules?.[0]?.keyText === '0%' || rules?.[0]?.keyText === '0%');
|
|
|
|
|
const rules = new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules;
|
|
|
|
|
assert.strictEqual(rules?.[0]?.keyText, '0%');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `@keyframes orbit` rule should have a `100%` selector.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
const rules = new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules
|
|
|
|
|
assert(rules?.[0]?.keyText === '100%' || rules?.[1]?.keyText === '100%');
|
|
|
|
|
assert.isTrue(rules?.[0]?.keyText === '100%' || rules?.[1]?.keyText === '100%');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `0%` selector should have a `transform` property set to `rotate(0deg) translate(-50%, -50%)`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules?.[0]?.style?.transform === 'rotate(0deg) translate(-50%, -50%)');
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules?.[0]?.style?.transform, 'rotate(0deg) translate(-50%, -50%)');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `100%` selector should come after your `0%` selector.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules?.[1]?.keyText === '100%')
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules?.[1]?.keyText, '100%')
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `100%` selector should have a `transform` property set to `rotate(360deg) translate(-50%, -50%)`.
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
assert(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules?.[1]?.style?.transform === 'rotate(360deg) translate(-50%, -50%)')
|
|
|
|
|
assert.strictEqual(new __helpers.CSSHelp(document).getCSSRules('keyframes')?.[0]?.cssRules?.[1]?.style?.transform, 'rotate(360deg) translate(-50%, -50%)')
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Your `.orbit` selector should have an `animation` property set to `orbit 5s linear infinite`.
|
|
|
|
|
@ -243,12 +251,10 @@ Your `.orbit` selector should have an `animation` property set to `orbit 5s line
|
|
|
|
|
```js
|
|
|
|
|
|
|
|
|
|
const orbitStyles = new __helpers.CSSHelp(document).getStyle('.orbit');
|
|
|
|
|
assert(
|
|
|
|
|
orbitStyles?.animationName === "orbit" &&
|
|
|
|
|
orbitStyles?.animationDuration === "5s" &&
|
|
|
|
|
orbitStyles?.animationTimingFunction === "linear" &&
|
|
|
|
|
orbitStyles?.animationIterationCount === "infinite"
|
|
|
|
|
);
|
|
|
|
|
assert.strictEqual(orbitStyles?.animationName, "orbit");
|
|
|
|
|
assert.strictEqual(orbitStyles?.animationDuration, "5s");
|
|
|
|
|
assert.strictEqual(orbitStyles?.animationTimingFunction, "linear");
|
|
|
|
|
assert.strictEqual(orbitStyles?.animationIterationCount, "infinite");
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|