<?php

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

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'mode_for_pro',
		'label'       => esc_html__( 'Purchase Pro For This Feature', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'general_options',
		'default'     => '',
		'transport'   => 'auto',
		'priority' => 2,
		'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', 'newshit' ),
	'section'  => 'general_options',
	'default'  => 'on',
	'priority' => 2,
	'choices'  => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
] );


Kirki::add_field( 'theme_config', [
	'type'            => 'color',
	'settings'        => 'preloader_color1',
	'label'           => __( 'Preload Color One', 'newshit' ),
	'section'         => 'general_options',
	'transport'       => 'auto',
	'priority'        => 2,
	'active_callback' => [
		[
			'setting'  => 'preloader_options',
			'operator' => '===',
			'value'    => true,
		],
	],
	'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', 'newshit' ),
	'section'         => 'general_options',
	'transport'       => 'auto',
	'priority'        => 2,
	'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', 'newshit' ),
	'section'         => 'general_options',
	'transport'       => 'auto',
	'priority'        => 2,
	'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', 'newshit' ),
	'section'  => 'general_options',
	'default'  => 'on',
	'priority' => 4,
	'choices'  => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
] );


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

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