start_controls_section( 'content_section', [ 'label' => __( 'Marquee Content', 'advanced-marquee-effect' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'ame_marquee_text_url', [ 'label' => esc_html__( 'URL', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( '#', 'advanced-marquee-effect' ), 'placeholder' => esc_html__( 'Enter your URL', 'advanced-marquee-effect' ), ] ); $repeater->add_control( 'ame_marquee_text_html', [ 'label' => __( 'Marquee Content', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::WYSIWYG, 'default' => __( '

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

', 'advanced-marquee-effect' ), 'dynamic' => [ 'active' => true ], ] ); $this->add_control( 'ame_marquee_text_list', [ 'label' => __( 'Marquee Items', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => '{{{ ame_marquee_text_html }}}', 'default' => [ [ 'ame_marquee_text_url' => __( '#', 'advanced-marquee-effect' ), ], [ 'ame_marquee_text_html' => __( '

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

', 'advanced-marquee-effect' ), ], ] ] ); $this->add_control( 'ame_marquee_text_direction', [ 'label' => __( 'Marquee Direction', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => [ 'left_to_right' => __( 'Left to Right', 'advanced-marquee-effect' ), 'right_to_left' => __( 'Right to Left', 'advanced-marquee-effect' ), ], 'default' => 'right_to_left', ] ); $this->add_control( 'ame_marquee_text_stop_on_hover', [ 'label' => esc_html__('Stop Scrolling on Hover', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__('Yes', 'advanced-marquee-effect'), 'label_off' => esc_html__('No', 'advanced-marquee-effect'), 'return_value' => 'yes', 'default' => 'no', 'description' => esc_html__('Pause the marquee scrolling when hovering over it.', 'advanced-marquee-effect'), ] ); $this->add_control( 'ame_marquee_text_speed', [ 'label' => __( 'Speed (Seconds)', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'min' => 1, 'max' => 1000, 'step' => 1, 'default' => 15, ] ); $this->add_control( 'ame_marquee_text_separator_icon', [ 'label' => esc_html__( 'Separator Icon', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-circle', 'library' => 'fa-solid', ] ] ); $this->add_control( 'ame_ticker_label_heading', [ 'label' => esc_html__('Ticker Label', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'ame_ticker_label_enable', [ 'label' => esc_html__('Enable Ticker Label', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__('Yes', 'advanced-marquee-effect'), 'label_off' => esc_html__('No', 'advanced-marquee-effect'), 'return_value' => 'yes', 'default' => 'no', 'description' => esc_html__('Show or hide the ticker label.', 'advanced-marquee-effect'), ] ); $this->add_control( 'ame_ticker_label_icon', [ 'label' => esc_html__('Label Icon', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-bullhorn', 'library' => 'fa-solid', ], 'condition' => [ 'ame_ticker_label_enable' => 'yes', ], ] ); $this->add_control( 'ame_ticker_label_text', [ 'label' => esc_html__('Label Text', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__(' Breaking News', 'advanced-marquee-effect'), 'placeholder' => esc_html__('Enter label text', 'advanced-marquee-effect'), 'label_block' => true, 'condition' => [ 'ame_ticker_label_enable' => 'yes', ] ] ); $this->end_controls_section(); // Style Section $this->start_controls_section( 'style_section', [ 'label' => __( 'Style', 'advanced-marquee-effect' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); // Typography control for marquee items $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'ame_marquee_text_typography', 'label' => esc_html__( 'Typography', 'advanced-marquee-effect' ), 'selector' => '{{WRAPPER}} .ame-marquee-text_item', ] ); $this->add_control( 'ame_marquee_text_color', [ 'label' => esc_html__( 'Text Color', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ame-marquee-text_item *' => 'color: {{VALUE}}', ], ] ); // Background Color control for marquee items $this->add_control( 'ame_marquee_text_bg_color', [ 'label' => __( 'Background Color', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#f7f6ff', 'selectors' => [ '{{WRAPPER}} .ame-marquee-text_section' => 'background: {{VALUE}}', ], ] ); // Padding control for marquee items $this->add_responsive_control( 'ame_marquee_text_padding', [ 'label' => __( 'Padding', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => 10, 'right' => 20, 'bottom' => 10, 'left' => 20, ], 'selectors' => [ '{{WRAPPER}} .ame-marquee-text_section' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'ame_icon_label_heading', [ 'label' => esc_html__('Separator Style', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'ame_marquee_text_separator_icon_size', [ 'label' => esc_html__( 'Separator Icon Size', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'min' => 0, 'max' => 1000, 'step' => 1, 'default' => 16, ] ); $this->add_control( 'ame_marquee_text_separator_color', [ 'label' => esc_html__( 'Separator color', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ame_marquee_text_separator__icon svg path' => 'fill: {{VALUE}}', ], ] ); $this->add_control( 'ame_marquee_text_separator_icon_gap', [ 'label' => esc_html__( 'Icon Gap', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'min' => 0, 'max' => 100, 'step' => 1, 'default' => 36, ] ); $this->add_control( 'ame_ticker_label_section', [ 'label' => esc_html__('Ticker Style', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'ame_ticker_label_enable' => 'yes', ] ] ); $this->add_responsive_control( 'ame_marquee_ticker_padding', [ 'label' => __( 'Padding', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => 8, 'right' => 16, 'bottom' => 8, 'left' => 16, ], 'selectors' => [ '{{WRAPPER}} .ame-ticker-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'ame_marquee_ticker_bg_color', [ 'label' => __( 'Background Color', 'advanced-marquee-effect' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#000', 'selectors' => [ '{{WRAPPER}} .ame-ticker-label' => 'background: {{VALUE}}', ], 'condition' => [ 'ame_ticker_label_enable' => 'yes', ] ] ); $this->add_control( 'ame_ticker_label_icon_color', [ 'label' => esc_html__('Icon Color', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .ame-ticker-label__icon svg path, {{WRAPPER}} .ame-ticker-label__icon i' => 'fill: {{VALUE}}; color: {{VALUE}}', ], 'condition' => [ 'ame_ticker_label_enable' => 'yes', ] ] ); $this->add_control( 'ame_ticker_label_icon_size', [ 'label' => esc_html__('Icon Size', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em', 'rem'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 100, ], 'em' => [ 'min' => 0.5, 'max' => 5, ], 'rem' => [ 'min' => 0.5, 'max' => 5, ], ], 'default' => [ 'unit' => 'px', 'size' => 24, ], 'selectors' => [ '{{WRAPPER}} .ame-ticker-label__icon' => 'width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'ame_ticker_label_enable' => 'yes', ] ] ); $this->add_control( 'ame_ticker_label_text_color', [ 'label' => esc_html__('Text Color', 'advanced-marquee-effect'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .ame-ticker-label__text' => 'color: {{VALUE}}', ], 'condition' => [ 'ame_ticker_label_enable' => 'yes', ] ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'ame_ticker_label_text_typography', 'label' => esc_html__('Text Typography', 'advanced-marquee-effect'), 'selector' => '{{WRAPPER}} .ame-ticker-label__text', 'default' => [ 'font_size' => [ 'unit' => 'px', 'size' => 16, ], ], 'condition' => [ 'ame_ticker_label_enable' => 'yes', ] ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $marquee_direction = $settings['ame_marquee_text_direction'] == 'right_to_left' ? 'marquee-text-right-to-left' : 'marquee-text-left-to-right'; $ame_marquee_text_speed = $settings['ame_marquee_text_speed']; $ame_pushed_on_hover = isset($settings['ame_marquee_text_stop_on_hover']) && $settings['ame_marquee_text_stop_on_hover'] === 'yes' ? 'ame-push-on-hover' : ''; ?>
'true']); ?>

'true' ] ); ?>
'true' ] ); ?>