<?php
/**
 * Template Name: Home Template
 */

get_header(); ?>

<main id="skip-content">
  <?php if (get_theme_mod('timber_work_banner_section_setting', false) != '') { ?>
    <section id="top-banner" class="banner-bg">
      <?php if(get_theme_mod('timber_work_banner_background_image') != ''){ ?>
        <div class="banner-bg-image">
          <img src="<?php echo esc_url(get_theme_mod('timber_work_banner_background_image')); ?>" alt="" />
        </div>
      <?php } else{?>
        <div class="banner-bg-image">
          <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/img/banner-bg.png" alt="" />
        </div>
      <?php } ?>
      <div class="slider-box">
        <div class="container ">
          <div class="row slide-index">
            <div class="col-xl-6 col-lg-6 col-md-6 col-sm-7 align-self-center slide-contentt">
              <div class="banner-content">
                <?php if(get_theme_mod('timber_work_banner_short_heading') != ''){ ?>
                  <div class="banner-short">
                      <h6><?php echo esc_html(get_theme_mod('timber_work_banner_short_heading')); ?></h6>
                  </div>
                <?php }?>
                <?php if(get_theme_mod('timber_work_banner_heading') != ''){ ?>
                  <div class="banner-head">
                      <h5><?php echo esc_html(get_theme_mod('timber_work_banner_heading')); ?></h5>
                  </div>
                <?php }?>
                <?php if(get_theme_mod('timber_work_banner_content') != ''){ ?>
                  <p><?php echo esc_html(get_theme_mod('timber_work_banner_content')); ?></p>
                <?php }?>
                <div class="banner-btn-main">
                  <?php if(get_theme_mod('timber_work_banner_btn_text_1') != '' || get_theme_mod('timber_work_banner_btn_url_1') != ''){?>
                    <div class="banner-btn">
                      <a href="<?php echo esc_url(get_theme_mod('timber_work_banner_btn_url_1')); ?>"><?php echo esc_html(get_theme_mod('timber_work_banner_btn_text_1')); ?><i class="fas fa-arrow-right ms-3"></i></a>
                    </div>
                  <?php }?>
                  <?php if(get_theme_mod('timber_work_banner_btn_text_2') != '' || get_theme_mod('timber_work_banner_btn_url_2') != ''){?>
                    <div class="banner-btn-1">
                      <a href="<?php echo esc_url(get_theme_mod('timber_work_banner_btn_url_2')); ?>"><?php echo esc_html(get_theme_mod('timber_work_banner_btn_text_2')); ?><i class="fas fa-arrow-right ms-3"></i></a>
                    </div>
                  <?php }?>
                </div>
              </div>
            </div>
            <div class="col-xl-6 col-lg-6 col-md-6 col-sm-5 align-self-center slide-imgg">
              <?php if(get_theme_mod('timber_work_banner_main_image') != ''){ ?>
                <div class="icon-img3">
                  <img src="<?php echo esc_url(get_theme_mod('timber_work_banner_main_image')); ?>" alt="" />
                </div>
              <?php } else{?>
                <div class="icon-img3">
                  <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/img/slider.png" alt="" />
                </div>
              <?php } ?>
              <?php if(get_theme_mod('timber_work_social_on_of_setting') != ''){ ?>
                <div class="social-icon">
                  <div class="social-link">
                    <?php if(get_theme_mod('timber_work_twitter_url') != ''){ ?>
                        <a class="twitter-icon" href="<?php echo esc_url(get_theme_mod('timber_work_twitter_url','')); ?>"><i class="<?php echo esc_html( get_theme_mod('timber_work_twitter_icon') ); ?>"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('timber_work_intagram_url') != ''){ ?>
                        <a class="instagram-icon" href="<?php echo esc_url(get_theme_mod('timber_work_intagram_url','')); ?>"><i class="<?php echo esc_html( get_theme_mod('timber_work_intagram_icon') ); ?>"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('timber_work_facebook_url') != ''){ ?>
                        <a class="facebook-icon" href="<?php echo esc_url(get_theme_mod('timber_work_facebook_url','')); ?>"><i class="<?php echo esc_html( get_theme_mod('timber_work_facebook_icon') ); ?>"></i></a>
                    <?php }?>
                  </div>
                </div>
              <?php }?>
            </div>
          </div>
        </div>
      </div>
    </section>
  <?php }?>

<?php if (get_theme_mod('timber_work_classes_section_setting', false) != '') { ?>
    <section id="classes-section" class="py-5">
      <div class="container">
        <div class="row pb-5">
          <div class="col-xl-5 col-lg-6 col-md-6 col-sm-6 align-self-center about-content">
            <?php if(get_theme_mod('timber_work_classes_heading') != ''){ ?>
              <h3 class="main-heading mb-5 pb-3"><?php echo esc_html(get_theme_mod('timber_work_classes_heading')); ?></h3>
            <?php }?>
            <?php if(get_theme_mod('timber_work_classes_content') != ''){ ?>
              <p class="main-content mb-4"><?php echo esc_html(get_theme_mod('timber_work_classes_content')); ?></p>
            <?php }?>
            <div class="feature-box row my-5">
              <div class="col-lg-6">
                <?php if(get_theme_mod('timber_work_about_us_detail_1') != '') {?>
                  <h6><i class="fas fa-screwdriver me-2"></i><?php echo esc_html(get_theme_mod('timber_work_about_us_detail_1')); ?></h6>
                <?php }?>
              </div>
              <div class="col-lg-6">
                <?php if(get_theme_mod('timber_work_about_us_detail_2') != '') {?>
                  <h6><i class="fas fa-handshake me-2"></i><?php echo esc_html(get_theme_mod('timber_work_about_us_detail_2')); ?></h6>
                <?php }?>
              </div>
              
            </div>
            <?php if(get_theme_mod('timber_work_classes_btn_text') != '' || get_theme_mod('timber_work_classes_btn_url') != ''){ ?>
              <a href="<?php echo esc_url(get_theme_mod('timber_work_classes_btn_url')); ?>" class="feature-btn" target="_blank"><?php echo esc_html(get_theme_mod('timber_work_classes_btn_text')); ?></a>
            <?php }?>
          </div>
          <div class="col-xl-7 col-lg-6 col-md-6 col-sm-6 align-self-center image-box">
            <?php if (get_theme_mod('timber_work_classes_image') != '') {?>
            <?php } else {?>
              <div class="class-img">
                <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/img/classes-img.png"/>
              </div>
            <?php }?>
            <?php if(get_theme_mod('timber_work_about_video_heading') != ''){ ?>
              <div class="video-text">
                  <h6><?php echo esc_html(get_theme_mod('timber_work_about_video_heading')); ?></h6>
              </div>
            <?php }?>
            <div class="class-img">
                <img src="<?php echo esc_url(get_theme_mod('timber_work_classes_image'));?>"/>
                <div class="video-image-box">
                  <?php if(get_theme_mod('timber_work_slider_video_button_url') != ''){ ?>
                    <div class="slide-button">
                      <!-- Button to open the modal -->
                      <div class="video-image">
                        <span class="image-video-btn">
                          <a id="openModalButton" data-modal-src="<?php echo esc_url(get_theme_mod('timber_work_slider_video_button_url')); ?>"><i class="fas fa-play"></i></a>
                          <!-- The modal -->
                      <div id="myModal" class="modal">
                        <!-- Modal content -->
                        <div class="modal-content">
                          <span id="closeModalButton" class="close">&times;</span>
                          <?php if( get_theme_mod('timber_work_slider_video_button_url') != ''){ ?>
                          <embed id="videoPlayer" height="369" src="<?php echo esc_url(get_theme_mod('timber_work_slider_video_button_url')); ?>"  allow="accelerometer; autoplay; classipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></embed>
                          <?php }else{ ?>
                            <h3><?php esc_html_e('Add Video Url In Customizer To Display Video Here','timber-work'); ?></h3>
                          <?php } ?>
                        </div>
                      </div> 
                        </span>
                      </div>
                    </div>
                  <?php } ?>
                </div>
              </div>
          </div>
          
        </div>
      </div>
    </section>
  <?php }?>
  <section id="page-content">
    <div class="container">
      <div class="spacer">
        <?php
          if ( have_posts() ) :
            while ( have_posts() ) : the_post();
              the_content();
            endwhile;
          endif;
        ?>
      </div>
    </div>
  </section>
</main>

<?php get_footer(); ?>