<?php

/**
 * wp-luxury WordPress Theme, ordasvit.com
 * wp-luxury is distributed under the terms of the GNU GPL
 * Copyright: OrdaSvit, ordasvit.com
 */

/**
 * Header scripts for this theme
 *
 * @package WordPress
 * @subpackage wp_luxury
 */


function wp_luxury_rigistre_scripts()
{
	$os_uri = get_template_directory_uri();

	wp_register_script('wp_luxury_custom_script', $os_uri . '/js/custom.js', array('jquery'), false);
	wp_enqueue_script('wp_luxury_custom_script');

	wp_register_script('wp_luxury_bootstrap_script', $os_uri . '/bootstrap/js/bootstrap.js', false);
	wp_enqueue_script('wp_luxury_bootstrap_script');

	wp_register_script('wp_luxury_swiper_js', $os_uri . '/js/swiper.js', false);
	wp_enqueue_script('wp_luxury_swiper_js');

	// Threaded comment reply styles.
	if (is_singular() && comments_open() && get_option('thread_comments')) {
		wp_enqueue_script('comment-reply');
	}
}
add_action('wp_enqueue_scripts', 'wp_luxury_rigistre_scripts');

add_action('wp_enqueue_scripts', 'wp_luxury_theme_slider_init_in_footer');
function wp_luxury_theme_slider_init_in_footer()
{
	add_action('print_footer_scripts', 'wp_luxury_slider_init');
}
function wp_luxury_slider_init()
{ ?>

	<script type='text/javascript'>
		const swiper = new Swiper('.swiper', {
			slidesPerView: 5,
			breakpoints: {
				320: {
					slidesPerView: 1,
				},
				768: {
					slidesPerView: 2,
				},
				1024: {
					slidesPerView: 3,
				},
				1200: {
					slidesPerView: 5,
				},
			},
			// loop: true,

			// Navigation arrows
			navigation: {
				nextEl: '.swiper-button-next',
				prevEl: '.swiper-button-prev',
			},
			on: {
				init() {
					// ...
				},
			},
		});

		const swiper_top = new Swiper('.swiper_top', {
			slidesPerView: 1,
			breakpoints: {
				320: {
					slidesPerView: 1,
				},
				768: {
					slidesPerView: 1,
				},
				1024: {
					slidesPerView: 1,
				},
				1200: {
					slidesPerView: 1,
				},
			},
			// loop: true,

			// Navigation arrows
			navigation: {
				nextEl: '.swiper-button-next',
				prevEl: '.swiper-button-prev',
			},
			on: {
				init() {
					// ...
				},
			},
		});
	</script>

<?php }
