Add generic code to build album of all images

This commit is contained in:
2024-10-24 12:00:02 +02:00
parent a5067c7e84
commit fef60c6e43
9 changed files with 118 additions and 17 deletions

36
assets/js/gallery.js Normal file
View File

@@ -0,0 +1,36 @@
$(function(){
$.get('./index.json', function(data) {
var items = $.map(data.images, function(img) {
return {
src: img.url,
srct: img.thumbnail,
height: img.height,
width: img.width,
}
});
$('#gallery').nanogallery2({
thumbnailHeight: 200,
thumbnailWidth: 'auto',
thumbnailGutterWidth: 10,
thumbnailGutterHeight: 10,
thumbnailDisplayTransition: 'scaleUp',
thumbnailDisplayTransitionDuration: 700,
thumbnailHoverEffect2: 'toolsAppear|scale120|borderLighter',
// thumbnailToolbarImage: {
// topLeft: 'share|download',
// },
viewerGallery: 'bottom',
viewerTools: {
topRight: 'zoomButton, fullscreenButton, downloadButton, closeButton',
},
items,
})
})
})