vendor
7 years ago
admin.js
1 year ago
ads.js
1 year ago
carousel.js
1 year ago
carousel.min.js
2 years ago
documents-viewer-script.js
3 years ago
embed-ui.min.js
11 months ago
front.js
1 year ago
gallery-justify.js
1 year ago
glider.js
1 year ago
glider.min.js
2 years ago
gutneberg-script.js
1 year ago
index.html
7 years ago
initCarousel.js
2 years ago
initplyr.js
2 years ago
instafeed.js
2 years ago
license.js
2 years ago
pdfobject.js
1 year ago
plyr.js
1 year ago
plyr.polyfilled.js
3 years ago
preview.js
3 years ago
remove-round-button.js
11 months ago
settings.js
6 years ago
vimeo-player.js
2 years ago
ytiframeapi.js
2 years ago
gallery-justify.js
34 lines
| 1 | (function(){ |
| 2 | function justifyGallery() { |
| 3 | const justify_scale = screen.height * 0.2; |
| 4 | let items = document.querySelectorAll('.photos-gallery-justify .photo-item'); |
| 5 | |
| 6 | items.forEach(item => { |
| 7 | let image = item.querySelector('img'); |
| 8 | if (!image) return; |
| 9 | |
| 10 | function adjustItem() { |
| 11 | let ratio = image.naturalWidth / image.naturalHeight; |
| 12 | item.style.width = justify_scale * ratio + 'px'; |
| 13 | item.style.flexGrow = ratio; |
| 14 | } |
| 15 | |
| 16 | if (image.complete) { |
| 17 | adjustItem(); |
| 18 | } else { |
| 19 | image.onload = adjustItem; |
| 20 | } |
| 21 | }); |
| 22 | } |
| 23 | |
| 24 | if (document.readyState === 'loading') { |
| 25 | document.addEventListener('DOMContentLoaded', justifyGallery); |
| 26 | } else { |
| 27 | justifyGallery(); |
| 28 | } |
| 29 | |
| 30 | |
| 31 | window.addEventListener('load', justifyGallery); |
| 32 | })(); |
| 33 | |
| 34 | console.log("checking for justifyGallery"); |