Flexbox Froggy: A game for learning CSS flexbox
flexboxfroggy.com
flexboxfroggy.com
Reminds me of CSS Diner - https://flukeout.github.io/
I first started learning webdev in 2005 and just a decade later the number of educational resources blows my mind.
That said, try "flexbox game learning" in duckduckgo ;-) - https://duckduckgo.com/?q=flexbox+game+learning&t=ffhp
FWIW: DuckDuckGo ROCKS! DuckDuckGo bang syntax ROCKS! Even when DuckDuckGo itself doesn't rock, it let's you easily, and slightly more privately, search other search engines https://duckduckgo.com/bang so It ROCKS even when it doesn't ROCK!
That said, I did enjoy the last level as a challenge; it prompted me not only to review earlier levels, but also check documentation elsewhere. Much like a real-world challenge, these can be valuable learning experiences.
This is similar to the way that https://rubymonk.com/ for example shows you how to do `2.even?` but doesn't show you the equivalent method for checking if a number is odd.
But this game was great! Ten minutes and I think I’m almost ready to ditch the crutch.
Here is a gist if you can't get it :-)
https://github.com/thomaspark/flexboxfroggy/blob/gh-pages/le...
Edit: later levels (~10) begin to help with the discerning the difference between the flexbox main and cross axes.
I was revamping some old code of mine, removing outdated technologies of third parties like YUI... But I noticed that I needed them for layout. But flexbox can provide an alternative for me.
Thanks a bunch!
Game designers, take note: design open-world games that let the player explore the controls, instead of simply refusing all unwanted actions.
Paste this into the console:
levels.push({ name: 'super secret-1', instructions: 'This is a secret level you get no instructions.', board: 'rggggyyyyy', style: {'flex-direction': 'column-reverse', 'flex-wrap': 'wrap-reverse', 'align-content': 'space-between', 'justify-content': 'center'}, before: "#pond {\n display: flex;\n", after: "}", });
Proceed to the secret 25th level! You can create your own levels, and make a pull request to his git repository if you really want to add some interesting practice levels. Just modify levels.js.
You can reference his levels here when trying to create your own.
https://github.com/thomaspark/flexboxfroggy/blob/gh-pages/le...
My understanding is that it seems `align-items` is to do with the children of the element, while `align-content` is to do with the spacing with regards to the parent container. In some ways, `align-content` will always imply a certain "bunching" to the children (they are either stuck to the start, end, center or spaced evenly in some manner - but never changing order, wrap or size), whereas `align-items` changes how lone-items behave in the flow, be it start, end, center or some stretching).
These two URLs provide some decent visual demos & distinction:
https://css-tricks.com/almanac/properties/a/align-content/ https://css-tricks.com/almanac/properties/a/align-items/
I do wonder about the point of the `order` property, would anyone ever want to mess with this? It seems like something that should absolutely be in your application code, either client-side javascript or server-side. Using it seems like it would make a project harder to maintain and understand.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexibl...
tldr:
desktop viewport:
_header____
nav|article
mobile viewport: header
article
nav
can be done really easily with flexbox and `order`.Their solution was creating a new paradigm. You need to regard it as different from display:block and display:inline in the same way that those are fundamentally different than display:table.
CSS is capable of supporting all sorts of display models… just wait until display:grid rolls around.
There is also "display: inline-flex" which functions as an element with "display: inline".
In my opinion this system is better than introducing a brand new css property. It would be redundant to have to put "display-contents: flex" along with "display: block".
The thing is, display: flex does control some aspects of the element it is applied to. Because there is display: inline-flex. It is roughly the equivalent of block and inline-block. It's just an added bonus that display: flex also affects the immediate children, making them flex items to be manipulated. For instance, make a div display: table and imagine its immediate children are automatically display: table-row, or something of that nature.
ie,
block | inline
---------
flex | inline-flex
What could you label the axes here? Or is this not a valid way to frame the relationship between these things?I'm guessing maybe I can say flex = block and inline-flex = inline-block? Except that the flex properties also affect its immediate children.
On a similar note Im curious if there is a responsive typography framework that's out there and people are using? A framework where the text automatically shrinks down without having to change the font-size in various media queries?
https://web-design-weekly.com/2014/11/18/viewport-units-vw-v...
I actually use the two in conjunction. I set some my html {font-size: 1.2vw;} (or whatever), and all type in the document to 1rem (or whatever measurement). Then I finally step out the html size to major browser breakpoints using old-fashioned media queries.
The "master" type size is set to a vh unit, everything else is rem’d off that, and stepped via media query.
edit: lvl 15 makes colorblind kids sad :(
edit2: almost, almost http://i.imgur.com/egndPZ8.png
edit3: champion!
There's nothing to stop you starting from the beginning at any point, or starting from scratch at any point in future. It makes it less of a 'game' but, like I said, I think you're overplaying the game element.