79 lines
No EOL
3.1 KiB
PHP
79 lines
No EOL
3.1 KiB
PHP
<?php
|
|
global $tp;
|
|
global $chirkashi;
|
|
|
|
if(empty($hero)) {
|
|
$hero = get_field('hero', $post->ID);
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
<?php if(!empty($hero)) : ?>
|
|
|
|
<div class="hero fw">
|
|
<div class="hero__container">
|
|
|
|
<div class="swiper-container">
|
|
<div class="swiper-wrapper">
|
|
|
|
<?php $hero_i = 0; ?>
|
|
<?php foreach($hero as $h) : ?>
|
|
<div class="swiper-slide">
|
|
<div class="hero__block hero-block image-border-wrap" <?php if(empty($h['video_file'])) : ?>style="background-image: url(<?php echo $h['image']; ?>);"<?php endif; ?> >
|
|
<?php if(!empty($h['video_file'])) : ?>
|
|
<div class="hero__video">
|
|
<video autoplay muted loop>
|
|
<source src="<?php echo $h['video_file']; ?>">
|
|
</video>
|
|
</div>
|
|
<?php endif ?>
|
|
<div class="hero-block__wrapper wrapper">
|
|
<?php if(!empty($h['title']) || !empty($h['subtitle']) || !empty($h['text'])) : ?>
|
|
<div class="hero__block-info">
|
|
|
|
<?php if(!empty($h['title'])) : ?>
|
|
<?php if($hero_i == 0) : ?>
|
|
<h1 class="hero__block-title"><?php echo $h['title']; ?></h1>
|
|
<?php else : ?>
|
|
<h2 class="hero__block-title"><?php echo $h['title']; ?></h2>
|
|
<?php endif; ?>
|
|
<?php endif ?>
|
|
|
|
<?php if(!empty($h['subtitle'])) : ?>
|
|
<div class="hero__block-subtitle"><?php echo $h['subtitle']; ?></div>
|
|
<?php endif ?>
|
|
|
|
<?php if(!empty($h['text'])) : ?>
|
|
<div class="hero__block-text description"><?php echo $h['text']; ?></div>
|
|
<?php endif ?>
|
|
<?php if(!empty($h['button'])) : ?>
|
|
<a class="btn" href="<?php echo $h['button']['url'] ?>" title="<?php echo $h['button']['title'] ?>"><?php echo $h["button"]["title"] ?> <i class="btn__icon btn__icon_arrow-right"></i></a>
|
|
<?php endif ?>
|
|
|
|
</div>
|
|
<?php endif ?>
|
|
<div class="hero__nav hero-nav hero-nav_<?php echo count($hero); ?>">
|
|
<div class="hero-nav__arrow hero-nav__arrow_prev"></div>
|
|
<div class="hero-nav__arrow hero-nav__arrow_next"></div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
$borders = $h['image_borders'];
|
|
set_query_var('borders', $borders);
|
|
get_template_part('partials/borders');
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<?php $hero_i++; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<div class="hero__pagination hero__pagination_<?php echo count($hero); ?> slider-pagination"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="scroll-down"><a class="scroll-down__btn" title="arrow down"><img src="<?php echo $tp; ?>/img/arrow-down.png" alt="arrow-down" /></a></div>
|
|
|
|
<?php endif; ?>
|