<?php /* NOTE: GENERATED BY GULP !!! */ ?><?php
$b = "flo-block-gallery-view-1"; // To be used inside HTML

// Start: Class name automation
  $b__for_css = ".".$b; // To be used inside CSS
  $b__uniq = $b."--".mt_rand(1, 999); // To be used inside HTML
  $b__uniq_for_css = ".".$b__uniq; // To be used inside CSS
// End: Class name automation

$elements_color = flo_data($data, "elements_color");
$stick_block_to_top = flo_data($data, "stick_block_to_top", true);
$stick_block_to_top_class = $stick_block_to_top ? $b."--stuck-to-top" : "";

$display_header = flo_data($data, "display_header");

$display_title_area = flo_data($data, "display_title_area");
$title_area_position = flo_data($data, "title_area_position", "above");
$title_area_position_class = $b . "--title-area-position-" . $title_area_position;
$display_back_button = flo_data($data, "display_back_button");
$back_button_label = flo_data($data, "back_button_label");
$back_button_font = flo_font_data($data, "back_button_font");
$title_font = flo_font_data($data, "title_font");
$display_category = flo_data($data, "display_category");
$category_font = flo_font_data($data, "category_font");
$display_counter = flo_data($data, "display_counter");
$counter_font = flo_font_data($data, "counter_font");

$gallery_view_layout = flo_data($data, "gallery_view_layout");
$gallery_view_layout_class = $b . "--gallery-view-layout-" . $gallery_view_layout;
$image_height = flo_data($data, "image_height", 479) / 16 . "rem";
$image_height_px = flo_data($data, "image_height", 479) * 2;
$gap_between_images = flo_data($data, "gap_between_images", 10) / 16 . "rem";

$arrows_color = flo_data($data, "arrows_color");
$arrows_overlay_color = flo_data($data, "arrows_overlay_color");
$arrows_overlay_opacity = flo_data($data, "arrows_overlay_opacity") / 100;

$first_categ = flo_get_the_first_term( $id = $post->ID, $taxonomy = 'gallery-category', $before = '', $sep = '', $after = '', $linked_terms = true ); //  Linked Cat Name
?>
<?php echo $__env->make('components.flo-generic-gallery-view-data', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<?php $__env->startSection('block_content'); ?>
  <?php echo $__env->make('core.style', [
    "breakpoint__general" => "

      ".
      flo_render_typography_styles(
      $b__uniq_for_css." ".$b__for_css."__back-button",
      $back_button_font
      )
      ."

      ".
      flo_render_typography_styles(
      $b__uniq_for_css." ".$b__for_css."__title",
      $title_font
      )
      ."

      ".
      flo_render_typography_styles(
      $b__uniq_for_css." ".$b__for_css."__category",
      $category_font
      )
      ."

      ".
      flo_render_typography_styles(
      $b__uniq_for_css." ".$b__for_css."__counter",
      $counter_font
      )
      ."

      ".$b__uniq_for_css." {
        color: ".$elements_color.";
        border-color: ".hex2rgba($elements_color, 0.1).";
      }

      ".$b__uniq_for_css." .is-not-sticky.flo-header {
        color: inherit!important;
        border-color: inherit!important;
        background-color: transparent!important;
      }

      ".$b__uniq_for_css." ".$b__for_css."__arrow {
        color: ".$arrows_color.";
      }

      ".$b__uniq_for_css." ".$b__for_css."__arrow-overlay {
        background-color: ".$arrows_overlay_color.";
        opacity: ".$arrows_overlay_opacity.";
      }

    ",

    "breakpoint__medium_up" => "
      ".$b__uniq_for_css." ".$b__for_css."__image {
        height: ".$image_height.";
      }
      ".$b__uniq_for_css."".$b__for_css."--gallery-view-layout-b ".$b__for_css."__image-wrap {
        margin: 0 ".$gap_between_images.";
      }
    "
  ], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
  <?php
    global $images, $galleryPostID;
  ?>
  <div class="<?php echo $b; ?> <?php echo $b__uniq; ?> <?php echo $gallery_view_layout_class; ?> <?php echo $title_area_position_class; ?> <?php echo $stick_block_to_top_class; ?>">
    <?php /* <div class="<?php echo $b; ?>__placeholder"></div> */ ?>
    <div class="<?php echo $b; ?>__content">
      <?php if($display_header): ?>
        <div class="<?php echo $b; ?>__header-area">
          <?php echo $__env->make('components.flo-header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        </div>
      <?php endif; ?>

      <?php if($display_title_area): ?>
        <div class="<?php echo $b; ?>__title-area">
          <div class="<?php echo $b; ?>__back-button-wrap">
            <?php if($back_button_label && $display_back_button): ?>
              <a class="<?php echo $b; ?>__back-button" href="javascript:history.back()">
                <?php echo $back_button_label; ?>

              </a>
            <?php endif; ?>
          </div>
          <div class="<?php echo $b; ?>__title-wrap">
            <h1 class="<?php echo $b; ?>__title">
              <?php echo get_the_title($galleryPostID); ?>

            </h1>
            <?php if($display_category): ?>
              <h4 class="<?php echo $b; ?>__category">
                <?php echo $first_categ; ?>

              </h4>
            <?php endif; ?>
          </div>
          <div class="<?php echo $b; ?>__counter-wrap">
            <?php if($display_counter): ?>
              <div class="<?php echo $b; ?>__counter">
                <div class="<?php echo $b; ?>__counter-index">
                  01
                </div>
                <div class="<?php echo $b; ?>__counter-separator"></div>
                <div class="<?php echo $b; ?>__counter-count">
                  26
                </div>
              </div>
            <?php endif; ?>
          </div>
        </div>
      <?php endif; ?>

      <div class="<?php echo $b; ?>__images-wrap">
        <div class="<?php echo $b; ?>__images">
          <?php $i = 0; ?>
          <?php foreach($images as $image): ?>
            <div class="<?php echo $b; ?>__image-wrap">
              <?php
                $desktop_src = $image["full_img"];
                $image_id = attachment_url_to_postid($desktop_src);

                $image_width_2080 = flo_aq($url = $desktop_src, $width = 2080, $height = $image_height_px, $crop = false, $force_sizes = true);
                $image_width_740 = flo_aq($url = $desktop_src, $width = 740, $height = $image_height_px, $crop = false, $force_sizes = true);
                $img_srcset = wp_get_attachment_image_srcset($image_id,'full');
                $img_srcset .= ','.$image_width_2080.' 2080w';
                $img_srcset .= ','.$image_width_740.' 740w';


              if($i <= 2){ ?>
                <img class="<?php echo $b; ?>__image" src="<?php echo $desktop_src; ?>" srcset="<?php echo $img_srcset; ?>" alt="<?php echo $image['alt']; ?>">
              <?php } else { ?>
                <img class="<?php echo $b; ?>__image" data-lazy="<?php echo $desktop_src; ?>" alt="<?php echo $image['alt']; ?>">
              <?php } ?>
              <?php if($image["video_code"]): ?>
                <?php if($image["video_code"]): ?>
                  <?php echo $__env->make('components.flo-video-embed', [
                  "embed_code" => $image["video_code"]
                  ], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                <?php endif; ?>
              <?php endif; ?>
            </div>
            <?php $i++; ?>
          <?php endforeach; ?>
        </div>
        <div class="<?php echo $b; ?>__arrow <?php echo $b; ?>__arrow--prev">
          <div class="<?php echo $b; ?>__arrow-overlay"></div>
          <i class="flo-icon-triangle-arrow-left"></i>
        </div>
        <div class="<?php echo $b; ?>__arrow <?php echo $b; ?>__arrow--next">
          <div class="<?php echo $b; ?>__arrow-overlay"></div>
          <i class="flo-icon-triangle-arrow-right"></i>
        </div>
      </div>
    </div>

  </div>
<?php $__env->stopSection(true); ?>

<?php echo $__env->make('layout.block', [
  "block_classes" => "flo-block--full-width", // Will be added to main block div. e.g. flo-block--full-width
  "data_onready" => "flo_block_gallery_view_1" // Specify a function (see _blank.js on how to define) that will be executed on document ready.
], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>