Merge branch 'responsive_gallery' into dev10

This commit is contained in:
Fred Tempez 2020-04-16 22:36:08 +02:00
parent 48d3edac4f
commit 69e5d127cd
4 changed files with 62 additions and 37 deletions

View File

@ -17,8 +17,27 @@
left: 0;
right: 0;
bottom: 0;
padding: 10px;
padding: 6px;
background: rgba(0, 0, 0, .6);
color: #FFF;
text-align: center;
}
.galleryRow {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.colPicture {
width : 16em;
max-width: 50%;
margin: 0.5em;
}
@media (max-width: 432px) {
.colPicture {
width: 90%;
max-width: 90%;
margin: 0.5em;
}
}

View File

@ -8,13 +8,9 @@
]); ?>
</div>
</div>
<?php $i = 1; ?>
<?php $picturesNb = count($module::$pictures); ?>
<div class="row galleryRow">
<?php foreach($module::$pictures as $picture => $legend): ?>
<?php if($i % 4 === 1): ?>
<div class="row">
<?php endif; ?>
<div class="col3">
<div class="colPicture">
<a
href="<?php echo helper::baseUrl(false) . $picture; ?>"
class="galleryGalleryPicture"
@ -26,8 +22,5 @@
<?php endif; ?>
</a>
</div>
<?php if($i % 4 === 0 OR $i === $picturesNb): ?>
</div>
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
</div>

View File

@ -1,7 +1,7 @@
.galleryPicture {
display: block;
border: 1px solid #DDD;
height: 200px;
height: 150px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
@ -17,8 +17,27 @@
left: 0;
right: 0;
bottom: 0;
padding: 10px;
padding: 6px;
background: rgba(0, 0, 0, .6);
color: #FFF;
text-align: center;
}
.galleryRow {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.colPicture {
width : 16em;
max-width: 50%;
margin: 0.5em;
}
@media (max-width: 432px) {
.colPicture {
width: 90%;
max-width: 90%;
margin: 0.5em;
}
}

View File

@ -1,11 +1,8 @@
<?php if($module::$galleries): ?>
<?php $i = 1; ?>
<?php $galleriesNb = count($module::$galleries); ?>
<div class="row galleryRow">
<?php foreach($module::$galleries as $galleryId => $gallery): ?>
<?php if($i % 2 === 1): ?>
<div class="row">
<?php endif; ?>
<div class="col6" div="pos<?php echo $gallery['config']['position']; ?>" >
<div class="colPicture" div="pos<?php echo $gallery['config']['position']; ?>" >
<a
href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>"
class="galleryPicture"
@ -14,11 +11,8 @@
<div class="galleryName"><?php echo $gallery['config']['name']; ?></div>
</a>
</div>
<?php if($i % 2 === 0 OR $i === $galleriesNb): ?>
</div>
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
</div>
<?php else: ?>
<?php echo template::speech('Aucune galerie.'); ?>
<?php endif; ?>