mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01: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.
21 lines
603 B
JavaScript
21 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();
|
|
});
|
|
})();
|