JavaScript 30 Day 5 Study Notes

https://javascript30.com/

The JavaScript 30 Day 5 project involved working with CSS transitions and flexbox more so than JavaScript. We manipulated panels of images with text using JavaScript, but the CSS setup played a vital part.

Five panels were set up in a row. Each panel contained three child panels containing text. However, initially, only one child panel was visible. Upon mouse click, the other two child panels drop into view.

Bos set up the HTML as such:

Then Bos nested a flexbox within a flexbox. I had never seen this done before.

He set up the first and last child of the .panel div to initially sit out of the viewport. Next, he set up a second sub-class, .panel.open-active, where they were in view.

The JavaScript merely listened for a click event and toggled between the two sub-classes.

And a similar code sequence to re-set.

The code was more familiar to me but nesting the flex divs created a neat visual effect I hadn’t seen before.

View my notes from Day 4

View my notes from the beginning.

--

--

Retired physician, writer, aspiring website designer and developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jeffrey Amen

Retired physician, writer, aspiring website designer and developer