Browse Source

docs(pimp-my-style): correct grammar

pull/1244/head
davhojt 2 years ago committed by Dav Hojt
parent
commit
dd454651c9
  1. 31
      subjects/pimp-my-style/README.md

31
subjects/pimp-my-style/README.md

@ -8,18 +8,22 @@ Check out that button on the HTML page:
<button class="button">pimp my style</div>
```
For now, it's only a lonely, basic and sad element ; let's pimp it up!
For now, it's only a lonely, basic and sad element. let's pimp it up.
On each click on the page, a function `pimp` is triggered.
Write the body of that function so that the button's class is altered:
- Add in order the next class of the `styles` array provided in the data file below
- When the end of the array is reached, remove backwards each class
- Toggle the class 'unpimp' when removing classes
- From the data file provided, add each of the `styles` array elements as classes, in order.
- When the end of the array is reached, remove the classes in a FIFO fashion.
- While removing classes, toggle the `unpimp` class on. And toggle it off again while adding classes.
```
Example for a `styles` array with only 3 classes:
```js
["one", "two", "three"]
```
```
Page load --> <button class="button"></div>
...adding
@ -35,21 +39,20 @@ Click 5 --> <button class="button one unpimp"></div>
Click 6 --> <button class="button"></div>
```
### Notions
- [`classList`](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList): `add()`, `remove()`, `toggle()`
### Files
You only need to create & submit the JS file `pimp-my-style.js` ; we're providing you the following files to download (click right and save link) & test locally:
You only need to create & submit the JS file `pimp-my-style.js`. Ee're providing you the following files to download and test locally.:
- the HTML file [pimp-my-style.html](./pimp-my-style.html) to open in the browser, which includes:
- the JS script running some code, and which will also allow to run yours
- some CSS pre-styled classes: feel free to use those as they are, or modify them
- the data file [pimp-my-style.data.js](./pimp-my-style.data.js) from which you can import `styles`
- the JS script running some code, and which will enable you to run yours.
- some CSS pre-styled classes: feel free to use those as they are, or modify them.
- the data file [pimp-my-style.data.js](./pimp-my-style.data.js) from which you can import `styles`.
### Expected result
You can see an example of the expected result [here](https://youtu.be/VIRf3TBDTN4)
### Notions
- [classList](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList): `add()`, `remove()`, `toggle()`

Loading…
Cancel
Save