Created
April 15, 2017 15:32
-
-
Save abusedmedia/ff8d5a545704569f7b118836f3c6f26f to your computer and use it in GitHub Desktop.
This file contains 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
function gen(){ | |
$('body').empty() | |
var number_column = parseInt(Math.random()*6) + 2 | |
for(var i=0; i<number_column; ++i){ | |
var number_rows = parseInt(Math.random()*50) + 5 | |
var flex_value_col = Math.random()*10 | |
var col = $('<div class="col" style="flex:'+flex_value_col+';"></div>') | |
$('body').append(col) | |
for(var j=0; j<number_rows; ++j){ | |
var flex_value_row = Math.random()*10 | |
var color = (Math.random()>.2) ? 'black' : 'white' | |
var border_bottom = (Math.random()>.5) ? 1 : 0 | |
col.append('<div class="item" style="flex:'+flex_value_row+';background-color:'+color+';margin-bottom:'+border_bottom+'px;"></div>') | |
} | |
} | |
} | |
$('body').on('click', function(){ | |
gen() | |
}) | |
gen() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment