<?php
/**
 * Packers Logistic functions and definitions
 *
 * @package packers-logistic
 */

/* Theme Setup */
if ( ! function_exists( 'packers_logistic_support' ) ) :

	function packers_logistic_support() {

		load_theme_textdomain( 'packers-logistic', get_template_directory() . '/languages' );

		add_theme_support( 'automatic-feed-links' );
		add_theme_support( 'wp-block-styles' );
		add_theme_support( 'align-wide' );
		add_theme_support( 'responsive-embeds' );
		add_theme_support( 'experimental-link-color' );

		add_editor_style( 'style.css' );
	}

endif;
add_action( 'after_setup_theme', 'packers_logistic_support' );


/* Enqueue Styles */
if ( ! function_exists( 'packers_logistic_styles' ) ) :

	function packers_logistic_styles() {

		$packers_logistic_theme_version = wp_get_theme()->get( 'Version' );
		$packers_logistic_theme_uri = get_template_directory_uri();

		// Main stylesheet
		wp_enqueue_style(
			'packers-logistic-style',
			$packers_logistic_theme_uri . '/style.css',
			array(),
			$packers_logistic_theme_version
		);

		wp_style_add_data( 'packers-logistic-style', 'rtl', 'replace' );

		// Extra styles
		wp_enqueue_style( 'animate-css', $packers_logistic_theme_uri . '/assets/css/animate.css', array(), '1.0' );

		wp_enqueue_style( 'dashicons' );

		wp_enqueue_style( 'fontawesome', $packers_logistic_theme_uri . '/inc/fontawesome/css/all.css', array(), '6.7.0' );

		wp_enqueue_style( 'owl-carousel-style', $packers_logistic_theme_uri . '/assets/css/owl-carousel.css', array(), '2.3.4' );

		wp_enqueue_style( 'swiper-css', $packers_logistic_theme_uri . '/assets/css/swiper-bundle.css', array(), '10.0' );
	}

endif;
add_action( 'wp_enqueue_scripts', 'packers_logistic_styles' );


/* Enqueue Scripts */
function packers_logistic_scripts() {

	$packers_logistic_theme_uri = get_template_directory_uri();

	// WOW JS
	wp_enqueue_script(
		'wow',
		$packers_logistic_theme_uri . '/assets/js/wow.js',
		array('jquery'),
		'1.0',
		true
	);

	// Custom JS
	wp_enqueue_script(
		'packers-logistic-custom',
		$packers_logistic_theme_uri . '/assets/js/custom.js',
		array('jquery'),
		'1.0',
		true
	);

	// Scroll to top
	wp_enqueue_script(
		'packers-logistic-scroll-to-top',
		$packers_logistic_theme_uri . '/assets/js/scroll-to-top.js',
		array(),
		'1.0',
		true
	);

	// Swiper JS
	wp_enqueue_script(
		'swiper-js',
		$packers_logistic_theme_uri . '/assets/js/swiper-bundle.js',
		array(),
		'10.0',
		true
	);

	// Owl Carousel
	wp_enqueue_script(
		'owl-carousel-js',
		$packers_logistic_theme_uri . '/assets/js/owl-carousel.js',
		array('jquery'),
		'2.3.4',
		true
	);
}
add_action( 'wp_enqueue_scripts', 'packers_logistic_scripts' );


/* Theme Settings */
function packers_logistic_theme_setting() {

	require get_template_directory() . '/inc/block-pattern.php';
	require get_template_directory() . '/inc/block-style.php';

}
add_action( 'after_setup_theme', 'packers_logistic_theme_setting' );