PhotosIndex: add dualMixed layout

This combines one landscape with one portrait.
This commit is contained in:
Aaron van Geffen 2023-12-19 22:42:30 +01:00
parent 553744aeb5
commit 37cc627e20
2 changed files with 24 additions and 0 deletions

View File

@ -52,6 +52,7 @@ class PhotoMosaic
// Dual layouts // Dual layouts
'dualLandscapes' => [Image::TYPE_LANDSCAPE, Image::TYPE_LANDSCAPE], 'dualLandscapes' => [Image::TYPE_LANDSCAPE, Image::TYPE_LANDSCAPE],
'dualPortraits' => [Image::TYPE_PORTRAIT, Image::TYPE_PORTRAIT], 'dualPortraits' => [Image::TYPE_PORTRAIT, Image::TYPE_PORTRAIT],
'dualMixed' => [Image::TYPE_LANDSCAPE, Image::TYPE_PORTRAIT],
// Fallback layouts // Fallback layouts
'singleLandscape' => [Image::TYPE_LANDSCAPE], 'singleLandscape' => [Image::TYPE_LANDSCAPE],

View File

@ -270,6 +270,29 @@ class PhotosIndex extends Template
</div>'; </div>';
} }
protected function dualMixed(array $photos, $altLayout)
{
$image = array_shift($photos);
echo '
<div class="row g-5 mb-5 tile-feat-landscape',
$altLayout ? ' flex-row-reverse' : '', '">
<div class="col-md-8">';
$this->photo($image, 'landscape', static::LANDSCAPE_WIDTH, static::LANDSCAPE_HEIGHT, 'top');
echo '
</div>
<div class="col-md-4">';
$this->photo($image, 'portrait', static::PORTRAIT_WIDTH, static::PORTRAIT_HEIGHT, true);
echo '
</div>
</div>
</div>';
}
protected function dualPortraits(array $photos, $altLayout) protected function dualPortraits(array $photos, $altLayout)
{ {
// Recycle the row layout so portraits don't appear too large // Recycle the row layout so portraits don't appear too large