<?php
/**
 * The template for displaying the footer
 *
 */
?>
<?php if (basel_needs_footer()): ?>
	<?php basel_page_bottom_part(); ?>
	<?php basel_enqueue_inline_style( 'footer-general' ); ?>

	<?php if ( basel_get_opt( 'prefooter_area' ) != '' ): ?>
		<div class="basel-prefooter">
			<div class="container">
				<?php echo do_shortcode( basel_get_opt( 'prefooter_area' ) ); ?>
			</div>
		</div>
	<?php endif ?>

	<!-- FOOTER -->
	<footer class="footer-container color-scheme-<?php echo esc_attr( basel_get_opt( 'footer-style' ) ); ?>">

		<?php
		if ( basel_get_opt( 'disable_footer' ) ) {
			get_sidebar( 'footer' );
		}
		?>

		<?php if ( basel_get_opt( 'disable_copyrights' ) ): ?>
			<div class="copyrights-wrapper copyrights-<?php echo esc_attr( basel_get_opt( 'copyrights-layout' ) ); ?>">
				<div class="container">
					<div class="min-footer footer-section">
						<div class="col-left">
							<?php if ( basel_get_opt( 'copyrights' ) != ''): ?>
								<?php echo do_shortcode( basel_get_opt( 'copyrights' ) ); ?>
							<?php else: ?>
								<p>&copy; <?php echo date( 'Y' ); ?> <a href="<?php echo esc_url( home_url('/') ); ?>"><?php bloginfo( 'name' ); ?></a>. <?php _e( 'All rights reserved', 'basel' ) ?></p>
							<?php endif ?>
						</div>
						<?php if ( basel_get_opt( 'copyrights2' ) != ''): ?>
							<div class="col-right">
								<?php echo do_shortcode( basel_get_opt( 'copyrights2' ) ); ?>
							</div>
						<?php endif ?>
						<div class="col-right">
								<p>Website By  <a href="https://nmgtechnologies.com/" target="_blank" rel="noopener">
									 <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/nmg-logo.png" alt="nmg-logo" width="69" height="25"></a>
								</p>
						</div>
					</div>
				</div>
			</div>
		<?php endif ?>

	</footer>
<?php endif ?>
</div> <!-- end wrapper -->

<div class="basel-close-side"></div>
<?php do_action( 'basel_before_wp_footer' ); ?>
<?php wp_footer(); ?>

<?php if (basel_needs_footer()) do_action( 'basel_after_footer' ); ?>
<div id="loader" style="display: none;" >
  	<div id="loader-icon"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/loder-img.gif"></div>
 </div>


</body>
</html>

<script>
	jQuery(document).ready(function(){
		if( jQuery('#mbl_video').length )         // use this if you are using id to check
		{
			const video = document.getElementById('mbl_video');
			video.play();
		}
		jQuery("#commentform").removeAttr('novalidate');
    });
//loader
	// window.addEventListener('load', () => {
	//   setTimeout(() => {
	//     document.querySelector('#loader').style.display = 'none'
	//     console.log('loaded')
	//   }, 2500)
	// })

function onReady(callback) {
  var intervalId = window.setInterval(function() {
    if (document.getElementsByTagName('body')[0] !== undefined) {
      window.clearInterval(intervalId);
      callback.call(this);
    }
  }, 1000);
}

function setVisible(selector, visible) {
  document.querySelector(selector).style.display = visible ? 'block' : 'none';
}

// onReady(function() {
//   setVisible('.website-wrapper', true);
//   setVisible('#loader', false);
// });


</script>
