hugo-theme-zzo/layouts/gallery/single.html

92 lines
2.9 KiB
HTML
Raw Normal View History

2019-11-04 13:09:44 +00:00
{{ define "main" }}
<header class="header">
<h3 class="terms__title h3">{{ .Title }}</h3>
<div class="gallery__contents">
{{ .Content }}
</div>
</header>
<main class="gallery main">
<div class="grid single__contents">
<div class="grid-sizer"></div>
{{ $basename := (replace .File.Dir "\\" "/") }}
{{ range (readDir (print "./static/" $basename)) }}
<div class="grid-item">
2019-11-05 08:22:56 +00:00
<img data-src="{{ $basename | relURL }}{{ .Name }}" alt="{{ .Name }}" class="lazyload">
2019-11-04 13:09:44 +00:00
</div>
{{ end }}
</div>
{{ partial "pagination/pagination-single" . }}
</main>
{{ partial "body/photoswipe" . }}
2019-11-05 08:51:53 +00:00
{{ $masonry := resources.Get `js/masonry.pkgd.min.js` | resources.Fingerprint }}
2019-11-05 08:59:17 +00:00
<script src="{{ $masonry.RelPermalink }}"></script>
2019-11-05 08:51:53 +00:00
{{ $imagesloaded := resources.Get `js/imagesloaded.pkgd.min.js` | resources.Fingerprint }}
2019-11-05 08:59:17 +00:00
<script src="{{ $imagesloaded.RelPermalink }}"></script>
2019-11-04 13:09:44 +00:00
<script>
2019-11-05 08:11:56 +00:00
var $grid = $('.grid').masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-sizer',
percentPosition: true,
});
$grid.imagesLoaded().progress(function () {
$grid.masonry();
});
2019-11-04 13:09:44 +00:00
2019-11-05 08:11:56 +00:00
enquire.register("screen and (max-width:500px)", {
match: function () {
$('.grid-item').addClass('full');
$('.grid-sizer').addClass('full');
$('.grid-item').removeClass('half');
$('.grid-sizer').removeClass('half');
},
unmatch: function () {
$('.grid-item').addClass('half');
$('.grid-sizer').addClass('half');
$('.grid-item').removeClass('full');
$('.grid-sizer').removeClass('full');
},
}).register("screen and (max-width:700px)", {
match: function () {
$('.grid-item').addClass('half');
$('.grid-sizer').addClass('half');
$('.grid-item').removeClass('third');
$('.grid-sizer').removeClass('third');
},
unmatch: function () {
$('.grid-item').addClass('third');
$('.grid-sizer').addClass('third');
$('.grid-item').removeClass('half');
$('.grid-sizer').removeClass('half');
},
}).register("screen and (max-width:900px)", {
match: function () {
$('.grid-item').addClass('third');
$('.grid-sizer').addClass('third');
$('.grid-item').removeClass('quarter');
$('.grid-sizer').removeClass('quarter');
},
unmatch: function () {
$('.grid-item').addClass('quarter');
$('.grid-sizer').addClass('quarter');
$('.grid-item').removeClass('third');
$('.grid-sizer').removeClass('third');
},
}).register("screen and (max-width:1200px)", {
match: function () {
$('.grid-item').addClass('quarter');
$('.grid-sizer').addClass('quarter');
$('.grid-item').removeClass('fifth');
$('.grid-sizer').removeClass('fifth');
},
unmatch: function () {
$('.grid-item').addClass('fifth');
$('.grid-sizer').addClass('fifth');
$('.grid-item').removeClass('quarter');
$('.grid-sizer').removeClass('quarter');
},
});
2019-11-04 13:09:44 +00:00
</script>
{{ end }}