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

195 lines 6.0 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 'animation', // hover animations
52 'entrance', // entrance basic style
53 ];
54 if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){
55 $styles['e-animations'] = [ // entrance animations
56 'external' => true,
57 ];
58 }
59 return $styles;
60 }
61 public function get_scripts()
62 {
63 return [
64 'carousel',
65 'utils/global-testimonial' => [
66 'condition' => [
67 'layout' => 'layout_5'
68 ],
69 ],
70 'utils/carousel-effects/circular' => [
71 'condition' => [
72 'animation_style' => 'circular',
73 ]
74 ],
75 'utils/carousel-effects/fade-and-blur' => [
76 'condition' => [
77 'animation_style' => 'fade_blur',
78 ]
79 ],
80 'entrance' => [
81 'condition' => [
82 'animate_items' => 'ui-e-grid-animate'
83 ],
84 ]
85 ];
86 }
87 protected function register_controls()
88 {
89
90 $this->TRAIT_register_logo_repeater_controls('Logo Carousel Items'); // Repeater Controls
91
92 $this->start_controls_section(
93 'section_carousel_settings',
94 [
95 'label' => __('Carousel Settings', 'uicore-elements'),
96 ]
97 );
98
99 $this->TRAIT_register_carousel_additional_controls(); // Carousel Additionals
100 $this->TRAIT_register_logo_adittional_controls();
101 $this->add_control('add_carousel_divider',['type' => Controls_Manager::DIVIDER,]);
102 $this->TRAIT_register_carousel_settings_controls(); // Carousel settings
103
104 $this->end_controls_section();
105
106 $this->TRAIT_register_navigation_controls(); // Navigation settings
107
108 $this->start_controls_section(
109 'section_style_review_items',
110 [
111 'label' => esc_html__( 'Logo Carousel', 'uicore-elements' ),
112 'tab' => Controls_Manager::TAB_STYLE,
113 ]
114 );
115
116 $this->start_controls_tabs( 'tabs_item_style' );
117
118 $this->start_controls_tab(
119 'tab_item_normal',
120 [
121 'label' => esc_html__( 'Normal', 'uicore-elements' ),
122 ]
123 );
124 $this->TRAIT_register_normal_item_style_controls(false);
125 $this->TRAIT_register_logos_image_style_controls('normal');
126 $this->end_controls_tab();
127
128 $this->start_controls_tab(
129 'tab_item_hover',
130 [
131 'label' => esc_html__( 'Hover', 'uicore-elements' ),
132 ]
133 );
134 $this->TRAIT_register_hover_item_style_controls(false);
135 $this->TRAIT_register_logos_image_style_controls('hover');
136 $this->end_controls_tab();
137
138 $this->start_controls_tab(
139 'tab_item_active',
140 [
141 'label' => esc_html__( 'Active', 'uicore-elements' ),
142 ]
143 );
144 $this->TRAIT_register_active_item_style_controls(false);
145 $this->TRAIT_register_logos_image_style_controls('active');
146 $this->end_controls_tabs();
147
148 $this->end_controls_tabs(); // Necessary because register_testimonial_card_controls() OPENS but DON'T close start_controls_tabs()
149
150 $this->end_controls_section();
151
152 $this->TRAIT_register_navigation_style_controls(); // Carousel Navigation Styles
153
154 $this->start_controls_section(
155 'section_style_animations',
156 [
157 'label' => __('Animations', 'uicore-elements'),
158 'tab' => Controls_Manager::TAB_STYLE,
159 ]
160 );
161
162 $this->TRAIT_register_entrance_animations_controls();
163 $this->TRAIT_register_hover_animation_control(
164 'Item Hover Animation',
165 [],
166 ['underline']
167 );
168 $this->TRAIT_register_hover_animation_control(
169 'Logo Hover Animation',
170 [],
171 ['underline']
172 );
173
174 $this->end_controls_section();
175
176 // Remove unused logo control
177 $this->remove_control('height');
178 }
179 public function render()
180 {
181 $ID = $this->get_ID();
182 $settings = $this->get_settings_for_display();
183
184 $this->add_render_attribute('review-carousel', 'class', ['ui-e-carousel', "carousel-$ID"]);
185 ?>
186 <div class="ui-e-carousel swiper">
187 <div class='swiper-wrapper'>
188 <?php $this->TRAIT_render_logo_item(); ?>
189 </div>
190 <?php $this->TRAIT_render_carousel_navigations(); ?>
191 </div>
192 <?php
193 }
194 }
195 \Elementor\Plugin::instance()->widgets_manager->register(new LogoCarousel());