Update gallery.php

Optimisation de l'affichage des photos sur de petits écrans en mode portrait et paysage. Plus "responsive desgin".
This commit is contained in:
brunoduc 2020-03-23 16:38:34 +01:00 committed by GitHub
parent 64157f89f2
commit 5c157189f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,26 +8,19 @@
]); ?>
</div>
</div>
<?php $i = 1; ?>
<?php $picturesNb = count($module::$pictures); ?>
<!-- Ajout du début de la ligne row en rajoutant la class rowGallery (on supprime $i et $picturesNb) ********************** -->
<div class="row galleryRow">
<?php foreach($module::$pictures as $picture => $legend): ?>
<?php if($i % 4 === 1): ?>
<div class="row">
<?php endif; ?>
<div class="col3">
<a
href="<?php echo helper::baseUrl(false) . $picture; ?>"
class="galleryGalleryPicture"
style="background-image:url('<?php echo helper::baseUrl(false) . $picture; ?>')"
data-caption="<?php echo $legend; ?>"
>
<?php if($legend): ?>
<div class="galleryGalleryName"><?php echo $legend; ?></div>
<?php endif; ?>
</a>
</div>
<?php if($i % 4 === 0 OR $i === $picturesNb): ?>
</div>
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
<div class="col3">
<a
href="<?php echo helper::baseUrl(false) . $picture; ?>"
class="galleryGalleryPicture"
style="background-image:url('<?php echo helper::baseUrl(false) . $picture; ?>')"
data-caption="<?php echo $legend; ?>"
>
<?php if($legend): ?>
<div class="galleryGalleryName"><?php echo $legend; ?></div>
<?php endif; ?>
</a>
</div>
<?php endforeach; ?>