<?php
/**
 * wp-it-courses WordPress Theme, ordasvit.com
 * wp-it-courses is distributed under the terms of the GNU GPL
 * Copyright: OrdaSvit, ordasvit.com
 */

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


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

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

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

	wp_register_script('swiper_js', $os_uri . '/js/swiper.min.js', false);
	wp_enqueue_script('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_it_courses_rigistre_scripts');

add_action('wp_enqueue_scripts', 'wp_it_courses_theme_slider_init_in_footer');
function wp_it_courses_theme_slider_init_in_footer()
{
	add_action('print_footer_scripts', 'wp_it_courses_slider_init');
}
function wp_it_courses_slider_init()
{ ?>

	<script type='text/javascript'>
		const swiper = new Swiper('.swiper', {
			slidesPerView: 5,
			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 }