<?php

/**
 * Enqueue scripts and styles.
 */

function glowify_wp_scripts() {

	wp_enqueue_style( 'animate', get_template_directory_uri() . '/assets/css/animate.min.css', array(), '1.0' );
	wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), '5.0.2' );
	wp_enqueue_style( 'fontawesome-pro', get_template_directory_uri() . '/assets/css/font-awesome-pro.css', array(), '5.15.4' );
	wp_enqueue_style( 'date-ranger-css', get_template_directory_uri() . '/assets/css/daterangepicker.css', array(), '2.0.7' );
	wp_enqueue_style( 'glowify-reset', get_template_directory_uri() . '/assets/css/reset.css', array(), '1.0' );
	wp_enqueue_style( 'glowify-elements', get_template_directory_uri() . '/assets/css/elements.css', array(), '1.0' );
	wp_enqueue_style( 'glowify-woocommerce', get_template_directory_uri() . '/assets/css/woocommerce.css', array(), '1.0' );
	wp_enqueue_style( 'glowify-style', get_stylesheet_uri() );
	wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), '5.0.2', true );
	wp_enqueue_script( 'jquery-zoom', get_template_directory_uri() . '/assets/js/jquery.zoom.js', array(), '1.7.21', true );
    wp_enqueue_script( 'jquery-masonry' );
	wp_enqueue_script( 'glowify-active', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), '1.0', true );


	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {

		wp_enqueue_script( 'comment-reply' );

	}


	$glowify_wp_custom_css = glowify_wp_option('glowify_wp_custom_css');
	$glowify_wp_custom_css = $glowify_wp_custom_css ? $glowify_wp_custom_css : '';

	$glowify_wp_head_scripts = glowify_wp_option('glowify_wp_head_scripts');
	$glowify_wp_head_scripts = $glowify_wp_head_scripts ? $glowify_wp_head_scripts : '';

	$glowify_wp_body_scripts = glowify_wp_option('glowify_wp_body_scripts');
	$glowify_wp_body_scripts = $glowify_wp_body_scripts ? $glowify_wp_body_scripts : '';

	wp_add_inline_style('glowify-style', $glowify_wp_custom_css);
	wp_add_inline_script('jquery-migrate', $glowify_wp_head_scripts);
	wp_add_inline_script('glowify-active', $glowify_wp_body_scripts);

}

add_action( 'wp_enqueue_scripts', 'glowify_wp_scripts' );


function glowify_wp_gutenberg_styles() {
	wp_enqueue_style( 'glowify-gutenberg', get_theme_file_uri( '/assets/css/gutenberg.css' ), false, '1.0', 'all' );
}
add_action( 'enqueue_block_editor_assets', 'glowify_wp_gutenberg_styles' );



