Use Bootstrap for album/photo grid #31

Merged
Aaron merged 8 commits from bootstrap-tiles into master 2023-04-05 17:08:17 +02:00
Showing only changes of commit 9fcde24c39 - Show all commits

View File

@ -51,7 +51,7 @@ class PhotosIndex extends Template
{ {
list($photos, $what) = $row; list($photos, $what) = $row;
$this->header($photos); $this->header($photos);
$this->$what($photos); $this->$what($photos, $i % 2);
} }
echo ' echo '
@ -115,7 +115,7 @@ class PhotosIndex extends Template
</div>'; </div>';
} }
protected function panorama(array $photos) protected function panorama(array $photos, $altLayout)
{ {
foreach ($photos as $image) foreach ($photos as $image)
{ {
@ -131,12 +131,13 @@ class PhotosIndex extends Template
} }
} }
protected function portrait(array $photos) protected function portrait(array $photos, $altLayout)
{ {
$image = array_shift($photos); $image = array_shift($photos);
echo ' echo '
<div class="row g-5 mb-5 tile-feat-portrait"> <div class="row g-5 mb-5 tile-feat-portrait',
$altLayout ? ' flex-row-reverse' : '', '">
<div class="col-md-4">'; <div class="col-md-4">';
$this->photo($image, 'portrait', static::PORTRAIT_WIDTH, static::PORTRAIT_HEIGHT, 'centre'); $this->photo($image, 'portrait', static::PORTRAIT_WIDTH, static::PORTRAIT_HEIGHT, 'centre');
@ -163,12 +164,13 @@ class PhotosIndex extends Template
</div>'; </div>';
} }
protected function landscape(array $photos) protected function landscape(array $photos, $altLayout)
{ {
$image = array_shift($photos); $image = array_shift($photos);
echo ' echo '
<div class="row g-5 mb-5 tile-feat-landscape"> <div class="row g-5 mb-5 tile-feat-landscape',
$altLayout ? ' flex-row-reverse' : '', '">
<div class="col-md-8">'; <div class="col-md-8">';
$this->photo($image, 'landscape', static::LANDSCAPE_WIDTH, static::LANDSCAPE_HEIGHT, 'top'); $this->photo($image, 'landscape', static::LANDSCAPE_WIDTH, static::LANDSCAPE_HEIGHT, 'top');
@ -195,7 +197,7 @@ class PhotosIndex extends Template
</div>'; </div>';
} }
protected function duo(array $photos) protected function duo(array $photos, $altLayout)
{ {
echo ' echo '
<div class="row g-5 mb-5 tile-duo">'; <div class="row g-5 mb-5 tile-duo">';
@ -215,7 +217,7 @@ class PhotosIndex extends Template
</div>'; </div>';
} }
protected function single(array $photos) protected function single(array $photos, $altLayout)
{ {
echo ' echo '
<div class="row g-5 mb-5 tile-single"> <div class="row g-5 mb-5 tile-single">
@ -229,7 +231,7 @@ class PhotosIndex extends Template
</div>'; </div>';
} }
protected function landscapes(array $photos) protected function landscapes(array $photos, $altLayout)
{ {
echo ' echo '
<div class="row g-5 mb-5 tile-row-landscapes">'; <div class="row g-5 mb-5 tile-row-landscapes">';
@ -249,7 +251,7 @@ class PhotosIndex extends Template
</div>'; </div>';
} }
protected function portraits(array $photos) protected function portraits(array $photos, $altLayout)
{ {
echo ' echo '
<div class="row g-5 mb-5 tile-row-portraits">'; <div class="row g-5 mb-5 tile-row-portraits">';