Fix the gallery not working on the FFXIV page

This commit is contained in:
Joshua Goins 2025-01-01 10:10:02 -05:00
parent 2d0fa5e673
commit 8c3116c255
2 changed files with 9 additions and 3 deletions

View file

@ -1,5 +1,7 @@
var masonry;
imagesLoaded(document.querySelector('.grid'), function(instance) { imagesLoaded(document.querySelector('.grid'), function(instance) {
new Masonry('.grid', { masonry = new Masonry('.grid', {
itemSelector: '.grid-item', itemSelector: '.grid-item',
columnWidth: '.grid-sizer', columnWidth: '.grid-sizer',
gutter: '.gutter-sizer', gutter: '.gutter-sizer',
@ -20,3 +22,7 @@ if (element.length > 0) {
}); });
}); });
} }
function relayout() {
masonry.layout();
}

View file

@ -34,7 +34,7 @@
</div> </div>
</div> </div>
<input type="radio" id="tab-2" name="my-tabs"> <input type="radio" id="tab-2" name="my-tabs" onChange="relayout()">
<label for="tab-2" class="tab-label">Artwork</label> <label for="tab-2" class="tab-label">Artwork</label>
<div class="container"> <div class="container">
<div class="box"> <div class="box">
@ -43,7 +43,7 @@
<p>Here's some fan art of my WoL, I want to do more general FFXIV fan art in the future too!</p> <p>Here's some fan art of my WoL, I want to do more general FFXIV fan art in the future too!</p>
<div style="height: 500px; overflow: auto"> <div style="height: 500px; overflow: auto">
{{ partial "art-section" . }} {{ partial "art-section" . }}
</div> </div>
</div> </div>
</div> </div>