diff --git a/public/css/default.css b/public/css/default.css index 32ac1f9f..f3913b3d 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -199,33 +199,57 @@ i.space-invader.alt-7::before { div.polaroid { background: #fff; - box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); + box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3); line-height: 0; position: relative; + transition: 0.25s; } -div.polaroid img { - background: url('../images/nothumb.svg') center no-repeat; +div.polaroid:hover { + box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5); +} +div.polaroid img.normal-photo { + background: #fff url('../images/nothumb.svg') center no-repeat; border: none; + left: 0; object-fit: cover; + position: absolute; + top: 0; width: 100%; + z-index: 20; +} +div.polaroid img.blur-photo { + filter: blur(50px); + left: 0; + object-fit: cover; + position: absolute; + top: 0; + width: 100%; + z-index: 0; +} +div.polaroid img.placeholder-image { + background: #fff; + z-index: 20; } div.polaroid h4 { + background: #fff; + bottom: 0; color: #000; margin: 0; font: 400 18px 'Coda', sans-serif; padding: 15px 5px; + position: absolute; text-overflow: ellipsis; text-align: center; + width: 100%; white-space: nowrap; overflow: hidden; + z-index: 20; } div.polaroid a { display: block; text-decoration: none; } -div.polaroid:hover { - box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); -} + /* Album title boxes @@ -366,22 +390,53 @@ footer a { /* Styling for the photo pages --------------------------------*/ -#photo_frame { - padding-top: 1.5vh; - text-align: center; -} -#photo_frame a { +#photo_frame { + padding: 3.5vh 0; + text-align: center; + height: 95vh; } -#photo_frame a img { - border: none; - box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); - cursor: -moz-zoom-in; - display: inline-block; - height: 97vh; - max-width: 100%; + +#photo-figure { + position: relative; object-fit: contain; - width: auto; + height: 93vh; + object-position: center center; +} +#photo-figure img { + object-position: center center; +} +#photo-figure img.normal-photo { + border: none; + cursor: -moz-zoom-in; + object-fit: contain; + z-index: 20; + position: absolute; + left: 0; + top: 0; +} +#photo-figure img.blur-photo { + filter: blur(50px); + left: 0; + object-fit: contain; + position: absolute; + top: 0; + z-index: 0; +} + +figure.portrait-figure, +figure.landscape-figure { + height: 93vh; + margin: 0 auto; +} +figure.panorama-figure { + object-fit: cover; + margin: 0 auto; +} +figure#photo-figure img.normal-photo, +figure#photo-figure img.blur-photo { + height: 100%; + width: 100%; } #previous_photo, #next_photo { diff --git a/templates/AlbumIndex.php b/templates/AlbumIndex.php index 676b8717..aa483856 100644 --- a/templates/AlbumIndex.php +++ b/templates/AlbumIndex.php @@ -42,7 +42,7 @@ class AlbumIndex extends Template { echo '
-
'; +
'; if ($this->show_edit_buttons) echo ' @@ -58,15 +58,20 @@ class AlbumIndex extends Template $thumbs[$factor] = $album['thumbnail']->getThumbnailUrl( static::TILE_WIDTH * $factor, static::TILE_HEIGHT * $factor, true, true); - echo ' + foreach (['normal-photo', 'blur-photo'] as $className) + { + echo ' '; + } } else { echo ' '; } diff --git a/templates/PhotoPage.php b/templates/PhotoPage.php index 52b6fe59..a4bcbb2f 100644 --- a/templates/PhotoPage.php +++ b/templates/PhotoPage.php @@ -67,17 +67,31 @@ class PhotoPage extends Template protected function photo() { echo ' - + '; } private function photoNav() diff --git a/templates/PhotosIndex.php b/templates/PhotosIndex.php index 196e870c..b01a9230 100644 --- a/templates/PhotosIndex.php +++ b/templates/PhotosIndex.php @@ -83,27 +83,33 @@ class PhotosIndex extends Template protected function photo(Image $image, $className, $width, $height, $crop = true, $fit = true) { + // Prefer thumbnail aspect ratio if available, otherwise use image aspect ratio. + $aspectRatio = isset($width, $height) ? $width / $height : $image->ratio(); + echo ' -