1
0
Fork 0
web-jbeyerstedt/site/snippets/base/html-end.php

72 lines
1.8 KiB
PHP
Raw Permalink Normal View History

<?php
// -------------------------------------------
// kirby snippet FOR GENERAL
// copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
// set switches, to enable parts of the code. All disabled by default!
// -------------------------------------------
// available switches:
$switches = array("bs_util", "bs_carousel", "plg_masonry");
$jquery = false;
foreach ($switches as $switch) {
if (isset(${$switch}) && ${$switch}==true) {
$jquery = true;
${$switch} = true;
}else {
${$switch} = false;
}
}
?>
<?php if($jquery) {
echo js('assets/vendors/jquery-2.2.2.min.js');
}?>
<!-- Bootstrap core JavaScript-->
<?php
if($bs_util) {
echo js('assets/vendors/bootstrap/js/dist/util.js');
}
if($bs_carousel) {
echo js('assets/vendors/bootstrap/js/dist/carousel.js');
}
?>
<?php if (c::get('plg_masonry.enable') && $plg_masonry==true) : $width = c::get('plg_masonry.width');?>
2016-10-15 18:10:34 +00:00
<style nonce="nRfqpuKWNuYyUAFPTr6WVNZk9">
#masonry {margin: 0 auto;}
.masonryitem { width: <?php echo $width ?>px; margin-bottom: 10px;}
.masonryitem.w2 { width: 40%; }
</style>
<?php echo js('assets/vendors/masonry/dist/masonry.pkgd.min.js');?>
2016-10-15 18:10:34 +00:00
<script type="text/javascript" nonce="nRfqpuKWNuYyUAFPTr6WVNZk9">
$('#masonry').masonry({
isFitWidth: true,
columnWidth: <?php echo c::get('plg_masonry.width') ?>,
gutter: 10,
itemSelector: '.masonryitem'
});
</script>
<?php echo js('assets/vendors/swipebox/src/js/jquery.swipebox.min.js');?>
<?php echo css('assets/vendors/swipebox/src/css/swipebox.css') ?>
2016-10-15 18:10:34 +00:00
<script type="text/javascript" nonce="nRfqpuKWNuYyUAFPTr6WVNZk9">
$(document).ready(function () {
$('.swipebox' ).swipebox();
});
</script>
<?php endif; ?>
<?php echo piwik(); ?>
</body>
</html>