/
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 calmor_address extends Widget_Base { public function get_name() { return 'calmor_address'; } public function get_title() { return __( 'calmer Address', 'calmor-core' ); } public function get_icon() { return 'eicon-device-desktop'; } 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( 'address_calmor', [ 'label' => __( 'Address Information', 'calmor-core' ), ] ); $this->add_control( 'addres_title', [ 'label' => __( 'Address Title', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'United State' ] ); $this->add_control( 'addres_title_location', [ 'label' => __( 'Address Content', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'United State' ] ); $this->add_control( 'addres_email', [ 'label' => __( 'Address Email', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'info@calmon.com' ] ); $this->add_control( 'addres_phone', [ 'label' => __( 'Contact Number', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => '+880-182760941' ] ); $this->add_control( 'addres_button', [ 'label' => __( 'Button Text', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'GET DIRECTION' ] ); $this->add_control( 'addres_button_url', [ 'label' => __( 'Button URL', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => '#' ] ); $this->end_controls_section(); // Button Style $this->start_controls_section( 'section_box_style', [ 'label' => __( 'Address Box Style', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_control( 'btn_bg_color', [ 'label' => esc_html__( 'Background Color', 'calmor-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .min_contact_box .single_contact_box' => 'background-color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'button_border', 'label' => esc_html__( 'Border', 'calmor-core' ), 'selector' => '{{WRAPPER}} .min_contact_box .single_contact_box', ] ); $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}} .min_contact_box .single_contact_box' => '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}} .min_contact_box .single_contact_box' => '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}} .min_contact_box .single_contact_box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'style_sec_adress', [ 'label' => __( 'Style Address', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_control( 'title_text_color', [ 'label' => esc_html__('Title Text Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_contact_box .single_contact_box h5' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_text_typo', 'selector' => ' {{WRAPPER}} .min_contact_box .single_contact_box h5', ] ); $this->add_control( 'content_text_color', [ 'label' => esc_html__('Location Text Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_contact_box .single_contact_box .location' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_text_typo', 'selector' => ' {{WRAPPER}} .min_contact_box .single_contact_box .location', ] ); $this->add_control( 'email_text_color', [ 'label' => esc_html__('Email Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_contact_box .single_contact_box .contact_list li .mail' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'email_text_typo', 'selector' => ' {{WRAPPER}} .min_contact_box .single_contact_box .contact_list li .mail', ] ); $this->add_control( 'phone_text_color', [ 'label' => esc_html__('Phone Text Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_contact_box .single_contact_box .contact_list li a' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'Phone_text_typo', 'selector' => ' {{WRAPPER}} .min_contact_box .single_contact_box .contact_list li a', ] ); $this->add_control( 'button_text_color', [ 'label' => esc_html__('Button Text Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .text_btn' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'button_text_typo', 'selector' => ' {{WRAPPER}} .text_btn', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings(); ?> <div class="min_contact_box"> <div class="single_contact_box"> <?php if($settings['addres_title']): ?> <h5><?php echo $settings['addres_title']; ?></h5> <?php endif; ?> <?php if($settings['addres_title_location']): ?> <span class="location"><?php echo $settings['addres_title_location']; ?></span> <?php endif; ?> <ul class="contact_list list-unstyled"> <li><a class="mail" href="mailto:<?php echo $settings['addres_email']; ?>"><?php echo $settings['addres_email']; ?></a> </li> <li><a href="tel:+<?php echo $settings['addres_phone']; ?>"><?php echo $settings['addres_phone']; ?></a></li> </ul> <a href="<?php echo $settings['addres_button_url']; ?>" class="text_btn"><?php echo $settings['addres_button']; ?> <i class="fa-solid fa-arrow-right"></i></a> </div> </div> <?php } }