mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-20 19:11:52 +02:00
This switches the Gallery shortcode to use MagicGrid instead of Packery. The main benefit is size (2.7k as opposed to 32k), and the results are mostly similar minus a few differences in image position.
20 lines
603 B
JavaScript
20 lines
603 B
JavaScript
(function init() {
|
|
|
|
$(window).on("load", function () {
|
|
let packeries = [];
|
|
let nodeGalleries = document.querySelectorAll('.gallery');
|
|
|
|
nodeGalleries.forEach(nodeGallery => {
|
|
let magicGrid = new MagicGrid({
|
|
container: nodeGallery,
|
|
static: true,
|
|
gutter: 5,
|
|
animate: false,
|
|
});
|
|
magicGrid.listen();
|
|
magicGrids.push(magicGrid);
|
|
});
|
|
console.log("Galleries founded and initialized with MagicGrid", packeries);
|
|
console.groupEnd();
|
|
});
|
|
})();
|