/
home
/
rekodeb
/
webmars
/
wp-content
/
plugins
/
calmor-core
/
widgets
/
Upload File
HOME
<?php namespace calmorCore\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Background; use WP_Query; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Text Typing Effect * * Elementor widget for text typing effect. * * @since 1.7.0 */ class calmer_contactform extends Widget_Base { public function get_name() { return 'calmor_contactform'; } public function get_title() { return __( 'calmor form', 'calmor-core' ); } public function get_icon() { return 'eicon-menu-bar'; } public function get_categories() { return [ 'calmor-elements' ]; } public function get_style_depends() { return [ 'appart-style', 'owl-carousel' ]; } public function get_script_depends() { return [ 'owl-carousel' ]; } protected function _register_controls() { $this->start_controls_section( 'section_title', [ 'label' => __( 'button Info', 'calmor-core' ), ] ); $this->add_control( 'button_level', [ 'label' => esc_html__( 'Button Text', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'View More', ] ); $this->add_control( 'button_url', [ 'label' => esc_html__( 'Button URL', 'calmer-core' ), 'type' => \Elementor\Controls_Manager::URL, 'options' => [ 'url', 'is_external', 'nofollow' ], 'default' => [ 'url' => '', 'is_external' => true, 'nofollow' => true, // 'custom_attributes' => '', ], 'label_block' => true, ] ); $this->end_controls_section(); // Button Style $this->start_controls_section( 'section_button_style', [ 'label' => __( 'button Style', 'calmer-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_responsive_control( 'calmer_button_align', [ 'label' => __('Button Alignment', 'calmer-core'), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'calmer-core'), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __('Center', 'calmer-core'), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __('Right', 'calmer-core'), 'icon' => 'eicon-text-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .calmer_button' => 'text-align: {{VALUE}};', ], ] ); $this->start_controls_tabs( 'style_tabs' ); //button Style Normal Style $this->start_controls_tab( 'style_normal', [ 'label' => __( 'Normal', 'calmor-core' ), ] ); $this->add_control( 'btn_font_color', [ 'label' => esc_html__( 'Font color', 'calmor-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'btn_bg_color', [ 'label' => esc_html__( 'Background Color', 'calmor-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'background-color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'button_border', 'label' => esc_html__( 'Border', 'calmor-core' ), 'selector' => '{{WRAPPER}} .bg_btn_color', ] ); $this->add_responsive_control( 'button_border_radius', [ 'label' => esc_html__('Border Radius', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_border_margin', [ 'label' => esc_html__('Margin', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .calmer_button .bg_btn_color' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_border_padding', [ 'label' => esc_html__('Padding', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .calmer_button .bg_btn_color' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_tab(); //Hover Color $this->start_controls_tab( 'style_hover_btn', [ 'label' => __( 'Hover', 'calmor-core' ), ] ); $this->add_control( 'hover_font_color', [ 'label' => __( 'Font Color', 'calmor-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .calmer_button.bg_btn_color:hover' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'hover_bg_color', [ 'label' => __( 'Background Color', 'calmor-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .calmer_button.bg_btn_color:hover' => 'background: {{VALUE}};', ] ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'hover_button_border', 'label' => esc_html__( 'Border', 'calmor-core' ), 'selector' => '{{WRAPPER}} .bg_btn_color:hover', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings(); if ( ! empty( $settings['button_url']['url'] ) ) { $this->add_link_attributes( 'button_url', $settings['button_url'] ); } ?> <?php if($settings['button_level']): ?> <div class="calmer_button"> <a <?php echo $this->get_render_attribute_string( 'button_url' ); ?> class="bg_btn_color wow fadeInLeft" data-wow-delay=".3s"><?php echo $settings['button_level']; ?></a> </div> <?php endif; ?> <?php } }