<?php

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


    /**
     * ALL CSS FILES
    */
    wp_enqueue_style( 'apexa-fonts', APEXA_THEME_CSS_DIR . 'apexa-fonts.css', []);
    if( is_rtl() ){
        wp_enqueue_style( 'bootstrap-rtl', APEXA_THEME_CSS_DIR.'bootstrap.rtl.min.css', array() );
    }else{
        wp_enqueue_style( 'bootstrap', APEXA_THEME_CSS_DIR.'bootstrap.min.css', array() );
    }
    wp_enqueue_style( 'apexa-animate', APEXA_THEME_CSS_DIR . 'animate.min.css', [] );
    wp_enqueue_style( 'magnific-popup', APEXA_THEME_CSS_DIR . 'magnific-popup.css', [] );
    wp_enqueue_style( 'font-awesome-free', APEXA_THEME_CSS_DIR . 'fontawesome-all.min.css', [] );
    wp_enqueue_style( 'flaticon', APEXA_THEME_CSS_DIR . 'flaticon.css', [] );
    wp_enqueue_style( 'odometer', APEXA_THEME_CSS_DIR . 'odometer.css', [] );
    wp_enqueue_style( 'swiper-bundle', APEXA_THEME_CSS_DIR . 'swiper-bundle.css', [] );
    wp_enqueue_style( 'aos', APEXA_THEME_CSS_DIR . 'aos.css', [] );
    wp_enqueue_style( 'apexa-default', APEXA_THEME_CSS_DIR . 'default.css', [] );
    wp_enqueue_style( 'apexa-core', APEXA_THEME_CSS_DIR . 'apexa-core.css', [] );
    wp_enqueue_style( 'apexa-unit', APEXA_THEME_CSS_DIR . 'apexa-unit.css', [] );
    wp_enqueue_style( 'apexa-style', get_stylesheet_uri() );


    // ALL JS FILES
    wp_enqueue_script( 'bootstrap-bundle', APEXA_THEME_JS_DIR . 'bootstrap.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'isotope', APEXA_THEME_JS_DIR . 'isotope.pkgd.min.js', ['imagesloaded'], '', true);
    wp_enqueue_script( 'magnific-popup', APEXA_THEME_JS_DIR . 'jquery.magnific-popup.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'odometer', APEXA_THEME_JS_DIR . 'jquery.odometer.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'appear', APEXA_THEME_JS_DIR . 'jquery.appear.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'gsap', APEXA_THEME_JS_DIR . 'gsap.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'scrollTrigger', APEXA_THEME_JS_DIR . 'scrollTrigger.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'splitText', APEXA_THEME_JS_DIR . 'splitText.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'gsap-animation', APEXA_THEME_JS_DIR . 'gsap-animation.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'parallaxScroll', APEXA_THEME_JS_DIR . 'jquery.parallaxScroll.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'swiper', APEXA_THEME_JS_DIR . 'swiper-bundle.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'wow', APEXA_THEME_JS_DIR . 'wow.min.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'aos', APEXA_THEME_JS_DIR . 'aos.js', [ 'jquery' ], '', true );
    wp_enqueue_script( 'apexa-main', APEXA_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', 'apexa_scripts' );