75 lines
1.7 KiB
PHTML
75 lines
1.7 KiB
PHTML
<?php
|
|
$this->headLink()->appendStylesheet($this->assetUrl('css/smartphoto.min.css',
|
|
'SmartGallery'));
|
|
$this->headLink()->appendStylesheet($this->assetUrl('css/style.css',
|
|
'SmartGallery'));
|
|
|
|
?>
|
|
|
|
<!--
|
|
<script>
|
|
console.log(<?= json_encode($images, JSON_UNESCAPED_SLASHES) ?>)
|
|
</script>
|
|
-->
|
|
|
|
<?php $image_id = 0; ?>
|
|
|
|
<div class="archive-item-block smart-gallery">
|
|
|
|
<?php if ($renderSourceLink) { ?>
|
|
<div class="source-link">
|
|
<a href="<?= $item_url ?>">Source</a>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<div class="wrapper">
|
|
<div class="masonry">
|
|
<?php foreach ($images as $image) { ?>
|
|
<?php $image_id = $image_id +1;
|
|
$img_id = $gallery_id . '-' . $image_id;
|
|
?>
|
|
<div class="brick">
|
|
<a href="<?= $image['media_url'] ?>"
|
|
class="<?= $gallery_id ?>"
|
|
data-caption="<?= $image['image_title'] ?>"
|
|
data-id="<?= $img_id ?>">
|
|
<img src="<?= $image['media_url'] ?>"
|
|
alt=""
|
|
item_url="<?= $image['item_url'] ?>"
|
|
width="<?= $width ?>"
|
|
/>
|
|
</a>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
<?php if ($title) { ?>
|
|
<div class="item_title">
|
|
<?= $title ?>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
|
|
<?php
|
|
echo $this->inlineScript()
|
|
->prependFile($this->assetUrl('js/jquery-smartphoto.min.js?v=1"',
|
|
'SmartGallery'));
|
|
|
|
?>
|
|
|
|
<script>
|
|
jQuery(document).ready(function() {
|
|
$(function(){
|
|
$(".<?= $gallery_id ?>").SmartPhoto({
|
|
resizeStyle: 'fit',
|
|
});
|
|
});
|
|
});
|
|
|
|
function updateSourceURL(thumbnail){
|
|
$(thumbnail).closest(".archive-gallery")
|
|
.find('.source-link')
|
|
.find('a').prop('href', $(thumbnail).attr('item_url'));
|
|
}
|
|
</script>
|