start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'nighty' ), ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'flaticon flaticon-asterisks', 'library' => 'flaticon', ], ] ); $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_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__( 'Open Hours : Mon-Fri: 9 AM – 6 PM Saturday: 9 AM – 4 PM Sunday: Closed','nighty' ), ], [ 'text' => esc_html__( 'Germany —785 15h Street, Office 478Berlin, De 81566', 'nighty' ), ], [ 'text' => esc_html__( 'Get In Touch — phone: +1(800)123-4566', 'nighty' ), ], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'general_section_style', [ 'label' => esc_html__( 'General', 'nighty' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'general_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .ova-text-marquee', ] ); $this->add_responsive_control( 'general_opacity', [ 'label' => esc_html__( 'Opacity', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0.1, 'max' => 1, 'step' => 0.1, ], ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee' => 'opacity: {{SIZE}};', ], ] ); $this->add_responsive_control( 'general_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'icon_section_style', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 100, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .icon i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .ova-text-marquee .icon svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .icon i' => 'color : {{VALUE}};', '{{WRAPPER}} .ova-text-marquee .icon svg path' => 'fill : {{VALUE}};' ], ] ); $this->add_responsive_control( 'icon_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $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 .content .text', ] ); $this->add_control( 'text_color', [ 'label' => esc_html__( 'Text Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .content .text' => 'color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'space_between', [ 'label' => esc_html__( 'Space Between', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .spacing' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $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']; ?>
'true' ] ); ?>
'true' ] ); ?>
register( new Nighty_Elementor_Text_Marquee() );