first commit
This commit is contained in:
@@ -0,0 +1,975 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Advanced_Accordion
|
||||
* Name: Advanced Accordion
|
||||
* Slug: advanced-accordion
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use Elementor\Core\Base\Document;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Repeater;
|
||||
use Stratum\Managers\Ajax_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Advanced_Accordion extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'advanced-accordion';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Advanced Accordion', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [ 'accordion', 'content', 'template' ];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-advanced-accordion';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$background_color = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color']) ? get_option( 'stratum_style' )['background_color'] : '') : '#71d7f7';
|
||||
$background_color_active = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color_active']) ? get_option( 'stratum_style' )['background_color_active'] : '') : '#0097c6';
|
||||
$background_color_hover = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color_hover']) ? get_option( 'stratum_style' )['background_color_hover'] : '') : '#008fbc';
|
||||
|
||||
$document_types = Plugin::instance()->documents->get_document_types( [
|
||||
'show_in_library' => true,
|
||||
] );
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'accordion_type',
|
||||
[
|
||||
'label' => esc_html__('Accordion Type', 'stratum'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'accordion',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'accordion' => esc_html__('Accordion', 'stratum'),
|
||||
'toggle' => esc_html__('Toggle', 'stratum'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'accordion_collapsible',
|
||||
[
|
||||
'label' => esc_html__( 'Collapsible', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'accordion_type' => 'accordion'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'accordion_interactivity',
|
||||
[
|
||||
'label' => esc_html__( 'Interactivity', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'click',
|
||||
'options' => [
|
||||
'click' => esc_html__( 'Click', 'stratum' ),
|
||||
'mouseenter' => esc_html__( 'Hover', 'stratum' )
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet.', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->start_controls_tabs( 'title_icon_styles' );
|
||||
|
||||
$repeater->start_controls_tab(
|
||||
'title_icon_tab',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->start_controls_tab(
|
||||
'title_icon_active_tab',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_icon_active',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->end_controls_tabs();
|
||||
|
||||
$repeater->add_control(
|
||||
'content_type',
|
||||
[
|
||||
'label' => esc_html__('Content Type', 'stratum'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'text',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'text' => esc_html__('Text', 'stratum'),
|
||||
'template' => esc_html__('Template', 'stratum'),
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'text',
|
||||
[
|
||||
'label' => esc_html__( 'Text', 'stratum' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'content_type' => 'text'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'accordion_template',
|
||||
[
|
||||
'label' => esc_html__('Template', 'stratum'),
|
||||
'type' => Stratum_AJAX_Control::QUERY,
|
||||
'label_block' => true,
|
||||
'multiple' => false,
|
||||
'ajax_route' => 'stratum_get_elementor_templates',
|
||||
'autocomplete' => [
|
||||
'object' => 'library_template',
|
||||
'query' => [
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => Document::TYPE_META_KEY,
|
||||
'value' => array_keys( $document_types ),
|
||||
'compare' => 'IN',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'options' => Ajax_Manager::stratum_get_elementor_templates(),
|
||||
'condition' => [
|
||||
'content_type' => 'template'
|
||||
],
|
||||
'description' => esc_html__( 'Here you can see sections you saved as templates.', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'manage_templates',
|
||||
[
|
||||
'label' => esc_html__( 'Manage Templates', 'stratum' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::BUTTON,
|
||||
'button_type' => 'success',
|
||||
'text' => esc_html__( 'Library', 'stratum' ),
|
||||
'event' => 'stratum:OpenTemplatesLibrary',
|
||||
'condition' => [
|
||||
'content_type' => 'template'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'active',
|
||||
[
|
||||
'label' => esc_html__( 'Unfolded by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'accordion_items',
|
||||
[
|
||||
'label' => esc_html__( 'Accordion items', 'stratum' ),
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ title }}}',
|
||||
'show_label' => true,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'active' => 'yes'
|
||||
],
|
||||
[
|
||||
'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'active' => 'no'
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'General Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'equal_height',
|
||||
[
|
||||
'label' => esc_html__( 'Equal container height', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'accordion_type' => 'accordion'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing between items', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 1,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'accordion_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Items Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'accordion_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Items Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'accordion_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'accordion_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'accordion_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'accordion_shadow',
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Expand icon style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_position',
|
||||
[
|
||||
'label' => esc_html__( 'Icon position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'right',
|
||||
'prefix_class' => 'stratum-advanced-accordion-icons-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 16,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__expand-icon' => 'font-size: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__expand-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}.stratum-advanced-accordion-icons-position-left .stratum-advanced-accordion .stratum-advanced-accordion__expand-icon' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}}.stratum-advanced-accordion-icons-position-right .stratum-advanced-accordion .stratum-advanced-accordion__expand-icon' => 'margin-left: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'expand_icon_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'expand_icon_tab',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header .stratum-advanced-accordion__expand-icon .normal' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-chevron-right',
|
||||
'library' => 'solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'expand_icon_active_tab',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon_active_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header .stratum-advanced-accordion__expand-icon .active' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon_active',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-chevron-down',
|
||||
'library' => 'solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'expand_icon_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header:hover .stratum-advanced-accordion__expand-icon span' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_header',
|
||||
[
|
||||
'label' => esc_html__( 'Header style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'title_align',
|
||||
[
|
||||
'label' => esc_html__( 'Title Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'header_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'header_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'header_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 16,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title-icon i' => 'font-size: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title-icon' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'header_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'header_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'header_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'header_shadow',
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'header_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'header_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header .stratum-advanced-accordion__title-icon .normal' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_header_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item .stratum-advanced-accordion__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_header_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item .stratum-advanced-accordion__item-header' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'active_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_active_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header .stratum-advanced-accordion__title-icon .active' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_active_header_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item.active-accordion .stratum-advanced-accordion__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_active_header_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color_active,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item.active-accordion .stratum-advanced-accordion__item-header' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'header_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header:hover .stratum-advanced-accordion__title-icon span' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_header_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item .stratum-advanced-accordion__item-header:hover .stratum-advanced-accordion__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_header_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color_hover,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item .stratum-advanced-accordion__item-header:hover' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-content .stratum-advanced-accordion__text' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'content_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-content .stratum-advanced-accordion__text',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'content_background',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_background_overlay',
|
||||
[
|
||||
'label' => esc_html__( 'Background Overlay', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-content-overlay' => 'background-color: {{VALUE}};'
|
||||
],
|
||||
'condition' => [
|
||||
'content_background_image[id]!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'render_type' => 'template',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'render_type' => 'template',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'content_border',
|
||||
'separator' => 'before',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper',
|
||||
'render_type' => 'template',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'content_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'content_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Advanced_Accordion() );
|
||||
@@ -0,0 +1,800 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Advanced_Google_Map
|
||||
* Name: Advanced Google Map
|
||||
* Slug: advanced-google-map
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Advanced_Google_Map extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'advanced-google-map';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Advanced Google Map', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-advanced-google-map';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'google-map-api',
|
||||
'google-map-styles'
|
||||
];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'general_settings',
|
||||
[
|
||||
'label' => esc_html__( 'General Settings', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_type_setup',
|
||||
[
|
||||
'label' => esc_html__( 'Google Map Type', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'single',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'single' => esc_html__( 'Single', 'stratum' ),
|
||||
'multiple' => esc_html__( 'Multiple Marker', 'stratum' )
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'interaction',
|
||||
[
|
||||
'label' => esc_html__( 'Zoom & Pan Interaction', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'cooperative',
|
||||
'label_block' => false,
|
||||
'separator' => 'after',
|
||||
'description' => esc_html__( 'These options are applied on frontend only.', 'stratum' ),
|
||||
'options' => [
|
||||
'cooperative' => esc_html__( 'Prevent zoom on page scroll', 'stratum' ),
|
||||
'greedy' => esc_html__( 'Enable zoom and pan', 'stratum' ),
|
||||
'none' => esc_html__( ' Disable zoom and pan' , 'stratum' )
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'zoom_level',
|
||||
[
|
||||
'label' => esc_html__( 'Zoom Level', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 2,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 1,
|
||||
'max' => 22
|
||||
]
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_lat',
|
||||
[
|
||||
'label' => esc_html__( 'Center Latitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => false,
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true,
|
||||
'default' => esc_html__( '48.208174', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_lng',
|
||||
[
|
||||
'label' => esc_html__( 'Center Longitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => false,
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true,
|
||||
'default' => esc_html__( '16.373819', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Map Marker Settings Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Map Settings (With Marker only for single)
|
||||
*/
|
||||
$controls->start_controls_section(
|
||||
'map_marker_section',
|
||||
[
|
||||
'label' => esc_html__( 'Map Marker Settings', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Marker', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Type your title here...', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_type_setup',
|
||||
[
|
||||
'label' => esc_html__( 'Address Type', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'address' => [
|
||||
'title' => esc_html__( 'Address', 'stratum' ),
|
||||
'icon' => 'fa fa-map'
|
||||
],
|
||||
'coordinates' => [
|
||||
'title' => esc_html__( 'Coordinates', 'stratum' ),
|
||||
'icon' => 'fa fa-map-marker'
|
||||
]
|
||||
],
|
||||
'default' => 'coordinates',
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_geo_address',
|
||||
[
|
||||
'label' => esc_html__( 'Geo Address', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Wien, Austria', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single'],
|
||||
'marker_type_setup' => ['address']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_lat',
|
||||
[
|
||||
'label' => esc_html__( 'Marker Latitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '48.208174', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single'],
|
||||
'marker_type_setup' => ['coordinates']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_lng',
|
||||
[
|
||||
'label' => esc_html__( 'Marker Longitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '16.373819', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single'],
|
||||
'marker_type_setup' => ['coordinates']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Type your content here...', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'is_open_popup',
|
||||
[
|
||||
'label' => esc_html__( 'Opened by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No' , 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'popup_max_width',
|
||||
[
|
||||
'label' => esc_html__( 'Popup Width', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'label_block' => false,
|
||||
'default' => 250,
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'use_custom_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Use Custom Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No' , 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes'
|
||||
],
|
||||
'default' => [ 'url' => '' ],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_icon_width',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 32,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes',
|
||||
'marker_icon[url]!' => ''
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_icon_height',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Height', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 32,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes',
|
||||
'marker_icon[url]!' => ''
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/**
|
||||
* Map Settings (With Markers only for Multiple)
|
||||
*/
|
||||
$controls->start_controls_section(
|
||||
'map_markers_section',
|
||||
[
|
||||
'label' => esc_html__( 'Map Marker Settings', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['multiple']
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater = new Repeater();
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Marker', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Type your title here...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_lat',
|
||||
[
|
||||
'label' => esc_html__( 'Marker Latitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '48.208174', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_lng',
|
||||
[
|
||||
'label' => esc_html__( 'Marker Longitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '16.373819', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Type your content here...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'is_open_popup',
|
||||
[
|
||||
'label' => esc_html__( 'Opened by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'popup_max_width',
|
||||
[
|
||||
'label' => esc_html__( 'Popup Width', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'label_block' => false,
|
||||
'default' => 250
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'use_custom_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Use Custom Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes'
|
||||
],
|
||||
'default' => [ 'url' => '' ]
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_icon_width',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 32,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes',
|
||||
'marker_icon[url]!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_icon_height',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Height', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 32,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes',
|
||||
'marker_icon[url]!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'markers',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '<i class="fa fa-map-marker" aria-hidden="true"></i> {{{ marker_title }}}',
|
||||
'default' => [
|
||||
[ 'marker_title' => esc_html__( 'Marker', 'stratum' ) ]
|
||||
],
|
||||
'item_actions' => [ 'sort' => false ],
|
||||
'fields' => $markersRepeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'map_controls',
|
||||
[
|
||||
'label' => esc_html__( 'Map Controls', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'street_view_control',
|
||||
[
|
||||
'label' => esc_html__( 'Street View Controls', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_type_control',
|
||||
[
|
||||
'label' => esc_html__( 'Map Type Control', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'zoom_control',
|
||||
[
|
||||
'label' => esc_html__( 'Zoom Control', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'fullscreen_control',
|
||||
[
|
||||
'label' => esc_html__( 'Fullscreen Control', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Map Marker Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_map_style_controls',
|
||||
[
|
||||
'label' => esc_html__( 'General Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'map_height',
|
||||
[
|
||||
'label' => esc_html__( 'Height', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 480,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'size_units' => [ 'px' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1400,
|
||||
'step' => 10
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-google-map__container' => 'height: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'render_type' => 'ui'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'map_theme',
|
||||
[
|
||||
'label' => esc_html__( 'Map Theme', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_theme_source',
|
||||
[
|
||||
'label' => esc_html__( 'Theme Source', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'standard' => [
|
||||
'title' => esc_html__( 'Google Standard', 'stratum' ),
|
||||
'icon' => 'fa fa-map'
|
||||
],
|
||||
'snazzymaps' => [
|
||||
'title' => esc_html__( 'Snazzy Maps', 'stratum' ),
|
||||
'icon' => 'fa fa-map-marker'
|
||||
],
|
||||
'custom' => [
|
||||
'title' => esc_html__( 'Custom', 'stratum' ),
|
||||
'icon' => 'fa fa-edit'
|
||||
]
|
||||
],
|
||||
'default' => 'standard',
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_standards_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Google Themes', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'standard',
|
||||
'options' => [
|
||||
'standard' => esc_html__( 'Standard' , 'stratum' ),
|
||||
'silver' => esc_html__( 'Silver' , 'stratum' ),
|
||||
'retro' => esc_html__( 'Retro' , 'stratum' ),
|
||||
'dark' => esc_html__( 'Dark' , 'stratum' ),
|
||||
'night' => esc_html__( 'Night' , 'stratum' ),
|
||||
'aubergine' => esc_html__( 'Aubergine' , 'stratum' )
|
||||
],
|
||||
'description' => sprintf( '<a href="https://mapstyle.withgoogle.com/" target="_blank">%1$s</a> %2$s', esc_html__( 'Click here', 'stratum' ), esc_html__( 'to generate your own theme and use JSON within a Custom style field.', 'stratum' ) ),
|
||||
'condition' => [
|
||||
'map_theme_source' => 'standard'
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_snazzy_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Snazzy Maps Themes', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'label_block' => true,
|
||||
'default' => 'blueWater',
|
||||
'options' => [
|
||||
'blueWater' => esc_html__( 'Blue Water' , 'stratum' ),
|
||||
'ultraLight' => esc_html__( 'Ultra Light' , 'stratum' ),
|
||||
'silverFox' => esc_html__( 'Silver Fox' , 'stratum' ),
|
||||
'shadesOfGrey' => esc_html__( 'Shades of Grey', 'stratum' ),
|
||||
'noLabels' => esc_html__( 'No Labels' , 'stratum' ),
|
||||
'trekWild' => esc_html__( 'Trek Wild' , 'stratum' ),
|
||||
'vintage' => esc_html__( 'Vintage' , 'stratum' ),
|
||||
'wireframe' => esc_html__( 'Wireframe' , 'stratum' ),
|
||||
'lightDream' => esc_html__( 'Light Dream' , 'stratum' )
|
||||
],
|
||||
'description' => sprintf( '<a href="https://snazzymaps.com/explore" target="_blank">%1$s</a> %2$s', esc_html__( 'Click here', 'stratum' ), esc_html__( 'to explore more themes and use JSON within a custom style field.', 'stratum' ) ),
|
||||
'condition' => [
|
||||
'map_theme_source'=> 'snazzymaps'
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_custom_style',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Style', 'stratum' ),
|
||||
'description' => sprintf( '<a href="https://mapstyle.withgoogle.com/" target="_blank">%1$s</a> %2$s', esc_html__( 'Click here', 'stratum' ), esc_html__( 'to get JSON style code to style your map', 'stratum' ) ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'condition' => [
|
||||
'map_theme_source' => 'custom'
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
|
||||
public function get_single_marker_option($marker) {
|
||||
$single_options = [
|
||||
'markerTitle' => $marker[ 'marker_title' ],
|
||||
'markerContent' => $marker[ 'marker_content' ],
|
||||
'popupMaxWidth' => $marker[ 'popup_max_width' ],
|
||||
'isOpenPopup' => !empty( $marker[ 'is_open_popup' ] ) ? true : false
|
||||
];
|
||||
if ( $marker[ 'use_custom_icon' ] ) {
|
||||
$custom_icon = [
|
||||
'markerIcon' => $marker[ 'marker_icon' ],
|
||||
'markerIconWidth' => $marker[ 'marker_icon_width' ],
|
||||
'markerIconHeight' => $marker[ 'marker_icon_height' ]
|
||||
];
|
||||
$single_options[ 'customIcon' ] = $custom_icon;
|
||||
}
|
||||
return $single_options;
|
||||
}
|
||||
|
||||
public function get_markers_options($settings) {
|
||||
$map_markers_amount = $settings[ 'map_type_setup' ];
|
||||
if ( $map_markers_amount == 'multiple' ) {
|
||||
|
||||
$markers_options = [];
|
||||
foreach ( $settings[ 'markers' ] as $marker ) {
|
||||
$marker_coords = [
|
||||
'markerLat' => $marker[ 'marker_lat' ],
|
||||
'markerLng' => $marker[ 'marker_lng' ]
|
||||
];
|
||||
|
||||
$marker_options = $this->get_single_marker_option( $marker );
|
||||
$markers_options []= array_merge( $marker_options, $marker_coords );
|
||||
}
|
||||
return $markers_options;
|
||||
} else {
|
||||
$marker_options = [];
|
||||
|
||||
$type_setup = $settings[ 'marker_type_setup' ];
|
||||
if ( $type_setup == 'coordinates' ) {
|
||||
|
||||
$marker_coords = [
|
||||
'markerLat' => $settings[ 'marker_lat' ],
|
||||
'markerLng' => $settings[ 'marker_lng' ]
|
||||
];
|
||||
|
||||
$marker_options []= array_merge( $marker_coords, $this->get_single_marker_option( $settings ) );
|
||||
} else {
|
||||
$geo = [ 'mapGeoAddress' => $settings[ 'map_geo_address' ] ];
|
||||
$marker_options []= array_merge( $geo, $this->get_single_marker_option( $settings ) );
|
||||
}
|
||||
return $marker_options;
|
||||
}
|
||||
}
|
||||
|
||||
public function set_map_theme_style($settings) {
|
||||
$theme_source = $settings[ 'map_theme_source' ];
|
||||
$standards_styles = $settings[ 'map_standards_styles' ];
|
||||
$snazzy_styles = $settings[ 'map_snazzy_styles' ];
|
||||
|
||||
if ( $theme_source == 'standard' ) {
|
||||
return $standards_styles;
|
||||
} else if ( $theme_source == 'snazzymaps' ) {
|
||||
return $snazzy_styles;
|
||||
} else {
|
||||
return json_decode(strip_tags(
|
||||
$settings[ 'map_custom_style' ]
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Advanced_Google_Map() );
|
||||
2487
wp-content/plugins/stratum/includes/widgets/advanced-posts.php
Normal file
2487
wp-content/plugins/stratum/includes/widgets/advanced-posts.php
Normal file
File diff suppressed because it is too large
Load Diff
1326
wp-content/plugins/stratum/includes/widgets/advanced-slider.php
Normal file
1326
wp-content/plugins/stratum/includes/widgets/advanced-slider.php
Normal file
File diff suppressed because it is too large
Load Diff
999
wp-content/plugins/stratum/includes/widgets/advanced-tabs.php
Normal file
999
wp-content/plugins/stratum/includes/widgets/advanced-tabs.php
Normal file
@@ -0,0 +1,999 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Advanced_Tabs
|
||||
* Name: Advanced Tabs
|
||||
* Slug: advanced-tabs
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use Elementor\Core\Base\Document;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Repeater;
|
||||
use Stratum\Managers\Ajax_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Advanced_Tabs extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'advanced-tabs';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Advanced Tabs', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [ 'tabs', 'content', 'template' ];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-advanced-tabs';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$background_color = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color']) ? get_option( 'stratum_style' )['background_color'] : '') : '#71d7f7';
|
||||
$background_color_active = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color_active']) ? get_option( 'stratum_style' )['background_color_active'] : '') : '#0097c6';
|
||||
$background_color_hover = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color_hover']) ? get_option( 'stratum_style' )['background_color_hover'] : '') : '#008fbc';
|
||||
|
||||
$document_types = Plugin::instance()->documents->get_document_types( [
|
||||
'show_in_library' => true,
|
||||
] );
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tabs_layout',
|
||||
[
|
||||
'label' => esc_html__('Tabs Layout', 'stratum'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'horizontal',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'horizontal' => esc_html__('Horizontal', 'stratum'),
|
||||
'vertical' => esc_html__('Vertical', 'stratum'),
|
||||
'icon_box' => esc_html__('Icon Box', 'stratum'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tabs_interactivity',
|
||||
[
|
||||
'label' => esc_html__( 'Interactivity', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'click',
|
||||
'options' => [
|
||||
'click' => esc_html__( 'Click', 'stratum' ),
|
||||
'mouseenter' => esc_html__( 'Hover', 'stratum' )
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'tab_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Title', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tab_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-home',
|
||||
'library' => 'solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'content_type',
|
||||
[
|
||||
'label' => esc_html__('Content Type', 'stratum'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'text',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'text' => esc_html__('Text', 'stratum'),
|
||||
'template' => esc_html__('Template', 'stratum'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tab_text',
|
||||
[
|
||||
'label' => esc_html__( 'Text', 'stratum' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'content_type' => 'text'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tab_template',
|
||||
[
|
||||
'label' => esc_html__('Template', 'stratum'),
|
||||
'type' => Stratum_AJAX_Control::QUERY,
|
||||
'label_block' => true,
|
||||
'multiple' => false,
|
||||
'ajax_route' => 'stratum_get_elementor_templates',
|
||||
'autocomplete' => [
|
||||
'object' => 'library_template',
|
||||
'query' => [
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => Document::TYPE_META_KEY,
|
||||
'value' => array_keys( $document_types ),
|
||||
'compare' => 'IN',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'options' => Ajax_Manager::stratum_get_elementor_templates(),
|
||||
'condition' => [
|
||||
'content_type' => 'template'
|
||||
],
|
||||
'description' => esc_html__( 'Here you can see sections you saved as templates.', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'manage_templates',
|
||||
[
|
||||
'label' => esc_html__( 'Manage Templates', 'stratum' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::BUTTON,
|
||||
'button_type' => 'success',
|
||||
'text' => esc_html__( 'Library', 'stratum' ),
|
||||
'event' => 'stratum:OpenTemplatesLibrary',
|
||||
'condition' => [
|
||||
'content_type' => 'template'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'active',
|
||||
[
|
||||
'label' => esc_html__( 'Active by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tabs_items',
|
||||
[
|
||||
'label' => esc_html__( 'Tab items', 'stratum' ),
|
||||
'title_field' => '<i class="{{ tab_icon.value }}" aria-hidden="true"></i> {{{ tab_title }}}',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'show_label' => true,
|
||||
'default' => [
|
||||
[
|
||||
'text' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 1 )
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_navigation_panel',
|
||||
[
|
||||
'label' => esc_html__( 'Navigation Panel Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_panel_width',
|
||||
[
|
||||
'label' => esc_html__( 'Navigation Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
],
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 500,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => '15',
|
||||
'unit' => '%',
|
||||
],
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs.tabs-layout-vertical .stratum-advanced-tabs__navigation' => 'min-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => ['vertical']
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tabs_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing between tabs', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 5,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs.tabs-layout-horizontal .stratum-advanced-tabs__navigation-item:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-tabs.tabs-layout-vertical .stratum-advanced-tabs__navigation-item:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-tabs.tabs-layout-icon_box .stratum-advanced-tabs__navigation-item:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_postion_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'top',
|
||||
'prefix_class' => 'stratum-advanced-tabs-nav-horizontal-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'equal_height' => 'yes',
|
||||
'tabs_layout' => ['horizontal', 'icon_box']
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_postion_vertical',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'prefix_class' => 'stratum-advanced-tabs-nav-vertical-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => 'vertical'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_align_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'prefix_class' => 'stratum-advanced-tabs-nav-horizontal-align-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
'stretch' => [
|
||||
'title' => esc_html__( 'Stretch', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-stretch',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => ['horizontal', 'icon_box']
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_align_vertical',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'top',
|
||||
'prefix_class' => 'stratum-advanced-tabs-nav-vertical-align-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'middle' => [
|
||||
'title' => esc_html__( 'Middle', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-middle',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
'stretch' => [
|
||||
'title' => esc_html__( 'Stretch', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-stretch',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => 'vertical'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_panel_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_panel_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'nav_panel_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_panel_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'nav_panel_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'nav_panel_shadow',
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_navigation_items',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'nav_items_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__title',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_items_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_items_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'nav_items_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_items_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'nav_items_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'nav_items_shadow',
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'nav_items_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'nav_items_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_nav_items_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_nav_items_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'active_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_active_nav_items_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item.active-nav' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_active_nav_items_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color_active,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item.active-nav' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'nav_items_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_nav_items_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item:hover' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_nav_items_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color_hover,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item:hover' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_position_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Icon position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'prefix_class' => 'stratum-advanced-tabs-icons-horizontal-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => ['horizontal', 'vertical']
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_position_vertical',
|
||||
[
|
||||
'label' => esc_html__( 'Icon position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'top',
|
||||
'prefix_class' => 'stratum-advanced-tabs-icons-vertical-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => 'icon_box'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 16,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__icon i' => 'font-size: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__icon svg' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}.stratum-advanced-tabs-icons-horizontal-position-left .stratum-advanced-tabs .stratum-advanced-tabs__icon' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}}.stratum-advanced-tabs-icons-horizontal-position-right .stratum-advanced-tabs .stratum-advanced-tabs__icon' => 'margin-left: {{SIZE}}{{UNIT}}',
|
||||
|
||||
'{{WRAPPER}}.stratum-advanced-tabs-icons-vertical-position-top .stratum-advanced-tabs .stratum-advanced-tabs__icon' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}}.stratum-advanced-tabs-icons-vertical-position-bottom .stratum-advanced-tabs .stratum-advanced-tabs__icon' => 'margin-top: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'icons_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'icon_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item .stratum-advanced-tabs__icon' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'icon_active',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_active_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item.active-nav .stratum-advanced-tabs__icon' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'icon_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item:hover .stratum-advanced-tabs__icon' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'none',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None', 'stratum' ),
|
||||
'slide' => esc_html__( 'Slide', 'stratum' ),
|
||||
'fade' => esc_html__( 'Fade', 'stratum' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'equal_height',
|
||||
[
|
||||
'label' => esc_html__( 'Equal container height', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_control(
|
||||
'custom_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content-item .stratum-advanced-tabs__text' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'content_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content-item .stratum-advanced-tabs__text',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'content_background',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_background_overlay',
|
||||
[
|
||||
'label' => esc_html__( 'Background Overlay', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content-overlay' => 'background-color: {{VALUE}};'
|
||||
],
|
||||
'condition' => [
|
||||
'content_background_image[id]!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'content_border',
|
||||
'separator' => 'before',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'content_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'content_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Advanced_Tabs() );
|
||||
553
wp-content/plugins/stratum/includes/widgets/banner.php
Normal file
553
wp-content/plugins/stratum/includes/widgets/banner.php
Normal file
@@ -0,0 +1,553 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Banner
|
||||
* Name: Banner
|
||||
* Slug: stratum-banner
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Banner extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'banner';
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Banner', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-banner';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
//Colors
|
||||
$theme_colors_first_color = '#080808';
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'background_type' => 'image'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes(),
|
||||
'condition' => [
|
||||
'background_type' => 'image'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'hosted_url',
|
||||
[
|
||||
'label' => esc_html__( 'Choose File', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'media_type' => 'video',
|
||||
'condition' => [
|
||||
'background_type' => 'video'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_type',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Background Type', 'stratum' ),
|
||||
'default' => 'image',
|
||||
'options' => [
|
||||
'image' => esc_html__( 'Image', 'stratum' ),
|
||||
'video' => esc_html__( 'Video', 'stratum' )
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Title', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Paste URL or type to search', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'link_target',
|
||||
[
|
||||
'label' => esc_html__( 'Open link in new window', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => '_blank',
|
||||
'condition' => [
|
||||
'link!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'link_rel',
|
||||
[
|
||||
'label' => esc_html__( 'Add nofollow', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'nofollow',
|
||||
'condition' => [
|
||||
'link!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'height',
|
||||
[
|
||||
'label' => esc_html__( 'Banner Height', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper' => 'height: {{VALUE}}px;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'block_paddings',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner .stratum-banner__content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_control(
|
||||
'animation_effect',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'aries',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None' , 'stratum' ),
|
||||
'aries' => esc_html__( 'Aries' , 'stratum' ),
|
||||
'taurus' => esc_html__( 'Taurus', 'stratum' ),
|
||||
'gemini' => esc_html__( 'Gemini', 'stratum' ),
|
||||
'cancer' => esc_html__( 'Cancer', 'stratum' ),
|
||||
'leo' => esc_html__( 'Leo' , 'stratum' ),
|
||||
'virgo' => esc_html__( 'Virgo' , 'stratum' )
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text_animation_effect',
|
||||
[
|
||||
'label' => esc_html__( 'Text Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'none',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None' , 'stratum' ),
|
||||
'opacity' => esc_html__( 'Fade In' , 'stratum' ),
|
||||
'opacity-top' => esc_html__( 'Fade In Up' , 'stratum' ),
|
||||
'opacity-bottom' => esc_html__( 'Fade In Down' , 'stratum' ),
|
||||
'opacity-left' => esc_html__( 'Fade In Left' , 'stratum' ),
|
||||
'opacity-right' => esc_html__( 'Fade In Right', 'stratum' ),
|
||||
'opacity-zoom-in' => esc_html__( 'Zoom In' , 'stratum' ),
|
||||
'opacity-zoom-out' => esc_html__( 'Zoom Out' , 'stratum' )
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'title_align',
|
||||
[
|
||||
'label' => esc_html__( 'Title Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner .stratum-banner__title' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-banner__title',
|
||||
'label' => esc_html__( 'Title Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'title!' => ''
|
||||
],
|
||||
'defaults' => [
|
||||
'html_tag' => 'h5',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_width',
|
||||
[
|
||||
'label' => esc_html__( 'Title Width', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__title' => 'max-width: {{VALUE}}px;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'text_align',
|
||||
[
|
||||
'label' => esc_html__( 'Text Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'None', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner .stratum-banner__text' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'subtitles_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-banner__text',
|
||||
'label' => esc_html__( 'Description Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'text!' => ''
|
||||
],
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'text_width',
|
||||
[
|
||||
'label' => esc_html__( 'Description Width', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__text' => 'max-width: {{VALUE}}px;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'block_horizontal_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Block Horizontal Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'flex-start',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__content-wrapper' => 'align-items: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'block_vertical_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Block Vertical Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'flex-end',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Middle', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-middle',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__content-wrapper' => 'justify-content: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'banner_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'banner_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 0.35
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'min' => 0,
|
||||
'step' => 0.01
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__overlay' => 'opacity: {{SIZE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_overlay_color',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $theme_colors_first_color,
|
||||
'value' => $theme_colors_first_color,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__overlay' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__text' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'banner_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 0.5
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'min' => 0,
|
||||
'step' => 0.01
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper:hover .stratum-banner__overlay' => 'opacity: {{SIZE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_overlay_color',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $theme_colors_first_color,
|
||||
'value' => $theme_colors_first_color,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper:hover .stratum-banner__overlay' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper:hover .stratum-banner__title' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__content-wrapper:before' => 'border-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__content-wrapper:after' => 'border-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper:hover .stratum-banner__text' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Banner() );
|
||||
@@ -0,0 +1,354 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Circle_Progress_Bar
|
||||
* Name: Circle progress bar
|
||||
* Slug: circle-progress-bar
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Circle_Progress_Bar extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'circle-progress-bar';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Circle Progress Bar', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [ 'donutty', 'waypoints' ];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-circle-progress-bar';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$first_color = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['primary_color']) ? get_option( 'stratum_style' )['primary_color'] : '') : '#3878ff';
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'widget_align',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'prefix_class' => 'stratum-circle-progress-bar-align%s-',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text',
|
||||
[
|
||||
'label' => esc_html__( 'Text', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Enter your title', 'stratum' ),
|
||||
'default' => esc_html__( 'Text', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'show_percents',
|
||||
'operator' => '!=',
|
||||
'value' => 'yes',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_percents',
|
||||
[
|
||||
'label' => esc_html__( 'Show percent', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'widget_width',
|
||||
[
|
||||
'label' => esc_html__( 'Width', 'stratum' ),
|
||||
"description" => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'render_type' => 'ui',
|
||||
'default' => [
|
||||
'size' => 150,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar__wrapper' => 'width: {{SIZE}}px',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'value',
|
||||
[
|
||||
'label' => esc_html__( 'Progress', 'stratum' ),
|
||||
'description' => esc_html__( 'In Percent (%)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => '%' ,
|
||||
'render_type' => 'template',
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 75,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'round',
|
||||
[
|
||||
'label' => esc_html__( 'Round Corners', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'circle',
|
||||
[
|
||||
'label' => esc_html__( 'Circle', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'padding',
|
||||
[
|
||||
'label' => esc_html__( 'Background Padding', 'stratum' ),
|
||||
"description" => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => '%' ,
|
||||
'render_type' => 'template',
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 4,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'thickness',
|
||||
[
|
||||
'label' => esc_html__( 'Line Thickness', 'stratum' ),
|
||||
"description" => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => '%' ,
|
||||
'render_type' => 'template',
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 10,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'text_style',
|
||||
'selector' => '{{WRAPPER}} .stratum-circle-progress-bar .donut-text, {{WRAPPER}} .stratum-circle-progress-bar__title',
|
||||
'label' => esc_html__( 'Text Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'tabs_color_style');
|
||||
$controls->start_controls_tab(
|
||||
'tab_color_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#000000',
|
||||
'default' => '#000000',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar .donut-text, {{WRAPPER}} .stratum-circle-progress-bar .stratum-circle-progress-bar__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'line_color',
|
||||
[
|
||||
'label' => esc_html__( 'Line Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => $first_color,
|
||||
'default' => $first_color,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar svg .donut-fill' => 'stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#4682b426',
|
||||
'default' => '#4682b426',
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar svg .donut-bg' => 'stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#000000',
|
||||
'default' => '#000000',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar:hover .donut-text, {{WRAPPER}} .stratum-circle-progress-bar:hover .stratum-circle-progress-bar__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'line_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Line Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => $first_color,
|
||||
'default' => $first_color,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar:hover svg .donut-fill' => 'stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#4682b426',
|
||||
'default' => '#4682b426',
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar:hover svg .donut-bg' => 'stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
$this->render_widget( 'js' );
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Circle_Progress_Bar() );
|
||||
666
wp-content/plugins/stratum/includes/widgets/content-switcher.php
Normal file
666
wp-content/plugins/stratum/includes/widgets/content-switcher.php
Normal file
@@ -0,0 +1,666 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Content_Switcher
|
||||
* Name: Content Switcher
|
||||
* Slug: stratum-content-switcher
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Core\Base\Document;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Repeater;
|
||||
|
||||
use Stratum\Managers\Ajax_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Content_Switcher extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'content-switcher';
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Content Switcher', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eicon-dual-button';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets', 'switch', 'content' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$document_types = Plugin::instance()->documents->get_document_types( [
|
||||
'show_in_library' => true,
|
||||
] );
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_type',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'description' => esc_html__( '', 'stratum' ),
|
||||
'default' => 'multiple',
|
||||
'options' => [
|
||||
'multiple' => esc_html__( 'Multiple Tabs', 'stratum' ),
|
||||
'toggle' => esc_html__( 'Toggle Tabs', 'stratum' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_type_description',
|
||||
[
|
||||
'raw' => '<strong>' . __( 'Please note:', 'stratum' ) . '</strong> ' . __( 'This style applies to only first two tabs.', 'stratum' ),
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
|
||||
'render_type' => 'ui',
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => __( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => __( 'Annual', 'stratum' ),
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'content_template',
|
||||
[
|
||||
'label' => esc_html__( 'Template', 'stratum' ),
|
||||
'type' => Stratum_AJAX_Control::QUERY,
|
||||
'label_block' => true,
|
||||
'multiple' => false,
|
||||
'ajax_route' => 'stratum_get_elementor_templates',
|
||||
'autocomplete' => [
|
||||
'object' => 'library_template',
|
||||
'query' => [
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => Document::TYPE_META_KEY,
|
||||
'value' => array_keys( $document_types ),
|
||||
'compare' => 'IN',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'options' => Ajax_Manager::stratum_get_elementor_templates(),
|
||||
'description' => esc_html__( 'Here you can see sections you saved as templates.', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'active',
|
||||
[
|
||||
'label' => esc_html__( 'Unfolded by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_items',
|
||||
[
|
||||
'label' => esc_html__( 'Items', 'stratum' ),
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ title }}}',
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'title' => esc_html__( 'Starter', 'stratum' ),
|
||||
'active' => 'yes'
|
||||
],
|
||||
[
|
||||
'title' => esc_html__( 'Advanced', 'stratum' ),
|
||||
'active' => 'no'
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'General Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'tabs_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Navigation Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher .stratum-content-switcher__nav' => 'justify-content: {{VALUE}};',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_items_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_items_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '20',
|
||||
'bottom' => '20',
|
||||
'left' => '20',
|
||||
'right' => '20',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__label' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_content_brcolor_multiple',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-content' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_content_brcolor_toggle',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__label' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'content_items_shadow_multiple',
|
||||
'selector' => '{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-content',
|
||||
'fields_options' => [
|
||||
'box_shadow_type' => [
|
||||
'default' => 'yes',
|
||||
],
|
||||
'box_shadow' => [
|
||||
'default' => [
|
||||
'horizontal' => 0,
|
||||
'vertical' => 4,
|
||||
'blur' => 24,
|
||||
'spread' => 0,
|
||||
'color' => 'rgba(0,0,0,0.1)',
|
||||
],
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'content_items_shadow_toggle',
|
||||
'selector' => '{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__label',
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_tabs_style',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'tabs_items_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-content-switcher .stratum-content-switcher__nav-title',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'tabs_items_padding_multiple',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '12',
|
||||
'bottom' => '12',
|
||||
'left' => '23',
|
||||
'right' => '23',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'tabs_items_padding_toggle',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '0',
|
||||
'bottom' => '0',
|
||||
'left' => '15',
|
||||
'right' => '15',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__nav-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'tabs_items_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '20',
|
||||
'bottom' => '20',
|
||||
'left' => '20',
|
||||
'right' => '20',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-pill' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'tabs_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#22262C',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-button' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__nav-item > .stratum-content-switcher__nav-title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_pill_bgcolor',
|
||||
[
|
||||
'label' => esc_html__( 'Pill Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#F74A00',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-pill' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_text_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-item:hover > .stratum-content-switcher__nav-button' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__nav-item:hover > .stratum-content-switcher__nav-title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_active',
|
||||
[
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_text_color_active_multiple',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-item.is-active > .stratum-content-switcher__nav-button' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_text_color_active_toggle',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#5D74DE',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__nav-item.is-active > .stratum-content-switcher__nav-title' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_switch_tabs_style',
|
||||
[
|
||||
'label' => esc_html__( 'Toggle Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'switch_checkbox_container_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '6',
|
||||
'right' => '16',
|
||||
'bottom' => '6',
|
||||
'left' => '16',
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'switch_checkbox_size',
|
||||
[
|
||||
'label' => esc_html__( 'Checkbox Switcher Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 9,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle::before' => '--toggle-size: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'switch_checkbox_container_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Switcher Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'switch_checkbox_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Checkbox Switcher Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 50,
|
||||
'unit' => '%',
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle::before' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'switch_checkbox_bgcolor',
|
||||
[
|
||||
'label' => esc_html__( 'Switcher Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#5D74DEA1',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle' => 'background: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'switch_checkbox_color',
|
||||
[
|
||||
'label' => esc_html__( 'Checkbox Switcher Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#5D74DE',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle::before' => 'background: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content_style',
|
||||
[
|
||||
'label' => esc_html__( 'Content Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '20',
|
||||
'bottom' => '20',
|
||||
'left' => '20',
|
||||
'right' => '20',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher__item-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'fade',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None', 'stratum' ),
|
||||
'fade' => esc_html__( 'Fade', 'stratum' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
// PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Content_Switcher() );
|
||||
582
wp-content/plugins/stratum/includes/widgets/countdown.php
Normal file
582
wp-content/plugins/stratum/includes/widgets/countdown.php
Normal file
@@ -0,0 +1,582 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Counter
|
||||
* Name: Counter
|
||||
* Slug: stratum-countdown
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Core\Schemes;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
|
||||
class Countdown extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'countdown';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
$script_depends = [
|
||||
'jquery-plugin',
|
||||
'jquery-countdown'
|
||||
];
|
||||
|
||||
preg_match( '/^(.*)_/', get_locale(), $current_locale );
|
||||
$locale_prefix = isset( $current_locale[ 1 ] ) && $current_locale[ 1 ] !='en' ? $current_locale[ 1 ] : '';
|
||||
|
||||
if ( $locale_prefix != '' ) {
|
||||
$locale_path = 'vendors/jquery.countdown/localization/jquery.countdown-' . $locale_prefix . '.js';
|
||||
|
||||
if ( file_exists( stratum_get_plugin_path( $locale_path ) ) ) {
|
||||
$script_depends[] = 'jquery-countdown-' . $locale_prefix;
|
||||
}
|
||||
}
|
||||
|
||||
return $script_depends;
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Countdown', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-countdown';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'date_time',
|
||||
[
|
||||
'label' => esc_html__( 'Select Date', 'stratum' ),
|
||||
'type' => Controls_Manager::DATE_TIME,
|
||||
'default' => gmdate( 'Y-m-d H:i', strtotime( '+1 week' ) + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ),
|
||||
/* translators: %s: Time zone. */
|
||||
'description' => sprintf( esc_html__( 'Date set according to your timezone: %s.', 'stratum' ), Utils::get_timezone_string() ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_years',
|
||||
[
|
||||
'label' => esc_html__( 'Years', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_months',
|
||||
[
|
||||
'label' => esc_html__( 'Months', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_weeks',
|
||||
[
|
||||
'label' => esc_html__( 'Weeks', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_days',
|
||||
[
|
||||
'label' => esc_html__( 'Days', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_hours',
|
||||
[
|
||||
'label' => esc_html__( 'Hours', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_minutes',
|
||||
[
|
||||
'label' => esc_html__( 'Minutes', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_seconds',
|
||||
[
|
||||
'label' => esc_html__( 'Seconds', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'stratum_expire_actions',
|
||||
[
|
||||
'label' => esc_html__( 'Actions After Expire', 'stratum' ),
|
||||
'description' => sprintf( esc_html__( 'Redirect, hide or show custom message', 'stratum' ), Utils::get_timezone_string() ),
|
||||
'type' => Controls_Manager::SELECT2,
|
||||
'options' => [
|
||||
'redirect' => esc_html__( 'Redirect', 'stratum' ),
|
||||
'hide' => esc_html__( 'Hide', 'stratum' ),
|
||||
'message' => esc_html__( 'Show Message', 'stratum' ),
|
||||
],
|
||||
'label_block' => true,
|
||||
'separator' => 'before',
|
||||
'render_type' => 'none',
|
||||
'multiple' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'message_after_expire',
|
||||
[
|
||||
'label' => esc_html__( 'Message', 'stratum' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'separator' => 'before',
|
||||
'render_type' => 'none',
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_expire_actions' => 'message',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expire_redirect_url',
|
||||
[
|
||||
'label' => esc_html__( 'Redirect URL', 'stratum' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'separator' => 'before',
|
||||
'options' => false,
|
||||
'render_type' => 'none',
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_expire_actions' => 'redirect',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_labels',
|
||||
[
|
||||
'label' => esc_html__( 'Show Label', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_labels',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Label', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_years',
|
||||
[
|
||||
'label' => esc_html__( 'Years', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Years', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Years', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_years' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_months',
|
||||
[
|
||||
'label' => esc_html__( 'Months', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Months', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Months', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_months' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_weeks',
|
||||
[
|
||||
'label' => esc_html__( 'Weeks', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Weeks', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Weeks', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_weeks' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_days',
|
||||
[
|
||||
'label' => esc_html__( 'Days', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Days', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Days', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_days' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_hours',
|
||||
[
|
||||
'label' => esc_html__( 'Hours', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Hours', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Hours', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_hours' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_minutes',
|
||||
[
|
||||
'label' => esc_html__( 'Minutes', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Minutes', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Minutes', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_minutes' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_seconds',
|
||||
[
|
||||
'label' => esc_html__( 'Seconds', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Seconds', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Seconds', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_seconds' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'box_width',
|
||||
[
|
||||
'label' => esc_html__( 'Box Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 100,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 300,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'min-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'box_align_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Box Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'prefix_class' => 'stratum-countdown-horizontal-align-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
'stretch' => [
|
||||
'title' => esc_html__( 'Stretch', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-stretch',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'box_border',
|
||||
'selector' => '{{WRAPPER}} .stratum-countdown .countdown-section',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'box_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'box_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Space Between', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'margin-left: calc( {{SIZE}}{{UNIT}}/2 );',
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'margin-right: calc( {{SIZE}}{{UNIT}}/2 );',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'box_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'digits_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-countdown .countdown-section .countdown-amount',
|
||||
'label' => esc_html__( 'Digits Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'label_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-countdown .countdown-section .countdown-period',
|
||||
'label' => esc_html__( 'Label Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'countdown_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'countdown_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'box_color',
|
||||
[
|
||||
'label' => esc_html__( 'Box Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'digit_color',
|
||||
[
|
||||
'label' => esc_html__( 'Digit Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section .countdown-amount' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_color',
|
||||
[
|
||||
'label' => esc_html__( 'Label Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section .countdown-period' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'countdown_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_box_color',
|
||||
[
|
||||
'label' => esc_html__( 'Box Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-countdown .countdown-section' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_digit_color',
|
||||
[
|
||||
'label' => esc_html__( 'Digit Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-countdown .countdown-section .countdown-amount' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_label_color',
|
||||
[
|
||||
'label' => esc_html__( 'Label Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-countdown .countdown-section .countdown-period' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Countdown() );
|
||||
358
wp-content/plugins/stratum/includes/widgets/counter.php
Normal file
358
wp-content/plugins/stratum/includes/widgets/counter.php
Normal file
@@ -0,0 +1,358 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Counter
|
||||
* Name: Counter
|
||||
* Slug: stratum-counter
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Counter extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'counter';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [ 'countup', 'waypoints' ];
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Counter', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-counter';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'start',
|
||||
[
|
||||
'label' => esc_html__( 'Start Value', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => 0
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'end',
|
||||
[
|
||||
'label' => esc_html__( 'End Value', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => 100
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'duration',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Duration', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => 3
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'smooth_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Smooth Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'prefix',
|
||||
[
|
||||
'label' => esc_html__( 'Counter Prefix', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'suffix',
|
||||
[
|
||||
'label' => esc_html__( 'Counter Suffix', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'horizontal_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Horizontal Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'flex-start',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-counter' => 'justify-content: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animation_effect',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'outExpo',
|
||||
'options' => [
|
||||
'outExpo' => esc_html__( 'OutExpo' , 'stratum' ),
|
||||
'outQuintic' => esc_html__( 'OutQuintic', 'stratum' ),
|
||||
'outCubic' => esc_html__( 'OutCubic' , 'stratum' )
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'display_separator',
|
||||
[
|
||||
'label' => esc_html__( 'Display Thousands Separator', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'thousands_separator',
|
||||
[
|
||||
'label' => esc_html__( 'Thousands Separator', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => ','
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'prefix__typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-counter__prefix',
|
||||
'label' => esc_html__( 'Prefix Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'number__typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-counter__number',
|
||||
'label' => esc_html__( 'Number Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'suffix__typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-counter__suffix',
|
||||
'label' => esc_html__( 'Suffix Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'decimal_places',
|
||||
[
|
||||
'label' => esc_html__( 'Decimal Places', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'min' => '0',
|
||||
'default' => '0'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'decimal_separator',
|
||||
[
|
||||
'label' => esc_html__( 'Decimal Separator', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => '.'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'numerals',
|
||||
[
|
||||
'label' => esc_html__( 'Numerals', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'default' => esc_html__( 'Default' , 'stratum' ),
|
||||
'eastern_arabic' => esc_html__( 'Eastern Arabic', 'stratum' ),
|
||||
'farsi' => esc_html__( 'Farsi' , 'stratum' )
|
||||
],
|
||||
'default' => 'default'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'counter_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'counter_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'prefix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Prefix Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-counter .stratum-counter__prefix' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'number_color',
|
||||
[
|
||||
'label' => esc_html__( 'Number Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-counter .stratum-counter__number' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'suffix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Suffix Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-counter .stratum-counter__suffix' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'counter_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_prefix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Prefix Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-counter .stratum-counter__prefix' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_number_color',
|
||||
[
|
||||
'label' => esc_html__( 'Number Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-counter .stratum-counter__number' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_suffix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Suffix Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-counter .stratum-counter__suffix' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
$this->render_widget( 'js' );
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Counter() );
|
||||
1335
wp-content/plugins/stratum/includes/widgets/flip-box.php
Normal file
1335
wp-content/plugins/stratum/includes/widgets/flip-box.php
Normal file
File diff suppressed because it is too large
Load Diff
1630
wp-content/plugins/stratum/includes/widgets/horizontal-timeline.php
Normal file
1630
wp-content/plugins/stratum/includes/widgets/horizontal-timeline.php
Normal file
File diff suppressed because it is too large
Load Diff
999
wp-content/plugins/stratum/includes/widgets/image-accordion.php
Normal file
999
wp-content/plugins/stratum/includes/widgets/image-accordion.php
Normal file
@@ -0,0 +1,999 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Image_Accordion
|
||||
* Name: Image Accordion
|
||||
* Slug: image-accordion
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Plugin;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Group_Control_Border;
|
||||
use Elementor\Group_Control_Typography;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
use Elementor\Group_Control_Text_Shadow;
|
||||
use Elementor\Group_Control_Css_Filter;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Image_Accordion extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'image-accordion';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Image Accordion', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-image-accordion';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'general_settings_section',
|
||||
[
|
||||
'label' => esc_html__( 'General Settings', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}::before, {{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__background' => 'background-image: url("{{URL}}");',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'label' => esc_html__( 'Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'auto' => esc_html__( 'Auto' , 'stratum' ),
|
||||
'contain' => esc_html__( 'Contain', 'stratum' ),
|
||||
'cover' => esc_html__( 'Cover' , 'stratum' ),
|
||||
'custom' => esc_html__( 'Custom' , 'stratum' )
|
||||
],
|
||||
'default' => 'auto',
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}::before, {{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__background' => 'background-size: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_position',
|
||||
[
|
||||
'label' => esc_html__( 'Position', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'top left' => esc_html__( 'Top Left' , 'stratum' ),
|
||||
'top center' => esc_html__( 'Top Center' , 'stratum' ),
|
||||
'top right' => esc_html__( 'Top Right' , 'stratum' ),
|
||||
'center center' => esc_html__( 'Center Center', 'stratum' ),
|
||||
'center left' => esc_html__( 'Center Left' , 'stratum' ),
|
||||
'center right' => esc_html__( 'Center Right' , 'stratum' ),
|
||||
'bottom center' => esc_html__( 'Bottom Center', 'stratum' ),
|
||||
'bottom left' => esc_html__( 'Bottom Left' , 'stratum' ),
|
||||
'bottom right' => esc_html__( 'Bottom Right' , 'stratum' )
|
||||
],
|
||||
'default' => 'center center',
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}::before, {{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__background' => 'background-position: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_repeat',
|
||||
[
|
||||
'label' => esc_html__( 'Repeat', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'repeat' => esc_html__( 'Repeat' , 'stratum' ),
|
||||
'no-repeat' => esc_html__( 'No-repeat', 'stratum' ),
|
||||
'repeat-x' => esc_html__( 'Repeat-x' , 'stratum' ),
|
||||
'repeat-y' => esc_html__( 'Repeat-y' , 'stratum' ),
|
||||
],
|
||||
'default' => 'repeat',
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}::before, {{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__background' => 'background-repeat: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'content_switcher',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'icon_switcher',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'icon_updated',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICON,
|
||||
'default' => 'fas fa-star',
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'icon_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'item_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Type your title here...', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'item_description',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'placeholder' => esc_html__( 'Type your content here...', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'custom_position',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Position','stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_responsive_control(
|
||||
'horizontal_offset',
|
||||
[
|
||||
'label' => esc_html__( 'Horizontal Offset', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 400
|
||||
]
|
||||
],
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__content' => 'position: absolute; left: {{SIZE}}{{UNIT}}'
|
||||
],
|
||||
'condition' => [
|
||||
'custom_position' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_responsive_control(
|
||||
'ver_offset',
|
||||
[
|
||||
'label' => esc_html__( 'Vertical Offset', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 400
|
||||
]
|
||||
],
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__content' => 'position: absolute; top: {{SIZE}}{{UNIT}}'
|
||||
],
|
||||
'condition' => [
|
||||
'custom_position' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'show_button',
|
||||
[
|
||||
'label' => esc_html__( 'Show button', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'separator' => 'before',
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'button_text',
|
||||
[
|
||||
'label' => esc_html__( 'Button Text', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Click Here', 'stratum' ),
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes',
|
||||
'show_button!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'stratum' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'condition' => [
|
||||
'show_button!' => ''
|
||||
],
|
||||
'placeholder' => esc_html__( 'https://your-link.com', 'stratum' ),
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes',
|
||||
'show_button!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_content',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'default' => [
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 1 ),
|
||||
'item_description' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'stratum' )
|
||||
],
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 2 ),
|
||||
'item_description' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'stratum' )
|
||||
],
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 3 ),
|
||||
'item_description' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'stratum' )
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls(),
|
||||
'title_field' => '{{{ item_title }}}'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'display_options_section',
|
||||
[
|
||||
'label' => esc_html__( 'Display Options', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hovered_default_active',
|
||||
[
|
||||
'label' => esc_html__( 'Hovered By Default Index', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'condition' => [
|
||||
'active_type' => 'activate-on-hover'
|
||||
],
|
||||
'description' => esc_html__( 'Set the index for the image to be hovered by default on page load, index starts from 1', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'opened_default_active',
|
||||
[
|
||||
'label' => esc_html__( 'Opened By Default Index', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'condition' => [
|
||||
'active_type' => 'activate-on-click'
|
||||
],
|
||||
'description' => esc_html__( 'Set the index for the image to be opened by default on page load, index starts from 1', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'direction',
|
||||
[
|
||||
'label' => esc_html__( 'Direction', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'horizontal',
|
||||
'options' => [
|
||||
'horizontal' => esc_html__( 'Horizontal','stratum' ),
|
||||
'vertical' => esc_html__( 'Vertical' ,'stratum' )
|
||||
],
|
||||
'label_block' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'skew_switcher',
|
||||
[
|
||||
'label' => esc_html__( 'Skew Images', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'direction' => 'horizontal'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'skew_direction',
|
||||
[
|
||||
'label' => esc_html__( 'Skew Direction', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'right',
|
||||
'options' => [
|
||||
'right' => esc_html__( 'Right','stratum' ),
|
||||
'left' => esc_html__( 'Left' ,'stratum' )
|
||||
],
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'direction' => 'horizontal',
|
||||
'skew_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'active_type',
|
||||
[
|
||||
'label' => esc_html__( 'Accordion Style', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'activate-on-click',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'activate-on-hover' => esc_html__( 'On Hover', 'stratum' ),
|
||||
'activate-on-click' => esc_html__( 'On Click', 'stratum' )
|
||||
],
|
||||
'label_block' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'height',
|
||||
[
|
||||
'label' => esc_html__( 'Image Height', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', 'em', 'vh' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 1000
|
||||
]
|
||||
],
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__item' => 'height: {{SIZE}}{{UNIT}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_position',
|
||||
[
|
||||
'label' => esc_html__( 'Content Vertical Position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top'
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Middle', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-middle'
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom'
|
||||
]
|
||||
],
|
||||
'toggle' => false,
|
||||
'default' => 'center',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__overlay' => 'justify-content: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_align',
|
||||
[
|
||||
'label' => esc_html__( 'Content Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title'=> esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left'
|
||||
],
|
||||
'center' => [
|
||||
'title'=> esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center'
|
||||
],
|
||||
'right' => [
|
||||
'title'=> esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right'
|
||||
]
|
||||
],
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'render_type' => 'template',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__content' => 'text-align: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'syle_front_section_section',
|
||||
[
|
||||
'label' => esc_html__( 'Images', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'overlay_background',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__overlay' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'overlay_hover_background',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Hover Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__item:hover .stratum-image-accordion__overlay' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'images_tabs' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'image_normal_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Css_Filter::get_type(),
|
||||
[
|
||||
'name' => 'css_filters_normal',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__background'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'image_hover_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Css_Filter::get_type(),
|
||||
[
|
||||
'name' => 'css_filters_hover',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__item:hover .stratum-image-accordion__background'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'icons_style_section',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'icons_active_tabs' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'icons_style_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon:hover' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_background_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Hover Color ', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon:hover' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'icon_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__icon'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 500
|
||||
],
|
||||
'em' => [
|
||||
'min' => 0,
|
||||
'max' => 20
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'font-size: {{SIZE}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'icon_border',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__icon'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%' ,'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'border-radius: {{SIZE}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'icon_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'icon_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'titles_style_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color ', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__title' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__title'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Text_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'title_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__title'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'title_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'title_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'description_style_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'description_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color ', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__description' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'description_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__description'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Text_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'description_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__description'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'description_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'description_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'button_style_section',
|
||||
[
|
||||
'label' => esc_html__( 'Button', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'button_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__button'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'button_tabs' );
|
||||
|
||||
$controls->start_controls_tab( 'normal',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_border_color',
|
||||
[
|
||||
'label' => esc_html__( 'Border Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'border-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'hover',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_hover_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button:hover' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_hover_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button:hover' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_hover_border_color',
|
||||
[
|
||||
'label' => esc_html__( 'Border Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button:hover' => 'border-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'button_border_width',
|
||||
[
|
||||
'label' => esc_html__( 'Border Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 20
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'border-width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'button_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'border-radius: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'separator' => 'after'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
public function image_accordion_render_button( $index, $button_text, $link ) {
|
||||
$out = '';
|
||||
$this->add_render_attribute( 'button' . $index, 'class', [
|
||||
'stratum-image-accordion__button'
|
||||
] );
|
||||
|
||||
if ( ! empty( $link[ 'url' ] ) ) {
|
||||
$this->add_link_attributes( 'button' . $index, $link );
|
||||
}
|
||||
|
||||
$button_class = $this->get_render_attribute_string( 'button' . $index );
|
||||
$out .= "<a " . ( empty( $link[ 'url' ] ) ? "href='#' " : '' ) . $button_class. ">" . esc_html( $button_text ) . "</a>";
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Image_Accordion() );
|
||||
459
wp-content/plugins/stratum/includes/widgets/image-hotspot.php
Normal file
459
wp-content/plugins/stratum/includes/widgets/image-hotspot.php
Normal file
@@ -0,0 +1,459 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Image_Hot_Spot
|
||||
* Name: Image Hot Spots
|
||||
* Slug: stratum-image-hotspot
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Utils;
|
||||
use Elementor\Repeater;
|
||||
use Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Image_Hot_Spot extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'image-hotspot';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Image Hotspot', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'popper',
|
||||
'tippy',
|
||||
'draggabilly',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'tippy-themes',
|
||||
'tippy-animation',
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-image-hotspot';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls = $this;
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes()
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->start_controls_tabs( 'hot_spots_tabs' );
|
||||
|
||||
$repeater->start_controls_tab ( 'tab_content', [ 'label' => esc_html__( 'Content', 'stratum' ) ]);
|
||||
|
||||
$repeater->add_control(
|
||||
'hotspot_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICON,
|
||||
'default' => 'fa fa-plus',
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->start_controls_tab( 'position', [ 'label' => esc_html__( 'Position', 'stratum' ) ] );
|
||||
|
||||
$repeater->add_control(
|
||||
'left_position',
|
||||
[
|
||||
'label' => esc_html__( 'Left Position', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 0.1
|
||||
]
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 50
|
||||
],
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}' => 'left: {{SIZE}}%;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'top_position',
|
||||
[
|
||||
'label' => esc_html__( 'Top Position', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 0.1
|
||||
]
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 50
|
||||
],
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}' => 'top: {{SIZE}}%;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->start_controls_tab( 'tab_tooltip', [ 'label' => esc_html__( 'Tooltip', 'stratum' ) ] );
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip',
|
||||
[
|
||||
'label' => esc_html__( 'Tooltip', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No' , 'stratum' ),
|
||||
'return_value' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet.', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Type your title here...', 'stratum' ),
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_content',
|
||||
[
|
||||
'label' => esc_html__( 'Tooltip Content', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Type your content here...', 'stratum' ),
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'open_by_default',
|
||||
[
|
||||
'label' => esc_html__( 'Opened by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_arrow',
|
||||
[
|
||||
'label' => esc_html__( 'Use Arrow', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No' , 'stratum' ),
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'placement',
|
||||
[
|
||||
'label' => esc_html__( 'Placement', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'top',
|
||||
'options' => [
|
||||
'top' => esc_html__( 'Top' , 'stratum' ),
|
||||
'right' => esc_html__( 'Right' , 'stratum' ),
|
||||
'bottom' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'left' => esc_html__( 'Left' , 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_theme',
|
||||
[
|
||||
'label' => esc_html__( 'Theme', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'light',
|
||||
'options' => [
|
||||
'light' => esc_html__( 'Light' , 'stratum' ),
|
||||
'dark' => esc_html__( 'Dark' , 'stratum' ),
|
||||
'light-border' => esc_html__( 'Light Border', 'stratum' ),
|
||||
'google' => esc_html__( 'Google' , 'stratum' ),
|
||||
'translucent' => esc_html__( 'Translucent' , 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'fade',
|
||||
'options' => [
|
||||
'shift-away' => esc_html__( 'Shift Away' , 'stratum' ),
|
||||
'shift-toward' => esc_html__( 'Shift Toward', 'stratum' ),
|
||||
'fade' => esc_html__( 'Fade' , 'stratum' ),
|
||||
'scale' => esc_html__( 'Scale' , 'stratum' ),
|
||||
'perspective' => esc_html__( 'Perspective' , 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_interactivity',
|
||||
[
|
||||
'label' => esc_html__( 'Interactivity', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'hover',
|
||||
'options' => [
|
||||
'hover' => esc_html__( 'Hover', 'stratum' ),
|
||||
'click' => esc_html__( 'Click', 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->end_controls_tabs();
|
||||
|
||||
$controls->add_control(
|
||||
'hotspot_dot_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
'return_value' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hot_spots',
|
||||
[
|
||||
'label' => '',
|
||||
'title_field' => '<i class="{{ hotspot_icon }}" aria-hidden="true"></i> {{{ tooltip_title }}}',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'default' => [
|
||||
[
|
||||
'feature_icon' => 'fa fa-plus',
|
||||
'left_position' => 20,
|
||||
'top_position' => 30
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_hotspot_style',
|
||||
[
|
||||
'label' => esc_html__( 'Hotspot', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'hotspot_icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [ 'size' => '20' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 6,
|
||||
'max' => 50,
|
||||
'step' => 1
|
||||
]
|
||||
],
|
||||
'size_units' => [ 'px' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot-content' => 'font-size: {{SIZE}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'hotspot_dot_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Point Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [ 'size' => '0' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 6,
|
||||
'max' => 100,
|
||||
'step' => 1
|
||||
]
|
||||
],
|
||||
'size_units' => [ 'px' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot' => 'padding: {{SIZE}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'hotspot_dot_opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Point Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [ 'size' => '1' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1,
|
||||
'step' => 0.1
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot' => 'opacity: {{SIZE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_color_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot-icon' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_bg_color_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {
|
||||
$this->render_widget( 'js' );
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
|
||||
public function get_dot_template($class, $dot_class, $wrapper_class, $icon_class, $type, $item = null) {
|
||||
$out = "";
|
||||
$out .= "<div ".$dot_class.">";
|
||||
$out .= "<div ".$wrapper_class."'>";
|
||||
$out .= "<div class='".esc_attr( $class."__dot-content" )."'>";
|
||||
$out .= "<i class='".esc_attr( $class."__dot-icon ".$icon_class )."'></i>";
|
||||
$out .= "</div>";
|
||||
$out .= "</div>";
|
||||
$out .= "</div>";
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Image_Hot_Spot() );
|
||||
342
wp-content/plugins/stratum/includes/widgets/instagram.php
Normal file
342
wp-content/plugins/stratum/includes/widgets/instagram.php
Normal file
@@ -0,0 +1,342 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Stratum_Instagram
|
||||
* Name: Instagram
|
||||
* Slug: stratum-instagram
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
// use \Stratum\Stratum_Widget_Base;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Instagram extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'instagram';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Instagram', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'anim-on-scroll',
|
||||
'modernizr-custom',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'scroll-anim-effects',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-instagram';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items',
|
||||
[
|
||||
'label' => esc_html__( 'Number of items', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
'default' => 6
|
||||
]
|
||||
);
|
||||
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$access_token = isset( $stratum_api['instagram_access_token'] ) ? $stratum_api['instagram_access_token'] : '';
|
||||
|
||||
if (empty($access_token)){
|
||||
$controls->add_control(
|
||||
'api_key',
|
||||
[
|
||||
'label' => esc_html__( 'API KEY', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => wp_kses(
|
||||
sprintf(
|
||||
__( 'Instagram Access Token is not set. <a href="%s" target="_blank">Connect Instagram Account</a>.', 'stratum' ),
|
||||
admin_url( 'admin.php?page=stratum-settings#stratum_api' )
|
||||
),
|
||||
array( 'a' => array( 'href' => array(), 'target' => array() ) )
|
||||
),
|
||||
'content_classes' => 'api-key-description',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_on_scroll',
|
||||
[
|
||||
'label' => esc_html__( 'Animate on scroll', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animation_effects',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'effect-2',
|
||||
'options' => [
|
||||
'effect-1' => esc_html__( 'Opacity', 'stratum' ),
|
||||
'effect-2' => esc_html__( 'Move Up', 'stratum' ),
|
||||
'effect-3' => esc_html__( 'Scale up', 'stratum' ),
|
||||
'effect-4' => esc_html__( 'Fall perspective', 'stratum' ),
|
||||
'effect-5' => esc_html__( 'Fly', 'stratum' ),
|
||||
'effect-6' => esc_html__( 'Flip', 'stratum' ),
|
||||
'effect-7' => esc_html__( 'Helix', 'stratum' ),
|
||||
'effect-8' => esc_html__( 'Zoom In 3D', 'stratum' ),
|
||||
],
|
||||
'condition' => [
|
||||
'animate_on_scroll' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'columns',
|
||||
[
|
||||
'label' => esc_html__( 'Columns', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'max' => 6,
|
||||
'step' => 1,
|
||||
'default' => 3,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__wrapper' => '--columns: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'padding_item',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'description' => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 5,
|
||||
],
|
||||
'tablet_default' => [
|
||||
'size' => 5,
|
||||
],
|
||||
'mobile_default' => [
|
||||
'size' => 5,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 30,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__item' => 'padding: {{SIZE}}px',
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__wrapper' => 'margin: -{{SIZE}}px',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'instagram_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'instagram_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#00000000',
|
||||
'default' => '#00000000',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__media-link:before' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'instagram_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#0000002e',
|
||||
'default' => '#0000002e',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__media-link:hover:before' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
protected function render( $instance = [] ) {
|
||||
|
||||
$media = $this->get_media();
|
||||
|
||||
if ( ! $media['success'] ) {
|
||||
?><p><?php
|
||||
echo wp_kses(
|
||||
$media['error'],
|
||||
array( 'a' => array( 'href' => array(), 'target' => array() ) )
|
||||
)
|
||||
?></p><?php
|
||||
return;
|
||||
}
|
||||
|
||||
$this->render_widget( 'php', [ 'media' => $media['media'] ] );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
|
||||
private function get_media() {
|
||||
|
||||
$instagram_media = get_transient( 'stratum_instagram_response_data' );
|
||||
$success = true;
|
||||
$error = '';
|
||||
|
||||
// @todo: remove in next release
|
||||
// added for backward compatibility
|
||||
if ( isset( $instagram_media->data ) ) {
|
||||
$instagram_media = $instagram_media->data;
|
||||
}
|
||||
|
||||
if ( false === $instagram_media ) {
|
||||
|
||||
$encryption = new String_Encryption();
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$access_token = isset( $stratum_api['instagram_access_token'] ) ? $encryption->decrypt( $stratum_api['instagram_access_token'] ) : '';
|
||||
|
||||
//If Empty Token
|
||||
if ( empty( $access_token ) ) {
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
$error = sprintf(
|
||||
__( 'Instagram Access Token is not set. <a href="%s" target="_blank">Connect Instagram Account</a>.', 'stratum' ),
|
||||
admin_url( 'admin.php?page=stratum-settings#stratum_api' )
|
||||
);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => false,
|
||||
'error' => $error,
|
||||
'media' => $instagram_media
|
||||
);
|
||||
}
|
||||
|
||||
//Get data from Instagram
|
||||
$response = wp_remote_get(
|
||||
'https://graph.instagram.com/me/media?fields=id,media_type,media_url,permalink,caption,thumbnail_url,children{media_url,thumbnail_url}&access_token=' . $access_token . '&limit=100',
|
||||
array( 'timeout' => 15 )
|
||||
);
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
$success = false;
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
$error = $response->get_error_message();
|
||||
}
|
||||
} else {
|
||||
$instagram_media = json_decode( wp_remote_retrieve_body( $response ) );
|
||||
//JSON valid
|
||||
if ( json_last_error() === JSON_ERROR_NONE ) {
|
||||
if ( isset( $instagram_media->error ) ) {
|
||||
$success = false;
|
||||
$error = sprintf(
|
||||
__( 'The access token could not be decrypted. Your access token is currently invalid. <a href="%s" target="_blank">Please re-authorize your Instagram account</a>.', 'stratum' ),
|
||||
admin_url( 'admin.php?page=stratum-settings#stratum_api' )
|
||||
);
|
||||
|
||||
} else {
|
||||
if ( $instagram_media->data ) {
|
||||
$instagram_media = $instagram_media->data;
|
||||
//Cache response
|
||||
set_transient( 'stratum_instagram_response_data', $instagram_media, 30 * MINUTE_IN_SECONDS );
|
||||
} else {
|
||||
$success = false;
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
$error = $instagram_media->meta->error_message;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$success = false;
|
||||
$error = __( 'Error in json_decode.', 'stratum' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => $success,
|
||||
'error' => $error,
|
||||
'media' => $instagram_media
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Instagram() );
|
||||
@@ -0,0 +1,431 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Lottie_Animations
|
||||
* Name: Lottie Animations
|
||||
* Slug: lottie-animations
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Plugin;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Group_Control_Border;
|
||||
use Elementor\Group_Control_Css_Filter;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
use Elementor\Group_Control_Typography;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Lottie_Animations extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'lottie-animations';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Lottie Animations', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-lottie-animations';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'lottie-animations-api'
|
||||
];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'general_settings',
|
||||
[
|
||||
'label' => esc_html__( 'General Settings', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_url',
|
||||
[
|
||||
'label' => esc_html__( 'Animation JSON URL', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
|
||||
'label_block' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_loop',
|
||||
[
|
||||
'label' => esc_html__( 'Loop','stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'true',
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_reverse',
|
||||
[
|
||||
'label' => esc_html__( 'Reverse', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'true',
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'lottie_loop' => 'true',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Only Play on Hover','stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'true',
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Speed', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => 1,
|
||||
'min' => 0.1,
|
||||
'max' => 3,
|
||||
'step' => 0.1
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_on_scroll',
|
||||
[
|
||||
'label' => esc_html__( 'Animate On Scroll', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'false',
|
||||
'condition' => [
|
||||
'lottie_hover!' => 'true',
|
||||
'lottie_reverse!' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Speed', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 4
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 10,
|
||||
'step' => 0.1
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'lottie_hover!' => 'true',
|
||||
'animate_on_scroll' => 'true',
|
||||
'lottie_reverse!' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_view',
|
||||
[
|
||||
'label' => esc_html__( 'Viewport', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'sizes' => [
|
||||
'start' => 0,
|
||||
'end' => 100
|
||||
],
|
||||
'unit' => '%'
|
||||
],
|
||||
'labels' => [
|
||||
esc_html__( 'Bottom', 'stratum' ),
|
||||
esc_html__( 'Top', 'stratum' )
|
||||
],
|
||||
'scales' => 1,
|
||||
'handles' => 'range',
|
||||
'condition' => [
|
||||
'lottie_hover!' => 'true',
|
||||
'animate_on_scroll' => 'true',
|
||||
'lottie_reverse!' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'animation_size',
|
||||
[
|
||||
'label' => esc_html__( 'Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 600
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 1,
|
||||
'max' => 800
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 30
|
||||
]
|
||||
],
|
||||
'render_type' => 'template',
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_rotate',
|
||||
[
|
||||
'label' => esc_html__( 'Rotate (degrees)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'description' => esc_html__( 'Set rotation value in degress', 'stratum' ),
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => -180,
|
||||
'max' => 180
|
||||
]
|
||||
],
|
||||
'default' => [
|
||||
'size' => 0
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'transform: rotate({{SIZE}}deg)'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'animation_align',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title'=> esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left'
|
||||
],
|
||||
'center' => [
|
||||
'title'=> esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center'
|
||||
],
|
||||
'flex-end' => [
|
||||
'title'=> esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right'
|
||||
]
|
||||
],
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations' => 'justify-content: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_renderer',
|
||||
[
|
||||
'label' => esc_html__( 'Render As', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'svg' => esc_html__( 'SVG', 'stratum' ),
|
||||
'canvas' => esc_html__( 'Canvas', 'stratum' )
|
||||
],
|
||||
'default' => 'svg',
|
||||
'prefix_class' => 'stratum-lottie-',
|
||||
'render_type' => 'template',
|
||||
'label_block' => true,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control('render_notice',
|
||||
[
|
||||
'raw' => esc_html__( 'Set render type to canvas if you\'re having performance issues on the page.', 'stratum' ),
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_lottie_style',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'show_label' => false
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'tabs_lottie' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_lottie_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_background',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'min' => 0.10,
|
||||
'step' => 0.01
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'opacity: {{SIZE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Css_Filter::get_type(),
|
||||
[
|
||||
'name' => 'css_filters',
|
||||
'selector' => '{{WRAPPER}} .stratum-lottie-animations__wrapper'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_lottie_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_hover_background',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper:hover' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'min' => 0.10,
|
||||
'step' => 0.01
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper:hover' => 'opacity: {{SIZE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Css_Filter::get_type(),
|
||||
[
|
||||
'name' => 'hover_css_filters',
|
||||
'selector' => '{{WRAPPER}} .stratum-lottie-animations__wrapper:hover'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'lottie_border',
|
||||
'selector' => '{{WRAPPER}} .stratum-lottie-animations__wrapper',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control('lottie_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control('animation_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Lottie_Animations() );
|
||||
400
wp-content/plugins/stratum/includes/widgets/masonry-gallery.php
Normal file
400
wp-content/plugins/stratum/includes/widgets/masonry-gallery.php
Normal file
@@ -0,0 +1,400 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Images_Masonry
|
||||
* Name: Images Masonry
|
||||
* Slug: masonry-gallery
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Images_Masonry extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'masonry-gallery';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Masonry Gallery', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'jquery-masonry',
|
||||
'anim-on-scroll',
|
||||
'modernizr-custom'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'scroll-anim-effects'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-masonry-gallery';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'gallery_images',
|
||||
[
|
||||
'label' => esc_html__( 'Gallery', 'stratum' ),
|
||||
'type' => Controls_Manager::GALLERY,
|
||||
'default' => [],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_on_scroll',
|
||||
[
|
||||
'label' => esc_html__( 'Animate on scroll', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animation_effects',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'effect-2',
|
||||
'options' => [
|
||||
'effect-1' => esc_html__( 'Opacity', 'stratum' ),
|
||||
'effect-2' => esc_html__( 'Move Up', 'stratum' ),
|
||||
'effect-3' => esc_html__( 'Scale up', 'stratum' ),
|
||||
'effect-4' => esc_html__( 'Fall perspective', 'stratum' ),
|
||||
'effect-5' => esc_html__( 'Fly', 'stratum' ),
|
||||
'effect-6' => esc_html__( 'Flip', 'stratum' ),
|
||||
'effect-7' => esc_html__( 'Helix', 'stratum' ),
|
||||
'effect-8' => esc_html__( 'Zoom In 3D', 'stratum' ),
|
||||
],
|
||||
'condition' => [
|
||||
'animate_on_scroll' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'gallery_columns',
|
||||
[
|
||||
'label' => esc_html__( 'Columns', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 2,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 2,
|
||||
'max' => 10,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'gutter',
|
||||
[
|
||||
'label' => esc_html__( 'Gutter', 'stratum' ),
|
||||
'description' => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 2,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 30,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_animation_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Animation Speed', 'stratum' ),
|
||||
'description' => esc_html__( 'In Seconds', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 0.25,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0.1,
|
||||
'max' => 2,
|
||||
'step' => 0.01,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__image' => 'transition: all {{SIZE}}s linear',
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__overlay' => 'transition: all {{SIZE}}s linear',
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__caption' => 'transition: all {{SIZE}}s linear',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'zoom_effect',
|
||||
[
|
||||
'prefix_class' => 'stratum-masonry-gallery-effect-',
|
||||
'return_value' => 'zoom',
|
||||
'label' => esc_html__( 'Zoom on hover', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'grayscale_effect',
|
||||
[
|
||||
'prefix_class' => 'stratum-masonry-gallery-effect-',
|
||||
'return_value' => 'grayscale',
|
||||
'label' => esc_html__( 'Colorize on hover', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'overlay_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'overlay_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'images_overlay_color',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#00000078',
|
||||
'default' => '#00000078',
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__overlay' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'overlay_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'images_overlay_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#00000000',
|
||||
'default' => '#00000000',
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item:hover .stratum-masonry-gallery__overlay' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_caption',
|
||||
[
|
||||
'label' => esc_html__( 'Caption', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'caption_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'caption_horizontal_align',
|
||||
[
|
||||
'label' => esc_html__( 'Horizontal Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'caption_vertical_align',
|
||||
[
|
||||
'label' => esc_html__( 'Vertical Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'bottom',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top'
|
||||
],
|
||||
'middle' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-middle'
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom'
|
||||
],
|
||||
],
|
||||
'selectors_dictionary' => [
|
||||
'top' => 'top: 0; bottom: 0;',
|
||||
'middle' => 'top: 50%; bottom: 0;',
|
||||
'bottom' => 'bottom: 0; top: unset;',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption' => '{{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'background',
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'exclude' => [ 'image' ],
|
||||
'selector' => '{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'caption_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'caption_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
|
||||
public function _get_image_attributes( $id ) {
|
||||
$attachment = get_post( $id );
|
||||
$image_data = [
|
||||
'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
|
||||
'caption' => $attachment->post_excerpt,
|
||||
'description' => $attachment->post_content,
|
||||
'title' => $attachment->post_title,
|
||||
];
|
||||
|
||||
return $image_data;
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Images_Masonry() );
|
||||
369
wp-content/plugins/stratum/includes/widgets/price-list.php
Normal file
369
wp-content/plugins/stratum/includes/widgets/price-list.php
Normal file
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Price_List
|
||||
* Name: Price List
|
||||
* Slug: stratum-price-list
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Price_List extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'price-list';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Price List', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-price-list';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'list_title',
|
||||
[
|
||||
'label' => esc_html__( 'Heading', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => esc_html__( 'List Heading', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_html_tag',
|
||||
[
|
||||
'label' => esc_html__( 'Heading HTML Tag', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'h1' => esc_html__( 'H1' , 'stratum' ),
|
||||
'h2' => esc_html__( 'H2' , 'stratum' ),
|
||||
'h3' => esc_html__( 'H3' , 'stratum' ),
|
||||
'h4' => esc_html__( 'H4' , 'stratum' ),
|
||||
'h5' => esc_html__( 'H5', 'stratum' ),
|
||||
'h6' => esc_html__( 'H6' , 'stratum' ),
|
||||
'div' => esc_html__( 'div' , 'stratum' ),
|
||||
'p' => esc_html__( 'p' , 'stratum' )
|
||||
],
|
||||
'default' => 'h5'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'item_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Title', 'stratum' ),
|
||||
'default' => esc_html__( 'Title', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_html_tag',
|
||||
[
|
||||
'label' => esc_html__( 'Title HTML Tag', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'h1' => esc_html__( 'H1' , 'stratum' ),
|
||||
'h2' => esc_html__( 'H2' , 'stratum' ),
|
||||
'h3' => esc_html__( 'H3' , 'stratum' ),
|
||||
'h4' => esc_html__( 'H4' , 'stratum' ),
|
||||
'h5' => esc_html__( 'H5 ', 'stratum' ),
|
||||
'h6' => esc_html__( 'H6' , 'stratum' ),
|
||||
'div' => esc_html__( 'div' , 'stratum' ),
|
||||
'span' => esc_html__( 'span', 'stratum' ),
|
||||
'p' => esc_html__( 'p' , 'stratum' )
|
||||
],
|
||||
'default' => 'span'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'item_price',
|
||||
[
|
||||
'label' => esc_html__( 'Price', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => '$11'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'list_items',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ item_title }}}',
|
||||
'default' => [
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 1 ),
|
||||
'item_price' => '$69'
|
||||
],
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 2 ),
|
||||
'item_price' => '$49'
|
||||
],
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 3 ),
|
||||
'item_price' => '$19'
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_image',
|
||||
[
|
||||
'label' => esc_html__( 'Show Image', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'return_value' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'type' => 'select',
|
||||
'default' => 'full',
|
||||
'options' => \Stratum\Stratum::get_instance()->get_scripts_manager()->get_image_sizes(),
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_width',
|
||||
[
|
||||
'label' => esc_html__( 'Image Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 250,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 600,
|
||||
'min' => 10,
|
||||
'step' => 1
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list__image-wrapper' => 'width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_position',
|
||||
[
|
||||
'label' => esc_html__( 'Image position', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'has-image-left',
|
||||
'options' => [
|
||||
'has-image-top' => esc_html__( 'Top' , 'stratum' ),
|
||||
'has-image-left' => esc_html__( 'Left' , 'stratum' ),
|
||||
'has-image-right' => esc_html__( 'Right', 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_price_connector',
|
||||
[
|
||||
'label' => esc_html__( 'Title-Price Separator', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Content Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list .stratum-price-list__wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'price_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'price_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
$controls->add_control(
|
||||
'heading_color',
|
||||
[
|
||||
'label' => esc_html__( 'Heading Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list .stratum-price-list__heading' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list__items .stratum-price-list__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list__items .stratum-price-list__price' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'price_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'heading_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Heading Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list:hover .stratum-price-list__heading' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list:hover .stratum-price-list__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list:hover .stratum-price-list__price' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Price_List() );
|
||||
396
wp-content/plugins/stratum/includes/widgets/price-menu.php
Normal file
396
wp-content/plugins/stratum/includes/widgets/price-menu.php
Normal file
@@ -0,0 +1,396 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Price_Menu
|
||||
* Name: Price Menu
|
||||
* Slug: stratum-price-menu
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Price_Menu extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'price-menu';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Price Menu', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-price-menu';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'menu_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Title', 'stratum' ),
|
||||
'default' => esc_html__( 'Title', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_html_tag',
|
||||
[
|
||||
'label' => esc_html__( 'Title HTML Tag', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'h1' => esc_html__( 'H1' , 'stratum' ),
|
||||
'h2' => esc_html__( 'H2' , 'stratum' ),
|
||||
'h3' => esc_html__( 'H3' , 'stratum' ),
|
||||
'h4' => esc_html__( 'H4' , 'stratum' ),
|
||||
'h5' => esc_html__( 'H5', 'stratum' ),
|
||||
'h6' => esc_html__( 'H6' , 'stratum' ),
|
||||
'div' => esc_html__( 'div' , 'stratum' ),
|
||||
'span' => esc_html__( 'span', 'stratum' ),
|
||||
'p' => esc_html__( 'p' , 'stratum' )
|
||||
],
|
||||
'default' => 'span'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'menu_description',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Description', 'stratum' ),
|
||||
'default' => esc_html__( 'Description', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'menu_price',
|
||||
[
|
||||
'label' => esc_html__( 'Price', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => '$49'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-price-menu__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'price_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-price-menu__price' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'description_color',
|
||||
[
|
||||
'label' => esc_html__( 'Description Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-price-menu__description' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'show_image',
|
||||
[
|
||||
'label' => esc_html__( 'Show Image', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'return_value' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'type' => 'select',
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes(),
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_align',
|
||||
[
|
||||
'label' => esc_html__( 'Image Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'menu_items',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ menu_title }}}',
|
||||
'default' => [
|
||||
[
|
||||
'menu_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 1 ),
|
||||
'menu_price' => '$69'
|
||||
],
|
||||
[
|
||||
'menu_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 2 ),
|
||||
'menu_price' => '$49'
|
||||
],
|
||||
[
|
||||
'menu_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 3 ),
|
||||
'menu_price' => '$19'
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_price_connector',
|
||||
[
|
||||
'label' => esc_html__( 'Title-Price Separator', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_divider',
|
||||
[
|
||||
'label' => esc_html__( 'Items Separator', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_animate',
|
||||
[
|
||||
'label' => esc_html__( 'Animate items', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'animate',
|
||||
'default' => '',
|
||||
'prefix_class' => 'stratum-price-menu-items-',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'items_gap',
|
||||
[
|
||||
'label' => esc_html__( 'Items Gap', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'size_units' => [ 'px', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper' => 'margin-bottom: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'items_images_width',
|
||||
[
|
||||
'label' => esc_html__( 'Image width', 'stratum' ),
|
||||
'description' => esc_html__( 'In Percent (%)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%' ],
|
||||
'default' => [
|
||||
'size' => '50',
|
||||
'unit' => '%',
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => '%',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => '%',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__image' => 'width: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}}.stratum-price-menu-items-animate .stratum-price-menu__image.image-align-left' => 'margin-left: -{{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}}.stratum-price-menu-items-animate .stratum-price-menu__image.image-align-right' => 'margin-right: -{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'items_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'stratum'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'condition' => [
|
||||
'items_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'items_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'items_paddings',
|
||||
[
|
||||
'label' => esc_html__( 'Content Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Price_Menu() );
|
||||
843
wp-content/plugins/stratum/includes/widgets/price-table.php
Normal file
843
wp-content/plugins/stratum/includes/widgets/price-table.php
Normal file
@@ -0,0 +1,843 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Price_Table
|
||||
* Name: Price Table
|
||||
* Slug: stratum-price-table
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Repeater;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Price_Table extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'price-table';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Price Table', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-price-table';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$first_color = '#000';
|
||||
$second_color = '#000';
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Premium', 'stratum' ),
|
||||
'title' => esc_html__( 'Title', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__header .stratum-price-table__title',
|
||||
'label' => esc_html__( 'Title Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'title!' => ''
|
||||
],
|
||||
'defaults' => [
|
||||
'html_tag' => 'h5',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Plan', 'stratum' ),
|
||||
'title' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'subtitles_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__subtitle',
|
||||
'label' => esc_html__( 'Subtitle Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'subtitle!' => ''
|
||||
],
|
||||
'defaults' => [
|
||||
'html_tag' => 'h4',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_text',
|
||||
[
|
||||
'label' => esc_html__( 'Price Text', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'rows' => 10,
|
||||
'default' => esc_html__( 'Min Price', 'stratum' ),
|
||||
'title' => esc_html__( 'Price Text', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'price_text_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__price-text',
|
||||
'label' => esc_html__( 'Price Subtitle Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'subtitle!' => ''
|
||||
],
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price',
|
||||
[
|
||||
'label' => esc_html__( 'Price', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'step' => 1,
|
||||
'default' => 7.50,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'price_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__price-wrapper .stratum-price-table__price',
|
||||
'label' => esc_html__( 'Price Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'price!' => ''
|
||||
],
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_currency',
|
||||
[
|
||||
'label' => esc_html__( 'Currency', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => '$',
|
||||
'title' => esc_html__( 'Currency', 'stratum' ),
|
||||
'condition' => [
|
||||
'price!' => ''
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'currency_align',
|
||||
[
|
||||
'label' => esc_html__( 'Currency Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'right',
|
||||
'prefix_class' => 'stratum-price-table-currency-align-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_description',
|
||||
[
|
||||
'label' => esc_html__( 'Price description', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'per 10GH/s', 'stratum' ),
|
||||
'title' => esc_html__( 'Price description', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'item_text',
|
||||
[
|
||||
'label' => esc_html__( 'Item text', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Caption', 'stratum' ),
|
||||
'default' => esc_html__( 'Text', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'item_icon',
|
||||
[
|
||||
'label_block' => true,
|
||||
'label' => esc_html__( 'Item icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICON
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}.stratum-price-table__content i' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'item_icon!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'icon_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color (Hover)', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover {{CURRENT_ITEM}}.stratum-price-table__content i' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'item_icon!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_items',
|
||||
[
|
||||
'label' => esc_html__( 'List items', 'stratum' ),
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ item_text }}}',
|
||||
'default' => [
|
||||
[
|
||||
'item_text' => esc_html__( 'First', 'stratum' )
|
||||
],
|
||||
[
|
||||
'item_text' => esc_html__( 'Second', 'stratum' )
|
||||
],
|
||||
[
|
||||
'item_text' => esc_html__( 'Third', 'stratum' )
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'align',
|
||||
[
|
||||
'label' => esc_html__( 'List Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'None', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__wrapper .stratum-price-table__content-wrapper' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'line_border',
|
||||
[
|
||||
'label' => esc_html__( 'List border', 'stratum' ),
|
||||
'type' => Controls_Manager::POPOVER_TOGGLE,
|
||||
'label_off' => esc_html__( 'Default', 'stratum' ),
|
||||
'label_on' => esc_html__( 'Custom', 'stratum' ),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
/*------------------------BORDER POPOVER------------------------*/
|
||||
$controls->start_popover();
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__content-wrapper li',
|
||||
'condition' => [
|
||||
'line_border' => 'yes'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_popover();
|
||||
/*------------------------------------------------*/
|
||||
|
||||
$controls->add_control(
|
||||
'button_show',
|
||||
[
|
||||
'label' => esc_html__( 'Show button', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'button_align',
|
||||
[
|
||||
'label' => esc_html__( 'Button Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'prefix_class' => 'stratum-price-table-button-align%s-',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'full' => [
|
||||
'title' => esc_html__( 'Justified', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'button_show' => 'yes'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_text',
|
||||
[
|
||||
'label' => esc_html__( 'Button caption', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Purchase', 'stratum' ),
|
||||
'title' => esc_html__( 'Button caption', 'stratum' ),
|
||||
'condition' => [
|
||||
'button_show' => 'yes'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_url',
|
||||
[
|
||||
'label' => esc_html__( 'Button URL', 'stratum' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'placeholder' => 'https://',
|
||||
'show_external' => true,
|
||||
'default' => [
|
||||
'url' => '',
|
||||
'is_external' => true,
|
||||
'nofollow' => true,
|
||||
],
|
||||
'condition' => [
|
||||
'button_text!' => '',
|
||||
'button_show' => 'yes'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'stratum_button_border',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'' => esc_html__( 'None', 'stratum' ),
|
||||
'solid' => esc_html__( 'Solid', 'stratum' ),
|
||||
'double' => esc_html__( 'Double', 'stratum' ),
|
||||
'dotted' => esc_html__( 'Dotted', 'stratum' ),
|
||||
'dashed' => esc_html__( 'Dashed', 'stratum' ),
|
||||
'groove' => esc_html__( 'Groove', 'stratum' ),
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'border-style: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'button_border_width',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border Width', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'default' => [
|
||||
'top' => 1,
|
||||
'right' => 1,
|
||||
'bottom' => 1,
|
||||
'left' => 1,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_button_border!' => '',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_button_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'price_table_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'price_table_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__header .stratum-price-table__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'title',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle_color',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__subtitle' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'subtitle',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
], [
|
||||
'name' => 'price_text',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__price-wrapper .stratum-price-table__price' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'price',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__price-text' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'subtitle',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
], [
|
||||
'name' => 'price_text',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'description_color',
|
||||
[
|
||||
'label' => esc_html__( 'Description Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__price-wrapper .stratum-price-table__price-description' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'price_description',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Content Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__content-wrapper .stratum-price-table__content' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_font',
|
||||
[
|
||||
'label' => esc_html__( 'Button Font Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_background',
|
||||
[
|
||||
'label' => esc_html__( 'Button Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'background-color: {{VALUE}}; border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_border',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_button_border!' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'price_table_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__header .stratum-price-table__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'title',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__subtitle' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'subtitle',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
], [
|
||||
'name' => 'price_text',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__price-wrapper .stratum-price-table__price' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'price',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_text_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Price Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__price-text' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'subtitle',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
], [
|
||||
'name' => 'price_text',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'description_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Description Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__price-wrapper .stratum-price-table__price-description' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'price_description',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Content Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__content-wrapper .stratum-price-table__content' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_font_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Button Font Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__button .button:hover' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
$controls->add_control(
|
||||
'button_color_background_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Button Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__button .button:hover' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_border_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__button .button:hover' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_button_border!' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Price_Table() );
|
||||
1421
wp-content/plugins/stratum/includes/widgets/table.php
Normal file
1421
wp-content/plugins/stratum/includes/widgets/table.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,521 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Testimonial_Carousel
|
||||
* Name: Testimonial Carousel
|
||||
* Slug: stratum-testimonial-carousel
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
use Elementor\Group_Control_Border;
|
||||
use Elementor\Repeater;
|
||||
use Elementor\Utils;
|
||||
use Elementor\Core\Schemes;
|
||||
use Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Testimonial_Carousel extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'testimonial-carousel';
|
||||
|
||||
public $default_arrows_color = '#7a7a7a';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Testimonial Carousel', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'swiper',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-testimonial-carousel';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls = $this;
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Type your content here...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes()
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'heading',
|
||||
[
|
||||
'label' => esc_html__( 'Heading', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Write heading...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'subtitle',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Write subtitle...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'slides',
|
||||
[
|
||||
'label' => 'Slides',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'separator' => 'after',
|
||||
'default' => [
|
||||
[
|
||||
'heading' => esc_html__( 'Title', 'stratum' ),
|
||||
'subtitle' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' )
|
||||
],
|
||||
[
|
||||
'heading' => esc_html__( 'Title', 'stratum' ),
|
||||
'subtitle' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' )
|
||||
],
|
||||
[
|
||||
'heading' => esc_html__( 'Title', 'stratum' ),
|
||||
'subtitle' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' )
|
||||
],
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'prefix_class' => 'stratum-testimonial-carousel-align%s-',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'slider_width',
|
||||
[
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'label' => esc_html__( 'Slider Width', 'stratum' ),
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 1140
|
||||
],
|
||||
'%' => [
|
||||
'min' => 50
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => '%',
|
||||
'size' => 100,
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => '%',
|
||||
'size' => 100,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel .stratum-testimonial-carousel__container' => 'max-width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_width',
|
||||
[
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'label' => esc_html__( 'Content Width', 'stratum' ),
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 1140
|
||||
],
|
||||
'%' => [
|
||||
'min' => 50
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'default' => [
|
||||
'unit' => '%'
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => '%',
|
||||
'size' => 100,
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => '%',
|
||||
'size' => 100,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel .stratum-testimonial-carousel__content' => 'max-width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_slides_style',
|
||||
[
|
||||
'label' => esc_html__( 'Slides', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'slide_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container' => 'background-color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'slide_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'slide_box_border',
|
||||
'label' => esc_html__( 'Box Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'slide_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'max' => 50,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container' => 'border-radius: {{SIZE}}{{UNIT}}'
|
||||
],
|
||||
'condition' => [
|
||||
'slide_box_border_border!' => ''
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'slide_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'slide_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content_style',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_style',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'image_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__footer' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'heading_style',
|
||||
[
|
||||
'label' => esc_html__( 'Heading', 'stratum' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'heading_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__heading' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'heading_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__heading' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'heading_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-testimonial-carousel__heading',
|
||||
'label' => esc_html__( 'Heading Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle_style',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'subtitle_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__subtitle' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'subtitle_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-testimonial-carousel__subtitle',
|
||||
'label' => esc_html__( 'Subtitle Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'span',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_style',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__text' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'text_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-testimonial-carousel__text',
|
||||
'label' => esc_html__( 'Text Typography', 'stratum' ),
|
||||
'render_type' => 'template'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$sections = new \Stratum\Sections( $this );
|
||||
$sections->advanced_carousel(
|
||||
[
|
||||
'settings' => Controls_Manager::TAB_CONTENT,
|
||||
'navigation' => Controls_Manager::TAB_STYLE
|
||||
],
|
||||
[],
|
||||
[
|
||||
'mousewheel_control',
|
||||
'slides_to_scroll',
|
||||
'dynamic_bullets',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Testimonial_Carousel() );
|
||||
1532
wp-content/plugins/stratum/includes/widgets/vertical-timeline.php
Normal file
1532
wp-content/plugins/stratum/includes/widgets/vertical-timeline.php
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user