CodePen

HTML

            
              <div class="controls">
  <input type="range" id="amount" />
</div>

<div id="flexbox-land">
  
  
</div>
            
          
!

CSS

            
              .controls {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 200px;
  padding: 20px;
  background: rgba(0,0,0,0.5);
}
input {
  width: 100%;
}

.flexer {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex; 
  width: 100%;
}
.flexer div {
  padding: 20px;
}
.flexer div:nth-child(2) {
  -webkit-box-flex: 1;
  -moz-box-flex: 1; 
  width: 20%;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              function removeAll() {
  $("#flexbox-land").empty(); 
}

var dummyText = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.";
var dummyTextArray = dummyText.split(" ");

var template = _.template(
  "<div class='flexer'>" + 
  "<div style='width: <%= width %>%; background: <%= background1 %>'>" + 
       "<%= content %>" + 
    "</div>" +
  "<div style='background: <%= background2 %>'><%= content %></div>" + 
  "</div>"
);


$("#amount").on("change", function() {
  
  removeAll();
  
  var num = $(this).val(), i;
  
  for (i = 0; i < num; i++) {
    
    var strLength = (Math.random()*80)+1;
    var content = "";
    for (x = 0; x < strLength; x++) {
       content += dummyTextArray[x] + " ";
    }
  
    tempString = template({
      "width": Math.floor((Math.random()*40)+20),
      "background1": '#'+Math.floor(Math.random()*16777215).toString(16),
      "background2": '#'+Math.floor(Math.random()*16777215).toString(16),
      "content" : content
    });
    
    // probably should concat all the strings then append just once.
    
    $("#flexbox-land").append(tempString);
    
  }  
  
}).change(); 
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................