<?php

/**
 * xotric_scripts description
 * @return [type] [description]
 */
function xotric_scripts() {


    /**
     * ALL CSS FILES
    */
    wp_enqueue_style( 'xotric-fonts', XOTRIC_THEME_CSS_DIR . 'xotric-fonts.css', [] );
    if( is_rtl() ){
        wp_enqueue_style( 'bootstrap-rtl', XOTRIC_THEME_CSS_DIR.'bootstrap.rtl.min.css', array() );
    }else{
        wp_enqueue_style( 'bootstrap', XOTRIC_THEME_CSS_DIR.'bootstrap.min.css', array() );
    }
    wp_enqueue_style( 'xotric-animate', XOTRIC_THEME_CSS_DIR . 'animate.min.css', [] );
    wp_enqueue_style( 'magnific-popup', XOTRIC_THEME_CSS_DIR . 'magnific-popup.css', [] );
    wp_enqueue_style( 'font-awesome-free', XOTRIC_THEME_CSS_DIR . 'fontawesome-all.min.css', [] );
    wp_enqueue_style( 'odometer', XOTRIC_THEME_CSS_DIR . 'odometer.css', [] );
    wp_enqueue_style( 'jarallax', XOTRIC_THEME_CSS_DIR . 'jarallax.css', [] );
    wp_enqueue_style( 'slick', XOTRIC_THEME_CSS_DIR . 'slick.css', [] );
    wp_enqueue_style( 'xotric-default', XOTRIC_THEME_CSS_DIR . 'default.css', [] );
    wp_enqueue_style( 'xotric-core', XOTRIC_THEME_CSS_DIR . 'xotric-core.css', [] );
    wp_enqueue_style( 'xotric-unit', XOTRIC_THEME_CSS_DIR . 'xotric-unit.css', [] );
    wp_enqueue_style( 'xotric-style', get_stylesheet_uri() );
    wp_enqueue_style( 'xotric-responsive', XOTRIC_THEME_CSS_DIR . 'responsive.css', [] );


    // ALL JS FILES
    wp_enqueue_script( 'bootstrap-bundle', XOTRIC_THEME_JS_DIR . 'bootstrap.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'isotope', XOTRIC_THEME_JS_DIR . 'isotope.pkgd.min.js', ['imagesloaded' ], '', true );
    wp_enqueue_script( 'magnific-popup', XOTRIC_THEME_JS_DIR . 'jquery.magnific-popup.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'odometer', XOTRIC_THEME_JS_DIR . 'jquery.odometer.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'appear', XOTRIC_THEME_JS_DIR . 'jquery.appear.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'slick', XOTRIC_THEME_JS_DIR . 'slick.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'jarallax', XOTRIC_THEME_JS_DIR . 'jarallax.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'parallaxScroll', XOTRIC_THEME_JS_DIR . 'jquery.parallaxScroll.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'gsap', XOTRIC_THEME_JS_DIR . 'gsap.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'scrollTrigger', XOTRIC_THEME_JS_DIR . 'scrollTrigger.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'splitText', XOTRIC_THEME_JS_DIR . 'splitText.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'gsap-animation', XOTRIC_THEME_JS_DIR . 'gsap-animation.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'wow', XOTRIC_THEME_JS_DIR . 'wow.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'xotric-main', XOTRIC_THEME_JS_DIR . 'main.js', [ 'jquery' ], false, true );

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
        wp_enqueue_script( 'comment-reply' );
    }
}
add_action( 'wp_enqueue_scripts', 'xotric_scripts' );