Skip to content

Commit

Permalink
Exercises for sections 01/01 - 02/05
Browse files Browse the repository at this point in the history
  • Loading branch information
milesfrain committed Feb 1, 2020
1 parent 1586d8f commit e632c8d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/01-Static-HTML/01-Static-HTML.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ To compile the next file and view its results in the browser, use these instruct
spago bundle-app -m StaticHTML.StaticHTML -t assets/static-html/static-html.js
parcel serve assets/static-html/static-html.html -o static-html--parcelified.html --open
```

## Exercises
1. Add another button below the first button with text label "Another Button".
2. Add a paragraph (`p` tag) containing any text.
3 changes: 3 additions & 0 deletions src/01-Static-HTML/03-Adding-Properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ To compile the next file and view its results in the browser, use these instruct
spago bundle-app -m StaticHTML.AddingProperties -t assets/static-html/adding-properties.js
parcel serve assets/static-html/adding-properties.html -o adding-properties--parcelified.html --open
```

## Exercises
1. Assign class names of "special-button" and "it-clicks" to the button.
3 changes: 3 additions & 0 deletions src/01-Static-HTML/05-Adding-CSS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,6 @@ To compile the next file and view its results in the browser, use these instruct
spago bundle-app -m StaticHTML.AddingCSS -t assets/static-html/adding-css.js
parcel serve assets/static-html/adding-css.html -o adding-css--parcelified.html --open
```

## Exercises
1. Change the `color` of the text of the span to `blue` and the button to `green`. Remember to add the necessary imports.
4 changes: 4 additions & 0 deletions src/02-Dynamic-HTML/01-Adding-State.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ To compile the next file and view its results in the browser, use these instruct
spago bundle-app -m DynamicHtml.AddingState -t assets/dynamic-html/adding-state.js
parcel serve assets/dynamic-html/adding-state.html -o adding-state--parcelified.html --open
```

## Exercises
1. Change the numbered states `1 2 3` to characters `A B C`.
2. Add a 4th state. Note that `assets/dynamic-html/adding-state.html` requires an edit.
4 changes: 4 additions & 0 deletions src/02-Dynamic-HTML/04-Adding-Event-Handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ To compile the next file and view its results in the browser, use these instruct
spago bundle-app -m DynamicHtml.AddingEventHandling -t assets/dynamic-html/adding-event-handling.js
parcel serve assets/dynamic-html/adding-event-handling.html -o adding-event-handling--parcelified.html --open
```

## Exercises
1. Make the button behave as a stoplight that rotates through three states: `Green, Yellow, Red`. Hint, use "algebraic data types" and `case` statements.
2. Change the background color of the button to match its state. Hint, refer to previous chapter on CSS.

0 comments on commit e632c8d

Please sign in to comment.