boxart / boxart-boiler

A boilerplate for Responsive DOM based Open Web Games.
MIT License
13 stars 4 forks source link

Add Clamp and Group #22

Closed mzgoddard closed 8 years ago

mzgoddard commented 8 years ago

Clamp falls into the group of responsive web design tools. It works to perform the difficult job of creating a box of known aspect ratio and horizontally and vertically centering it. We can probably revisit and break it up the aspect ratio and centering. The aspect ratio is to the viewport and it'll go outside the viewport if the elements are added above the box (and elements below will be offscreen). More control needs to be afforded either with companion styling or style control through react and matchMedia to change the max-width value in those cases.

Group provides a simple common optimization when paired with immutable data. It only updates if the data changes and it only creates new react elements for data in the passed array that changed.

mzgoddard commented 8 years ago

@MattSurabian When you get a chance, these should be ready to go at their current phase. Batch is pretty well and done. Clamp will definitely get revisited once @wilto and me figure we want people configuring it.

Realized the travis errors were node 4 and npm X complaining about peer dependency mismatch. Its a good thing we included node 4 in our test matrix.

MattSurabian commented 8 years ago

Thanks @mzgoddard I'll review this before the end of the day!

MattSurabian commented 8 years ago

Changes look good to me. I wish we had a better naming convention for that clamp directory hierarchy but at least what's there is sensible. :+1: Merge when ready @mzgoddard