Commit 760f6c659beb578d7deef4d1f125a77c6551667a

Authored by Eugeny Galkovskiy
1 parent 36801e2c

Галерея, стили

frontend/views/site/gallery.php
... ... @@ -13,26 +13,31 @@
13 13  
14 14 ?>
15 15  
16   -
17   -<div class="my-gallery" itemscope itemtype="http://schema.org/ImageGallery">
18   - <?php foreach ($images as $image) {
19   - if (file_exists(\Yii::getAlias('@storage/' . $image->id . '_' . $image->fileHash . '.' . $image->extension))) {
20   - ?>
21   - <figure class="reviews_gallery">
22   - <a href="<?= $image->getUrl() ?>" itemprop="contentUrl" data-size="<?= getimagesize(
23   - $image->getPath()
24   - )[ 0 ] . 'x' . getimagesize(
25   - $image->getPath()
26   - )[ 1 ] ?>">
27   - <img src="<?= ImageHelper::set($image->getPath())
28   - ->cropResize(500, 325)
29   - ->render() ?>" itemprop="thumbnail" alt=""/>
30   - </a>
31   - </figure>
32   - <?php
33   - }
34   - }
35   - ?>
  16 +<div id="content" class="contgallery">
  17 + <div class="container">
  18 + <div class="row">
  19 + <div class="my-gallery" itemscope itemtype="http://schema.org/ImageGallery">
  20 + <?php foreach ($images as $image) {
  21 + if (file_exists(\Yii::getAlias('@storage/' . $image->id . '_' . $image->fileHash . '.' . $image->extension))) {
  22 + ?>
  23 + <figure class="reviews_gallery">
  24 + <a href="<?= $image->getUrl() ?>" itemprop="contentUrl" data-size="<?= getimagesize(
  25 + $image->getPath()
  26 + )[ 0 ] . 'x' . getimagesize(
  27 + $image->getPath()
  28 + )[ 1 ] ?>">
  29 + <img src="<?= ImageHelper::set($image->getPath())
  30 + ->cropResize(500, 325)
  31 + ->render() ?>" itemprop="thumbnail" alt=""/>
  32 + </a>
  33 + </figure>
  34 + <?php
  35 + }
  36 + }
  37 + ?>
  38 + </div>
  39 + </div>
  40 + </div>
36 41 </div>
37 42  
38 43 <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
... ...
frontend/web/css/custom.css
... ... @@ -342,4 +342,26 @@ input[type=&quot;text&quot;].form-control{
342 342 }
343 343 .artbox_list_container #list-view{
344 344 padding-top:40px;
  345 +}
  346 +.contgallery{
  347 + margin-bottom: 60px;
  348 +}
  349 +figure.reviews_gallery {
  350 + width: 33.333%;
  351 + float: left;
  352 + padding: 10px;
  353 +}
  354 +.reviews_gallery img {
  355 + width: 100%;
  356 + height: 100%;
  357 +}
  358 +@media ( max-width: 690px ) {
  359 + figure.reviews_gallery{
  360 + width:50%;
  361 + }
  362 +}
  363 +@media ( max-width: 380px ) {
  364 + figure.reviews_gallery{
  365 + width:100%;
  366 + }
345 367 }
346 368 \ No newline at end of file
... ...