<?php

Kirki::add_section( 'general_options', array(
	'title' => esc_html__( 'General Options', 'newscope' ),
	'panel' => 'newscope_theme_options',
) );

// pro
new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'theme_mode_pro',
		'label'       => esc_html__( 'Purchase Pro', 'newscope' ),
		'description' => newscope_purchase_link(),
		'section'     => 'general_options',
		'default'     => '',
		'priority' => 1,
		'transport'   => 'auto',
		'choices'     => [
			'1'   => get_template_directory_uri() . '/assets/image/pro/dark.jpg',
		],
	]
);
Kirki::add_field( 'theme_config', [
	'type'     => 'switch',
	'settings' => 'preloader_options',
	'label'    => esc_html__( 'Enable Preloader', 'newscope' ),
	'section'  => 'general_options',
	'default'  => 'on',
	'priority' => 2,
	'choices'  => [
		'on'  => esc_html__( 'Enable', 'newscope' ),
		'off' => esc_html__( 'Disable', 'newscope' ),
	],
] );


Kirki::add_field( 'theme_config', [
	'type'            => 'color',
	'settings'        => 'preloader_color1',
	'label'           => __( 'Preload Color One', 'newscope' ),
	'section'         => 'general_options',
	'transport'       => 'auto',
	'priority'        => 2,
	'active_callback' => [
		[
			'setting'  => 'preloader_options',
			'operator' => '===',
			'value'    => true,
		],
	],
	'default'     => '#ffffff',
	'output'          => array(
		array(
			'element'  => '.preloader-area .preloader-inner .theme-loader',
			'property' => 'border-color',
		),
	),
] );


Kirki::add_field( 'theme_config', [
	'type'            => 'color',
	'settings'        => 'preloader_color2',
	'label'           => __( 'Preload Color Two', 'newscope' ),
	'section'         => 'general_options',
	'transport'       => 'auto',
	'priority'        => 2,
	'default'     => '#FA1AE4',
	'active_callback' => [
		[
			'setting'  => 'preloader_options',
			'operator' => '===',
			'value'    => true,
		],
	],
	'output'          => array(
		array(
			'element'  => '.preloader-area .preloader-inner .theme-loader::after',
			'property' => 'border-color',
		),
	),
] );


Kirki::add_field( 'theme_config', [
	'type'            => 'color',
	'settings'        => 'preloader_bg',
	'label'           => __( 'Preloader Background Color', 'newscope' ),
	'section'         => 'general_options',
	'transport'       => 'auto',
	'priority'        => 2,
	'default'     => '#000D38',
	'active_callback' => [
		[
			'setting'  => 'preloader_options',
			'operator' => '===',
			'value'    => true,
		],
	],
	'output'          => array(
		array(
			'element'  => '.preloader-area',
			'property' => 'background-color',
		),
	),
] );


Kirki::add_field( 'theme_config', [
	'type'     => 'switch',
	'settings' => 'bottom_to_top',
	'label'    => esc_html__( 'Enable Bottom To Top', 'newscope' ),
	'section'  => 'general_options',
	'default'  => 'on',
	'priority' => 4,
	'choices'  => [
		'on'  => esc_html__( 'Enable', 'newscope' ),
		'off' => esc_html__( 'Disable', 'newscope' ),
	],
] );


Kirki::add_field( 'theme_config', [
	'type'            => 'color',
	'settings'        => 'bottom_top_color',
	'label'           => __( 'Color', 'newscope' ),
	'section'         => 'general_options',
	'transport'       => 'auto',
	'priority'        => 4,
	'active_callback' => [
		[
			'setting'  => 'bottom_to_top',
			'operator' => '===',
			'value'    => true,
		],
	],
	'default'     => '#ffffff',
	'output'          => array(
		array(
			'element'  => '.to-top .to-top-icon',
			'property' => 'color',
		),
	),
] );

Kirki::add_field( 'theme_config', [
	'type'            => 'color',
	'settings'        => 'bottom_top_bg',
	'label'           => __( 'Background Color', 'newscope' ),
	'section'         => 'general_options',
	'transport'       => 'auto',
	'priority'        => 4,
	'active_callback' => [
		[
			'setting'  => 'bottom_to_top',
			'operator' => '===',
			'value'    => true,
		],
	],
	'default'     => '#FA1AE4',
	'output'          => array(
		array(
			'element'  => '.to-top',
			'property' => 'background-color',
		),
	),
] );