ImageGallery-omeka-module/view/common/block-layout/imageGallery.phtml

67 lines
1.6 KiB
PHTML

<?php
$this->headLink()->appendStylesheet($this->assetUrl('css/gallery.css', 'ImageGallery'));
?>
<?php $image_id = 0; ?>
<div class="archive-gallery">
<?php if ($item_url) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
<section id="<?= $gallery_id ?>"
class="gallery"
style="padding-top: 400px; max-width: <?= $max_width ?>%;">
<?php foreach ($images as $image) { ?>
<?php $image_id = $image_id +1;
$img_id = $gallery_id . '-' . $image_id;
?>
<div class="gallery__item">
<input type="radio"
id="<?= $img_id ?>"
checked name="gallery"
class="gallery__selector"/>
<img class="gallery__img"
style=""
src="<?= $image->primaryMedia()->originalUrl() ?>"
alt="<?= $image->primaryMedia()->source() ?>"
/>
<label for="<?= $img_id ?>" class="gallery__thumb">
<img src="<?= $image->primaryMedia()->thumbnailUrl('large') ?>"
alt="Thumbnail: <?= $image->primaryMedia()->source() ?>"
/>
</label>
</div>
<?php } ?>
</section>
<?php if ($title) { ?>
<div class="item_title">
<?= $title ?>
</div>
<?php } ?>
</div>
<script>
jQuery(document).ready(function() {
var gallery_image_height=0;
$( ".gallery__img" ).each(function( index ) {
if ($(this).height() > gallery_image_height) {
gallery_image_height = $(this).height();
}
});
$('section.gallery').css('padding-top', gallery_image_height)
//$(".gallery__thumb:first-of-type").css('margin-left', 0)
//$(".gallery__thumb:last-of-type").css('margin-right', 0)
});
</script>