| Current Path : /home/helpink/www/modules/mod_uk_dgallery/tmpl/ |
| Current File : /home/helpink/www/modules/mod_uk_dgallery/tmpl/default.php |
<?php defined('_JEXEC') or die;
/*
* @package mod_uk_gallery
* @copyright © 2022 Joomlaplates. All rights reserved.
* @license GNU General Public License version 3 or later; see http://www.gnu.org/licenses/gpl-3.0.txt
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('jquery');
$content_before_class = $params->get('content_before_class');
$content_before = $params->get('content_before');
?>
<?php if ($content_before) { ?>
<div class="<?php echo $content_before_class; ?>">
<?php echo $content_before; ?>
</div>
<?php } ?>
<div uk-scrollspy="target: > div > div .uk-transition-toggle; cls: uk-animation-scale-up; delay: 300" >
<div uk-lightbox="animation: <?php echo $animation; ?>" class="js-filter mod_uk_gallery<?php echo $grid_class, $classes; ?>" uk-grid<?php echo $grid_params, $hm_param; ?> >
<?php $path = Uri::root() . "images/" . $items->imgdir . "/"; ?>
<?php foreach ($images as $key => $image) { ?>
<div class="gal_con gal_con_outer">
<div class="uk-transition-toggle uk-inline <?php echo $item_style; ?>" >
<a href="<?php echo $path . $image; ?>">
<img src="<?php echo $path . $image; ?>" alt="">
<div class="uk-transition-fade uk-position-cover uk-overlay-default uk-position-cover"></div>
<div class="uk-position-center">
<span class="uk-transition-fade" uk-icon="icon: plus; ratio: 2"></span>
</div>
</a>
</div>
</div>
<?php } ?>
</div>
<?php if ((int)$items->showLoadMore) { // load more button ?>
<div>
<a href="#" class="btn btn-sm btn-primary" id="loadMore"><?php echo Text::_('MOD_UK_DGALLERY_LOADMORE'); ?></a>
</div>
<?php } ?>
</div>
<!-- Load More assets should load only if display -->
<?php if ((int)$items->showLoadMore) { ?>
<style>
.gal_con_outer {display:none;}
#loadMore {
width:150px;
display: block;
text-align: center;
margin: 20px auto;
padding: 10px;
transition: .3s;
text-decoration: none;
}
.noContent {
pointer-events: none;
}
</style>
<script>
jQuery(document).ready(function(){
jQuery(".gal_con_outer").slice(0, <?php echo $items->initCount; ?>).show();
jQuery("#loadMore").on("click", function(e){
e.preventDefault();
jQuery(".gal_con_outer:hidden").slice(0, <?php echo $items->loadCount; ?>).slideDown();
if(jQuery(".gal_con_outer:hidden").length == 0) {
jQuery("#loadMore").text("<?php echo Text::_('MOD_UK_DGALLERY_NOIMAGE'); ?>")
jQuery("#loadMore").addClass("noContent");
}
});
})
</script>
<?php } ?>