startControlsSection( 'section_counter', [ 'label' => __('Counter'), ] ); $this->addControl( 'starting_number', [ 'label' => __('Starting Number'), 'type' => ControlsManager::NUMBER, 'default' => 0, ] ); $this->addControl( 'ending_number', [ 'label' => __('Ending Number'), 'type' => ControlsManager::NUMBER, 'default' => 100, 'dynamic' => [ 'active' => true, ], ] ); $this->addControl( 'prefix', [ 'label' => __('Number Prefix'), 'type' => ControlsManager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => 1, ] ); $this->addControl( 'suffix', [ 'label' => __('Number Suffix'), 'type' => ControlsManager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => __('Plus'), ] ); $this->addControl( 'duration', [ 'label' => __('Animation Duration'), 'type' => ControlsManager::NUMBER, 'default' => 2000, 'min' => 100, 'step' => 100, ] ); $this->addControl( 'thousand_separator', [ 'label' => __('Thousand Separator'), 'type' => ControlsManager::SWITCHER, 'default' => 'yes', 'label_on' => __('Show'), 'label_off' => __('Hide'), ] ); $this->addControl( 'thousand_separator_char', [ 'label' => __('Separator'), 'type' => ControlsManager::SELECT, 'condition' => [ 'thousand_separator' => 'yes', ], 'options' => [ '' => 'Default', '.' => 'Dot', ' ' => 'Space', ], ] ); $this->addControl( 'title', [ 'label' => __('Title'), 'type' => ControlsManager::TEXT, 'label_block' => true, 'dynamic' => [ 'active' => true, ], 'default' => __('Cool Number'), 'placeholder' => __('Cool Number'), ] ); $this->addControl( 'view', [ 'label' => __('View'), 'type' => ControlsManager::HIDDEN, 'default' => 'traditional', ] ); $this->endControlsSection(); $this->startControlsSection( 'section_number', [ 'label' => __('Number'), 'tab' => ControlsManager::TAB_STYLE, ] ); $this->addControl( 'number_color', [ 'label' => __('Text Color'), 'type' => ControlsManager::COLOR, 'scheme' => [ 'type' => SchemeColor::getType(), 'value' => SchemeColor::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .elementor-counter-number-wrapper' => 'color: {{VALUE}};', ], ] ); $this->addGroupControl( GroupControlTypography::getType(), [ 'name' => 'typography_number', 'scheme' => SchemeTypography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .elementor-counter-number-wrapper', ] ); $this->addGroupControl( GroupControlTextShadow::getType(), [ 'name' => 'number_shadow', 'selector' => '{{WRAPPER}} .elementor-counter-number-wrapper', ] ); $this->endControlsSection(); $this->startControlsSection( 'section_title', [ 'label' => __('Title'), 'tab' => ControlsManager::TAB_STYLE, ] ); $this->addControl( 'title_color', [ 'label' => __('Text Color'), 'type' => ControlsManager::COLOR, 'scheme' => [ 'type' => SchemeColor::getType(), 'value' => SchemeColor::COLOR_2, ], 'selectors' => [ '{{WRAPPER}} .elementor-counter-title' => 'color: {{VALUE}};', ], ] ); $this->addGroupControl( GroupControlTypography::getType(), [ 'name' => 'typography_title', 'scheme' => SchemeTypography::TYPOGRAPHY_2, 'selector' => '{{WRAPPER}} .elementor-counter-title', ] ); $this->addGroupControl( GroupControlTextShadow::getType(), [ 'name' => 'title_shadow', 'selector' => '{{WRAPPER}} .elementor-counter-title', ] ); $this->endControlsSection(); } /** * Render counter widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 */ protected function contentTemplate() { ?> <# view.addRenderAttribute( 'counter-title', 'class', 'elementor-counter-title' ); view.addInlineEditingAttributes( 'counter-title' ); #>