<?php
$count = 1;

if ($this->images) { ?>
    <div class="property__slider">
        <div id="properties-thumbs" class="slider slider--small js-slider-thumbs">
            <div class="slider__block js-slick-slider">
                <?php
                $i = 0;
                foreach ($this->images as $image) {
                    ?>

                    <?php
                    $imgInfo = @getimagesize(Images::getFullSizeUrl($image));
                    $imgInfoSize = '';
                    if (isset($imgInfo[0]) && isset($imgInfo[1])) {
                        $imgInfoSize = $imgInfo[0] . 'x' . $imgInfo[1];
                    }
                    $imgAlt = Images::getAlt($image);
                    ?>

                    <div class="slider__item slider__item--<?php echo $i; ?>" data-size="<?= $imgInfoSize; ?>">
                        <a href="<?php echo Images::getFullSizeUrl($image); ?>"
                           data-slick-index="<?php echo $i; ?>"
                           data-size="<?= $imgInfoSize; ?>"
                           data-gallery-index='<?php echo $i; ?>' class="slider__img js-gallery-item">
                            <img src="<?php echo Images::getFullSizeUrl($image); ?>"
                                 data-lazy="<?php echo Images::getFullSizeUrl($image); ?>"
                                 alt="<?= $imgAlt ?>"/>
                        </a>
                    </div>
                    <?php $i++;
                }

                $i = 0;
                ?>
            </div>
        </div>
        <div class="slider slider--thumbs">
            <div class="slider__wrap">
                <div class="slider__block js-slick-slider">
                    <?php foreach ($this->images as $image) { ?>
                        <div data-slide-rel='<?php echo $i; ?>' class="slider__item slider__item--<?php echo $i; ?>">
                            <div class="slider__img">
                                <img data-lazy="<?php echo Images::getThumbUrl($image, 205, 107); ?>"
                                     src="<?php echo Images::getThumbUrl($image, 205, 107); ?>" alt="<?= $imgAlt ?>"/>
                            </div>
                        </div>

                        <?php $i++;
                    }
                    ?>
                </div>
                <button type="button" class="slider__control slider__control--prev js-slick-prev"><i
                            class="fas fa-angle-left"></i></button>
                <button type="button" class="slider__control slider__control--next js-slick-next"><i
                            class="fas fa-angle-right"></i></button>
            </div>
        </div>
    </div>
<?php } ?>

   