Main Menu

kittens

Started by Darren Dirt, November 28, 2018, 09:36:12 AM

Previous topic - Next topic

Darren Dirt

Because some day you might need to fill a webpage with a grid of kittens.
And I just discovered placekitten.com, so built this...

kittens=function(min, max, bGrayscale){
var html=[], w, h, grayscale=!bGrayscale?"":"g/";
min=min||200;
max=max||(min+5);
for(w=min; w<=max; w++){
for(h=min; h<=max; h++){
html.push('<img src="http://placekitten.com/{g}{w}/{h}" />'.replace(/{g}/g, grayscale).replace(/{w}/g, w).replace(/{h}/g, h));
}
html.push('<br />');
}
return html.join("\n");
};
_____________________

Strive for progress. Not perfection.
_____________________