start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'nighty' ), ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'text', [ 'label' => esc_html__( 'Text', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => esc_html__( 'Your Text' , 'nighty' ), 'show_label' => true, ] ); $repeater->add_control( 'show_image', [ 'label' => esc_html__( 'Show Image', 'nighty' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'nighty' ), 'label_off' => esc_html__( 'Hide', 'nighty' ), 'return_value' => 'yes', 'default' => 'yes', ], ); $repeater->add_control( 'image', [ 'label' => esc_html__( 'Choose Image', 'nighty' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], 'condition' => [ 'show_image' => 'yes', ], ] ); $repeater->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'typography_content', 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}', ] ); $repeater->add_control( 'color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'items', [ 'label' => esc_html__( 'Items', 'nighty' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'text' => esc_html__( 'Marketing','nighty' ), ], [ 'text' => esc_html__( 'SEO', 'nighty' ), ], [ 'text' => esc_html__( 'Dancing', 'nighty' ), ], [ 'text' => esc_html__( 'Convention', 'nighty' ), ], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'image_section_style', [ 'label' => esc_html__( 'Image', 'nighty' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'image_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee-2 .content .image img' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'image_border_radius', [ 'label' => esc_html__( 'Border Radius', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee-2 .content .image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'image_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee-2 .content .image' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'line_decoration_section_style', [ 'label' => esc_html__( 'Line Decoration', 'nighty' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'line_decoration_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-text-marquee-2 .content .image .line-decoration' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'line_decoration_width', [ 'label' => esc_html__( 'Width', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee-2 .content .image .line-decoration' => 'width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .ova-text-marquee-2 .content .image' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'line_decoration_height', [ 'label' => esc_html__( 'Height', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee-2 .content .image .line-decoration' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'line_decoration_position_bottom', [ 'label' => esc_html__( 'Position Bottom', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee-2 .content .image .line-decoration' => 'bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'line_decoration_border', 'label' => esc_html__( 'Border', 'nighty' ), 'selector' => '{{WRAPPER}} .ova-text-marquee-2 .content .image .line-decoration', ] ); $this->end_controls_section(); $this->start_controls_section( 'text_section_style', [ 'label' => esc_html__( 'Text', 'nighty' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .ova-text-marquee-2 .content .text', ] ); $this->add_group_control( \Elementor\Group_Control_Text_Stroke::get_type(), [ 'name' => 'text_stroke', 'selector' => '{{WRAPPER}} .ova-text-marquee-2 .content .text', ] ); $this->add_control( 'text_color', [ 'label' => esc_html__( 'Text Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-text-marquee-2 .content .text' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'time_duration', [ 'label' => esc_html__( 'Time Duration', 'nighty' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'normal', 'options' => [ 'slow' => esc_html__( 'Slow', 'nighty' ), 'normal' => esc_html__( 'Normal', 'nighty' ), 'fast' => esc_html__( 'Fast', 'nighty' ), ], ] ); $this->add_control( 'direction', [ 'label' => esc_html__( 'Direction', 'nighty' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'rtl', 'options' => [ 'ltr' => esc_html__( 'Left to Right', 'nighty' ), 'rtl' => esc_html__( 'Right to Left', 'nighty' ), ], ] ); $this->end_controls_section(); } // Render Template Here protected function render() { $settings = $this->get_settings(); $items = $settings['items']; $direction = $settings['direction']; $time_duration = $settings['time_duration']; ?>