Skip to content

Instantly share code, notes, and snippets.

@atestu
Last active December 29, 2015 23:09
Show Gist options
  • Save atestu/7741150 to your computer and use it in GitHub Desktop.
Save atestu/7741150 to your computer and use it in GitHub Desktop.
Artsy Quilt makes image quilts out of tag and gene pages on Artsy. It is based on the work of Edward Tufte and inspired by the ImageQuilt extension created by Tufte and Adam Schwartz.
(function () {
var masonryJS = document.createElement('script');
masonryJS.src = '//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js';
document.getElementsByTagName('head')[0].appendChild(masonryJS);
var div = $('.frame:visible')[0],
images = $(div).find('figure img');
$(div).empty().append(images);
$(div).find('img').map(function (i, d) {
$(d).css({
margin: 0,
padding: 0
});
});
var interval = setInterval(function() {
if ($(div).masonry) {
$(div).masonry({
itemSelector: 'img'
});
clearInterval(interval);
}
}, 100);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment