<?php 
    class Edumodo_Customizer_General_Scroll_Top{
        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_scroll_to_top_config();
        }
        public function general_scroll_to_top_config(){

            #   start scroll to top region 
                Kirki::add_section('edumodo_general_scroll_to_top', array(
                    'title' => esc_attr__('Scroll to Top', $this->text_domain),
                    'panel' => $this->panel_key,
                    'priority' => $this->priority,
                ) );
                    Kirki::add_field( 'edumodo_enable_scrolltop', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_enable_scrolltop',
                        'label'       => esc_html__( 'Enable', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', $this->text_domain ),
                            'off' => esc_html__( 'No', $this->text_domain )
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_position', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_scrolltop_position',
                        'label'       => esc_html__( 'Position', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'default'     => 'right',
                        'priority'    => 10,
                        'choices'     => [
                            'left'   => esc_html__( 'Left', $this->text_domain ),
                            'right' => esc_html__( 'Right', $this->text_domain )
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_bottom_position', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_scrolltop_bottom_position',
                        'label'       => esc_html__( 'Bottom Position (px)', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'default'     => 50,
                        'choices'     => [
                            'min'  => 0,
                            'max'  => 200,
                            'step' => 1,
                        ],
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_button_size', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_scrolltop_button_size',
                        'label'       => esc_html__( 'Button Size (px)', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'default'     => 50,
                        'choices'     => [
                            'min'  => 0,
                            'max'  => 200,
                            'step' => 1,
                        ],
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_icon_size', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_scrolltop_icon_size',
                        'label'       => esc_html__( 'Icon Size (px)', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'default'     => 16,
                        'choices'     => [
                            'min'  => 0,
                            'max'  => 50,
                            'step' => 1,
                        ],
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_border_radius', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_scrolltop_border_radius',
                        'label'       => esc_html__( 'Border Radius (px)', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'default'     => 0,
                        'choices'     => [
                            'min'  => 0,
                            'max'  => 100,
                            'step' => 1,
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                        'priority'    => 10,
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_background_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_scrolltop_background_color',
                        'label'       => __( 'Background Color', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_background_hover_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_scrolltop_background_hover_color',
                        'label'       => __( 'Background Hover Color', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_border_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_scrolltop_border_color',
                        'label'       => __( 'Border Color', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_border_hover_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_scrolltop_border_hover_color',
                        'label'       => __( 'Border Hover Color', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_scrolltop_color',
                        'label'       => __( 'Color', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_scrolltop_hover_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_scrolltop_hover_color',
                        'label'       => __( 'Hover Color', $this->text_domain ),
                        'section'     => 'edumodo_general_scroll_to_top',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_enable_scrolltop',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
            #   end of scroll to top region 


        }
    }
?>