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

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