<?php
// Register Logo Widget
pxl_add_custom_widget(
    array(
        'name' => 'pxl_showcase',
        'title' => esc_html__('Case Showcase', 'solarva' ),
        'icon' => 'eicon-editor-list-ul',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'tab_layout',
                    'label' => esc_html__('Layout', 'solarva'),
                    'tab' => \Elementor\Controls_Manager::TAB_LAYOUT,
                    'controls' => array(
                        array(
                            'name' => 'layout',
                            'label' => esc_html__('Templates', 'solarva'),
                            'type' => 'layoutcontrol',
                            'default' => '1',
                            'options' => array(
                                '1' => array(
                                    'label' => esc_html__('Layout 1', 'solarva'),
                                    'image' => get_template_directory_uri() . '/elements/assets/img/pxl_showcase/showcase1.jpg',
                                ),
                                '2' => array(
                                    'label' => esc_html__('Layout 2', 'solarva'),
                                    'image' => get_template_directory_uri() . '/elements/assets/img/pxl_showcase/showcase2.jpg',
                                ),
                            ),
                        ),
                    ),
                ),
                array(
                    'name' => 'section_content',
                    'label' => esc_html__('Items', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                    'controls' => array(
                        array(
                            'name' => 'img_size',
                            'label' => esc_html__('Image Size', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::TEXT,
                            'placeholder' => 'Ex: 200x100(WxH), thumbnail, medium...',
                        ),
                        array(
                            'name' => 'button_text',
                            'label' => esc_html__('Button Text', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::TEXT,
                            'default' => esc_html__('Preview', 'solarva'),
                        ),
                        array(
                            'name' => 'button_text2',
                            'label' => esc_html__('Button Text 2', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::TEXT,
                            'default' => esc_html__('Onepage', 'solarva'),
                        ),
                        array(
                            'name' => 'coming_soon_text',
                            'label' => esc_html__('Coming Soon Text', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::TEXT,
                            'default' => esc_html__('Coming Soon', 'solarva'),
                        ),
                        array(
                            'name' => 'cases',
                            'label' => esc_html__('Cases', 'solarva'),
                            'type' => \Elementor\Controls_Manager::REPEATER,
                            'controls' => array(
                                array(
                                    'name' => 'is_coming_soon',
                                    'label' => esc_html__('Cooming Soon', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::SWITCHER,
                                    'default' => '',
                                ),
                                array(
                                    'name' => 'title',
                                    'label' => esc_html__('Title', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::TEXT,
                                ),
                                array(
                                    'name' => 'subtitle',
                                    'label' => esc_html__('Subtitle', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::TEXT,
                                    'label_block' => true,
                                ),
                                array(
                                    'name' => 'image',
                                    'label' => esc_html__('Upload', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::MEDIA,
                                ),
                                array(
                                    'name' => 'link',
                                    'label' => esc_html__('Link', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::URL,
                                ),
                                array(
                                    'name' => 'link2',
                                    'label' => esc_html__('Link 2', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::URL,
                                ),

                                array(
                                    'name' => 'bg_image',
                                    'label' => esc_html__('Background Image', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::MEDIA,
                                ),
                                array(
                                    'name' => 'bg_color',
                                    'label' => esc_html__('Background Color', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::COLOR,
                                    'selectors' => [
                                        '{{WRAPPER}} .pxl-showcase {{CURRENT_ITEM}} .pxl-item--bg' => 'background-color: {{VALUE}}',
                                    ],
                                ),
                                array(
                                    'name' => 'button_bg_color',
                                    'label' => esc_html__('Button Background Color', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::COLOR,
                                    'selectors' => [
                                        '{{WRAPPER}} .pxl-showcase .pxl-item--single{{CURRENT_ITEM}}' => '--color: {{VALUE}}',
                                    ],
                                ),
                            ),
                        ),
                    ),
                ),
                array(
                    'name' => 'tab_style',
                    'label' => esc_html__('General', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array_merge(
                        array(
                            array(
                                'name' => 'justify_content',
                                'label' => esc_html__('Justify Content', 'solarva' ),
                                'type' => \Elementor\Controls_Manager::CHOOSE,
                                'default' => '',
                                'options' => [
                                    'start' =>  [
                                        'title' => esc_html__('Start', 'solarva'),
                                        'icon' => 'eicon-justify-start-h',
                                    ],
                                    'center' =>  [
                                        'title' => esc_html__('Center', 'solarva'),
                                        'icon' => 'eicon-justify-center-h',
                                    ],
                                    'end' =>  [
                                        'title' => esc_html__('End', 'solarva'),
                                        'icon' => 'eicon-justify-end-h',
                                    ],
                                ],
                                'selectors' => [
                                    '{{WRAPPER}} .pxl-showcase .pxl-item--inner' => 'justify-content: {{VALUE}}'
                                ],
                            ),
                        ),
                    ),
                ),
                solarva_grid_settings(false),
                solarva_widget_animation_settings(),
            ),
        ),
    ),
    solarva_get_class_widget_path(),
);