Created
May 16, 2013 19:04
-
-
Save sebastiangeiger/5594203 to your computer and use it in GitHub Desktop.
Simulating different responsive strategies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| simulated_widths = (100 ... 1024).to_a.reverse | |
| puts "Maximizing the width" | |
| simulated_widths.each do |width| | |
| number_of_elements_per_row = (width/200.0).ceil | |
| element_width = (width/number_of_elements_per_row).floor #floor to get even pixel values | |
| puts " #{width}px: #{number_of_elements_per_row} elements with #{element_width}px" | |
| end | |
| puts "Minimizing the width" | |
| simulated_widths.each do |width| | |
| number_of_elements_per_row = (width/100.0).floor | |
| element_width = (width/number_of_elements_per_row).floor #floor to get even pixel values | |
| puts " #{width}px: #{number_of_elements_per_row} elements with #{element_width}px" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment