/
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\Scheme_Typography; use Elementor\Group_Control_Typography; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Text Typing Effect * * Elementor widget for text typing effect. * * @since 1.7.0 */ class calmor_awards extends Widget_Base { public function get_name() { return 'calmor_features'; } public function get_title() { return __( 'Calmer Awards', 'calmor-core' ); } public function get_icon() { return ' eicon-column'; } public function get_categories() { return [ 'calmor-elements' ]; } protected function _register_controls() { $awards = new \Elementor\Repeater(); $this->start_controls_section( 'client_images_features_sec', [ 'label' => __( 'Awards List', 'calmor-core' ), ] ); $awards->add_control( 'awards_title', [ 'label' => __( ' Awards Title', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'Best Design Awards' ] ); $awards->add_control( 'awards_time', [ 'label' => __( ' Awards Date', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => false, 'default' => 'December 2022' ] ); $awards->add_control( 'awards_content', [ 'label' => __( ' Awards Description', 'calmor-core' ), 'type' => \Elementor\Controls_Manager::WYSIWYG, 'default' => 'Curabitur auctor metus et cursus feugiat phasellus tempus nibh non erat ultricies in fermentum' ] ); $awards->add_control( 'awards_image', [ 'label' => esc_html__( 'Choose Image', 'calmor-core' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $this->add_control( 'feature_awards', [ 'label' => __( 'Awards Info', 'calmor-core' ), 'type' => Controls_Manager::REPEATER, 'title_field' => '{{{ awards_title }}}', 'fields' => $awards->get_controls(), ] ); $this->end_controls_section(); /*================= start award style =============*/ $this->start_controls_section( 'style_sec_one', [ 'label' => __( 'General Setting', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'background_section', 'label' => esc_html__( 'Section Background', 'calmor-core' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => ' {{WRAPPER}} .min_aword_area .singe_aword', ] ); $this->add_responsive_control( 'awards_margin', [ 'label' => esc_html__('Margin', 'almor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => array( '{{WRAPPER}} .min_aword_area .singe_aword' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ] ); $this->add_responsive_control( 'awards_padding', [ 'label' => esc_html__('Padding', 'almor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => array( '{{WRAPPER}} .min_aword_area .singe_aword' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'section_border', 'label' => esc_html__( 'Border', 'calmor-core' ), 'selector' => ' {{WRAPPER}} .min_aword_area .singe_aword', ] ); $this->add_responsive_control( 'awards_border_radius', [ 'label' => esc_html__('Border Radius', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => array( '{{WRAPPER}} .min_aword_area .singe_aword' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ] ); $this->end_controls_section(); $this->start_controls_section( 'style_sec', [ 'label' => __( 'Content Style', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_control( 'title_color', [ 'label' => esc_html__('Title Text Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_aword_area .singe_aword .left_content .content h5 a' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typo', 'selector' => ' {{WRAPPER}} .min_aword_area .singe_aword .left_content .content h5 a', ] ); $this->add_control( 'content_color', [ 'label' => esc_html__('Content Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_aword_area .singe_aword .right_content p' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typo', 'selector' => ' {{WRAPPER}} .min_aword_area .singe_aword .right_content p', ] ); $this->add_control( 'time_color', [ 'label' => esc_html__('Awards Time Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_aword_area .singe_aword .left_content .content span' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'time_typo', 'selector' => ' {{WRAPPER}} .min_aword_area .singe_aword .left_content .content span', ] ); $this->add_control( 'awards_icon_color', [ 'label' => esc_html__('Awards Icon Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_aword_area .singe_aword .right_content i' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'awards_icon_typo', 'selector' => ' {{WRAPPER}} .min_aword_area .singe_aword .right_content i', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings(); $feature_awards = isset($settings['feature_awards']) ? $settings['feature_awards'] : ''; ?> <section class="aword"> <div class="min_aword_area"> <?php if ( is_array( $feature_awards ) && count( $feature_awards ) > 0 ) { $i=1; foreach ( $feature_awards as $awards_list ) { ?> <div class="singe_aword wow fadeInLeft" data-wow-delay="0.3s"> <div class="row"> <div class="col-lg-6"> <div class="left_content"> <img src="<?php echo esc_url($awards_list['awards_image']['url']); ?>" alt=""> <div class="content"> <h5><a href=""><?php echo $awards_list['awards_title']; ?></a></h5> <span><?php echo $awards_list['awards_time']; ?></span> </div> </div> </div> <div class="col-lg-6"> <div class="right_content"> <?php echo $awards_list['awards_content']; ?> <i class="fa-solid fa-arrow-right"></i> </div> </div> </div> </div> <?php } } ?> </div> </section> <?php } }