<?php 
    class Edumodo_Customizer_General_Preloader{
        private $panel_key;
        private $priority;
        private $text_domain = 'edumodo';
        public function __construct($panel_key, $priority){
            $this->panel_key = $panel_key;
            $this->priority = $priority;
            $this->general_preloader_kirki_config();
        }
        public function general_preloader_kirki_config(){

            #   start color region 
                Kirki::add_section('edumodo_general_preloader', array(
                    'title' => esc_attr__('Preloader', 'edumodo'),
                    'panel' => $this->panel_key,
                    'priority' => $this->priority,
                ) );
                    Kirki::add_field( 'edumodo_preloader', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_preloader',
                        'label'       => esc_html__( 'Preloader', $this->text_domain ),
                        'section'     => 'edumodo_general_preloader',
                        'default'     => 'off',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', $this->text_domain ),
                            'off' => esc_html__( 'No', $this->text_domain )
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_preloader_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_preloader_color',
                        'label'       => __( 'Color', $this->text_domain ),
                        'section'     => 'edumodo_general_preloader',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_preloader',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_preloader_background_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_preloader_background_color',
                        'label'       => __( 'Background', $this->text_domain ),
                        'section'     => 'edumodo_general_preloader',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_preloader',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
            #   end of color region 
        }
    }
?>