PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.2.3
UiCore Elements – Free widgets and templates for Elementor v1.2.3
1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 All 41 releases
uicore-elements / includes / widgets / logo-carousel.php

logo-carousel.php in UiCore Elements – Free widgets and templates for Elementor 1.2.3, at includes/widgets/logo-carousel.php

174 lines 5.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace UiCoreElements;
3 use Elementor\Controls_Manager;
4 use UiCoreElements\UiCoreWidget;
5 use UiCoreElements\Utils\Carousel_Trait;
6 use UiCoreElements\Utils\Logo_Trait;
7 use UiCoreElements\Utils\Animation_Trait;
8 use UicoreElements\Utils\Item_Style_Component;
9
10 defined('ABSPATH') || exit();
11
12 /**
13 * Logo Carousel
14 *
15 * @author Lucas Marini Falbo <lucas@uicore.co>
16 * @since 1.0.1
17 */
18
19 class LogoCarousel extends UiCoreWidget
20 {
21
22 use Carousel_Trait;
23 use Logo_Trait;
24 use Animation_Trait;
25 use Item_Style_Component;
26
27 public function get_name()
28 {
29 return 'uicore-logo-carousel';
30 }
31 public function get_title()
32 {
33 return esc_html__('Logo Carousel', 'uicore-elements');
34 }
35 public function get_icon()
36 {
37 return 'eicon-logo ui-e-widget';
38 }
39 public function get_categories()
40 {
41 return ['uicore'];
42 }
43 public function get_keywords()
44 {
45 return ['logo', 'client', 'brand', 'showcase', 'carousel', 'slide'];
46 }
47 public function get_styles()
48 {
49 $styles = [
50 'logo-carousel',
51 'carousel',
52 'animation', // hover animations
53 'entrance', // entrance basic style
54 ];
55 if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){
56 $styles['e-animations'] = [ // entrance animations
57 'external' => true,
58 ];
59 }
60 return $styles;
61 }
62 public function get_scripts()
63 {
64 return $this->TRAIT_get_carousel_scripts();
65 }
66 public function has_widget_inner_wrapper(): bool {
67 // TODO: remove after 3.30, when the full deprecation of widget innet wrapper is ready
68 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
69 }
70 protected function register_controls()
71 {
72
73 $this->TRAIT_register_logo_repeater_controls('Logo Carousel Items'); // Repeater Controls
74
75 $this->start_controls_section(
76 'section_carousel_settings',
77 [
78 'label' => __('Carousel Settings', 'uicore-elements'),
79 ]
80 );
81
82 $this->TRAIT_register_carousel_additional_controls(); // Carousel Additionals
83 $this->TRAIT_register_logo_adittional_controls();
84 $this->add_control('add_carousel_divider',['type' => Controls_Manager::DIVIDER,]);
85 $this->TRAIT_register_carousel_settings_controls(); // Carousel settings
86
87 $this->end_controls_section();
88
89 $this->TRAIT_register_navigation_controls(); // Navigation settings
90
91 $this->start_controls_section(
92 'section_style_review_items',
93 [
94 'label' => esc_html__( 'Logo Carousel', 'uicore-elements' ),
95 'tab' => Controls_Manager::TAB_STYLE,
96 ]
97 );
98
99 $this->start_controls_tabs( 'tabs_item_style' );
100
101 $this->start_controls_tab(
102 'tab_item_normal',
103 [
104 'label' => esc_html__( 'Normal', 'uicore-elements' ),
105 ]
106 );
107 $this->TRAIT_register_normal_item_style_controls(false);
108 $this->TRAIT_register_logos_image_style_controls('normal');
109 $this->end_controls_tab();
110
111 $this->start_controls_tab(
112 'tab_item_hover',
113 [
114 'label' => esc_html__( 'Hover', 'uicore-elements' ),
115 ]
116 );
117 $this->TRAIT_register_hover_item_style_controls(false);
118 $this->TRAIT_register_logos_image_style_controls('hover');
119 $this->end_controls_tab();
120
121 $this->start_controls_tab(
122 'tab_item_active',
123 [
124 'label' => esc_html__( 'Active', 'uicore-elements' ),
125 ]
126 );
127 $this->TRAIT_register_active_item_style_controls(false);
128 $this->TRAIT_register_logos_image_style_controls('active');
129 $this->end_controls_tabs();
130
131 $this->end_controls_tabs(); // Necessary because register_testimonial_card_controls() OPENS but DON'T close start_controls_tabs()
132
133 $this->end_controls_section();
134
135 $this->TRAIT_register_navigation_style_controls(); // Carousel Navigation Styles
136
137 $this->start_controls_section(
138 'section_style_animations',
139 [
140 'label' => __('Animations', 'uicore-elements'),
141 'tab' => Controls_Manager::TAB_STYLE,
142 ]
143 );
144
145 $this->TRAIT_register_entrance_animations_controls();
146 $this->TRAIT_register_hover_animation_control(
147 'Item Hover Animation',
148 [],
149 ['underline']
150 );
151 $this->TRAIT_register_hover_animation_control(
152 'Logo Hover Animation',
153 [],
154 ['underline']
155 );
156
157 $this->end_controls_section();
158
159 // Remove unused logo control
160 $this->remove_control('height');
161 }
162 public function render()
163 {
164 ?>
165 <div class="ui-e-carousel swiper">
166 <div class='swiper-wrapper'>
167 <?php $this->TRAIT_render_logo_item(); ?>
168 </div>
169 </div>
170 <?php $this->TRAIT_render_carousel_navigations(); ?>
171 <?php
172 }
173 }
174 \Elementor\Plugin::instance()->widgets_manager->register(new LogoCarousel());