File: //proc/self/cwd/wp-content/plugins/ftech-plugin/elementor/widgets/animation-matter.php
<?php
/**
* Elementor Single Widget
* @package ftech Tools
* @since 1.0.0
*/
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
class Ftech_Matter extends Widget_Base {
/**
* Get widget name.
*
* Retrieve Elementor widget name.
*
* @since 1.0.0
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'go-matter';
}
/**
* Get widget title.
*
* Retrieve Elementor widget title.
*
* @since 1.0.0
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return esc_html__( 'Matter Animation', 'ftech-plugin' );
}
/**
* Get widget icon.
*
* Retrieve Elementor widget icon.
*
* @since 1.0.0
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'ftech-custom-icon';
}
/**
* Get widget categories.
*
* Retrieve the list of categories the Elementor widget belongs to.
*
* @since 1.0.0
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'ftech_widgets' ];
}
protected function register_controls() {
$this->start_controls_section(
'--faq-option',
[
'label' => esc_html__( 'Option', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'title', [
'label' => esc_html__( 'Title', 'ftech-plugin' ),
'default' => esc_html__( 'Section Title', 'ftech-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
'logos', [
'label' => esc_html__( 'Logo', 'gtbus-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
]
);
$this->add_control(
'animations',
[
'label' => esc_html__( 'Add Animation Item', 'goyto-plugin' ),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
]
);
$this->end_controls_section();
// Sub title style
$this->start_controls_section(
'icon_style',
[
'label' => esc_html__( 'Icon Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'sub_margin',
[
'label' => esc_html__( 'List Icon Margin', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-campaign-2-feature .icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'icon_color',
[
'label' => esc_html__( 'Icon Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-campaign-2-feature .icon' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'icon-size',
[
'label' => esc_html__( 'Icon Size', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-campaign-2-feature .icon' => 'font-size: {{SIZE}}{{UNIT}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'slider_sub_title_style',
[
'label' => esc_html__( 'Title Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'ttl_margin',
[
'label' => esc_html__( 'Title Margin', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-campaign-2-feature' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Sub Title Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-campaign-2-feature' => 'color: {{VALUE}}',
],
]
);
// typography
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'm_s_typography',
'selector' => '{{WRAPPER}} .ftc-campaign-2-feature',
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();?>
<div class="ftc-campaign-4-box" txa-matter-scene="true">
<?php if(!empty($settings['title'])):?>
<h4 class="title ftc-heading-2 has-color-white ftc-font-700 wow" data-splitting><?php echo ftech_wp_kses($settings['title']) ?></h4>
<?php endif;?>
<div class="ftc-campaign-4-tag-wrap">
<?php foreach($settings['animations'] as $item):?>
<div class="ftc-campaign-4-tag" txa-matter-item>
<span class="ftc-campaign-4-tag-item" >
<img src="<?php echo esc_url($item['logos']['url']);?>" alt="<?php if(!empty($item['logos']['alt'])){ echo esc_attr($item['logos']['alt']);}?>">
</span>
</div>
<?php endforeach;?>
</div>
</div>
<?php
}
}
Plugin::instance()->widgets_manager->register( new Ftech_Matter() );