Flex Panels is a image gallery website built with Vanilla JavaScript.
✅ Completed & Deployed
- HTML
- CSS
- Vanilla JS
This was another Vanilla JS project from JavaScript 30 course by Wes Bos.
Some features to highlight in this project are:
-
using
flexbox
and nested flexbox to position panels and its child elements. -
using the
flex-grow
CSS property to adjust the ratio of the sizes of the panels. -
toggling the
.open
and.open-active
classes from the panel elements to give animation-like effect with thetransform
properties..panel > *:first-child { transform: translateY(-100%); } .panel.open-active > *:first-child { transform: translateY(0); } .panel > *:last-child { transform: translateY(100%); } .panel.open-active > *:last-child { transform: translateY(0); }
Some new CSS tricks that I learned from this project are:
- understanding
flex-grow
,flex-shrink
, andflex-basis
:flex-basis
: base sizeflex-grow
: how to share extra spaceflex-shrink
: how much to shrink when there isn't enough space
Soojeong Park @codingsooj