This post is about the next two classes in the course. In case you missed it, check out my post on class #1 and class #2.
What I learned:
- CSS vars, duh!
.controls CSS class to select controls!
- nasty way to set the var’s suffix. Manually add a
data- attribute to the input element just to read it back later and use it for the CSS var. Ugh!
Array Cardio Day 1
- filter/sort/map/reduce yay! Reduce is quite powerful.
- de-structuring an array. Cool trick to easily get elements out of an array into separate variables.
OK, slacked a bit before taking these two classes. Life happens in between 🙂
OK, OK, episode2… Go!
This time the goal is to make an analog clock tick.
Again, most of the HTML+CSS is there provided by Wes and I only need to add the “ticking” JS code. The “trick” is to keep applying a CSS transformation to the hands by setting the rotation angle.
What I learned in this course:
transform-origin to position the point where the CSS transformation will apply
transition-timing-function for how the transition should play out
- The cubic bezier editor in Chrome’s developer tools! Look at that!
element.style.transform is not a function so, no
.transform(rotate(...)). I intuitively tried to use it as a function, not sure why.
- and oh, yeah, forgot to mention the backticks in episode 1. Cool way to embed variables in strings and have them be expanded!
K, this was a quick one but fun anyway. Stay tuned!
To make the commitment a little more, well, official, I decided to document my findings throughout the courses so, here I am!
First course was about wiring up a Drum Kit in JS. Starter files had the HTML+CSS ready and I just needed to add the JS6 code. Every time a key is hit, the drum kit will play the corresponding sound (say clap, hihat, kick, etc) while doing a small animation of the key on-screen to show which one got hit. Neat!
So, here’s what I learned from the first course called Drum Kit:
- attribute selectors
- arrow function (
- listening for the