}
},
});
+
+import blueimp from 'blueimp-gallery';
+
+document.getElementById('product-gallery').onclick = function (event) {
+ event = event || window.event;
+ var target = event.target || event.srcElement,
+ link = target.src ? target.parentNode : target,
+ options = {index: link, event: event, closeOnSlideClick: true, carrousel: true},
+ links = this.querySelectorAll('a.g');
+
+ blueimp(links, options);
+};
+
@php
- $images=$product->getImagesData('images');
+ $images = $product->getImagesData('images','',null,$product->getEntity()->image_alt);
+ array_shift($images);
@endphp
-<div class="product-gallery flex-grow" style="max-width: 348px;">
+<div id="product-gallery" class="product-gallery flex-grow" style="max-width: 348px;">
<div class="product-gallery-main">
- <div class="product-gallery-main-image">
+ <a href="{{$product->getEntity()->image}}" alt="{{$product->getEntity()->image_alt}}"
+ class="product-gallery-main-image g">
<img src="{{$product->getEntity()->image}}" alt="{{$product->getEntity()->image_alt}}" class="bgimg"/>
- </div>
- </div>
- <div class="grid grid-cols-3 grid-gap-sm">
- @foreach($images as $image)
- <div class="product-gallery-thumb">
- <img src="{{$image['url']}}" alt="{{$image['alt']}}" class="bgimg cover"/>
- </div>
- @endforeach
+ </a>
</div>
- <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls " style="display: none;">
- <div class="slides" style="width: 7680px;"></div>
- <h3 class="title"></h3>
- <p class="description"></p> <a class="prev">
- <svg xmlns="http://www.w3.org/2000/svg" width="38.414" height="26" viewBox="0 0 38.414 26">
- <g fill="none" stroke="#fff" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2">
- <path d="M13.414 25l-12-12 12-12"></path>
- <path d="M1.413 13h36.001"></path>
- </g>
- </svg>
- </a> <a class="next">
- <svg xmlns="http://www.w3.org/2000/svg" width="38.414" height="26" viewBox="0 0 38.414 26">
- <g fill="none" stroke="#fff" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2">
- <path d="M25 1l12 12-12 12"></path>
- <path d="M37.001 13H1"></path>
- </g>
- </svg>
- </a> <a class="close">×</a>
- <ol class="indicator"></ol> <!----></div>
+ @if(count($images)>0)
+ <div class="grid grid-cols-3 grid-gap-sm">
+ @foreach($images as $image)
+ <a href="{{$image['url']}}" title="{{$image['alt']}}" class="g product-gallery-thumb">
+ <img src="{{$image['url']}}" alt="{{$image['alt']}}" class="bgimg cover"/>
+ </a>
+ @endforeach
+ </div>
+ @endif
+
+</div>
+<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls " style="display: none;">
+ <div class="slides" style="width: 7680px;"></div>
+ <h3 class="title"></h3>
+ <p class="description"></p> <a class="prev">
+ <svg xmlns="http://www.w3.org/2000/svg" width="38.414" height="26" viewBox="0 0 38.414 26">
+ <g fill="none" stroke="#fff" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2">
+ <path d="M13.414 25l-12-12 12-12"></path>
+ <path d="M1.413 13h36.001"></path>
+ </g>
+ </svg>
+ </a> <a class="next">
+ <svg xmlns="http://www.w3.org/2000/svg" width="38.414" height="26" viewBox="0 0 38.414 26">
+ <g fill="none" stroke="#fff" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2">
+ <path d="M25 1l12 12-12 12"></path>
+ <path d="M37.001 13H1"></path>
+ </g>
+ </svg>
+ </a> <a class="close">×</a>
+ <ol class="indicator"></ol> <!---->
</div>