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 / custom-slider.php

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

101 lines 3.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\Plugin;
4
5 defined('ABSPATH') || exit();
6
7 /**
8 * Custom Slider
9 *
10 * @author Lucas Marini Falbo <lucas@uicore.co>
11 * @since 1.0.7
12 */
13
14 class CustomSlider extends CustomCarousel {
15
16 public function get_name()
17 {
18 return 'uicore-custom-slider';
19 }
20 public function get_title()
21 {
22 return esc_html__('Custom Slider', 'uicore-elements');
23 }
24 public function get_icon()
25 {
26 return 'eicon-slides ui-e-widget';
27 }
28 public function get_categories()
29 {
30 return ['uicore'];
31 }
32 public function get_keywords()
33 {
34 return ['slide', 'carousel', 'nested'];
35 }
36 public function get_styles()
37 {
38 $styles = [
39 'custom-slider',
40 'carousel',
41 'animation', // hover animations
42 'entrance', // entrance basic style
43 ];
44 if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){
45 $styles['e-animations'] = [ // entrance animations
46 'external' => true,
47 ];
48 }
49 return $styles;
50 }
51
52 protected function register_controls(bool $is_slider = false)
53 {
54
55 parent::register_controls(true); // inherit original controls and enables slider height
56
57 // Change default border radius to zero
58 $this->update_control( 'item_border_radius', [
59 'default' => [
60 'top' => 0,
61 'right' => 0,
62 'bottom' => 0,
63 'left' => 0,
64 'unit' => 'px',
65 'isLinked' => true,
66 ],
67 ]);
68 // Add special animation slide
69 $this->update_control('animation_style',[
70 'default' => 'fade',
71 'options' => [
72 'coverflow' => esc_html__('Coverflow', 'uicore-elements'),
73 'fade' => esc_html__('Fade', 'uicore-elements'),
74 'cards' => esc_html__('Cards', 'uicore-elements'),
75 'flip' => esc_html__('Flip', 'uicore-elements'),
76 'creative' => esc_html__('Creative', 'uicore-elements'),
77 'stacked' => esc_html__('Stacked', 'uicore-elements'),
78 ]
79 ]);
80 // Decrease default item padding
81 $this->update_control('item_padding', [
82 'default' => [
83 'top' => 25,
84 'right' => 25,
85 'bottom' => 25,
86 'left' => 25,
87 'unit' => 'px',
88 'isLinked' => true,
89 ],
90 ]);
91
92 // Remove controls that are meant for carousel, not slide type widgets
93 $this->remove_responsive_control('slides_per_view');
94 $this->remove_control('show_hidden');
95 $this->remove_control('fade_edges');
96 $this->remove_control('fade_edges_alert');
97 $this->remove_control('match_height');
98 $this->remove_control('carousel_gap');
99 }
100 }
101 \Elementor\Plugin::instance()->widgets_manager->register(new CustomSlider());