<?php
/**
* Class: Jet_Elements_Animated_Box
* Name: Animated Box
* Slug: jet-animated-box
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Animated_Box extends Jet_Elements_Base {
public function get_name() {
return 'jet-animated-box';
}
public function get_title() {
return esc_html__( 'Animated Box', 'jet-elements' );
}
public function get_icon() {
return 'jet-elements-icon-animated-box';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/how-to-showcase-your-services-in-the-form-of-a-flip-box-with-jetelements-animated-box-widget/';
}
public function get_categories() {
return array( 'cherry' );
}
/**
* Retrieve the list of scripts the widget depended on.
*
* @return array
*/
public function get_script_depends() {
return array( 'imagesloaded', 'html2canvas', 'oridomi', 'peel-js', 'jquery-ui-draggable', 'jquery-touch-punch' );
}
/**
* [get_style_depends description]
* @return [type] [description]
*/
public function get_style_depends() {
return array( 'peel-css' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-elements/animated-box/css-scheme',
array(
'animated_box' => '.jet-animated-box',
'animated_box_inner' => '.jet-animated-box__inner',
'animated_box_front' => '.jet-animated-box__front',
'animated_box_back' => '.jet-animated-box__back',
'animated_box_icon' => '.jet-animated-box__icon',
'animated_box_icon_box' => '.jet-animated-box__icon-box',
'animated_box_title' => '.jet-animated-box__title',
'animated_box_subtitle' => '.jet-animated-box__subtitle',
'animated_box_description' => '.jet-animated-box__description',
'animated_box_button' => '.jet-animated-box__button',
'animated_box_button_icon' => '.jet-animated-box__button-icon',
'animated_box_icon_front' => '.jet-animated-box__icon--front',
'animated_box_icon_back' => '.jet-animated-box__icon--back',
'animated_box_title_front' => '.jet-animated-box__title--front',
'animated_box_title_back' => '.jet-animated-box__title--back',
'animated_box_subtitle_front' => '.jet-animated-box__subtitle--front',
'animated_box_subtitle_back' => '.jet-animated-box__subtitle--back',
'animated_box_desc_front' => '.jet-animated-box__description--front',
'animated_box_desc_back' => '.jet-animated-box__description--back',
'animated_box_toggle' => '.jet-animated-box__toggle',
'animated_box_toggle_front' => '.jet-animated-box__toggle--front',
'animated_box_toggle_back' => '.jet-animated-box__toggle--back',
'animated_box_canvas' => '.jet-animated-box canvas',
)
);
$this->start_controls_section(
'section_front_content',
array(
'label' => esc_html__( 'Front Side Content', 'jet-elements' ),
)
);
$this->add_control(
'front_side_content_type',
array(
'label' => esc_html__( 'Content Type', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => array(
'default' => esc_html__( 'Default', 'jet-elements' ),
'template' => esc_html__( 'Template', 'jet-elements' ),
),
)
);
$this->_add_advanced_icon_control(
'front_side_icon',
array(
'label' => esc_html__( 'Icon', 'jet-elements' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'condition' => array(
'front_side_content_type' => 'default',
),
)
);
$this->add_control(
'front_side_title',
array(
'label' => esc_html__( 'Title', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Title', 'jet-elements' ),
'dynamic' => array( 'active' => true ),
'condition' => array(
'front_side_content_type' => 'default',
),
)
);
$this->add_control(
'front_side_subtitle',
array(
'label' => esc_html__( 'Subtitle', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Flip Box', 'jet-elements' ),
'dynamic' => array( 'active' => true ),
'condition' => array(
'front_side_content_type' => 'default',
),
)
);
$this->add_control(
'front_side_description',
array(
'label' => esc_html__( 'Description', 'jet-elements' ),
'type' => Controls_Manager::TEXTAREA,
'default' => esc_html__( 'Easily add or remove any text on your flip box!', 'jet-elements' ),
'dynamic' => array( 'active' => true ),
'condition' => array(
'front_side_content_type' => 'default',
),
)
);
$this->add_control(
'front_side_template_id',
array(
'label' => esc_html__( 'Choose Template', 'jet-elements' ),
'label_block' => 'true',
'type' => 'jet-query',
'query_type' => 'elementor_templates',
'condition' => array(
'front_side_content_type' => 'template',
),
)
);
$this->_add_advanced_icon_control(
'front_side_toggle_icon',
array(
'label' => esc_html__( 'Toggle Icon', 'jet-elements' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-angle-right',
'fa5_default' => array(
'value' => 'fas fa-angle-right',
'library' => 'fa-solid',
),
'condition' => array(
'switch_event_type' => 'toggle',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_back_content',
array(
'label' => esc_html__( 'Back Side Content', 'jet-elements' ),
)
);
$this->add_control(
'back_side_content_type',
array(
'label' => esc_html__( 'Content Type', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => array(
'default' => esc_html__( 'Default', 'jet-elements' ),
'template' => esc_html__( 'Template', 'jet-elements' ),
),
)
);
$this->_add_advanced_icon_control(
'back_side_icon',
array(
'label' => esc_html__( 'Icon', 'jet-elements' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => '',
'condition' => array(
'back_side_content_type' => 'default',
),
)
);
$this->add_control(
'back_side_title',
array(
'label' => esc_html__( 'Title', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Back Side', 'jet-elements' ),
'dynamic' => array( 'active' => true ),
'condition' => array(
'back_side_content_type' => 'default',
),
)
);
$this->add_control(
'back_side_subtitle',
array(
'label' => esc_html__( 'Subtitle', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
'default' => '',
'dynamic' => array( 'active' => true ),
'condition' => array(
'back_side_content_type' => 'default',
),
)
);
$this->add_control(
'back_side_description',
array(
'label' => esc_html__( 'Description', 'jet-elements' ),
'type' => Controls_Manager::TEXTAREA,
'default' => esc_html__( 'Easily add or remove any text on your flip box!', 'jet-elements' ),
'dynamic' => array( 'active' => true ),
'condition' => array(
'back_side_content_type' => 'default',
),
)
);
$this->add_control(
'back_side_button_text',
array(
'label' => esc_html__( 'Button text', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Read More', 'jet-elements' ),
'condition' => array(
'back_side_content_type' => 'default',
),
)
);
$this->add_control(
'back_side_button_link',
array(
'label' => esc_html__( 'Button Link', 'jet-elements' ),
'type' => Controls_Manager::URL,
'placeholder' => 'http://your-link.com',
'default' => array(
'url' => '#',
),
'dynamic' => array( 'active' => true ),
'condition' => array(
'back_side_content_type' => 'default',
),
)
);
$this->add_control(
'back_side_template_id',
array(
'label' => esc_html__( 'Choose Template', 'jet-elements' ),
'label_block' => 'true',
'type' => 'jet-query',
'query_type' => 'elementor_templates',
'condition' => array(
'back_side_content_type' => 'template',
),
)
);
$this->_add_advanced_icon_control(
'back_side_toggle_icon',
array(
'label' => esc_html__( 'Toggle Icon', 'jet-elements' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-times',
'fa5_default' => array(
'value' => 'fas fa-times',
'library' => 'fa-solid',
),
'condition' => array(
'switch_event_type' => 'toggle',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
$this->add_responsive_control(
'box_height',
array(
'label' => esc_html__( 'Height', 'jet-elements' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', 'rem', 'vh' ),
'range' => array(
'px' => array(
Loading ...