PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.2.0
UiCore Elements – Free widgets and templates for Elementor v1.2.0
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 / gallery-slider.php

gallery-slider.php in UiCore Elements – Free widgets and templates for Elementor 1.2.0, at includes/widgets/gallery-slider.php

126 lines 4.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
4 use Elementor\Controls_Manager;
5
6 defined('ABSPATH') || exit();
7
8 /**
9 * Gallery Slider
10 *
11 * Use Gallery Carousel as base
12 *
13 * @author Lucas Marini Falbo <lucas95@uicore.co>
14 * @since 1.0.14
15 */
16
17 class GallerySlider extends GalleryCarousel
18 {
19 public function get_name()
20 {
21 return 'uicore-gallery-slider';
22 }
23 public function get_title()
24 {
25 return esc_html__('Gallery Slider', 'uicore-elements');
26 }
27 public function get_icon()
28 {
29 return 'eicon-slides ui-e-widget';
30 }
31 public function get_styles()
32 {
33 $styles = parent::get_styles();
34
35 // replace 'gallery-carousel' for 'gallery-slider'
36 unset($styles['gallery-carousel']);
37 $styles[] = 'gallery-slider';
38
39 return $styles;
40 }
41 protected function register_controls()
42 {
43 parent::register_controls(); // keep original controls
44
45 // Add special animation slide
46 $this->update_control(
47 'animation_style',
48 [
49 'default' => 'fade',
50 'options' => [
51 'coverflow' => esc_html__('Coverflow', 'uicore-elements'),
52 'fade' => esc_html__('Fade', 'uicore-elements'),
53 'cards' => esc_html__('Cards', 'uicore-elements'),
54 'flip' => esc_html__('Flip', 'uicore-elements'),
55 'creative' => esc_html__('Creative', 'uicore-elements'),
56 'stacked' => esc_html__('Stacked', 'uicore-elements'),
57 ]
58 ]
59 );
60
61 // Remove conditions from image height
62 $this->update_responsive_control(
63 'image_height',
64 [
65 'conditions' => false,
66 ]
67 );
68
69 // Remove item entrance and hover animation
70 $this->remove_control('animate_items');
71 $this->remove_control('item_hover_animation');
72
73 // Remove item active state styles
74 $this->remove_control('tab_item_active');
75 $this->remove_control('item_active_background');
76 $this->remove_control('item_active_border_color');
77 $this->remove_control('item_active_box_shadow');
78
79 // Remove controls that are meant for carousel, not slide type widgets
80 $this->remove_responsive_control('slides_per_view');
81 $this->remove_control('show_hidden');
82 $this->remove_control('fade_edges');
83 $this->remove_control('fade_edges_alert');
84 $this->remove_control('match_height');
85 $this->remove_control('carousel_gap');
86 $this->remove_control('main_image');
87
88 // Add vertical content alignment control
89 $this->start_injection([
90 'of' => 'layout',
91 'at' => 'after',
92 ]);
93
94 $this->add_responsive_control(
95 'content_v_alignment',
96 [
97 'label' => __('Vertical Alignment', 'uicore-elements'),
98 'type' => Controls_Manager::CHOOSE,
99 'default' => 'start',
100 'options' => [
101 'start' => [
102 'title' => __('Left', 'uicore-elements'),
103 'icon' => 'eicon-align-start-v',
104 ],
105 'center' => [
106 'title' => __('Center', 'uicore-elements'),
107 'icon' => 'eicon-align-center-v',
108 ],
109 'end' => [
110 'title' => __('Right', 'uicore-elements'),
111 'icon' => 'eicon-align-end-v',
112 ],
113 ],
114 'condition' => [
115 'layout' => 'ui-e-overlay'
116 ],
117 'selectors' => [
118 '{{WRAPPER}} .ui-e-content' => 'justify-content: {{VALUE}};',
119 ]
120 ]
121 );
122
123 $this->end_injection();
124 }
125 }
126 \Elementor\Plugin::instance()->widgets_manager->register(new GallerySlider());