mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-23 15:05:38 -06:00
35 lines
927 B
JavaScript
35 lines
927 B
JavaScript
( function( window ) {
|
|
|
|
'use strict';
|
|
|
|
window.appendRandomSizedItems = function( container ) {
|
|
var frag = document.createDocumentFragment();
|
|
var item;
|
|
for ( var i=0; i < 9; i++ ) {
|
|
item = document.createElement('div');
|
|
item.className = 'item';
|
|
var w = Math.floor( Math.random() * Math.random() * 70 ) + 10;
|
|
var h = Math.floor( Math.random() * Math.random() * 70 ) + 10;
|
|
item.style.width = w + 'px';
|
|
item.style.height = h + 'px';
|
|
frag.appendChild( item );
|
|
}
|
|
|
|
// last one isn't random, but is needed for checking
|
|
// bigger than colum width and stuff
|
|
item = document.createElement('div');
|
|
item.className = 'item';
|
|
item.style.width = '72px';
|
|
item.style.height = '25px';
|
|
frag.appendChild( item );
|
|
|
|
container.appendChild( frag );
|
|
};
|
|
|
|
window.gimmeAnItemElement = function() {
|
|
var elem = document.createElement('div');
|
|
elem.className = 'item';
|
|
return elem;
|
|
};
|
|
|
|
})( window );
|