-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #737 from FitzwilliamMuseum/feature/image-gallery
Feature/image gallery
- Loading branch information
Showing
8 changed files
with
100 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"/js/app.js": "/js/app.js?id=b8905b220a3026e29c691fbcf7f1ab86", | ||
"/css/app.css": "/css/app.css?id=81ca4c70d8e1a66441ec421a2a8c1814", | ||
"/css/fitzwilliam.css": "/css/fitzwilliam.css?id=ac5439ad1da7ccbbd3f994488e57982e" | ||
"/css/app.css": "/css/app.css?id=c77e47e067d8b347e47c65c32b2a3587", | ||
"/css/fitzwilliam.css": "/css/fitzwilliam.css?id=36320d096c399350614b372ec7c4975b" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.image-gallery .carousel-control-prev { | ||
background: linear-gradient(to right, black, rgba(0,0,0,0)); | ||
} | ||
|
||
.image-gallery .carousel-control-prev:hover, | ||
.image-gallery .carousel-control-prev:focus { | ||
background: linear-gradient(to right, black, rgba(0,0,0,0.5)); | ||
} | ||
|
||
.image-gallery .carousel-control-next { | ||
background: linear-gradient(to left, black, rgba(0,0,0,0)); | ||
} | ||
|
||
.image-gallery .carousel-control-next:hover, | ||
.image-gallery .carousel-control-next:focus { | ||
background: linear-gradient(to left, black, rgba(0,0,0,0.5)); | ||
} | ||
|
||
.gallery-card { | ||
height: 400px; | ||
|
||
img { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
resources/views/support/components/image-gallery.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@if(!empty($component['image_gallery'])) | ||
<div class="container image-gallery"> | ||
<div class="row"> | ||
<div id="image-gallery" class="collection-carousel carousel slide" data-ride="carousel" data-bs-interval="false" data-pause="hover"> | ||
<div class="carousel-inner"> | ||
@foreach(array_chunk($component['image_gallery'],3,true) as $slides) | ||
<div class="carousel-item {{ $loop->first ? 'active' : '' }}"> | ||
<div class="row"> | ||
@foreach($slides as $image) | ||
@php | ||
if(!empty($image['image_id'])) { | ||
if(!empty($page['image_blocks'])) { | ||
$image_source = $page['image_blocks']; | ||
} | ||
if(!empty($exhibition['exhibition_files'])) { | ||
$image_source = $exhibition['exhibition_files']; | ||
} | ||
foreach($image_source as $image_block) { | ||
if(!empty($image_block['directus_files_id'])) { | ||
$image_block['asset_id'] = $image_block['directus_files_id']; | ||
} | ||
if($image_block['asset_id']['id'] == $image['image_id']) { | ||
$image_asset = $image_block['asset_id']; | ||
} | ||
} | ||
} | ||
@endphp | ||
<div class="col-md-4 mb-3"> | ||
<div class="card gallery-card"> | ||
@if(!empty($image_asset)) | ||
<img src="{{ $image_asset['data']['full_url'] }}" alt="{{ !empty($image_asset['data']['description']) ? $block_image['data']['description'] : '' }}" load="lazy"> | ||
@else | ||
<img | ||
src="{{ env('MISSING_IMAGE_URL') }}" | ||
load="lazy" alt=""> | ||
@endif | ||
</div> | ||
</div> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endforeach | ||
</div> | ||
<button class="carousel-control-prev" type="button" data-bs-target="#image-gallery" data-bs-slide="prev"> | ||
<svg height="48" viewBox="0 0 48 48" width="64" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill="black" d="M0 0h48v48h-48z"></path> | ||
<path fill="white" d="M14.83 30.83l9.17-9.17 9.17 9.17 2.83-2.83-12-12-12 12z"></path> | ||
</svg> | ||
<span class="visually-hidden">Previous</span> | ||
</button> | ||
<button class="carousel-control-next" type="button" data-bs-target="#image-gallery" data-bs-slide="next"> | ||
<svg height="48" viewBox="0 0 48 48" width="64" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill="black" d="M0 0h48v48h-48z"></path> | ||
<path fill="white" d="M14.83 30.83l9.17-9.17 9.17 9.17 2.83-2.83-12-12-12 12z"></path> | ||
</svg> | ||
<span class="visually-hidden">Next</span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
@endif |