PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.17
UiCore Elements – Free widgets and templates for Elementor v1.3.17
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.3.17, at includes/widgets/logo-carousel.php

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