first commit
This commit is contained in:
@@ -0,0 +1,359 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Plugin;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
use \Essential_Addons_Elementor\Pro\Skins\Skin_Default;
|
||||
use \Essential_Addons_Elementor\Pro\Skins\Skin_Five;
|
||||
use \Essential_Addons_Elementor\Pro\Skins\Skin_Four;
|
||||
use \Essential_Addons_Elementor\Pro\Skins\Skin_One;
|
||||
use \Essential_Addons_Elementor\Pro\Skins\Skin_Seven;
|
||||
use \Essential_Addons_Elementor\Pro\Skins\Skin_Six;
|
||||
use \Essential_Addons_Elementor\Pro\Skins\Skin_Three;
|
||||
use \Essential_Addons_Elementor\Pro\Skins\Skin_Two;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Advanced_Menu extends Widget_Base
|
||||
{
|
||||
|
||||
protected $_has_template_content = false;
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-advanced-menu';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('Advanced Menu', 'essential-addons-elementor');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-advanced-menu';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'advanced menu',
|
||||
'ea advanced menu',
|
||||
'nav menu',
|
||||
'ea nav menu',
|
||||
'navigation',
|
||||
'ea navigation',
|
||||
'navigation menu',
|
||||
'ea navigation menu',
|
||||
'header menu',
|
||||
'megamenu',
|
||||
'mega menu',
|
||||
'ea megamenu',
|
||||
'ea mega menu',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/ea-advanced-menu/';
|
||||
}
|
||||
|
||||
protected function register_skins()
|
||||
{
|
||||
$this->add_skin(new Skin_Default($this));
|
||||
$this->add_skin(new Skin_One($this));
|
||||
$this->add_skin(new Skin_Two($this));
|
||||
$this->add_skin(new Skin_Three($this));
|
||||
$this->add_skin(new Skin_Four($this));
|
||||
$this->add_skin(new Skin_Five($this));
|
||||
$this->add_skin(new Skin_Six($this));
|
||||
$this->add_skin(new Skin_Seven($this));
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
/**
|
||||
* Content: General
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_advanced_menu_section_general',
|
||||
[
|
||||
'label' => esc_html__('General', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_menu',
|
||||
[
|
||||
'label' => esc_html__('Select Menu', 'essential-addons-elementor'),
|
||||
'description' => sprintf(__('Go to the <a href="%s" target="_blank">Menu screen</a> to manage your menus.', 'essential-addons-elementor'), admin_url('nav-menus.php')),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'label_block' => false,
|
||||
'options' => Helper::get_menus(),
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_advanced_menu_section_hamburger',
|
||||
[
|
||||
'label' => esc_html__('Hamburger Options', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_hamburger_disable_selected_menu',
|
||||
[
|
||||
'label' => esc_html__('Disable Selected Menu', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => __( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'hide',
|
||||
'default' => 'no',
|
||||
'prefix_class' => 'eael_advanced_menu_hamburger_disable_selected_menu_',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_hamburger_alignment',
|
||||
[
|
||||
'label' => __('Hamburger Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'right',
|
||||
'prefix_class' => 'eael-advanced-menu-hamburger-align-',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_full_width',
|
||||
[
|
||||
'label' => __( 'Full Width', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'description' => __( 'Stretch the dropdown of the menu to full width.', 'essential-addons-elementor' ),
|
||||
'label_on' => __( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => __( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'stretch',
|
||||
'default' => 'no',
|
||||
'prefix_class' => 'eael-advanced-menu--',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_hamburger_icon',
|
||||
[
|
||||
'label' => esc_html__('Icon', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-bars',
|
||||
'library' => 'fa-solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_heading_mobile_dropdown',
|
||||
[
|
||||
'label' => esc_html__( 'Mobile Dropdown', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$default_value = 'tablet';
|
||||
$dropdown_options = Helper::get_breakpoint_dropdown_options();
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_dropdown',
|
||||
[
|
||||
'label' => esc_html__( 'Breakpoint', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => esc_html( $default_value ),
|
||||
'options' => $dropdown_options,
|
||||
'prefix_class' => 'eael-hamburger--',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style: Main Menu
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_advanced_menu_section_style_menu',
|
||||
[
|
||||
'label' => __('Main Menu', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style: Mobile Menu
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_advanced_menu_section_style_mobile_menu',
|
||||
[
|
||||
'label' => __('Hamburger Menu', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_hamburger_bg',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#000000',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-advanced-menu-container .eael-advanced-menu-toggle' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_hamburger_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 30,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-advanced-menu-container .eael-advanced-menu-toggle i' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-advanced-menu-container .eael-advanced-menu-toggle svg' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_hamburger_icon_color',
|
||||
[
|
||||
'label' => __('Icon Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-advanced-menu-container .eael-advanced-menu-toggle i' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-advanced-menu-container .eael-advanced-menu-toggle svg' => 'fill: {{VALUE}}',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_hamburger_item_heading',
|
||||
[
|
||||
'label' => __('Items', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_advanced_menu_hamburger_menu_item_alignment',
|
||||
[
|
||||
'label' => __('Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'eael-hamburger-left' => [
|
||||
'title' => __('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'eael-hamburger-center' => [
|
||||
'title' => __('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'eael-hamburger-right' => [
|
||||
'title' => __('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// $this->add_control(
|
||||
// 'eael_advanced_menu_hamburger_icon',
|
||||
// [
|
||||
// 'label' => __('Icon Color', 'essential-addons-elementor'),
|
||||
// 'type' => Controls_Manager::COLOR,
|
||||
// 'default' => '#ffffff',
|
||||
// 'selectors' => [
|
||||
// '{{WRAPPER}} .eael-advanced-menu-container .eael-advanced-menu-toggle .eicon-menu-bar' => 'color: {{VALUE}}',
|
||||
// ],
|
||||
|
||||
// ]
|
||||
// );
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style: Dropdown Menu
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_advanced_menu_section_style_dropdown',
|
||||
[
|
||||
'label' => __('Dropdown Menu', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style: Top Level Items
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_advanced_menu_section_style_top_level_item',
|
||||
[
|
||||
'label' => __('Top Level Item', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style: Main Menu (Hover)
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_advanced_menu_section_style_dropdown_item',
|
||||
[
|
||||
'label' => __('Dropdown Item', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,946 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Core\Files\Assets\Svg\Svg_Handler;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use Elementor\Icons_Manager;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Core\Schemes\Typography;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Group_Control_Image_Size;
|
||||
use \Elementor\Widget_Base;
|
||||
use Essential_Addons_Elementor\Classes\Helper as HelperClass;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
|
||||
|
||||
class Flip_Carousel extends Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'eael-flip-carousel';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Flip Carousel', 'essential-addons-elementor' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-flip-carousel';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'media slider',
|
||||
'ea slider',
|
||||
'ea flip slider',
|
||||
'ea flip carousel',
|
||||
'flip carousel',
|
||||
'flip effect',
|
||||
'flip slider',
|
||||
'image slider',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/flip-carousel/';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
/**
|
||||
* Flip Carousel Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_flip_carousel_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Filp Carousel Settings', 'essential-addons-elementor' )
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_type',
|
||||
[
|
||||
'label' => esc_html__( 'Carousel Type', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'coverflow',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'coverflow' => esc_html__( 'Cover-Flow', 'essential-addons-elementor' ),
|
||||
'carousel' => esc_html__( 'Carousel', 'essential-addons-elementor' ),
|
||||
'flat' => esc_html__( 'Flat', 'essential-addons-elementor' ),
|
||||
'wheel' => esc_html__( 'Wheel', 'essential-addons-elementor' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_fade_in',
|
||||
[
|
||||
'label' => esc_html__( 'Fade In (ms)', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => false,
|
||||
'default' => 400,
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_start_from',
|
||||
[
|
||||
'label' => __( 'Item Starts From Center?', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'true',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
/**
|
||||
* Condition: 'eael_flip_carousel_start_from' => 'true'
|
||||
*/
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_starting_number',
|
||||
[
|
||||
'label' => esc_html__( 'Enter Starts Number', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'label_block' => false,
|
||||
'default' => 1,
|
||||
'condition' => [
|
||||
'eael_flip_carousel_start_from!' => 'true'
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_loop',
|
||||
[
|
||||
'label' => __( 'Loop', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'false',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_autoplay',
|
||||
[
|
||||
'label' => __( 'Autoplay', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'false',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
/**
|
||||
* Condition: 'eael_flip_carousel_autoplay' => 'true'
|
||||
*/
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_autoplay_time',
|
||||
[
|
||||
'label' => esc_html__( 'Autoplay Timeout (ms)', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => false,
|
||||
'default' => 2000,
|
||||
'condition' => [
|
||||
'eael_flip_carousel_autoplay' => 'true'
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_pause_on_hover',
|
||||
[
|
||||
'label' => __( 'Pause On Hover', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'true',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_click',
|
||||
[
|
||||
'label' => __( 'On Click Play?', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'true',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_scrollwheel',
|
||||
[
|
||||
'label' => __( 'On Scroll Wheel Play?', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'true',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_touch',
|
||||
[
|
||||
'label' => __( 'On Touch Play?', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'true',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_button',
|
||||
[
|
||||
'label' => __( 'Carousel Navigator', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'true',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Slide Spacing', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => -0.6
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => -1,
|
||||
'max' => 1,
|
||||
'step' => 0.1
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Filp Carousel Slides
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_flip_carousel_slides_label',
|
||||
[
|
||||
'label' => esc_html__( 'Flip Carousel Slides', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_content_view',
|
||||
[
|
||||
'label' => esc_html__( 'Content Appearance', 'essential-addons-elementor' ),
|
||||
'type' => \Elementor\Controls_Manager::SELECT,
|
||||
'default' => 'none',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'No Content', 'essential-addons-elementor' ),
|
||||
'hover' => esc_html__( 'On Hover', 'essential-addons-elementor' ),
|
||||
'always' => esc_html__( 'Always Show', 'essential-addons-elementor' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_content_overlay',
|
||||
[
|
||||
'label' => __( 'Enable Overlay', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Enable', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'Disable', 'essential-addons-elementor' ),
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'eael_flip_carousel_content_view!' => 'none'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_content_active_only',
|
||||
[
|
||||
'label' => __( 'Content on active only', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Enable', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'Disable', 'essential-addons-elementor' ),
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'eael_flip_carousel_content_view' => 'always'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_flip_carousel_slide',
|
||||
[
|
||||
'label' => esc_html__( 'Slide', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => EAEL_PRO_PLUGIN_URL . 'assets/front-end/img/slide.png',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_flip_carousel_slide_text',
|
||||
[
|
||||
'label' => esc_html__( 'Slide Text', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '', 'essential-addons-elementor' ),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_flip_carousel_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'essential-addons-elementor' ),
|
||||
'type' => \Elementor\Controls_Manager::WYSIWYG,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Optio, neque qui velit. Magni dolorum quidem ipsam eligendi, totam, facilis laudantium cum accusamus ullam voluptatibus commodi numquam, error, est. Ea, consequatur.', 'essential-addons-elementor' ),
|
||||
'placeholder' => esc_html__( 'Type your description here', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_flip_carousel_enable_slide_link',
|
||||
[
|
||||
'label' => __( 'Enable Slide Link', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'false',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_flip_carousel_slide_link',
|
||||
[
|
||||
'label' => esc_html__( 'Slide Link', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'dynamic' => ['active' => true],
|
||||
'label_block' => true,
|
||||
'default' => [
|
||||
'url' => '#',
|
||||
'is_external' => '',
|
||||
],
|
||||
'show_external' => true,
|
||||
'condition' => [
|
||||
'eael_flip_carousel_enable_slide_link' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_slides',
|
||||
[
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'seperator' => 'before',
|
||||
'default' => [
|
||||
[ 'eael_flip_carousel_slide' => EAEL_PRO_PLUGIN_URL . 'assets/front-end/img/slide.png' ],
|
||||
[ 'eael_flip_carousel_slide' => EAEL_PRO_PLUGIN_URL . 'assets/front-end/img/slide.png' ],
|
||||
[ 'eael_flip_carousel_slide' => EAEL_PRO_PLUGIN_URL . 'assets/front-end/img/slide.png' ],
|
||||
[ 'eael_flip_carousel_slide' => EAEL_PRO_PLUGIN_URL . 'assets/front-end/img/slide.png' ],
|
||||
[ 'eael_flip_carousel_slide' => EAEL_PRO_PLUGIN_URL . 'assets/front-end/img/slide.png' ],
|
||||
[ 'eael_flip_carousel_slide' => EAEL_PRO_PLUGIN_URL . 'assets/front-end/img/slide.png' ],
|
||||
[ 'eael_flip_carousel_slide' => EAEL_PRO_PLUGIN_URL . 'assets/front-end/img/slide.png' ],
|
||||
],
|
||||
'fields' => $repeater->get_controls(),
|
||||
'title_field' => '{{eael_flip_carousel_slide_text}}',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style (Flip Carousel Style)
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_flip_carousel_style_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Flip Carousel Style', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_bg_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-flip-carousel' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_flip_carousel_container_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-flip-carousel' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_flip_carousel_container_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-flip-carousel' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_flip_carousel_border',
|
||||
'label' => esc_html__( 'Border', 'essential-addons-elementor' ),
|
||||
'selector' => '{{WRAPPER}} .eael-flip-carousel',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 4,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 500,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-flip-carousel' => 'border-radius: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_flip_carousel_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-flip-carousel',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style (Flip Carousel Navigator Style)
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_filp_carousel_custom_nav_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Navigator Style', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_custom_nav',
|
||||
[
|
||||
'label' => __( 'Navigator', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'false',
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
/**
|
||||
* Condition: 'eael_flip_carousel_custom_nav' => 'true'
|
||||
*/
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_custom_nav_prev_new',
|
||||
[
|
||||
'label' => esc_html__( 'Previous Icon', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'eael_flip_carousel_custom_nav_prev',
|
||||
'default' => [
|
||||
'value' => 'fas fa-arrow-left',
|
||||
'library' => 'fa-solid',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_flip_carousel_custom_nav' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
/**
|
||||
* Condition: 'eael_flip_carousel_custom_nav' => 'true'
|
||||
*/
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_custom_nav_next_new',
|
||||
[
|
||||
'label' => esc_html__( 'Next Icon', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'eael_flip_carousel_custom_nav_next',
|
||||
'default' => [
|
||||
'value' => 'fas fa-arrow-right',
|
||||
'library' => 'fa-solid',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_flip_carousel_custom_nav' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_flip_carousel_custom_nav_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .flip-custom-nav' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_custom_nav_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => '30'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .flip-custom-nav' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-flip-carousel-svg-icon' => 'width: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .flip-custom-nav svg' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_custom_nav_bg_size',
|
||||
[
|
||||
'label' => esc_html__( 'Background Size', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 40,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .flip-custom-nav' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_custom_nav_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 50,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 50,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .flip-custom-nav' => 'border-radius: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_custom_nav_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#42418e',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .flip-custom-nav' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .flip-custom-nav svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_custom_nav_bg_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .flip-custom-nav' => 'background: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_flip_carousel_custom_nav_border',
|
||||
'label' => esc_html__( 'Border', 'essential-addons-elementor' ),
|
||||
'selector' => '{{WRAPPER}} .flip-custom-nav',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_flip_carousel_custom_navl_shadow',
|
||||
'selector' => '{{WRAPPER}} .flip-custom-nav',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style (Flip Carousel Content Style)
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_filp_carousel_main_content_style_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'eael_flip_carousel_content_view!' => 'none'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael__filp_carousel_main_content_alignment',
|
||||
[
|
||||
'label' => esc_html__('Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-flip-carousel-content' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_filp_carousel_main_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#4d4d4d',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-flip-carousel-content' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-flip-carousel-content *' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_flip_carousel_main_content_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-flip-carousel-content',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_main_content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-elementor' ),
|
||||
'type' => \Elementor\Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em', 'rem' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-flip-carousel-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_main_content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-elementor' ),
|
||||
'type' => \Elementor\Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em', 'rem' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-flip-carousel-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_flip_carousel_main_content_heading',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Style', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_flip_carousel_main_content_overlay_background',
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'exclude' => ['image'],
|
||||
'selector' => '{{WRAPPER}} .eael-flip-carousel-content',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style (Flip Carousel footer Content Style)
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_filp_carousel_content_style_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Footer Content', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael__filp_carousel_content_alignment',
|
||||
[
|
||||
'label' => esc_html__('Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .flip-carousel-text' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_filp_carousel_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#4d4d4d',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .flip-carousel-text' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_flip_carousel_content_typography',
|
||||
'selector' => '{{WRAPPER}} .flip-carousel-text',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
$nav_prev = ((isset($settings['__fa4_migrated']['eael_flip_carousel_custom_nav_prev_new']) || empty($settings['eael_flip_carousel_custom_nav_prev'])) ? $this->get_settings('eael_flip_carousel_custom_nav_prev_new')['value'] : $this->get_settings('eael_flip_carousel_custom_nav_prev'));
|
||||
$nav_next = ((isset($settings['__fa4_migrated']['eael_flip_carousel_custom_nav_next_new']) || empty($settings['eael_flip_carousel_custom_nav_next'])) ? $this->get_settings('eael_flip_carousel_custom_nav_next_new')['value'] : $this->get_settings('eael_flip_carousel_custom_nav_next'));
|
||||
|
||||
// Loop Value
|
||||
if( 'true' == $settings['eael_flip_carousel_loop'] ) : $eael_loop = 'true'; else: $eael_loop = 'false'; endif;
|
||||
// Autoplay Value
|
||||
if( 'true' == $settings['eael_flip_carousel_autoplay'] ) : $eael_autoplay = $settings['eael_flip_carousel_autoplay_time']; else: $eael_autoplay = 'false'; endif;
|
||||
// Pause On Hover Value
|
||||
if( 'true' == $settings['eael_flip_carousel_pause_on_hover'] ) : $eael_pause_hover = 'true'; else: $eael_pause_hover = 'false'; endif;
|
||||
// Click Value
|
||||
if( 'true' == $settings['eael_flip_carousel_click'] ) : $eael_click = 'true'; else: $eael_click = 'false'; endif;
|
||||
// Scroll Wheel Value
|
||||
if( 'true' == $settings['eael_flip_carousel_scrollwheel'] ) : $eael_wheel = 'true'; else: $eael_wheel = 'false'; endif;
|
||||
// Touch Play Value
|
||||
if( 'true' == $settings['eael_flip_carousel_touch'] ) : $eael_touch = 'true'; else: $eael_touch = 'false'; endif;
|
||||
// Navigator Value
|
||||
if( 'true' == $settings['eael_flip_carousel_button'] ) : $eael_buttons = 'true'; else: $eael_buttons = 'false'; endif;
|
||||
if( 'true' == $settings['eael_flip_carousel_custom_nav'] ) : $eael_custom_buttons = 'custom';else: $eael_custom_buttons = ''; endif;
|
||||
// Start Value
|
||||
if( 'true' == $settings['eael_flip_carousel_start_from'] ) : $eael_start = 'center'; else: $eael_start = (int) $settings['eael_flip_carousel_starting_number']; endif;
|
||||
|
||||
$this->add_render_attribute(
|
||||
'eael-flip-carousel-wrap',
|
||||
[
|
||||
'class' => [
|
||||
'eael-flip-carousel',
|
||||
'flip-carousel-'.esc_attr( $this->get_id())
|
||||
],
|
||||
'data-style' => esc_attr( $settings['eael_flip_carousel_type'] ),
|
||||
'data-start' => $eael_start,
|
||||
'data-fadein' => esc_attr( (int) $settings['eael_flip_carousel_fade_in'] ),
|
||||
'data-loop' => $eael_loop,
|
||||
'data-autoplay' => $eael_autoplay,
|
||||
'data-pauseonhover' => $eael_pause_hover,
|
||||
'data-spacing' => esc_attr( $settings['eael_flip_carousel_spacing']['size'] ),
|
||||
'data-click' => $eael_click,
|
||||
'data-scrollwheel' => $eael_wheel,
|
||||
'data-touch' => $eael_touch,
|
||||
'data-buttons' => $eael_custom_buttons
|
||||
]
|
||||
);
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $settings['eael_flip_carousel_custom_nav_prev_new'], [ 'aria-hidden' => 'true' ] );
|
||||
$nav_prev_icon = ob_get_clean();
|
||||
$this->add_render_attribute( 'eael-flip-carousel-wrap', 'data-buttonprev', $nav_prev_icon );
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $settings['eael_flip_carousel_custom_nav_next_new'], [ 'aria-hidden' => 'true' ] );
|
||||
$nav_next_icon = ob_get_clean();
|
||||
$this->add_render_attribute( 'eael-flip-carousel-wrap', 'data-buttonnext', $nav_next_icon );
|
||||
|
||||
if ( $settings['eael_flip_carousel_content_active_only'] === 'yes' ){
|
||||
$this->add_render_attribute( 'eael-flip-carousel-wrap', 'class', 'show-active-only' );
|
||||
}
|
||||
else{
|
||||
$this->add_render_attribute( 'eael-flip-carousel-wrap', 'class', 'show-all' );
|
||||
}
|
||||
|
||||
if ( $settings['eael_flip_carousel_content_view'] !== 'none' ){
|
||||
$this->add_render_attribute( 'eael-flip-carousel-wrap', 'class', esc_attr( $settings['eael_flip_carousel_content_view'] ) );
|
||||
}
|
||||
|
||||
?>
|
||||
<div <?php $this->print_render_attribute_string('eael-flip-carousel-wrap'); ?>>
|
||||
<ul class="flip-items eael-flip-container">
|
||||
<?php
|
||||
foreach( $settings['eael_flip_carousel_slides'] as $slides ) :
|
||||
$image_alt_text = get_post_meta( $slides['eael_flip_carousel_slide']['id'], '_wp_attachment_image_alt', true );
|
||||
$content_type = $settings['eael_flip_carousel_content_view'];
|
||||
$overlay = $settings['eael_flip_carousel_content_overlay'];
|
||||
?>
|
||||
<li class="eael-flip-item">
|
||||
<?php if( 'true' == $slides['eael_flip_carousel_enable_slide_link'] ) :
|
||||
$eael_slide_link = $slides['eael_flip_carousel_slide_link']['url'];
|
||||
?>
|
||||
<a href="<?php echo esc_url( $eael_slide_link ); ?>" <?php echo ( $slides['eael_flip_carousel_slide_link']['is_external'] ? 'target="_blank"' : '' ) . ' ' . ( $slides['eael_flip_carousel_slide_link']['nofollow'] ? 'rel="nofollow"' : '' ); ?>>
|
||||
<img src="<?php echo esc_url( $slides['eael_flip_carousel_slide']['url'] ) ?>" alt="<?php echo esc_attr($image_alt_text); ?>">
|
||||
</a>
|
||||
<?php if( $slides['eael_flip_carousel_slide_text'] !='' ) : ?>
|
||||
<p class="flip-carousel-text"><?php echo wp_kses( $slides['eael_flip_carousel_slide_text'], HelperClass::eael_allowed_tags() ); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php else:
|
||||
$content_html = '<img src="' . esc_url( $slides['eael_flip_carousel_slide']['url'] ) . '" alt="'. esc_attr( $image_alt_text ) .'">';
|
||||
|
||||
if ( $content_type != 'none' ){
|
||||
$content_html .= $overlay === 'yes' ? "<div class='eael-flip-carousel-content-overlay'></div>" : '';
|
||||
$content_html .= "<div class='eael-flip-carousel-content '>". $slides['eael_flip_carousel_content'] ."</div>";
|
||||
}
|
||||
|
||||
if( $slides['eael_flip_carousel_slide_text'] !='' ){
|
||||
$content_html .= '<p class="flip-carousel-text">'. $slides['eael_flip_carousel_slide_text'] .'</p>';
|
||||
}
|
||||
echo $content_html ? wp_kses( $content_html, HelperClass::eael_allowed_tags() ) : '';
|
||||
endif; ?>
|
||||
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,795 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use Elementor\Group_Control_Image_Size;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
if ( !defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
// If this file is called directly, abort.
|
||||
|
||||
class Image_Comparison extends Widget_Base {
|
||||
public function get_name() {
|
||||
return 'eael-image-comparison';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Image Comparison', 'essential-addons-elementor' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-image-comparison';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [
|
||||
'image',
|
||||
'compare',
|
||||
'ea image compare',
|
||||
'ea image comparison',
|
||||
'table',
|
||||
'before after image',
|
||||
'before and after image',
|
||||
'before after slider',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url() {
|
||||
return 'https://essential-addons.com/elementor/docs/image-comparison/';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
// Content Controls
|
||||
$this->start_controls_section(
|
||||
'eael_image_comparison_images',
|
||||
[
|
||||
'label' => esc_html__( 'Images', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'before_image_label',
|
||||
[
|
||||
'label' => __( 'Label Before', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => 'Before',
|
||||
'title' => __( 'Input before image label', 'essential-addons-elementor' ),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'before_image',
|
||||
[
|
||||
'label' => __( 'Choose Before Image', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'before_image_alt',
|
||||
[
|
||||
'label' => __( 'Before Image ALT Tag', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'label_block' => true,
|
||||
'default' => '',
|
||||
'placeholder' => __( 'Enter alter tag for the image', 'essential-addons-elementor' ),
|
||||
'title' => __( 'Input image alter tag here', 'essential-addons-elementor' ),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'after_image_label',
|
||||
[
|
||||
'label' => __( 'Label After', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => 'After',
|
||||
'title' => __( 'Input after image label', 'essential-addons-elementor' ),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'after_image',
|
||||
[
|
||||
'label' => __( 'Choose After Image', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'after_image_alt',
|
||||
[
|
||||
'label' => __( 'After Image ALT Tag', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'label_block' => true,
|
||||
'default' => '',
|
||||
'placeholder' => __( 'Enter alter tag for the image', 'essential-addons-elementor' ),
|
||||
'title' => __( 'Input image alter tag here', 'essential-addons-elementor' ),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Image_Size::get_type(),
|
||||
[
|
||||
'name' => 'eael_before_image_size',
|
||||
'exclude' => [ 'custom' ],
|
||||
'default' => 'full',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_image_comparison_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Settings', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_comp_offset',
|
||||
[
|
||||
'label' => esc_html__( 'Original Image Visibility', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['%'],
|
||||
'range' => ['%' => ['min' => 10, 'max' => 90]],
|
||||
'default' => ['size' => 70, 'unit' => '%'],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_comp_orientation',
|
||||
[
|
||||
'label' => esc_html__( 'Orientation', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'horizontal' => __( 'Horizontal', 'essential-addons-elementor' ),
|
||||
'vertical' => __( 'Vertical', 'essential-addons-elementor' ),
|
||||
],
|
||||
'default' => 'horizontal',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_comp_overlay',
|
||||
[
|
||||
'label' => esc_html__( 'Wants Overlay ?', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'yes', 'essential-addons-elementor' ),
|
||||
'label_off' => __( 'no', 'essential-addons-elementor' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_comp_move',
|
||||
[
|
||||
'label' => esc_html__( 'Move Slider On Hover', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'yes', 'essential-addons-elementor' ),
|
||||
'label_off' => __( 'no', 'essential-addons-elementor' ),
|
||||
'default' => 'no',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_comp_click',
|
||||
[
|
||||
'label' => esc_html__( 'Move Slider On Click', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'yes', 'essential-addons-elementor' ),
|
||||
'label_off' => __( 'no', 'essential-addons-elementor' ),
|
||||
'default' => 'no',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_image_comparison_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Image Container Styles', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_container_width',
|
||||
[
|
||||
'label' => esc_html__( 'Set max width for the container?', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'yes', 'essential-addons-elementor' ),
|
||||
'label_off' => __( 'no', 'essential-addons-elementor' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_image_container_width_value',
|
||||
[
|
||||
'label' => __( 'Container Max Width', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 80,
|
||||
'unit' => '%',
|
||||
],
|
||||
'size_units' => ['%', 'px'],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
],
|
||||
'px' => [
|
||||
'min' => 1,
|
||||
'max' => 1000,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-comp-container' => 'max-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_image_container_width' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_img_comp_border',
|
||||
'selector' => '{{WRAPPER}} .eael-img-comp-container',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_img_comp_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-comp-container' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style tab: overlay background
|
||||
*/
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_overlay_style',
|
||||
[
|
||||
'label' => __( 'Overlay', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'eael_image_comp_overlay' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_img_cmp_overlay_background',
|
||||
'label' => __( 'Background', 'essential-addons-elementor' ),
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .eael-img-comp-container .twentytwenty-overlay:hover',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Handle
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_handle_style',
|
||||
[
|
||||
'label' => __( 'Handle', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs( 'tabs_handle_style' );
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_handle_normal',
|
||||
[
|
||||
'label' => __( 'Normal', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'handle_icon_color',
|
||||
[
|
||||
'label' => __( 'Icon Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-left-arrow' => 'border-right-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .twentytwenty-right-arrow' => 'border-left-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .twentytwenty-up-arrow' => 'border-bottom-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .twentytwenty-down-arrow' => 'border-top-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'handle_background',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .twentytwenty-handle',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'handle_border',
|
||||
'label' => __( 'Border', 'essential-addons-elementor' ),
|
||||
'placeholder' => '1px',
|
||||
'default' => '1px',
|
||||
'selector' => '{{WRAPPER}} .twentytwenty-handle',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'handle_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-handle' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'handle_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .twentytwenty-handle',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_handle_hover',
|
||||
[
|
||||
'label' => __( 'Hover', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'handle_icon_color_hover',
|
||||
[
|
||||
'label' => __( 'Icon Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-handle:hover .twentytwenty-left-arrow' => 'border-right-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .twentytwenty-handle:hover .twentytwenty-right-arrow' => 'border-left-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .twentytwenty-handle:hover .twentytwenty-up-arrow' => 'border-bottom-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .twentytwenty-handle:hover .twentytwenty-down-arrow' => 'border-top-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'handle_background_hover',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .twentytwenty-handle:hover',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'handle_border_color_hover',
|
||||
[
|
||||
'label' => __( 'Border Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-handle:hover' => 'border-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Divider
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_divider_style',
|
||||
[
|
||||
'label' => __( 'Divider', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'divider_color',
|
||||
[
|
||||
'label' => __( 'Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-horizontal .twentytwenty-handle:before, {{WRAPPER}} .twentytwenty-horizontal .twentytwenty-handle:after, {{WRAPPER}} .twentytwenty-vertical .twentytwenty-handle:before, {{WRAPPER}} .twentytwenty-vertical .twentytwenty-handle:after' => 'background: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'divider_width',
|
||||
[
|
||||
'label' => __( 'Width', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 3,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 20,
|
||||
],
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => 'px',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-horizontal .twentytwenty-handle:before, {{WRAPPER}} .twentytwenty-horizontal .twentytwenty-handle:after' => 'width: {{SIZE}}{{UNIT}}; margin-left: calc(-{{SIZE}}{{UNIT}}/2);',
|
||||
'{{WRAPPER}} .twentytwenty-vertical .twentytwenty-handle:before, {{WRAPPER}} .twentytwenty-vertical .twentytwenty-handle:after' => 'height: {{SIZE}}{{UNIT}}; margin-top: calc(-{{SIZE}}{{UNIT}}/2);',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Label
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_label_style',
|
||||
[
|
||||
'label' => __( 'Label', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_horizontal_position',
|
||||
[
|
||||
'label' => __( 'Position', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => false,
|
||||
'default' => 'top',
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => __( 'Top', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'middle' => [
|
||||
'title' => __( 'Middle', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-v-align-middle',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => __( 'Bottom', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'prefix_class' => 'eael-ic-label-horizontal-',
|
||||
'condition' => [
|
||||
'orientation' => 'horizontal',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_vertical_position',
|
||||
[
|
||||
'label' => __( 'Position', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __( 'Left', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __( 'Center', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __( 'Right', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'prefix_class' => 'eael-ic-label-vertical-',
|
||||
'condition' => [
|
||||
'orientation' => 'vertical',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'label_align',
|
||||
[
|
||||
'label' => __( 'Align', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 200,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}.eael-ic-label-horizontal-top .twentytwenty-horizontal .twentytwenty-before-label:before,
|
||||
{{WRAPPER}}.eael-ic-label-horizontal-top .twentytwenty-horizontal .twentytwenty-after-label:before' => 'top: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .twentytwenty-horizontal .twentytwenty-before-label:before' => 'left: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .twentytwenty-horizontal .twentytwenty-after-label:before' => 'right: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}}.eael-ic-label-horizontal-bottom .twentytwenty-horizontal .twentytwenty-before-label:before,
|
||||
{{WRAPPER}}.eael-ic-label-horizontal-bottom .twentytwenty-horizontal .twentytwenty-after-label:before' => 'bottom: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .twentytwenty-vertical .twentytwenty-before-label:before' => 'top: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .twentytwenty-vertical .twentytwenty-after-label:before' => 'bottom: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}}.eael-ic-label-vertical-left .twentytwenty-vertical .twentytwenty-before-label:before,
|
||||
{{WRAPPER}}.eael-ic-label-vertical-left .twentytwenty-vertical .twentytwenty-after-label:before' => 'left: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}}.eael-ic-label-vertical-right .twentytwenty-vertical .twentytwenty-before-label:before,
|
||||
{{WRAPPER}}.eael-ic-label-vertical-right .twentytwenty-vertical .twentytwenty-after-label:before' => 'right: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs( 'tabs_label_style' );
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_label_before',
|
||||
[
|
||||
'label' => __( 'Before', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_text_color_before',
|
||||
[
|
||||
'label' => __( 'Text Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-before-label:before' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_bg_color_before',
|
||||
[
|
||||
'label' => __( 'Background Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-before-label:before' => 'background: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'label_border',
|
||||
'label' => __( 'Border', 'essential-addons-elementor' ),
|
||||
'placeholder' => '1px',
|
||||
'default' => '1px',
|
||||
'selector' => '{{WRAPPER}} .twentytwenty-before-label:before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-before-label:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_label_after',
|
||||
[
|
||||
'label' => __( 'After', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_text_color_after',
|
||||
[
|
||||
'label' => __( 'Text Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-after-label:before' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_bg_color_after',
|
||||
[
|
||||
'label' => __( 'Background Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-after-label:before' => 'background: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'label_border_after',
|
||||
'label' => __( 'Border', 'essential-addons-elementor' ),
|
||||
'placeholder' => '1px',
|
||||
'default' => '1px',
|
||||
'selector' => '{{WRAPPER}} .twentytwenty-after-label:before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_border_radius_after',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-after-label:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'label_typography',
|
||||
'label' => __( 'Typography', 'essential-addons-elementor' ),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_ACCENT
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .twentytwenty-before-label:before, {{WRAPPER}} .twentytwenty-after-label:before',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'label_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .twentytwenty-before-label:before, {{WRAPPER}} .twentytwenty-after-label:before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
/**
|
||||
* Getting the options from user.
|
||||
*/
|
||||
$settings = $this->get_settings_for_display();
|
||||
$before_image = $settings['before_image'];
|
||||
$after_image = $settings['after_image'];
|
||||
$eael_compar_image_size = $settings['eael_before_image_size_size'];
|
||||
$eael_compar_before_image_url = wp_get_attachment_image_src( $before_image['id'], $eael_compar_image_size );
|
||||
$eael_compar_after_image_url = wp_get_attachment_image_src( $after_image['id'], $eael_compar_image_size );
|
||||
|
||||
$this->add_render_attribute(
|
||||
'wrapper',
|
||||
[
|
||||
'id' => 'eael-image-comparison-' . esc_attr( $this->get_id() ),
|
||||
'class' => ['eael-img-comp-container','twentytwenty-container'],
|
||||
'data-offset' => ( $settings['eael_image_comp_offset']['size'] / 100 ),
|
||||
'data-orientation' => $settings['eael_image_comp_orientation'],
|
||||
'data-before_label' => $settings['before_image_label'],
|
||||
'data-after_label' => $settings['after_image_label'],
|
||||
'data-overlay' => $settings['eael_image_comp_overlay'],
|
||||
'data-onhover' => $settings['eael_image_comp_move'],
|
||||
'data-onclick' => $settings['eael_image_comp_click'],
|
||||
]
|
||||
);
|
||||
|
||||
echo '<div '; $this->print_render_attribute_string( 'wrapper' ); echo '>
|
||||
<img class="eael-before-img" alt="' . esc_attr( $settings['before_image_alt'] ) . '" src="' . ( $eael_compar_before_image_url ? esc_url( $eael_compar_before_image_url[0] ) : esc_url( $before_image['url'] ) ) . '">
|
||||
<img class="eael-after-img" alt="' . esc_attr( $settings['after_image_alt'] ) . '" src="' . ( $eael_compar_after_image_url ? esc_url( $eael_compar_after_image_url[0] ) : esc_url( $after_image['url'] ) ) . '">
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Core\Schemes\Typography;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Image_Scroller extends Widget_Base
|
||||
{
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-image-scroller';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('Image Scroller', 'essential-addons-elementor');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-image-scroller';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'ea image scroller',
|
||||
'ea image scrolling effect',
|
||||
'ea scroller',
|
||||
'scrolling image',
|
||||
'vertical scrolling',
|
||||
'horizontal scrolling',
|
||||
'scrolling effect',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/ea-image-scroller/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
/**
|
||||
* General Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_image_scroller_section_general',
|
||||
[
|
||||
'label' => esc_html__('General', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_scroller_bg_img',
|
||||
[
|
||||
'label' => __('Background Image', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_scroller_container_height',
|
||||
[
|
||||
'label' => __('Container Height', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'description' => 'Container height/width should be less than the image height/width. Otherwise scroll will not work.',
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 1000,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 300,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-image-scroller' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_scroller_direction',
|
||||
[
|
||||
'label' => __('Scroll Direction', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'vertical',
|
||||
'options' => [
|
||||
'horizontal' => __('Horizontal', 'essential-addons-elementor'),
|
||||
'vertical' => __('Vertical', 'essential-addons-elementor'),
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_scroller_auto_scroll',
|
||||
[
|
||||
'label' => esc_html__('Auto Scroll', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_scroller_duration',
|
||||
[
|
||||
'label' => __('Scroll Duration', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 10000,
|
||||
'step' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 1000,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-image-scroller.eael-image-scroller-hover img' => 'transition-duration: {{SIZE}}ms;',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_image_scroller_auto_scroll' => 'yes',
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_image_scroller_section_style',
|
||||
[
|
||||
'label' => __('General Style', 'essential-addons-elementor'),
|
||||
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_scroller_radius',
|
||||
[
|
||||
'label' => __('Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}, {{WRAPPER}} .eael-image-scroller' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_image_scroller_shadow',
|
||||
'label' => __('Shadow', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-image-scroller',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
$wrap_classes = ['eael-image-scroller', 'eael-image-scroller-' . $settings['eael_image_scroller_direction']];
|
||||
|
||||
if ($settings['eael_image_scroller_auto_scroll'] === 'yes') {
|
||||
$wrap_classes[] = 'eael-image-scroller-hover';
|
||||
}
|
||||
|
||||
echo '<div class="' . esc_attr( implode(' ', $wrap_classes ) ) . '">
|
||||
<img src="' . esc_url( $settings['eael_image_scroller_bg_img']['url'] ) . '" alt="' . esc_attr(get_post_meta($settings['eael_image_scroller_bg_img']['id'], '_wp_attachment_image_alt', true)) . '">
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,833 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use Elementor\Plugin;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
use Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
} // If this file is called directly, abort.
|
||||
|
||||
class Instagram_Feed extends Widget_Base {
|
||||
use \Essential_Addons_Elementor\Pro\Traits\Instagram_Feed;
|
||||
|
||||
public function get_name () {
|
||||
return 'eael-instafeed';
|
||||
}
|
||||
|
||||
public function get_title () {
|
||||
return esc_html__('Instagram Feed', 'essential-addons-elementor');
|
||||
}
|
||||
|
||||
public function get_icon () {
|
||||
return 'eaicon-instagram-feed';
|
||||
}
|
||||
|
||||
public function get_categories () {
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords () {
|
||||
return [
|
||||
'instagram',
|
||||
'instagram feed',
|
||||
'ea instagram feed',
|
||||
'instagram gallery',
|
||||
'ea instagram gallery',
|
||||
'social media',
|
||||
'social feed',
|
||||
'ea social feed',
|
||||
'instagram embed',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url () {
|
||||
return 'https://essential-addons.com/elementor/docs/instagram-feed/';
|
||||
}
|
||||
|
||||
public function get_style_depends () {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_script_depends () {
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
protected function register_controls () {
|
||||
$this->start_controls_section(
|
||||
'eael_section_instafeed_settings_account',
|
||||
[
|
||||
'label' => esc_html__('Instagram Account Settings', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_access_token',
|
||||
[
|
||||
'label' => esc_html__('Access Token', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
'label_block' => true,
|
||||
'description' => '<a href="https://essential-addons.com/elementor/docs/instagram-feed/" class="eael-btn" target="_blank">Get Access Token</a>',
|
||||
'essential-addons-elementor',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_data_cache_limit',
|
||||
[
|
||||
'label' => __('Data Cache Time', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'default' => 60,
|
||||
'description' => __('Cache expiration time (Minutes)', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_instafeed_settings_content',
|
||||
[
|
||||
'label' => esc_html__('Feed Settings', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_sort_by',
|
||||
[
|
||||
'label' => esc_html__('Sort By', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'none',
|
||||
'options' => [
|
||||
'none' => esc_html__('None', 'essential-addons-elementor'),
|
||||
'most-recent' => esc_html__('Most Recent', 'essential-addons-elementor'),
|
||||
'least-recent' => esc_html__('Least Recent', 'essential-addons-elementor'),
|
||||
// 'most-liked' => esc_html__('Most Likes', 'essential-addons-elementor'),
|
||||
// 'least-liked' => esc_html__('Least Likes', 'essential-addons-elementor'),
|
||||
// 'most-commented' => esc_html__('Most Commented', 'essential-addons-elementor'),
|
||||
// 'least-commented' => esc_html__('Least Commented', 'essential-addons-elementor'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_image_count',
|
||||
[
|
||||
'label' => esc_html__('Max Visible Images', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 12,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_caption_length',
|
||||
[
|
||||
'label' => esc_html__('Max Caption Length', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'max' => 2000,
|
||||
'default' => 60,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_force_square',
|
||||
[
|
||||
'label' => esc_html__('Force Square Image?', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_force_square_type',
|
||||
[
|
||||
'label' => esc_html__( 'Image Render Type', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'fill',
|
||||
'options' => [
|
||||
'fill' => esc_html__( 'Stretched', 'essential-addons-elementor' ),
|
||||
'cover' => esc_html__( 'Cropped', 'essential-addons-elementor' ),
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-instafeed-square-img .eael-instafeed-item img' => 'object-fit: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_instafeed_force_square' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_instafeed_sq_image_size',
|
||||
[
|
||||
'label' => esc_html__('Image Dimension (px)', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 280,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 1,
|
||||
'max' => 1000,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-instafeed-square-img .eael-instafeed-item img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_instafeed_force_square' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_hashtags',
|
||||
[
|
||||
'label' => esc_html__( 'Filter By HashTags', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => '#tag1, #tag2, #tag3',
|
||||
'ai' => [ 'active' => false ],
|
||||
'label_block' => true,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_instafeed_settings_general',
|
||||
[
|
||||
'label' => esc_html__('General Settings', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_layout',
|
||||
[
|
||||
'label' => esc_html__('Layout', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'overlay',
|
||||
'options' => [
|
||||
'card' => esc_html__('Card', 'essential-addons-elementor'),
|
||||
'overlay' => esc_html__('Overlay', 'essential-addons-elementor'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_card_style',
|
||||
[
|
||||
'label' => esc_html__('Card Style', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'outer',
|
||||
'options' => [
|
||||
'inner' => esc_html__('Content Inner', 'essential-addons-elementor'),
|
||||
'outer' => esc_html__('Content Outer', 'essential-addons-elementor'),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_instafeed_layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_overlay_style',
|
||||
[
|
||||
'label' => esc_html__('Overlay Style', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'simple',
|
||||
'options' => [
|
||||
'simple' => esc_html__('Simple', 'essential-addons-elementor'),
|
||||
'basic' => esc_html__('Basic', 'essential-addons-elementor'),
|
||||
'standard' => esc_html__('Standard', 'essential-addons-elementor'),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_instafeed_layout' => 'overlay',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_instafeed_columns',
|
||||
[
|
||||
'label' => esc_html__('Number of Columns', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'eael-col-4',
|
||||
'options' => [
|
||||
'eael-col-1' => esc_html__('1 Column', 'essential-addons-elementor'),
|
||||
'eael-col-2' => esc_html__('2 Columns', 'essential-addons-elementor'),
|
||||
'eael-col-3' => esc_html__('3 Columns', 'essential-addons-elementor'),
|
||||
'eael-col-4' => esc_html__('4 Columns', 'essential-addons-elementor'),
|
||||
'eael-col-5' => esc_html__('5 Columns', 'essential-addons-elementor'),
|
||||
'eael-col-6' => esc_html__('6 Columns', 'essential-addons-elementor'),
|
||||
],
|
||||
'prefix_class' => 'instafeed-gallery%s-',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_user_info',
|
||||
[
|
||||
'label' => esc_html__('User Info', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition' => [
|
||||
'eael_instafeed_layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_show_profile_image',
|
||||
[
|
||||
'label' => esc_html__('Show Profile Image', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'eael_instafeed_layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_instafeed_profile_image',
|
||||
[
|
||||
'label' => esc_html__('Profile Image', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_instafeed_show_profile_image' => 'yes',
|
||||
'eael_instafeed_layout' => 'card',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_show_username',
|
||||
[
|
||||
'label' => esc_html__('Show Username', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'eael_instafeed_layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_instafeed_username',
|
||||
[
|
||||
'label' => esc_html__('Username', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => __('Essential Addons', 'essential-addons-elementor'),
|
||||
'condition' => [
|
||||
'eael_instafeed_show_username' => 'yes',
|
||||
'eael_instafeed_layout' => 'card',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_pagination_heading',
|
||||
[
|
||||
'label' => __('Pagination', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_pagination',
|
||||
[
|
||||
'label' => esc_html__('Enable Load More?', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'loadmore_text',
|
||||
[
|
||||
'label' => __('Label', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => __('Load More', 'essential-addons-elementor'),
|
||||
'condition' => [
|
||||
'eael_instafeed_pagination' => 'yes'
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_caption_heading',
|
||||
[
|
||||
'label' => __('Link & Content', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_caption',
|
||||
[
|
||||
'label' => esc_html__('Display Caption', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_date',
|
||||
[
|
||||
'label' => esc_html__('Display Date', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_link',
|
||||
[
|
||||
'label' => esc_html__('Enable Link', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_link_target',
|
||||
[
|
||||
'label' => esc_html__('Open in new window?', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'eael_instafeed_link' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_instafeed_styles_general',
|
||||
[
|
||||
'label' => esc_html__('Instagram Feed Styles', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_instafeed_spacing',
|
||||
[
|
||||
'label' => esc_html__('Padding Between Images', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-instafeed-item-inner' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_instafeed_box_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-instafeed-item-inner',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_box_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-instafeed-item-inner' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px; overflow: hidden;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_instafeed_styles_content',
|
||||
[
|
||||
'label' => esc_html__('Color & Typography', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_overlay_color',
|
||||
[
|
||||
'label' => esc_html__('Overlay Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(137,12,255,0.75)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-instafeed-caption' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_like_comments_heading',
|
||||
[
|
||||
'label' => __('Icon Styles', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_icon_color',
|
||||
[
|
||||
'label' => esc_html__('Icon Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-instafeed-caption i' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_caption_style_heading',
|
||||
[
|
||||
'label' => __('Caption Styles', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_caption_color',
|
||||
[
|
||||
'label' => esc_html__('Caption Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-instafeed-caption,
|
||||
{{WRAPPER}} .eael-instafeed-caption-text' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_instafeed_caption_typography',
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_SECONDARY,
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-instafeed-caption, {{WRAPPER}} .eael-instafeed-caption-text',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_load_more_btn',
|
||||
[
|
||||
'label' => __('Load More Button Style', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_instafeed_load_more_btn_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-load-more-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_instafeed_load_more_btn_margin',
|
||||
[
|
||||
'label' => esc_html__('Margin', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-load-more-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_instafeed_load_more_btn_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-load-more-button',
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs('eael_instafeed_load_more_btn_tabs');
|
||||
|
||||
// Normal State Tab
|
||||
$this->start_controls_tab('eael_instafeed_load_more_btn_normal',
|
||||
['label' => esc_html__('Normal', 'essential-addons-elementor')]);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_load_more_btn_normal_text_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-load-more-button' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_cta_btn_normal_bg_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#29d8d8',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-load-more-button' => 'background: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_instafeed_load_more_btn_normal_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-load-more-button',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_load_more_btn_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-load-more-button' => 'border-radius: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_instafeed_load_more_btn_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-load-more-button',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
// Hover State Tab
|
||||
$this->start_controls_tab('eael_instafeed_load_more_btn_hover',
|
||||
['label' => esc_html__('Hover', 'essential-addons-elementor')]);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_load_more_btn_hover_text_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-load-more-button:hover' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_load_more_btn_hover_bg_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#27bdbd',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-load-more-button:hover' => 'background: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_instafeed_load_more_btn_hover_border_color',
|
||||
[
|
||||
'label' => esc_html__('Border Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-load-more-button:hover' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_instafeed_load_more_btn_hover_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-load-more-button:hover',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render () {
|
||||
$settings = $this->get_settings_for_display();
|
||||
$layout = isset($settings['eael_instafeed_layout']) ? $settings['eael_instafeed_layout'] : '';
|
||||
$post_id = 0;
|
||||
if (Plugin::$instance->documents->get_current()) {
|
||||
$post_id = Plugin::$instance->documents->get_current()->get_main_id();
|
||||
}
|
||||
$this->add_render_attribute('insta-wrap', [
|
||||
'class' => [
|
||||
"eael-instafeed",
|
||||
'eael-instafeed-'.$layout,
|
||||
'eael-instafeed-'.$layout.'-'.$settings["eael_instafeed_{$layout}_style"]
|
||||
],
|
||||
'id' => "eael-instafeed-".$this->get_id(),
|
||||
]);
|
||||
|
||||
if ($settings['eael_instafeed_force_square']=='yes'){
|
||||
$this->add_render_attribute('insta-wrap', 'class',"eael-instafeed-square-img");
|
||||
}
|
||||
|
||||
$this->add_render_attribute('load-more', [
|
||||
'class' => "eael-load-more-button",
|
||||
'id' => "eael-load-more-btn-" . $this->get_id(),
|
||||
'data-widget-id' => $this->get_id(),
|
||||
'data-post-id' => $post_id,
|
||||
'data-page' => 1,
|
||||
]);
|
||||
|
||||
if ( \Elementor\Plugin::instance()->editor->is_edit_mode() ) {
|
||||
$this->add_render_attribute( 'load-more', [
|
||||
'data-settings' => http_build_query( [
|
||||
'eael_instafeed_access_token' => $settings['eael_instafeed_access_token'],
|
||||
'eael_instafeed_data_cache_limit' => $settings['eael_instafeed_data_cache_limit'],
|
||||
'eael_instafeed_image_count' => $settings['eael_instafeed_image_count'],
|
||||
'eael_instafeed_caption_length' => ! empty( $settings['eael_instafeed_caption_length'] ) ? $settings['eael_instafeed_caption_length'] : 60,
|
||||
'eael_instafeed_sort_by' => $settings['eael_instafeed_sort_by'],
|
||||
'eael_instafeed_link' => $settings['eael_instafeed_link'],
|
||||
'eael_instafeed_link_target' => $settings['eael_instafeed_link_target'],
|
||||
'eael_instafeed_layout' => $settings['eael_instafeed_layout'],
|
||||
'eael_instafeed_overlay_style' => $settings['eael_instafeed_overlay_style'],
|
||||
'eael_instafeed_caption' => $settings['eael_instafeed_caption'],
|
||||
'eael_instafeed_date' => $settings['eael_instafeed_date'],
|
||||
'eael_instafeed_show_profile_image' => $settings['eael_instafeed_show_profile_image'],
|
||||
'eael_instafeed_profile_image' => $settings['eael_instafeed_profile_image'],
|
||||
'eael_instafeed_show_username' => $settings['eael_instafeed_show_username'],
|
||||
'eael_instafeed_username' => $settings['eael_instafeed_username'],
|
||||
'eael_instafeed_card_style' => $settings['eael_instafeed_card_style'],
|
||||
] )
|
||||
] );
|
||||
}
|
||||
?>
|
||||
<div <?php $this->print_render_attribute_string('insta-wrap'); ?>>
|
||||
<?php echo wp_kses( $this->instafeed_render_items(), Helper::eael_allowed_tags() ); ?>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (($settings['eael_instafeed_pagination'] == 'yes')) { ?>
|
||||
<div class="eael-load-more-button-wrap">
|
||||
<button <?php $this->print_render_attribute_string('load-more'); ?>>
|
||||
<div class="eael-btn-loader button__loader"></div>
|
||||
<span><?php echo esc_html($settings['loadmore_text']); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (Plugin::instance()->editor->is_edit_mode()) {
|
||||
echo '<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
$(".eael-instafeed").each(function() {
|
||||
var $node_id = "'. esc_attr( $this->get_id() ) .'",
|
||||
$gallery = $(this),
|
||||
$scope = $(".elementor-element-"+$node_id+""),
|
||||
$settings = {
|
||||
itemSelector: ".eael-instafeed-item",
|
||||
percentPosition: true,
|
||||
masonry: {
|
||||
columnWidth: ".eael-instafeed-item",
|
||||
}
|
||||
};
|
||||
|
||||
// init isotope
|
||||
$instagram_gallery = $(".eael-instafeed", $scope).isotope($settings);
|
||||
|
||||
// layout gal, while images are loading
|
||||
$instagram_gallery.imagesLoaded().progress(function() {
|
||||
$instagram_gallery.isotope("layout");
|
||||
});
|
||||
|
||||
$(".eael-instafeed-item", $gallery).resize(function() {
|
||||
$instagram_gallery.isotope("layout");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,357 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
// If this file is called directly, abort.
|
||||
|
||||
class Interactive_Promo extends Widget_Base
|
||||
{
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-interactive-promo';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('Interactive Promo', 'essential-addons-elementor');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-interactive-promo';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'BANNER',
|
||||
'Promotional ad',
|
||||
'promo',
|
||||
'interactive banner',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/interactive-promo/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
|
||||
// Content Controls
|
||||
$this->start_controls_section(
|
||||
'eael_section_promo_content',
|
||||
[
|
||||
'label' => esc_html__('Promo Content', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_image',
|
||||
[
|
||||
'label' => __('Promo Image', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_image_alt',
|
||||
[
|
||||
'label' => __('Image ALT Tag', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => '',
|
||||
'placeholder' => __('Enter alter tag for the image', 'essential-addons-elementor'),
|
||||
'title' => __('Input image alter tag here', 'essential-addons-elementor'),
|
||||
'dynamic' => ['action' => true],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_heading',
|
||||
[
|
||||
'label' => __('Promo Heading', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => 'I am Interactive',
|
||||
'placeholder' => __('Enter heading for the promo', 'essential-addons-elementor'),
|
||||
'title' => __('Enter heading for the promo', 'essential-addons-elementor'),
|
||||
'dynamic' => ['active' => true],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_content',
|
||||
[
|
||||
'label' => __('Promo Content', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'default' => __('Click to inspect, then edit as needed.', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_link_url',
|
||||
[
|
||||
'label' => __('Link URL', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => ['active' => true],
|
||||
'label_block' => true,
|
||||
'default' => '#',
|
||||
'placeholder' => __('Enter link URL for the promo', 'essential-addons-elementor'),
|
||||
'title' => __('Enter URL for the promo', 'essential-addons-elementor'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_link_target',
|
||||
[
|
||||
'label' => esc_html__('Open in new window?', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('_blank', 'essential-addons-elementor'),
|
||||
'label_off' => __('_self', 'essential-addons-elementor'),
|
||||
'default' => '_self',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Style Controls
|
||||
$this->start_controls_section(
|
||||
'eael_section_promo_settings',
|
||||
[
|
||||
'label' => esc_html__('Promo Effects & Settings', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_effect',
|
||||
[
|
||||
'label' => esc_html__('Set Promo Effect', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'effect-lily',
|
||||
'options' => [
|
||||
'effect-lily' => esc_html__('Lily', 'essential-addons-elementor'),
|
||||
'effect-sadie' => esc_html__('Sadie', 'essential-addons-elementor'),
|
||||
'effect-layla' => esc_html__('Layla', 'essential-addons-elementor'),
|
||||
'effect-oscar' => esc_html__('Oscar', 'essential-addons-elementor'),
|
||||
'effect-marley' => esc_html__('Marley', 'essential-addons-elementor'),
|
||||
'effect-ruby' => esc_html__('Ruby', 'essential-addons-elementor'),
|
||||
'effect-roxy' => esc_html__('Roxy', 'essential-addons-elementor'),
|
||||
'effect-bubba' => esc_html__('Bubba', 'essential-addons-elementor'),
|
||||
'effect-romeo' => esc_html__('Romeo', 'essential-addons-elementor'),
|
||||
'effect-sarah' => esc_html__('Sarah', 'essential-addons-elementor'),
|
||||
'effect-chico' => esc_html__('Chico', 'essential-addons-elementor'),
|
||||
'effect-milo' => esc_html__('Milo', 'essential-addons-elementor'),
|
||||
'effect-apollo' => esc_html__('Apolo', 'essential-addons-elementor'),
|
||||
'effect-jazz' => esc_html__('Jazz', 'essential-addons-elementor'),
|
||||
'effect-ming' => esc_html__('Ming', 'essential-addons-elementor'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_container_width',
|
||||
[
|
||||
'label' => esc_html__('Set max width for the container?', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('yes', 'essential-addons-elementor'),
|
||||
'label_off' => __('no', 'essential-addons-elementor'),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'promo_container_width_value',
|
||||
[
|
||||
'label' => __('Container Max Width (% or px)', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 480,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
'step' => 5,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-interactive-promo' => 'max-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'promo_container_width' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'promo_border',
|
||||
'selector' => '{{WRAPPER}} .eael-interactive-promo figure',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-interactive-promo figure' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_promo_styles',
|
||||
[
|
||||
'label' => esc_html__('Colors & Typography', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_heading_color',
|
||||
[
|
||||
'label' => esc_html__('Promo Heading Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-interactive-promo figure figcaption h2' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_promo_title_typography',
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-interactive-promo figure figcaption h2',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'promo_content_color',
|
||||
[
|
||||
'label' => esc_html__('Promo Content Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-interactive-promo figure p' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_promo_content_typography',
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-interactive-promo figure p',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'promo_overlay_color',
|
||||
'label' => __('Background', 'essential-addons-elementor'),
|
||||
'types' => ['classic', 'gradient'],
|
||||
'default' => '#3085a3',
|
||||
'selector' => '{{WRAPPER}} .eael-interactive-promo figure',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
$promo_image = $this->get_settings_for_display('promo_image');
|
||||
?>
|
||||
<div id="eael-promo-<?php echo esc_attr($this->get_id()); ?>" class="eael-interactive-promo">
|
||||
<figure class="<?php echo esc_attr($settings['promo_effect']); ?>">
|
||||
<?php echo '<img alt="' . $settings['promo_image_alt'] . '" src="' . $promo_image['url'] . '">'; ?>
|
||||
<figcaption>
|
||||
<div>
|
||||
<?php if (!empty($settings['promo_heading'])) : ?>
|
||||
<h2><?php echo esc_attr($settings['promo_heading']); ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<p><?php echo $settings['promo_content']; ?></p>
|
||||
</div>
|
||||
<?php if (isset($settings['promo_link_url']) && !empty($settings['promo_link_url'])) : ?>
|
||||
<a href="<?php echo esc_url( $settings['promo_link_url'] ); ?>" target="<?php echo esc_attr( $settings['promo_link_target'] ); ?>"></a>
|
||||
<?php endif; ?>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
protected function content_template()
|
||||
{
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,997 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
// If this file is called directly, abort.
|
||||
|
||||
class Mailchimp extends Widget_Base
|
||||
{
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-mailchimp';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('Mailchimp', 'essential-addons-elementor');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-mailchimp';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'mailchimp',
|
||||
'ea mailchimp',
|
||||
'email marketing',
|
||||
'lead generation',
|
||||
'contact form',
|
||||
'ea subscription form',
|
||||
'newsletter subscription',
|
||||
'subscription form',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/mailchimp/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
|
||||
/**
|
||||
* Mailchimp API Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_mailchimp_api_settings',
|
||||
[
|
||||
'label' => esc_html__('Mailchimp Account Settings', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_mailchimp_lists',
|
||||
[
|
||||
'label' => esc_html__('Mailchimp List', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'label_block' => false,
|
||||
'description' => 'Set your API Key from <strong>Elementor > Essential Addons > Mailchimp Settings</strong>',
|
||||
'options' => Helper::mailchimp_lists(),
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
/**
|
||||
* Mailchimp Fields Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_mailchimp_field_settings',
|
||||
[
|
||||
'label' => esc_html__('Field Settings', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_email_label_text',
|
||||
[
|
||||
'label' => esc_html__('Email Label', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => 'Email',
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_email_placeholder_text',
|
||||
[
|
||||
'label' => esc_html__('Email Placeholder', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => 'Email',
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_fname_show',
|
||||
[
|
||||
'label' => esc_html__('Enable First Name', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_fname_label_text',
|
||||
[
|
||||
'label' => esc_html__('First Name Label', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => 'First Name',
|
||||
'condition' => [
|
||||
'eael_mailchimp_fname_show' => 'yes',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_fname_placeholder_text',
|
||||
[
|
||||
'label' => esc_html__('First Name Placeholder', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => 'First Name',
|
||||
'condition' => [
|
||||
'eael_mailchimp_fname_show' => 'yes',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_lname_show',
|
||||
[
|
||||
'label' => esc_html__('Enable Last Name', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_lname_label_text',
|
||||
[
|
||||
'label' => esc_html__('Last Name Label', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => 'Last Name',
|
||||
'condition' => [
|
||||
'eael_mailchimp_lname_show' => 'yes',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_lname_placeholder_text',
|
||||
[
|
||||
'label' => esc_html__('Last Name Placeholder', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => 'Last Name',
|
||||
'condition' => [
|
||||
'eael_mailchimp_lname_show' => 'yes',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_tags_show',
|
||||
[
|
||||
'label' => esc_html__('Enable Tags', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_tags_label_text',
|
||||
[
|
||||
'label' => esc_html__('Tags Label', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => 'Tags',
|
||||
'condition' => [
|
||||
'eael_mailchimp_tags_show' => 'yes',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_mailchimp_tags_placeholder_text',
|
||||
[
|
||||
'label' => esc_html__('Tags Placeholder', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => 'Tags (comma separated)',
|
||||
'condition' => [
|
||||
'eael_mailchimp_tags_show' => 'yes',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Mailchimp Button Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_mailchimp_button_settings',
|
||||
[
|
||||
'label' => esc_html__('Button Settings', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_section_mailchimp_button_text',
|
||||
[
|
||||
'label' => esc_html__('Button Text', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => esc_html__('Subscribe', 'essential-addons-elementor'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_section_mailchimp_loading_text',
|
||||
[
|
||||
'label' => esc_html__('Loading Text', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => esc_html__('Submitting...', 'essential-addons-elementor'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Mailchimp Message Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_mailchimp_message_settings',
|
||||
[
|
||||
'label' => esc_html__('Message Settings', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_section_mailchimp_success_text',
|
||||
[
|
||||
'label' => esc_html__('Success Text', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => esc_html__('You have subscribed successfully!', 'essential-addons-elementor'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_section_mailchimp_pending_text',
|
||||
[
|
||||
'label' => esc_html__('Pending Text', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => esc_html__('Please check your email and confirm subscription!', 'essential-addons-elementor'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style Mailchimp Style
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_mailchimp_style_settings',
|
||||
[
|
||||
'label' => esc_html__('General Style', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_layout',
|
||||
[
|
||||
'label' => __('Layout', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'inline' => 'Inline',
|
||||
'stacked' => 'Stacked',
|
||||
],
|
||||
'default' => 'stacked',
|
||||
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_box_bg',
|
||||
'label' => __('Background', 'essential-addons-elementor'),
|
||||
'types' => ['none', 'classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-wrap',
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_margin',
|
||||
[
|
||||
'label' => esc_html__('Margin', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-wrap',
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-wrap',
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Tab Style: Form Fields Style
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_contact_form_field_styles',
|
||||
[
|
||||
'label' => esc_html__('Form Fields Styles', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_input_background',
|
||||
[
|
||||
'label' => esc_html__('Input Field Background', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-input' => 'background: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_input_width',
|
||||
[
|
||||
'label' => esc_html__('Input Width', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-field-group' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_input_height',
|
||||
[
|
||||
'label' => esc_html__('Input Height', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 30,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-input' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_input_padding',
|
||||
[
|
||||
'label' => esc_html__('Fields Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_input_margin',
|
||||
[
|
||||
'label' => esc_html__('Fields Margin', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-field-group' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_input_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'separator' => 'before',
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_input_border',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-input',
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_input_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-input',
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Tab Style: Form Field Color & Typography
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_mailchimp_typography',
|
||||
[
|
||||
'label' => esc_html__('Color & Typography', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_label_color',
|
||||
[
|
||||
'label' => esc_html__('Label Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-wrap label' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_field_color',
|
||||
[
|
||||
'label' => esc_html__('Field Font Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-input' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_field_placeholder_color',
|
||||
[
|
||||
'label' => esc_html__('Placeholder Font Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-wrap ::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-mailchimp-wrap ::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-mailchimp-wrap ::-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_label_heading',
|
||||
[
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'label' => esc_html__('Label Typography', 'essential-addons-elementor'),
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_label_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-wrap label',
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_heading_input_field',
|
||||
[
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'label' => esc_html__('Input Fields Typography', 'essential-addons-elementor'),
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_input_field_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-input',
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Subscribe Button Style
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_subscribe_btn',
|
||||
[
|
||||
'label' => __('Subscribe Button Style', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_subscribe_btn_display',
|
||||
[
|
||||
'label' => __('Button Display', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'inline' => 'Inline',
|
||||
'block' => 'Block',
|
||||
],
|
||||
'default' => 'inline',
|
||||
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_subscribe_btn_width',
|
||||
[
|
||||
'label' => esc_html__('Button Max Width', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 0,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-submit-btn' => 'max-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_subscribe_btn_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-subscribe' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_subscribe_btn_margin',
|
||||
[
|
||||
'label' => esc_html__('Margin', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-subscribe' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_subscribe_btn_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-subscribe',
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs('eael_mailchimp_subscribe_btn_tabs');
|
||||
|
||||
// Normal State Tab
|
||||
$this->start_controls_tab('eael_mailchimp_subscribe_btn_normal', ['label' => esc_html__('Normal', 'essential-addons-elementor')]);
|
||||
|
||||
$this->add_control(
|
||||
'eael_mailchimp_subscribe_btn_normal_text_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-subscribe' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_mailchimp_subscribe_btn_normal_bg_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#29d8d8',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-subscribe' => 'background: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_subscribe_btn_normal_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-subscribe',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_mailchimp_subscribe_btn_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-subscribe' => 'border-radius: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_subscribe_btn_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-subscribe',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
$this->end_controls_tab();
|
||||
|
||||
// Hover State Tab
|
||||
$this->start_controls_tab('eael_mailchimp_subscribe_btn_hover', ['label' => esc_html__('Hover', 'essential-addons-elementor')]);
|
||||
|
||||
$this->add_control(
|
||||
'eael_mailchimp_subscribe_btn_hover_text_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-subscribe:hover' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_mailchimp_subscribe_btn_hover_bg_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#27bdbd',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-subscribe:hover' => 'background: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_mailchimp_subscribe_btn_hover_border_color',
|
||||
[
|
||||
'label' => esc_html__('Border Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-subscribe:hover' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_subscribe_btn_hover_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-subscribe:hover',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Subscribe Button Style
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_success_message',
|
||||
[
|
||||
'label' => __('Message Style', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_message_background',
|
||||
[
|
||||
'label' => esc_html__('Background', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-message' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_mailchimp_message_color',
|
||||
[
|
||||
'label' => esc_html__('Font Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-message' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_message_alignment',
|
||||
[
|
||||
'label' => esc_html__('Text Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'default' => [
|
||||
'title' => __('Default', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-ban',
|
||||
],
|
||||
'left' => [
|
||||
'title' => esc_html__('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'default',
|
||||
'prefix_class' => 'eael-mailchimp-message-text-',
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_message_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-message',
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_message_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-message' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_message_margin',
|
||||
[
|
||||
'label' => esc_html__('Margin', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-message' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_mailchimp_message_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-mailchimp-message' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_message_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-message',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_mailchimp_message_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-mailchimp-message',
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
$api_key = get_option('eael_save_mailchimp_api');
|
||||
|
||||
// Layout Class
|
||||
if ('stacked' === $settings['eael_mailchimp_layout']) {
|
||||
$layout = 'eael-mailchimp-stacked';
|
||||
} elseif ('inline' === $settings['eael_mailchimp_layout']) {
|
||||
$layout = 'eael-mailchimp-inline';
|
||||
}
|
||||
// Button Display Class
|
||||
if ('block' === $settings['eael_mailchimp_subscribe_btn_display']) {
|
||||
$subscribe_btn_display = 'eael-mailchimp-btn-block';
|
||||
} elseif ('inline' === $settings['eael_mailchimp_subscribe_btn_display']) {
|
||||
$subscribe_btn_display = 'eael-mailchimp-btn-inline';
|
||||
}
|
||||
|
||||
$this->add_render_attribute('eael-mailchimp-main-wrapper', 'class', 'eael-mailchimp-wrap');
|
||||
$this->add_render_attribute('eael-mailchimp-main-wrapper', 'class', esc_attr($layout));
|
||||
$this->add_render_attribute('eael-mailchimp-main-wrapper', 'data-mailchimp-id', esc_attr($this->get_id()));
|
||||
$this->add_render_attribute('eael-mailchimp-main-wrapper', 'data-list-id', $settings['eael_mailchimp_lists']);
|
||||
$this->add_render_attribute('eael-mailchimp-main-wrapper', 'data-button-text', $settings['eael_section_mailchimp_button_text']);
|
||||
$this->add_render_attribute('eael-mailchimp-main-wrapper', 'data-success-text', $settings['eael_section_mailchimp_success_text']);
|
||||
$this->add_render_attribute('eael-mailchimp-main-wrapper', 'data-pending-text', $settings['eael_section_mailchimp_pending_text']);
|
||||
$this->add_render_attribute('eael-mailchimp-main-wrapper', 'data-loading-text', $settings['eael_section_mailchimp_loading_text']);
|
||||
|
||||
?>
|
||||
<?php if (!empty($api_key)): ?>
|
||||
<div <?php $this->print_render_attribute_string('eael-mailchimp-main-wrapper'); ?> >
|
||||
<form id="eael-mailchimp-form-<?php echo esc_attr($this->get_id()); ?>" method="POST">
|
||||
<div class="eael-form-fields-wrapper eael-mailchimp-fields-wrapper <?php echo esc_attr($subscribe_btn_display); ?>">
|
||||
<div class="eael-field-group eael-mailchimp-email">
|
||||
<label for="<?php echo esc_attr($settings['eael_mailchimp_email_label_text'], 'essential-addons-elementor'); ?>"><?php echo esc_html__($settings['eael_mailchimp_email_label_text'], 'essential-addons-elementor'); ?></label>
|
||||
<input type="email" name="eael_mailchimp_email" class="eael-mailchimp-input" placeholder="<?php echo esc_html__($settings['eael_mailchimp_email_placeholder_text'], 'essential-addons-elementor'); ?>" required="required">
|
||||
</div>
|
||||
<?php if ('yes' == $settings['eael_mailchimp_fname_show']) : ?>
|
||||
<div class="eael-field-group eael-mailchimp-fname">
|
||||
<label for="<?php echo esc_attr($settings['eael_mailchimp_fname_label_text'], 'essential-addons-elementor'); ?>"><?php echo esc_html__($settings['eael_mailchimp_fname_label_text'], 'essential-addons-elementor'); ?></label>
|
||||
<input type="text" name="eael_mailchimp_firstname" class="eael-mailchimp-input" placeholder="<?php echo esc_html__($settings['eael_mailchimp_fname_placeholder_text'], 'essential-addons-elementor'); ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ('yes' == $settings['eael_mailchimp_lname_show']) : ?>
|
||||
<div class="eael-field-group eael-mailchimp-lname">
|
||||
<label for="<?php echo esc_attr($settings['eael_mailchimp_lname_label_text'], 'essential-addons-elementor'); ?>"><?php echo esc_html__($settings['eael_mailchimp_lname_label_text'], 'essential-addons-elementor'); ?></label>
|
||||
<input type="text" name="eael_mailchimp_lastname" class="eael-mailchimp-input" placeholder="<?php echo esc_html__($settings['eael_mailchimp_lname_placeholder_text'], 'essential-addons-elementor'); ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty( $settings['eael_mailchimp_tags_show'] ) && 'yes' == $settings['eael_mailchimp_tags_show']) : ?>
|
||||
<div class="eael-field-group eael-mailchimp-tags">
|
||||
<label for="<?php echo esc_attr($settings['eael_mailchimp_tags_label_text'], 'essential-addons-elementor'); ?>"><?php echo esc_html__($settings['eael_mailchimp_tags_label_text'], 'essential-addons-elementor'); ?></label>
|
||||
<input type="text" name="eael_mailchimp_tags" class="eael-mailchimp-input" placeholder="<?php echo esc_attr($settings['eael_mailchimp_tags_placeholder_text'], 'essential-addons-elementor'); ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eael-field-group eael-mailchimp-submit-btn">
|
||||
<button type="submit" id="eael-subscribe-<?php echo esc_attr($this->get_id()); ?>" class="eael-button eael-mailchimp-subscribe">
|
||||
<div class="eael-btn-loader button__loader"></div>
|
||||
<span><?php echo esc_html__($settings['eael_section_mailchimp_button_text'], 'essential-addons-elementor'); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eael-mailchimp-message"></div>
|
||||
</form>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<p class="eael-mailchimp-error alert-warning">
|
||||
<?php echo __('Whoops! It seems like you didn\'t set Mailchimp API key. You can set from <strong>WordPress Dashboard > Essential Addons > Elements > Form Styler Elements > Mailchimp (Settings)</strong>', 'essential-addons-elementor'); ?> <!-- Static String -->
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,779 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use Elementor\Icons_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
use Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* One Page Navigation Widget
|
||||
*/
|
||||
class One_Page_Navigation extends Widget_Base
|
||||
{
|
||||
|
||||
/**
|
||||
* Retrieve one page navigation widget name.
|
||||
*/
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-one-page-nav';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve one page navigation widget title.
|
||||
*/
|
||||
public function get_title()
|
||||
{
|
||||
return __('One Page Navigation', 'essential-addons-elementor');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the one page navigation widget belongs to.
|
||||
*/
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'single page navigation',
|
||||
'ea single page navigation',
|
||||
'one page navigation',
|
||||
'ea one page navigation',
|
||||
'ea onepage navigation',
|
||||
'spa',
|
||||
'single page application',
|
||||
'page scroller',
|
||||
'page navigator',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/one-page-navigation/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve one page navigation widget icon.
|
||||
*/
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-one-page-navigaton';
|
||||
}
|
||||
|
||||
/**
|
||||
* Register one page navigation widget controls.
|
||||
*/
|
||||
protected function register_controls()
|
||||
{
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* CONTENT TAB
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Content Tab: Navigation Dots
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_nav_dots',
|
||||
[
|
||||
'label' => __('Navigation Dots', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new \Elementor\Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'section_title',
|
||||
[
|
||||
'label' => __('Section Title', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => __('Section Title', 'essential-addons-elementor'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'section_id',
|
||||
[
|
||||
'label' => __('Section ID', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => '',
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'dot_icon_new',
|
||||
[
|
||||
'label' => __('Navigation Dot', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'dot_icon',
|
||||
'default' => [
|
||||
'value' => 'fas fa-circle',
|
||||
'library' => 'fa-solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'nav_dots',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'default' => [
|
||||
[
|
||||
'section_title' => __('Section #1', 'essential-addons-elementor'),
|
||||
'section_id' => 'section-1',
|
||||
'dot_icon' => 'fa fa-circle',
|
||||
],
|
||||
[
|
||||
'section_title' => __('Section #2', 'essential-addons-elementor'),
|
||||
'section_id' => 'section-2',
|
||||
'dot_icon' => 'fa fa-circle',
|
||||
],
|
||||
[
|
||||
'section_title' => __('Section #3', 'essential-addons-elementor'),
|
||||
'section_id' => 'section-3',
|
||||
'dot_icon' => 'fa fa-circle',
|
||||
],
|
||||
],
|
||||
'fields' => $repeater->get_controls(),
|
||||
'title_field' => '{{{ section_title }}}',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Content Tab: Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_onepage_nav_settings',
|
||||
[
|
||||
'label' => __('Settings', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'nav_tooltip',
|
||||
[
|
||||
'label' => __('Tooltip', 'essential-addons-elementor'),
|
||||
'description' => __('Show tooltip on hover', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => __('Yes', 'essential-addons-elementor'),
|
||||
'label_off' => __('No', 'essential-addons-elementor'),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'tooltip_arrow',
|
||||
[
|
||||
'label' => __('Tooltip Arrow', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => __('Show', 'essential-addons-elementor'),
|
||||
'label_off' => __('Hide', 'essential-addons-elementor'),
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'nav_tooltip' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'scroll_wheel',
|
||||
[
|
||||
'label' => __('Scroll Wheel', 'essential-addons-elementor'),
|
||||
'description' => __('Use mouse wheel to navigate from one row to another', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'off',
|
||||
'label_on' => __('On', 'essential-addons-elementor'),
|
||||
'label_off' => __('Off', 'essential-addons-elementor'),
|
||||
'return_value' => 'on',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'scroll_touch',
|
||||
[
|
||||
'label' => __('Touch Swipe', 'essential-addons-elementor'),
|
||||
'description' => __('Use touch swipe to navigate from one row to another in mobile devices', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'off',
|
||||
'label_on' => __('On', 'essential-addons-elementor'),
|
||||
'label_off' => __('Off', 'essential-addons-elementor'),
|
||||
'return_value' => 'on',
|
||||
'condition' => [
|
||||
'scroll_wheel' => 'on',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'scroll_keys',
|
||||
[
|
||||
'label' => __('Scroll Keys', 'essential-addons-elementor'),
|
||||
'description' => __('Use UP and DOWN arrow keys to navigate from one row to another', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'off',
|
||||
'label_on' => __('On', 'essential-addons-elementor'),
|
||||
'label_off' => __('Off', 'essential-addons-elementor'),
|
||||
'return_value' => 'on',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'top_offset',
|
||||
[
|
||||
'label' => __('Row Top Offset', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => ['size' => '0'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 300,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'size_units' => ['px'],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'scrolling_speed',
|
||||
[
|
||||
'label' => __('Scrolling Speed', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '700',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* STYLE TAB
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Style Tab: Navigation Box
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_nav_box_style',
|
||||
[
|
||||
'label' => __('Navigation Box', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'heading_alignment',
|
||||
[
|
||||
'label' => __('Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => __('Top', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => __('Bottom', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
'left' => [
|
||||
'title' => __('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'right',
|
||||
'prefix_class' => 'nav-align-',
|
||||
'frontend_available' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-caldera-form-heading' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'nav_container_background',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .eael-one-page-nav',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'nav_container_border',
|
||||
'label' => __('Border', 'essential-addons-elementor'),
|
||||
'placeholder' => '1px',
|
||||
'default' => '1px',
|
||||
'selector' => '{{WRAPPER}} .eael-one-page-nav'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'nav_container_border_radius',
|
||||
[
|
||||
'label' => __('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'nav_container_margin',
|
||||
[
|
||||
'label' => __('Margin', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'nav_container_padding',
|
||||
[
|
||||
'label' => __('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'nav_container_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-one-page-nav',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Navigation Dots
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_dots_style',
|
||||
[
|
||||
'label' => __('Navigation Dots', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'dots_size',
|
||||
[
|
||||
'label' => __('Size', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => ['size' => '10', 'unit'=>'px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 5,
|
||||
'max' => 60,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-nav-dot' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} img.eael-nav-dot' => 'width: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-nav-dot-wrap svg' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};line-height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'dots_spacing',
|
||||
[
|
||||
'label' => __('Spacing', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => ['size' => '10'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 2,
|
||||
'max' => 30,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}.nav-align-right .eael-one-page-nav-item, {{WRAPPER}}.nav-align-left .eael-one-page-nav-item' => 'margin-bottom: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}}.nav-align-top .eael-one-page-nav-item, {{WRAPPER}}.nav-align-bottom .eael-one-page-nav-item' => 'margin-right: {{SIZE}}{{UNIT}}; margin-left: 0',
|
||||
'.rtl {{WRAPPER}}.nav-align-top .eael-one-page-nav-item, {{WRAPPER}}.nav-align-bottom .eael-one-page-nav-item' => 'margin-left: {{SIZE}}{{UNIT}};margin-right: 0;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'dots_padding',
|
||||
[
|
||||
'label' => __('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-nav-dot-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'dots_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-nav-dot-wrap',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs('tabs_dots_style');
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_dots_normal',
|
||||
[
|
||||
'label' => __('Normal', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_color_normal',
|
||||
[
|
||||
'label' => __('Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-nav-dot' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} svg.eael-nav-dot' => 'fill: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-nav-dot-wrap svg' => 'fill: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-nav-dot-wrap svg path' => 'fill: {{VALUE}}; stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_bg_color_normal',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-nav-dot-wrap' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'dots_border',
|
||||
'label' => __('Border', 'essential-addons-elementor'),
|
||||
'placeholder' => '1px',
|
||||
'default' => '1px',
|
||||
'selector' => '{{WRAPPER}} .eael-nav-dot-wrap'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_border_radius',
|
||||
[
|
||||
'label' => __('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-nav-dot-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_dots_hover',
|
||||
[
|
||||
'label' => __('Hover', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_color_hover',
|
||||
[
|
||||
'label' => __('Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav-item .eael-nav-dot-wrap:hover .eael-nav-dot' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-one-page-nav-item .eael-nav-dot-wrap:hover svg.eael-nav-dot' => 'fill: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-one-page-nav-item .eael-nav-dot-wrap:hover svg' => 'fill: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_bg_color_hover',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav-item .eael-nav-dot-wrap:hover' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_border_color_hover',
|
||||
[
|
||||
'label' => __('Border Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav-item .eael-nav-dot-wrap:hover' => 'border-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_dots_active',
|
||||
[
|
||||
'label' => __('Active', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_color_active',
|
||||
[
|
||||
'label' => __('Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav-item.active .eael-nav-dot' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-one-page-nav-item.active svg.eael-nav-dot' => 'fill: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-one-page-nav-item.active .eael-nav-dot-wrap svg' => 'fill: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-one-page-nav-item.active .eael-nav-dot-wrap svg path' => 'fill: {{VALUE}}; stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_bg_color_active',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav-item.active .eael-nav-dot-wrap' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'dots_border_color_active',
|
||||
[
|
||||
'label' => __('Border Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-one-page-nav-item.active .eael-nav-dot-wrap' => 'border-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Tooltip
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_tooltips_style',
|
||||
[
|
||||
'label' => __('Tooltip', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'nav_tooltip' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'tooltip_bg_color',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-nav-dot-tooltip-content' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-nav-dot-tooltip' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'nav_tooltip' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'tooltip_color',
|
||||
[
|
||||
'label' => __('Text Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-nav-dot-tooltip-content' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'nav_tooltip' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'tooltip_typography',
|
||||
'label' => __('Typography', 'essential-addons-elementor'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_ACCENT
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-nav-dot-tooltip',
|
||||
'condition' => [
|
||||
'nav_tooltip' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'tooltip_padding',
|
||||
[
|
||||
'label' => __('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-nav-dot-tooltip-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
$this->add_render_attribute('onepage-nav-container', 'class', 'eael-one-page-nav-container');
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'class', 'eael-one-page-nav');
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'id', 'eael-one-page-nav-' . $this->get_id());
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'data-section-id', 'eael-one-page-nav-' . $this->get_id());
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'data-top-offset', $settings['top_offset']['size']);
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'data-scroll-speed', $settings['scrolling_speed']);
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'data-scroll-wheel', $settings['scroll_wheel']);
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'data-scroll-touch', $settings['scroll_touch']);
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'data-scroll-keys', $settings['scroll_keys']);
|
||||
|
||||
$this->add_render_attribute('onepage-nav', 'data-section-ids', wp_json_encode( wp_list_pluck( $settings['nav_dots'], 'section_id') ) );
|
||||
|
||||
$this->add_render_attribute('tooltip', 'class', 'eael-nav-dot-tooltip');
|
||||
|
||||
if ($settings['tooltip_arrow'] == 'yes') {
|
||||
$this->add_render_attribute('tooltip', 'class', 'eael-tooltip-arrow');
|
||||
}
|
||||
|
||||
?>
|
||||
<div <?php $this->print_render_attribute_string('onepage-nav-container'); ?>>
|
||||
<ul <?php $this->print_render_attribute_string('onepage-nav'); ?>>
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($settings['nav_dots'] as $index => $dot) {
|
||||
$dot_icon_migrated = isset($dot['__fa4_migrated']['dot_icon_new']);
|
||||
$dot_icon_is_new = empty($dot['dot_icon']);
|
||||
|
||||
$eael_section_title = $dot['section_title'];
|
||||
$eael_section_id = $dot['section_id'];
|
||||
$eael_dot_icon = ((isset($settings['__fa4_migrated']['dot_icon_new']) || empty($dot['dot_icon']) || !empty($dot['dot_icon_new']['value'])) ? Helper::get_render_icon($dot['dot_icon_new'], ['class'=>'eael-nav-dot']) : '<i class="'.$dot['dot_icon'].' eael-nav-dot"></i>');
|
||||
$eael_dot_icon = (( $dot_icon_migrated || $dot_icon_is_new || !empty($dot['dot_icon_new']['value'])) ? $dot['dot_icon_new']['value'] : $dot['dot_icon']);
|
||||
|
||||
if ($settings['nav_tooltip'] == 'yes') {
|
||||
$eael_dot_tooltip = sprintf('<span %1$s><span class="eael-nav-dot-tooltip-content">%2$s</span></span>', $this->get_render_attribute_string('tooltip'), $eael_section_title);
|
||||
} else {
|
||||
$eael_dot_tooltip = '';
|
||||
}
|
||||
|
||||
if ($dot_icon_is_new || $dot_icon_migrated) {
|
||||
echo '<li class="eael-one-page-nav-item">'. wp_kses( $eael_dot_tooltip, Helper::eael_allowed_tags() ) .'<a href="#" data-row-id="'. esc_attr( $eael_section_id ) .'"><span class="eael-nav-dot-wrap">';
|
||||
Icons_Manager::render_icon( $dot['dot_icon_new'], ['class'=>'eael-nav-dot'] );
|
||||
echo '</span></a></li>';
|
||||
} else {
|
||||
echo '<li class="eael-one-page-nav-item">'. wp_kses( $eael_dot_tooltip, Helper::eael_allowed_tags() ) .'<a href="#" data-row-id="'. esc_attr( $eael_section_id ) .'"><span class="eael-nav-dot-wrap">'. wp_kses( $eael_dot_icon, Helper::eael_allowed_icon_tags() ) .'</span></a></li>';
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render one page navigation widget output in the editor.
|
||||
*/
|
||||
protected function content_template()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,907 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Essential_Addons_Elementor\Classes\Helper as HelperClass;
|
||||
use Essential_Addons_Elementor\Traits\Helper;
|
||||
|
||||
class Post_Block extends Widget_Base
|
||||
{
|
||||
use Helper;
|
||||
|
||||
private $page_id;
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-post-block';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return __('Post Block', 'essential-addons-elementor');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-post-block';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'post block',
|
||||
'ea postblock',
|
||||
'ea post block',
|
||||
'post layout',
|
||||
'flex layout',
|
||||
'post grid',
|
||||
'post showcase',
|
||||
'portfolio',
|
||||
'gallery',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/post-block/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
/**
|
||||
* Query And Layout Controls!
|
||||
* @source includes/elementor-helper.php
|
||||
*/
|
||||
do_action('eael/controls/query', $this);
|
||||
do_action('eael/controls/layout', $this);
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_post_block_links',
|
||||
[
|
||||
'label' => __('Links', 'essential-addons-elementor'),
|
||||
'conditions' => [
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'eael_show_image',
|
||||
'operator' => '==',
|
||||
'value' => 'yes',
|
||||
],
|
||||
[
|
||||
'name' => 'eael_show_title',
|
||||
'operator' => '==',
|
||||
'value' => 'yes',
|
||||
],
|
||||
[
|
||||
'name' => 'eael_show_read_more_button',
|
||||
'operator' => '==',
|
||||
'value' => 'yes',
|
||||
],
|
||||
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'image_link',
|
||||
[
|
||||
'label' => __('Image', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition' => [
|
||||
'eael_show_image' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'image_link_nofollow',
|
||||
[
|
||||
'label' => __('No Follow', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'essential-addons-elementor'),
|
||||
'label_off' => __('No', 'essential-addons-elementor'),
|
||||
'return_value' => 'true',
|
||||
'condition' => [
|
||||
'eael_show_image' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'image_link_target_blank',
|
||||
[
|
||||
'label' => __('Target Blank', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'essential-addons-elementor'),
|
||||
'label_off' => __('No', 'essential-addons-elementor'),
|
||||
'return_value' => 'true',
|
||||
'condition' => [
|
||||
'eael_show_image' => 'yes',
|
||||
],
|
||||
'separator' => 'after',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title_link',
|
||||
[
|
||||
'label' => __('Title', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition' => [
|
||||
'eael_show_title' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title_link_nofollow',
|
||||
[
|
||||
'label' => __('No Follow', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'essential-addons-elementor'),
|
||||
'label_off' => __('No', 'essential-addons-elementor'),
|
||||
'return_value' => 'true',
|
||||
'condition' => [
|
||||
'eael_show_title' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title_link_target_blank',
|
||||
[
|
||||
'label' => __('Target Blank', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'essential-addons-elementor'),
|
||||
'label_off' => __('No', 'essential-addons-elementor'),
|
||||
'return_value' => 'true',
|
||||
'condition' => [
|
||||
'eael_show_title' => 'yes',
|
||||
],
|
||||
'separator' => 'after',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'read_more_link',
|
||||
[
|
||||
'label' => __('Read More', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition' => [
|
||||
'eael_show_read_more_button' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'read_more_link_nofollow',
|
||||
[
|
||||
'label' => __('No Follow', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'essential-addons-elementor'),
|
||||
'label_off' => __('No', 'essential-addons-elementor'),
|
||||
'return_value' => 'true',
|
||||
'condition' => [
|
||||
'eael_show_read_more_button' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'read_more_link_target_blank',
|
||||
[
|
||||
'label' => __('Target Blank', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'essential-addons-elementor'),
|
||||
'label_off' => __('No', 'essential-addons-elementor'),
|
||||
'return_value' => 'true',
|
||||
'condition' => [
|
||||
'eael_show_read_more_button' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_post_block_style',
|
||||
[
|
||||
'label' => __('General', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_bg_color',
|
||||
[
|
||||
'label' => __('Post Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-block-item' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'grid_style!' => 'post-block-style-overlay',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
/*$this->add_control(
|
||||
'eael_thumbnail_overlay_color',
|
||||
[
|
||||
'label' => __( 'Thumbnail Overlay Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(0,0,0, .5)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-overlay, {{WRAPPER}} .eael-post-block.post-block-style-overlay .eael-entry-wrapper' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
|
||||
]
|
||||
);*/
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_block_spacing',
|
||||
[
|
||||
'label' => esc_html__('Spacing Between Items', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-block-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_post_block_layout' => 'post-block-layout-block'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_tiled_gap',
|
||||
[
|
||||
'label' => esc_html__('Grid Gap', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'range' => [
|
||||
'px' => ['max' => 50],
|
||||
'%' => ['max' => 50]
|
||||
],
|
||||
'default' => [
|
||||
'size' => 20,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .post-block-layout-tiled .eael-post-block-grid' => 'grid-gap: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_post_block_layout' => 'post-block-layout-tiled'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_post_block_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-post-block-item',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-block-item' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_post_block_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-post-block-item',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_content_box_padding',
|
||||
[
|
||||
'label' => esc_html__('Content Box Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} 0px {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-entry-footer' => 'padding: 0px {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'grid_style!' => 'post-block-style-overlay',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_overlay_content_box_padding',
|
||||
[
|
||||
'label' => esc_html__('Content Box Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'grid_style' => 'post-block-style-overlay',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
/**
|
||||
* Thumbnail Image Control
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_post_block_thumbnail_style',
|
||||
[
|
||||
'label' => __('Thumbnail Style', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'grid_style' => 'post-block-style-default'
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_post_block_thumbnail_border',
|
||||
[
|
||||
'label' => __('Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-block-item .eael-entry-media' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_post_block_thumbnail_border',
|
||||
'label' => __('Border', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-post-block-item .eael-entry-media',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Color & Typography
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_typography',
|
||||
[
|
||||
'label' => __('Color & Typography', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_title_style',
|
||||
[
|
||||
'label' => __('Title Style', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_title_color',
|
||||
[
|
||||
'label' => __('Title Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-title, {{WRAPPER}} .eael-entry-title a' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_title_hover_color',
|
||||
[
|
||||
'label' => __('Title Hover Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-title:hover, {{WRAPPER}} .eael-entry-title a:hover' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_block_title_alignment',
|
||||
[
|
||||
'label' => __('Title Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-title' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_post_block_title_typography',
|
||||
'label' => __('Typography', 'essential-addons-elementor'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-entry-title > a',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_title_spacing',
|
||||
[
|
||||
'label' => esc_html__('Title Spacing', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_excerpt_style',
|
||||
[
|
||||
'label' => __('Excerpt Style', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_excerpt_color',
|
||||
[
|
||||
'label' => __('Excerpt Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-grid-post-excerpt p' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_block_excerpt_alignment',
|
||||
[
|
||||
'label' => __('Excerpt Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
'title' => __('Justified', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-grid-post-excerpt p' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_post_block_excerpt_typography',
|
||||
'label' => __('Excerpt Typography', 'essential-addons-elementor'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_TEXT,
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-grid-post-excerpt p',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_excerpt_spacing',
|
||||
[
|
||||
'label' => esc_html__('Excerpt Spacing', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-grid-post-excerpt p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'content_height',
|
||||
[
|
||||
'label' => esc_html__('Content Height', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'range' => [
|
||||
'px' => ['max' => 300],
|
||||
'%' => ['max' => 100]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-block-item .eael-entry-wrapper' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_meta_style',
|
||||
[
|
||||
'label' => __('Meta Style', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_meta_color',
|
||||
[
|
||||
'label' => __('Meta Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-meta, {{WRAPPER}} .eael-entry-meta a, {{WRAPPER}} .eael-entry-meta ul li i, {{WRAPPER}} .eael-entry-meta ul li a, {{WRAPPER}} .eael-entry-meta > span, {{WRAPPER}} .eael-entry-meta > span a' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_block_meta_alignment_footer',
|
||||
[
|
||||
'label' => __('Meta Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => __('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => __('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-footer' => 'justify-content: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'meta_position' => 'meta-entry-footer',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_block_meta_alignment_header',
|
||||
[
|
||||
'label' => __('Meta Alignment', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
'title' => __('Justified', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-entry-meta' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'meta_position' => 'meta-entry-header',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_post_block_meta_typography',
|
||||
'label' => __('Meta Typography', 'essential-addons-elementor'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_TEXT,
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-entry-meta > div, {{WRAPPER}} .eael-entry-meta > span, {{WRAPPER}} .eael-entry-meta ul li i, {{WRAPPER}} .eael-entry-meta ul li a',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style tab: terms style
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_meta_terms_style',
|
||||
[
|
||||
'label' => __('Terms Style', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_post_block_terms_color',
|
||||
[
|
||||
'label' => __('Terms Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .post-meta-categories li, {{WRAPPER}} .post-meta-categories li a' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_post_block_terms_typography',
|
||||
'label' => __('Meta Typography', 'essential-addons-elementor'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_TEXT
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .post-meta-categories li, {{WRAPPER}} .post-meta-categories li a',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_carousel_terms_margin',
|
||||
[
|
||||
'label' => __('Margin', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .post-meta-categories' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Read More Button Style Controls
|
||||
*/
|
||||
do_action('eael/controls/read_more_button_style', $this);
|
||||
|
||||
/**
|
||||
* Load More Button Style Controls!
|
||||
*/
|
||||
do_action('eael/controls/load_more_button_style', $this);
|
||||
|
||||
/**
|
||||
* Card Hover Style
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_post_block_hover_card',
|
||||
[
|
||||
'label' => __('Hover Card Style', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_hover_animation',
|
||||
[
|
||||
'label' => esc_html__('Animation', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'fade-in',
|
||||
'options' => [
|
||||
'none' => esc_html__('None', 'essential-addons-elementor'),
|
||||
'fade-in' => esc_html__('FadeIn', 'essential-addons-elementor'),
|
||||
'zoom-in' => esc_html__('ZoomIn', 'essential-addons-elementor'),
|
||||
'slide-up' => esc_html__('SlideUp', 'essential-addons-elementor'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_bg_hover_icon_new',
|
||||
[
|
||||
'label' => __('Post Hover Icon', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'eael_post_block_bg_hover_icon',
|
||||
'default' => [
|
||||
'value' => 'fas fa-long-arrow-alt-right',
|
||||
'library' => 'fa-solid',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_post_block_hover_animation!' => 'none',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_hover_bg_color',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(0,0,0, .75)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-block-item .eael-entry-overlay' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-post-block.post-block-style-overlay .eael-entry-wrapper' => 'background-color: {{VALUE}} !important;',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_block_hover_icon_color',
|
||||
[
|
||||
'label' => __('Icon Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-block-item .eael-entry-overlay > i' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'grid_style!' => 'post-block-style-overlay',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_block_hover_icon_fontsize',
|
||||
[
|
||||
'label' => __('Icon size', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => 'px',
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 18,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-block-item .eael-entry-overlay > i' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-post-block-item .eael-entry-overlay .eael-post-block-hover-svg-icon' => 'width:{{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'condition' => [
|
||||
'grid_style!' => 'post-block-style-overlay',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$ds = $this->get_settings_for_display();
|
||||
$settings = HelperClass::fix_old_query($ds);
|
||||
$args = HelperClass::get_query_args($settings);
|
||||
$args = HelperClass::get_dynamic_args($settings, $args);
|
||||
|
||||
$settings ['post_block_hover_animation'] = $settings['eael_post_block_hover_animation'];
|
||||
$settings ['show_read_more_button'] = $settings['eael_show_read_more_button'];
|
||||
$settings ['eael_post_block_bg_hover_icon'] = $settings['eael_post_block_hover_animation'] == 'none' ? '' : ( ( isset( $settings['__fa4_migrated']['eael_post_block_bg_hover_icon_new'] ) || empty( $settings['eael_post_block_bg_hover_icon'] ) ) ? $settings['eael_post_block_bg_hover_icon_new']['value'] : $settings['eael_post_block_bg_hover_icon'] );
|
||||
$settings ['expanison_indicator'] = $settings['excerpt_expanison_indicator'];
|
||||
|
||||
$link_settings = [
|
||||
'image_link_nofollow' => $settings['image_link_nofollow'] ? 'rel="nofollow"' : '',
|
||||
'image_link_target_blank' => $settings['image_link_target_blank'] ? 'target="_blank"' : '',
|
||||
'title_link_nofollow' => $settings['title_link_nofollow'] ? 'rel="nofollow"' : '',
|
||||
'title_link_target_blank' => $settings['title_link_target_blank'] ? 'target="_blank"' : '',
|
||||
'read_more_link_nofollow' => $settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '',
|
||||
'read_more_link_target_blank' => $settings['read_more_link_target_blank'] ? 'target="_blank"' : '',
|
||||
];
|
||||
|
||||
$this->add_render_attribute(
|
||||
'eael-post-block-wrapper',
|
||||
[
|
||||
'id' => 'eael-post-block-' . esc_attr($this->get_id()),
|
||||
'class' => [
|
||||
'eael-post-block',
|
||||
$settings['grid_style'],
|
||||
$settings['eael_post_block_layout'],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_render_attribute(
|
||||
'eael-post-block-wrap-inner',
|
||||
[
|
||||
'class' => ['eael-post-block-grid', 'eael-post-appender', 'eael-post-appender-' . esc_attr($this->get_id()), $settings['eael_post_tiled_preset'], $settings['eael_post_tiled_column']],
|
||||
]
|
||||
);
|
||||
|
||||
echo '<div '; $this->print_render_attribute_string('eael-post-block-wrapper'); echo '>
|
||||
<div '; $this->print_render_attribute_string('eael-post-block-wrap-inner'); echo '>';
|
||||
|
||||
$template = $this->get_template($settings['eael_dynamic_template_Layout']);
|
||||
$settings['loadable_file_name'] = $this->get_filename_only($template);
|
||||
$found_posts = 0;
|
||||
if (file_exists($template)) {
|
||||
$query = new \WP_Query($args);
|
||||
if ($query->have_posts()) {
|
||||
$found_posts = $query->found_posts;
|
||||
$max_page = ceil( $found_posts / absint( $args['posts_per_page'] ) );
|
||||
$args['max_page'] = $max_page;
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
include($template);
|
||||
}
|
||||
} else {
|
||||
echo '<p class="no-posts-found">'. esc_html__( 'No posts found!', 'essential-addons-elementor' ) .'</p>';
|
||||
}
|
||||
wp_reset_postdata();
|
||||
} else {
|
||||
echo '<p class="no-posts-found">'. esc_html__( 'No layout found!', 'essential-addons-elementor' ) .'</p>';
|
||||
}
|
||||
|
||||
echo '</div>
|
||||
</div>';
|
||||
|
||||
// normalize settings for load more
|
||||
$settings['eael_dynamic_template_Layout'] = 'default';
|
||||
if (method_exists($this, 'print_load_more_button') && $found_posts > $args['posts_per_page']) {
|
||||
$dir_name = method_exists( $this, 'get_temp_dir_name' ) ? $this->get_temp_dir_name( $settings[ 'loadable_file_name' ] ) : "pro";
|
||||
$this->print_load_more_button($settings, $args, $dir_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,821 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Control_Media;
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle Widget
|
||||
*/
|
||||
class Toggle extends Widget_Base {
|
||||
/**
|
||||
* Retrieve toggle widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'eael-toggle';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve toggle widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return __( 'Toggle', 'essential-addons-elementor' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the toggle widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'toggle',
|
||||
'ea toggle',
|
||||
'ea content toggle',
|
||||
'content toggle',
|
||||
'content switcher',
|
||||
'switcher',
|
||||
'ea switcher',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/content-toggle/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve toggle widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'eaicon-content-toggle';
|
||||
}
|
||||
|
||||
/**
|
||||
* Register toggle widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function register_controls() {
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* CONTENT TAB
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Content Tab: Primary
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_primary',
|
||||
[
|
||||
'label' => __( 'Primary', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'primary_label',
|
||||
[
|
||||
'label' => __( 'Label', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => __( 'Annual', 'essential-addons-elementor' ),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'primary_content_type',
|
||||
[
|
||||
'label' => __( 'Content Type', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'image' => __( 'Image', 'essential-addons-elementor' ),
|
||||
'content' => __( 'Content', 'essential-addons-elementor' ),
|
||||
'template' => __( 'Saved Templates', 'essential-addons-elementor' ),
|
||||
],
|
||||
'default' => 'content',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'primary_templates',
|
||||
[
|
||||
'label' => __( 'Choose Template', 'essential-addons-elementor' ),
|
||||
'type' => 'eael-select2',
|
||||
'source_name' => 'post_type',
|
||||
'source_type' => 'elementor_library',
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'primary_content_type' => 'template',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'primary_content',
|
||||
[
|
||||
'label' => __( 'Content', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'default' => __( 'Primary Content', 'essential-addons-elementor' ),
|
||||
'condition' => [
|
||||
'primary_content_type' => 'content',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'primary_image',
|
||||
[
|
||||
'label' => __( 'Image', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'condition' => [
|
||||
'primary_content_type' => 'image',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Content Tab: Secondary
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_secondary',
|
||||
[
|
||||
'label' => __( 'Secondary', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'secondary_label',
|
||||
[
|
||||
'label' => __( 'Label', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => __( 'Lifetime', 'essential-addons-elementor' ),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'secondary_content_type',
|
||||
[
|
||||
'label' => __( 'Content Type', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'image' => __( 'Image', 'essential-addons-elementor' ),
|
||||
'content' => __( 'Content', 'essential-addons-elementor' ),
|
||||
'template' => __( 'Saved Templates', 'essential-addons-elementor' ),
|
||||
],
|
||||
'default' => 'content',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'secondary_templates',
|
||||
[
|
||||
'label' => __( 'Choose Template', 'essential-addons-elementor' ),
|
||||
'type' => 'eael-select2',
|
||||
'source_name' => 'post_type',
|
||||
'source_type' => 'elementor_library',
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'secondary_content_type' => 'template',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'secondary_content',
|
||||
[
|
||||
'label' => __( 'Content', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'default' => __( 'Secondary Content', 'essential-addons-elementor' ),
|
||||
'condition' => [
|
||||
'secondary_content_type' => 'content',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'secondary_image',
|
||||
[
|
||||
'label' => __( 'Image', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'condition' => [
|
||||
'secondary_content_type' => 'image',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Overlay
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_toggle_switch_style',
|
||||
[
|
||||
'label' => __( 'Switch', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'toggle_switch_alignment',
|
||||
[
|
||||
'label' => __( 'Alignment', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __( 'Left', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __( 'Center', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __( 'Right', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'prefix_class' => 'eael-toggle-',
|
||||
'frontend_available' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'switch_style',
|
||||
[
|
||||
'label' => __( 'Switch Style', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'round' => __( 'Round', 'essential-addons-elementor' ),
|
||||
'rectangle' => __( 'Rectangle', 'essential-addons-elementor' ),
|
||||
],
|
||||
'default' => 'round',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'toggle_switch_size',
|
||||
[
|
||||
'label' => __( 'Switch Size', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 26,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => [ 'px' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 15,
|
||||
'max' => 60,
|
||||
],
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => 'px',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-switch-container' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'toggle_switch_spacing',
|
||||
[
|
||||
'label' => __( 'Headings Spacing', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 15,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => 'px',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-switch-container' => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'toggle_switch_gap',
|
||||
[
|
||||
'label' => __( 'Margin Bottom', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 20,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => 'px',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-switch-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs( 'tabs_switch' );
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_switch_primary',
|
||||
[
|
||||
'label' => __( 'Primary', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'toggle_switch_primary_background',
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .eael-toggle-slider',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'toggle_switch_primary_border',
|
||||
'label' => __( 'Border', 'essential-addons-elementor' ),
|
||||
'placeholder' => '1px',
|
||||
'default' => '1px',
|
||||
'selector' => '{{WRAPPER}} .eael-toggle-switch-container',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'toggle_switch_primary_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-switch-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_switch_secondary',
|
||||
[
|
||||
'label' => __( 'Secondary', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'toggle_switch_secondary_background',
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .eael-toggle-switch-on .eael-toggle-slider',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'toggle_switch_secondary_border',
|
||||
'label' => __( 'Border', 'essential-addons-elementor' ),
|
||||
'placeholder' => '1px',
|
||||
'default' => '1px',
|
||||
'selector' => '{{WRAPPER}} .eael-toggle-switch-container.eael-toggle-switch-on',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'toggle_switch_secondary_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-switch-container.eael-toggle-switch-on' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->add_control(
|
||||
'switch_controller_heading',
|
||||
[
|
||||
'label' => __( 'Controller', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'toggle_controller_background',
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .eael-toggle-slider::before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'toggle_controller_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-slider::before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Label
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_label_style',
|
||||
[
|
||||
'label' => __( 'Label', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_horizontal_position',
|
||||
[
|
||||
'label' => __( 'Position', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => false,
|
||||
'default' => 'middle',
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => __( 'Top', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'middle' => [
|
||||
'title' => __( 'Middle', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-v-align-middle',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => __( 'Bottom', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'selectors_dictionary' => [
|
||||
'top' => 'flex-start',
|
||||
'middle' => 'center',
|
||||
'bottom' => 'flex-end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-switch-inner' => 'align-items: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs( 'tabs_label_style' );
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_label_primary',
|
||||
[
|
||||
'label' => __( 'Primary', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_text_color_primary',
|
||||
[
|
||||
'label' => __( 'Text Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-primary-toggle-label' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_active_text_color_primary',
|
||||
[
|
||||
'label' => __( 'Active Text Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-primary-toggle-label.active' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'label_typography_primary',
|
||||
'label' => __( 'Typography', 'essential-addons-elementor' ),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_ACCENT
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-primary-toggle-label',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_label_secondary',
|
||||
[
|
||||
'label' => __( 'Secondary', 'essential-addons-elementor' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_text_color_secondary',
|
||||
[
|
||||
'label' => __( 'Text Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-secondary-toggle-label' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'label_active_text_color_secondary',
|
||||
[
|
||||
'label' => __( 'Active Text Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-secondary-toggle-label.active' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'label_typography_secondary',
|
||||
'label' => __( 'Typography', 'essential-addons-elementor' ),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_ACCENT
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-secondary-toggle-label',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Content
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_content_style',
|
||||
[
|
||||
'label' => __( 'Content', 'essential-addons-elementor' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'content_alignment',
|
||||
[
|
||||
'label' => __( 'Alignment', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __( 'Left', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __( 'Center', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __( 'Right', 'essential-addons-elementor' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-content-wrap' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'content_text_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'essential-addons-elementor' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-toggle-content-wrap' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'content_typography',
|
||||
'label' => __( 'Typography', 'essential-addons-elementor' ),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_ACCENT
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-toggle-content-wrap',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Render toggle widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
$this->add_render_attribute( 'toggle-container', 'class', 'eael-toggle-container' );
|
||||
|
||||
$this->add_render_attribute( 'toggle-container', 'id', 'eael-toggle-container-' . esc_attr( $this->get_id() ) );
|
||||
$this->add_render_attribute( 'toggle-switch-wrap', 'class', 'eael-toggle-switch-wrap' );
|
||||
|
||||
$this->add_render_attribute( 'toggle-switch-container', 'class', 'eael-toggle-switch-container' );
|
||||
|
||||
$this->add_render_attribute( 'toggle-switch-container', 'class', 'eael-toggle-switch-' . $settings['switch_style'] );
|
||||
|
||||
$this->add_render_attribute( 'toggle-content-wrap', 'class', 'eael-toggle-content-wrap primary' );
|
||||
?>
|
||||
<div <?php echo $this->get_render_attribute_string( 'toggle-container' ); ?>>
|
||||
<div <?php echo $this->get_render_attribute_string( 'toggle-switch-wrap' ); ?>>
|
||||
<div class="eael-toggle-switch-inner">
|
||||
|
||||
<div class="eael-primary-toggle-label">
|
||||
<?php echo esc_attr( $settings['primary_label'] ); ?>
|
||||
</div>
|
||||
<div <?php echo $this->get_render_attribute_string( 'toggle-switch-container' ); ?>>
|
||||
<label class="eael-toggle-switch">
|
||||
<input type="checkbox">
|
||||
<span class="eael-toggle-slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="eael-secondary-toggle-label">
|
||||
<?php echo esc_attr( $settings['secondary_label'] ); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div <?php echo $this->get_render_attribute_string( 'toggle-content-wrap' ); ?>>
|
||||
<div class="eael-toggle-primary-wrap">
|
||||
<?php
|
||||
if ( $settings['primary_content_type'] == 'content' ) {
|
||||
echo $this->parse_text_editor( $settings['primary_content'] );
|
||||
} elseif ( $settings['primary_content_type'] == 'image' ) {
|
||||
$this->add_render_attribute( 'primary-image', 'src', esc_url( $settings['primary_image']['url'] ) );
|
||||
$this->add_render_attribute( 'primary-image', 'alt', Control_Media::get_image_alt( $settings['primary_image'] ) );
|
||||
$this->add_render_attribute( 'primary-image', 'title', Control_Media::get_image_title( $settings['primary_image'] ) );
|
||||
|
||||
printf( '<img %s />', $this->get_render_attribute_string( 'primary-image' ) );
|
||||
} elseif ( $settings['primary_content_type'] == 'template' ) {
|
||||
if ( ! empty( $settings['primary_templates'] ) ) {
|
||||
// WPML Compatibility
|
||||
if ( ! is_array( $settings['primary_templates'] ) ) {
|
||||
$settings['primary_templates'] = apply_filters( 'wpml_object_id', $settings['primary_templates'], 'wp_template', true );
|
||||
}
|
||||
echo Plugin::$instance->frontend->get_builder_content( $settings['primary_templates'], true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="eael-toggle-secondary-wrap">
|
||||
<?php
|
||||
if ( $settings['secondary_content_type'] == 'content' ) {
|
||||
echo $this->parse_text_editor( $settings['secondary_content'] );
|
||||
} elseif ( $settings['secondary_content_type'] == 'image' ) {
|
||||
$this->add_render_attribute( 'secondary-image', 'src', esc_url( $settings['secondary_image']['url'] ) );
|
||||
$this->add_render_attribute( 'secondary-image', 'alt', Control_Media::get_image_alt( $settings['secondary_image'] ) );
|
||||
$this->add_render_attribute( 'secondary-image', 'title', Control_Media::get_image_title( $settings['secondary_image'] ) );
|
||||
|
||||
printf( '<img %s />', $this->get_render_attribute_string( 'secondary-image' ) );
|
||||
} elseif ( $settings['secondary_content_type'] == 'template' ) {
|
||||
if ( ! empty( $settings['secondary_templates'] ) ) {
|
||||
// WPML Compatibility
|
||||
if ( ! is_array( $settings['secondary_templates'] ) ) {
|
||||
$settings['secondary_templates'] = apply_filters( 'wpml_object_id', $settings['secondary_templates'], 'wp_template', true );
|
||||
}
|
||||
echo Plugin::$instance->frontend->get_builder_content( $settings['secondary_templates'], true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render toggle widget output in the editor.
|
||||
*
|
||||
* Written as a Backbone JavaScript template and used to generate the live preview.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function content_template() {
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,666 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Woo_Collections extends Widget_Base
|
||||
{
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-woo-collections';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('Woo Product Collections', 'essential-addons-elementor');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-woo-product-collections';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor', 'woocommerce-elements' ];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'woo product collections',
|
||||
'ea woo product collections',
|
||||
'woocommerce product collections',
|
||||
'ea woocommerce product collections',
|
||||
'ecommerce product collections',
|
||||
'woocommerce',
|
||||
'product list',
|
||||
'woo',
|
||||
'product feed',
|
||||
'ecommerce',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/ea-woo-product-collections/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
/**
|
||||
* General Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_woo_collections_section_general',
|
||||
[
|
||||
'label' => esc_html__('General', 'essential-addons-elementor'),
|
||||
]
|
||||
);
|
||||
|
||||
if (!apply_filters('eael/is_plugin_active', 'woocommerce/woocommerce.php')) {
|
||||
$this->add_control(
|
||||
'ea_woo_collections_woo_required',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => __('<strong>WooCommerce</strong> is not installed/activated on your site. Please install and activate <a href="plugin-install.php?s=woocommerce&tab=search&type=term" target="_blank">WooCommerce</a> first.', 'essential-addons-for-elementor-lite'),
|
||||
'content_classes' => 'eael-warning',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_type',
|
||||
[
|
||||
'label' => esc_html__('Collection Type', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'category',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'category' => esc_html__('Category', 'essential-addons-elementor'),
|
||||
'tags' => esc_html__('Tags', 'essential-addons-elementor'),
|
||||
'attributes' => esc_html__('Attributes', 'essential-addons-elementor'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_category',
|
||||
[
|
||||
'label' => esc_html__('Category', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'label_block' => false,
|
||||
'options' => Helper::get_terms_list('product_cat'),
|
||||
'condition' => [
|
||||
'eael_woo_collections_type' => 'category',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_tags',
|
||||
[
|
||||
'label' => esc_html__('Tag', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'label_block' => false,
|
||||
'options' => Helper::get_woo_product_tags(),
|
||||
'condition' => [
|
||||
'eael_woo_collections_type' => 'tags',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_attributes',
|
||||
[
|
||||
'label' => esc_html__('Attribute', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'label_block' => false,
|
||||
'options' => Helper::get_woo_product_atts(),
|
||||
'condition' => [
|
||||
'eael_woo_collections_type' => 'attributes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_bg_img',
|
||||
[
|
||||
'label' => __('Background Image', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'separator' => 'before',
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_subtitle',
|
||||
[
|
||||
'label' => __('Subtitle', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => __('Collections', 'essential-addons-elementor'),
|
||||
'separator' => 'before',
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_is_show_badge',
|
||||
[
|
||||
'label' => __('Show Badge', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Show', 'essential-addons-elementor'),
|
||||
'label_off' => __('Hide', 'essential-addons-elementor'),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_badge_label',
|
||||
[
|
||||
'label' => __('Badge Label', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'default' => __('Sale', 'essential-addons-elementor'),
|
||||
'placeholder' => __('Type your lable here', 'essential-addons-elementor'),
|
||||
'condition' => [
|
||||
'eael_woo_collections_is_show_badge' => 'yes'
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style: General
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_woo_collections_section_style_general',
|
||||
[
|
||||
'label' => esc_html__('General', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_woo_collections_layout',
|
||||
[
|
||||
'label' => __('Choose Layout', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::SELECT,
|
||||
'default' => '',
|
||||
'options' => [
|
||||
'' => __('Default Style', 'essential-addons-elementor'),
|
||||
'two' => __('Style Two', 'essential-addons-elementor'),
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_woo_collections_item_heading_style',
|
||||
[
|
||||
'label' => __('Layout Style', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
// 'condition' => [
|
||||
// 'eael_woo_collections_layout' => 'two'
|
||||
// ]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_main_area_padding',
|
||||
[
|
||||
'label' => __('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'default' => [
|
||||
'top' => '20',
|
||||
'right' => '20',
|
||||
'bottom' => '20',
|
||||
'left' => '20',
|
||||
'isLinked' => true,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-layout-two' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-woo-collections-layout-two .eael-woo-collections-overlay' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_woo_collections_layout' => 'two'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_overlay_padding',
|
||||
[
|
||||
'label' => __('Overlay Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'default' => [
|
||||
'top' => '20',
|
||||
'right' => '20',
|
||||
'bottom' => '20',
|
||||
'left' => '20',
|
||||
'isLinked' => true,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-overlay' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_main_area_radius',
|
||||
[
|
||||
'label' => __('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'default' => [
|
||||
'top' => '5',
|
||||
'right' => '5',
|
||||
'bottom' => '5',
|
||||
'left' => '5',
|
||||
'isLinked' => true,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-layout-, {{WRAPPER}} .eael-woo-collections-layout-two' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
// 'condition' => [
|
||||
// 'eael_woo_collections_layout' => 'two'
|
||||
// ]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_woo_collections_main_area_border',
|
||||
'label' => __('Border', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-woo-collections-layout-two, {{WRAPPER}} .eael-woo-collections-layout-',
|
||||
// 'condition' => [
|
||||
// 'eael_woo_collections_layout' => 'two'
|
||||
// ]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_woo_collections_main_area_shadow',
|
||||
'label' => __('Shadow', 'essential-addons-elementor'),
|
||||
'selector' => '{{WRAPPER}} .eael-woo-collections-layout-two, {{WRAPPER}} .eael-woo-collections-layout-',
|
||||
// 'condition' => [
|
||||
// 'eael_woo_collections_layout' => 'two'
|
||||
// ]
|
||||
]
|
||||
);
|
||||
|
||||
// thumbnail style
|
||||
$this->add_control(
|
||||
'eael_woo_collections_thumbnail_heading_style',
|
||||
[
|
||||
'label' => __('Thumbnail Style', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_woo_collections_overlay_space',
|
||||
[
|
||||
'label' => __('Overlay Spacing', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-overlay' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_woo_collections_layout' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_overlay_bg',
|
||||
[
|
||||
'label' => __('Overlay Background', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#0000004d',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-overlay' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_woo_collections_layout' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_overlay_bg_hover',
|
||||
[
|
||||
'label' => __('Overlay Background Hover', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#00000080',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-overlay:hover' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_woo_collections_layout' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_overlay_radius',
|
||||
[
|
||||
'label' => __('Border Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-layout- .eael-woo-collections-overlay, {{WRAPPER}} .eael-woo-collections-layout-two > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_overlay_content_hr',
|
||||
[
|
||||
'label' => esc_html__('Horizontal Align', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'eael-woo-collections-overlay-left',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'eael-woo-collections-overlay-left' => esc_html__('Left', 'essential-addons-elementor'),
|
||||
'eael-woo-collections-overlay-center' => esc_html__('Center', 'essential-addons-elementor'),
|
||||
'eael-woo-collections-overlay-right' => esc_html__('Right', 'essential-addons-elementor'),
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_overlay_content_vr',
|
||||
[
|
||||
'label' => esc_html__('Vertical Align', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'eael-woo-collections-overlay-inner-bottom',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'eael-woo-collections-overlay-inner-top' => esc_html__('Top', 'essential-addons-elementor'),
|
||||
'eael-woo-collections-overlay-inner-middle' => esc_html__('Middle', 'essential-addons-elementor'),
|
||||
'eael-woo-collections-overlay-inner-bottom' => esc_html__('Bottom', 'essential-addons-elementor'),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_woo_collections_layout' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_content_alignment',
|
||||
[
|
||||
'label' => __('Content Alignment', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __('Left', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __('Center', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __('Right', 'essential-addons-elementor'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'toggle' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-overlay-inner' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_woo_collections_layout' => 'two'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_bg_hover_effect',
|
||||
[
|
||||
'label' => esc_html__('Image Hover Effect', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'eael-woo-collections-bg-hover-zoom-in',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'eael-woo-collections-bg-hover-none' => esc_html__('None', 'essential-addons-elementor'),
|
||||
'eael-woo-collections-bg-hover-zoom-in' => esc_html__('ZoomIn', 'essential-addons-elementor'),
|
||||
'eael-woo-collections-bg-hover-zoom-out' => esc_html__('ZoomOut', 'essential-addons-elementor'),
|
||||
'eael-woo-collections-bg-hover-blur' => esc_html__('Blur', 'essential-addons-elementor'),
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
/**
|
||||
* Style: General
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_woo_collections_section_style_typography',
|
||||
[
|
||||
'label' => esc_html__('Typography', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_woo_collections_title_typography',
|
||||
'label' => __('Title', 'essential-addons-elementor'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-woo-collections-overlay-inner h2',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_title_color',
|
||||
[
|
||||
'label' => __('Title Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-overlay-inner h2' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_title_color_hover',
|
||||
[
|
||||
'label' => __('Title Color Hover', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections:hover .eael-woo-collections-overlay-inner h2' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-woo-collections-layout-two .eael-woo-collections-overlay-inner h2:hover' => 'color: {{VALUE}}',
|
||||
],
|
||||
'separator' => 'after',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_woo_collections_span_typography',
|
||||
'label' => __('Subtitle', 'essential-addons-elementor'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-woo-collections-overlay-inner span',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_span_color',
|
||||
[
|
||||
'label' => __('Subtitle Color', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections-overlay-inner span' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_woo_collections_title_span_hover',
|
||||
[
|
||||
'label' => __('Subtitle Color Hover', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collections:hover .eael-woo-collections-overlay-inner span' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .eael-woo-collections-layout-two .eael-woo-collections-overlay-inner span:hover' => 'color: {{VALUE}}',
|
||||
],
|
||||
'separator' => 'after',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Badge Style
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_woo_collections_badge_style',
|
||||
[
|
||||
'label' => esc_html__('Badge', 'essential-addons-elementor'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'eael_woo_collections_is_show_badge' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_woo_collections_badge_padding',
|
||||
[
|
||||
'label' => __('Padding', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collection-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_woo_collections_badge_radius',
|
||||
[
|
||||
'label' => __('Radius', 'essential-addons-elementor'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collection-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_woo_collections_badge_background',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collection-badge' => 'background: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_woo_collections_badge_color',
|
||||
[
|
||||
'label' => __('Text Color', 'essential-addons-elementor'),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-woo-collection-badge' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
if (!apply_filters('eael/is_plugin_active', 'woocommerce/woocommerce.php')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$term = [];
|
||||
|
||||
if ($settings['eael_woo_collections_type'] == 'category' && $settings['eael_woo_collections_category']) {
|
||||
$term = get_term($settings['eael_woo_collections_category']);
|
||||
} else if ($settings['eael_woo_collections_type'] == 'tags' && $settings['eael_woo_collections_tags']) {
|
||||
$term = get_term($settings['eael_woo_collections_tags']);
|
||||
} else if ($settings['eael_woo_collections_type'] == 'attributes' && $settings['eael_woo_collections_attributes']) {
|
||||
$term = get_term($settings['eael_woo_collections_attributes']);
|
||||
}
|
||||
|
||||
$link = (!is_wp_error($term) && !empty($term)) ? get_term_link($term) : '#';
|
||||
$name = (!is_wp_error($term) && !empty($term)) ? $term->name : __('Collection Name', 'essential-addons-elementor');
|
||||
|
||||
$this->add_render_attribute('eael-woo-collections-bg', [
|
||||
'class' => ['eael-woo-collections-bg', $settings['eael_woo_collections_bg_hover_effect']],
|
||||
'src' => esc_url( $settings['eael_woo_collections_bg_img']['url'] ),
|
||||
'alt' => esc_attr(get_post_meta($settings['eael_woo_collections_bg_img']['id'], '_wp_attachment_image_alt', true)),
|
||||
]);
|
||||
|
||||
$badge = '';
|
||||
|
||||
if ( $settings['eael_woo_collections_is_show_badge'] == 'yes' && !empty($settings['eael_woo_collections_badge_label'])) {
|
||||
$badge = '<div class="eael-woo-collection-badge">'.$settings['eael_woo_collections_badge_label'].'</div>';
|
||||
}
|
||||
|
||||
echo '<div class="eael-woo-collections eael-woo-collections-layout-' . esc_attr( $settings['eael_woo_collections_layout'] ) . '">
|
||||
<a href="' . esc_url( $link ) . '">
|
||||
<img ' . $this->get_render_attribute_string('eael-woo-collections-bg') . '>
|
||||
<div class="eael-woo-collections-overlay ' . esc_attr( $settings['eael_woo_collections_overlay_content_hr'] ) . '">
|
||||
<div class="eael-woo-collections-overlay-inner ' . esc_attr( $settings['eael_woo_collections_overlay_content_vr'] ) . '">
|
||||
'. wp_kses( $badge, Helper::eael_allowed_tags() ) .'
|
||||
<span>' . sprintf(esc_html__('%s', 'essential-addons-elementor'), ($settings['eael_woo_collections_subtitle'] ?: '')) . '</span>
|
||||
<h2>' . sprintf(esc_html__('%s', 'essential-addons-elementor'), $name) . '</h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Advance Google Map Themes
|
||||
*
|
||||
* @return array google-map-themes
|
||||
*/
|
||||
return [
|
||||
'gstandard' => [
|
||||
'standard' => '[]',
|
||||
'silver' => '[{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]',
|
||||
'retro' => '[{"elementType":"geometry","stylers":[{"color":"#ebe3cd"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#523735"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f1e6"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#c9b2a6"}]},{"featureType":"administrative.land_parcel","elementType":"geometry.stroke","stylers":[{"color":"#dcd2be"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#ae9e90"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#93817c"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#a5b076"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#447530"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#f5f1e6"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#fdfcf8"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#f8c967"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#e9bc62"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#e98d58"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.stroke","stylers":[{"color":"#db8555"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#806b63"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"transit.line","elementType":"labels.text.fill","stylers":[{"color":"#8f7d77"}]},{"featureType":"transit.line","elementType":"labels.text.stroke","stylers":[{"color":"#ebe3cd"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#b9d3c2"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#92998d"}]}]',
|
||||
'dark' => '[{"elementType":"geometry","stylers":[{"color":"#212121"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#212121"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"color":"#757575"}]},{"featureType":"administrative.country","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#181818"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"poi.park","elementType":"labels.text.stroke","stylers":[{"color":"#1b1b1b"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"color":"#2c2c2c"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#8a8a8a"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#373737"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#3c3c3c"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#4e4e4e"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#3d3d3d"}]}]',
|
||||
'night' => '[{"elementType":"geometry","stylers":[{"color":"#242f3e"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#746855"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#242f3e"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#263c3f"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#6b9a76"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#38414e"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#212a37"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#9ca5b3"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#746855"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#1f2835"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#f3d19c"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#2f3948"}]},{"featureType":"transit.station","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#17263c"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#515c6d"}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"color":"#17263c"}]}]',
|
||||
'aubergine' => '[{"elementType":"geometry","stylers":[{"color":"#1d2c4d"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#8ec3b9"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#1a3646"}]},{"featureType":"administrative.country","elementType":"geometry.stroke","stylers":[{"color":"#4b6878"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#64779e"}]},{"featureType":"administrative.province","elementType":"geometry.stroke","stylers":[{"color":"#4b6878"}]},{"featureType":"landscape.man_made","elementType":"geometry.stroke","stylers":[{"color":"#334e87"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#023e58"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#283d6a"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#6f9ba5"}]},{"featureType":"poi","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#023e58"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#3C7680"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#304a7d"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#98a5be"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#2c6675"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#255763"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#b0d5ce"}]},{"featureType":"road.highway","elementType":"labels.text.stroke","stylers":[{"color":"#023e58"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#98a5be"}]},{"featureType":"transit","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"transit.line","elementType":"geometry.fill","stylers":[{"color":"#283d6a"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#3a4762"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#0e1626"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#4e6d70"}]}]'
|
||||
],
|
||||
'snazzymaps' => [
|
||||
'default' => '',
|
||||
'simple' => '[{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#6195a0"}]},{"featureType":"administrative.province","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"lightness":"0"},{"saturation":"0"},{"color":"#f5f5f2"},{"gamma":"1"}]},{"featureType":"landscape.man_made","elementType":"all","stylers":[{"lightness":"-3"},{"gamma":"1.00"}]},{"featureType":"landscape.natural.terrain","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#bae5ce"},{"visibility":"on"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45},{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#fac9a9"},{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"labels.text","stylers":[{"color":"#4e4e4e"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#787878"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"transit.station.airport","elementType":"labels.icon","stylers":[{"hue":"#0a00ff"},{"saturation":"-77"},{"gamma":"0.57"},{"lightness":"0"}]},{"featureType":"transit.station.rail","elementType":"labels.text.fill","stylers":[{"color":"#43321e"}]},{"featureType":"transit.station.rail","elementType":"labels.icon","stylers":[{"hue":"#ff6c00"},{"lightness":"4"},{"gamma":"0.75"},{"saturation":"-68"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#eaf6f8"},{"visibility":"on"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#c7eced"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"lightness":"-49"},{"saturation":"-53"},{"gamma":"0.79"}]}]',
|
||||
'colorful' => '[{"featureType":"all","elementType":"all","stylers":[{"color":"#ff7000"},{"lightness":"69"},{"saturation":"100"},{"weight":"1.17"},{"gamma":"2.04"}]},{"featureType":"all","elementType":"geometry","stylers":[{"color":"#cb8536"}]},{"featureType":"all","elementType":"labels","stylers":[{"color":"#ffb471"},{"lightness":"66"},{"saturation":"100"}]},{"featureType":"all","elementType":"labels.text.fill","stylers":[{"gamma":0.01},{"lightness":20}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"saturation":-31},{"lightness":-33},{"weight":2},{"gamma":0.8}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"all","stylers":[{"lightness":"-8"},{"gamma":"0.98"},{"weight":"2.45"},{"saturation":"26"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"lightness":30},{"saturation":30}]},{"featureType":"poi","elementType":"geometry","stylers":[{"saturation":20}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"lightness":20},{"saturation":-20}]},{"featureType":"road","elementType":"geometry","stylers":[{"lightness":10},{"saturation":-30}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"saturation":25},{"lightness":25}]},{"featureType":"water","elementType":"all","stylers":[{"lightness":-20},{"color":"#ecc080"}]}]',
|
||||
'complex' => '[{"elementType":"geometry","stylers":[{"hue":"#ff4400"},{"saturation":-68},{"lightness":-4},{"gamma":0.72}]},{"featureType":"road","elementType":"labels.icon"},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"hue":"#0077ff"},{"gamma":3.1}]},{"featureType":"water","stylers":[{"hue":"#00ccff"},{"gamma":0.44},{"saturation":-33}]},{"featureType":"poi.park","stylers":[{"hue":"#44ff00"},{"saturation":-23}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"hue":"#007fff"},{"gamma":0.77},{"saturation":65},{"lightness":99}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"gamma":0.11},{"weight":5.6},{"saturation":99},{"hue":"#0091ff"},{"lightness":-86}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"lightness":-48},{"hue":"#ff5e00"},{"gamma":1.2},{"saturation":-23}]},{"featureType":"transit","elementType":"labels.text.stroke","stylers":[{"saturation":-64},{"hue":"#ff9100"},{"lightness":16},{"gamma":0.47},{"weight":2.7}]}]',
|
||||
'dark' => '[{"stylers":[{"hue":"#ff1a00"},{"invert_lightness":true},{"saturation":-100},{"lightness":33},{"gamma":0.5}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#2D333C"}]}]',
|
||||
'greyscale' => '[{"featureType":"administrative","elementType":"all","stylers":[{"saturation":"-100"}]},{"featureType":"administrative.province","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"all","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","elementType":"all","stylers":[{"saturation":-100},{"lightness":"50"},{"visibility":"simplified"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":"-100"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"all","stylers":[{"lightness":"30"}]},{"featureType":"road.local","elementType":"all","stylers":[{"lightness":"40"}]},{"featureType":"transit","elementType":"all","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]},{"featureType":"water","elementType":"labels","stylers":[{"lightness":-25},{"saturation":-100}]}]',
|
||||
'light' => '[{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#6195a0"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#e6f3d6"},{"visibility":"on"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45},{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#f4d2c5"},{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"labels.text","stylers":[{"color":"#4e4e4e"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#f4f4f4"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#787878"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#eaf6f8"},{"visibility":"on"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#eaf6f8"}]}]',
|
||||
'monochrome' => '[{"featureType":"administrative.locality","elementType":"all","stylers":[{"hue":"#2c2e33"},{"saturation":7},{"lightness":19},{"visibility":"on"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"simplified"}]},{"featureType":"poi","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"on"}]},{"featureType":"road.arterial","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":-2},{"visibility":"simplified"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"hue":"#e9ebed"},{"saturation":-90},{"lightness":-8},{"visibility":"simplified"}]},{"featureType":"transit","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":10},{"lightness":69},{"visibility":"on"}]},{"featureType":"water","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":-78},{"lightness":67},{"visibility":"simplified"}]}]',
|
||||
'nolabels' => '[{"elementType":"labels","stylers":[{"visibility":"off"},{"color":"#f49f53"}]},{"featureType":"landscape","stylers":[{"color":"#f9ddc5"},{"lightness":-7}]},{"featureType":"road","stylers":[{"color":"#813033"},{"lightness":43}]},{"featureType":"poi.business","stylers":[{"color":"#645c20"},{"lightness":38}]},{"featureType":"water","stylers":[{"color":"#1994bf"},{"saturation":-69},{"gamma":0.99},{"lightness":43}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"color":"#f19f53"},{"weight":1.3},{"visibility":"on"},{"lightness":16}]},{"featureType":"poi.business"},{"featureType":"poi.park","stylers":[{"color":"#645c20"},{"lightness":39}]},{"featureType":"poi.school","stylers":[{"color":"#a95521"},{"lightness":35}]},{},{"featureType":"poi.medical","elementType":"geometry.fill","stylers":[{"color":"#813033"},{"lightness":38},{"visibility":"off"}]},{},{},{},{},{},{},{},{},{},{},{},{"elementType":"labels"},{"featureType":"poi.sports_complex","stylers":[{"color":"#9e5916"},{"lightness":32}]},{},{"featureType":"poi.government","stylers":[{"color":"#9e5916"},{"lightness":46}]},{"featureType":"transit.station","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","stylers":[{"color":"#813033"},{"lightness":22}]},{"featureType":"transit","stylers":[{"lightness":38}]},{"featureType":"road.local","elementType":"geometry.stroke","stylers":[{"color":"#f19f53"},{"lightness":-10}]},{},{},{}]',
|
||||
'twotone' => '[{"stylers":[{"hue":"#007fff"},{"saturation":89}]},{"featureType":"water","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative.country","elementType":"labels","stylers":[{"visibility":"off"}]}]',
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user