Added lightbox to Gallery

This commit is contained in:
Torsten 2023-10-13 11:29:33 +02:00
parent 5d6f3f1b05
commit 1cc9751c21
14 changed files with 24 additions and 5 deletions

View file

@ -44,10 +44,16 @@ class GalleryController extends Controller
$imagelist_orig = Storage::disk('img_storage')->files("tour-$tour_id");
$imagelist=[];
foreach($imagelist_orig as $image) {
$arr = explode("/", $image);
$image = end($arr);
$before = $image;
if (str_ends_with($image, "_gross.jpg")) {
$image = substr($image, 0, -10); # Remove last 10 characters
array_push($imagelist, $image);
}
}
//dd($imagelist);
return view('tour/gallery/show')->with("tour_id",$tour_id)->with("imagelist",$imagelist);

View file

@ -6,10 +6,21 @@
<h1>(Galerie Elemente)</h1>
<a href="/img_storage/tour-1/awa-ruckkehr-nach-lobeshpng_gross.jpg" data-lightbox="awa-ruckkehr-nach-lobeshpng_gross.jpg" data-title="TestImage">
<img class="mt-3 ml-3" src="/img_storage/tour-1/awa-ruckkehr-nach-lobeshpng.jpg">
</a>
<div class="container text-primary" style="display:flex">
<ul class="list-group offset-2 col-8">
<ul class="list-group offset-2 col-8" style="display:inline">
@foreach($imagelist as $image)
<img src="/img_storage/tour-{{$tour_id}}/{{$image}}">
<a style="display: inline;" href="/img_storage/tour-{{$tour_id}}/{{$image}}_gross.jpg" data-lightbox="/img_storage/tour-{{$tour_id}}/{{$image}}_gross.jpg" data-title="{{$image}}">
<img class="mt-3 ml-3" src="/img_storage/tour-{{$tour_id}}/{{$image}}.jpg">
</a>
@endforeach
</ul>
@ -23,4 +34,6 @@
</form>
</div>
@endsection

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB