<?php
// Register Logo Widget
pxl_add_custom_widget(
    array(
        'name' => 'pxl_divider',
        'title' => esc_html__('Case Divider', 'solarva' ),
        'icon' => 'eicon-divider',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'section_content',
                    'label' => esc_html__('Content', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                    'controls' => array(
                        array(
                            'name' => 'color',
                            'label' => esc_html__('Color', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'default' => '#223035',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-divider' => 'background-color: {{VALUE}};'
                            ]
                        ),
                        array(
                            'name' => 'type_width',
                            'label' => esc_html__('Type Width', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::CHOOSE,
                            'options' => [
                                '100vw' =>  [
                                    'title' => esc_html__('Full Screen', 'solarva'),
                                    'icon' => 'eicon-grow',
                                ],
                                '100%' =>  [
                                    'title' => esc_html__('Auto', 'solarva'),
                                    'icon' => 'eicon-shrink',
                                ],
                                'custom' =>  [
                                    'title' => esc_html__('Custom', 'solarva'),
                                    'icon' => 'eicon-custom',
                                ],
                            ],
                            'default' => '100%', 
                            'selectors' => [
                                '{{WRAPPER}} .pxl-divider-wrap .pxl-divider' => 'width: {{VALUE}};',
                            ],
                        ),
                        array(
                            'name' => 'width',
                            'label' => esc_html__('Width', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive' ,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'range' => [
                                'px' => [
                                    'min' => 1, 
                                    'max' => 3000
                                ],
                            ],
                            'condition' => [
                                'type_width' => 'custom',
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-divider-wrap .pxl-divider' => 'width: {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'height',
                            'label' => esc_html__('Height', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive' ,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'range' => [
                                'px' => [
                                    'min' => 1, 
                                    'max' => 1000
                                ],
                            ],
                            'default' => [
                                'size' => '1',
                                'unit' => 'px',
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-divider-wrap' => 'height: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'spacing_top',
                            'label' => esc_html__('Spacing Top', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive' ,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'range' => [
                                'px' => [
                                    'min' => 1, 
                                    'max' => 1000
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-divider-wrap' => 'margin-top: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'spacing_bottom',
                            'label' => esc_html__('Spacing Bottom', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive' ,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'range' => [
                                'px' => [
                                    'min' => 1, 
                                    'max' => 1000
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-divider-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'animate',
                            'label' => esc_html__('Animate', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'none' => esc_html__('None', 'solarva'),
                            ],
                            'default' => 'none', 
                        ),
                    ),
                ),
                solarva_widget_animation_settings(),
            ),
        ),
    ),
    solarva_get_class_widget_path()
);