| 1 |
<?php |
| 2 |
namespace UiCoreElements; |
| 3 |
|
| 4 |
defined('ABSPATH') || exit(); |
| 5 |
|
| 6 |
/** |
| 7 |
* Testimonial Slider |
| 8 |
* |
| 9 |
* Use Testimonial Carousel as base |
| 10 |
* |
| 11 |
* @author Lucas Marini Falbo <lucas@uicore.co> |
| 12 |
* @since 1.0.1 |
| 13 |
*/ |
| 14 |
|
| 15 |
class TestimonialSlider extends TestimonialCarousel |
| 16 |
{ |
| 17 |
|
| 18 |
public $is_slider = true; |
| 19 |
|
| 20 |
public function get_name() |
| 21 |
{ |
| 22 |
return 'uicore-testimonial-slider'; |
| 23 |
} |
| 24 |
public function get_title() |
| 25 |
{ |
| 26 |
return esc_html__('Testimonial Slider', 'uicore-elements'); |
| 27 |
} |
| 28 |
public function get_icon() |
| 29 |
{ |
| 30 |
return 'eicon-testimonial ui-e-widget'; |
| 31 |
} |
| 32 |
public function get_styles() |
| 33 |
{ |
| 34 |
return [ |
| 35 |
'testimonial-slider', |
| 36 |
'animation', // hover animations |
| 37 |
'entrance', // entrance basic style |
| 38 |
'e-animations' => [ // entrance animations |
| 39 |
'condition' => [ |
| 40 |
'animation_assets' => 'false' |
| 41 |
], |
| 42 |
'external' => true, |
| 43 |
] |
| 44 |
]; |
| 45 |
} |
| 46 |
protected function register_controls() { |
| 47 |
|
| 48 |
parent::register_controls(); // keep original controls |
| 49 |
|
| 50 |
// Control Updates |
| 51 |
$this->update_control('h_alignment', ['default' => 'center']); |
| 52 |
// Default avatar size with one slide visible per time is too big, needs a decrease |
| 53 |
$this->update_control( 'avatar_size', |
| 54 |
[ |
| 55 |
'devices' => ['desktop', 'tablet', 'mobile'], |
| 56 |
'default' => [ |
| 57 |
'size' => 10, |
| 58 |
'unit' => '%' |
| 59 |
], |
| 60 |
'tablet_default' => [ |
| 61 |
'size' => 15, |
| 62 |
'unit' => '%' |
| 63 |
], |
| 64 |
'mobile_default' => [ |
| 65 |
'size' => 40, |
| 66 |
'unit' => '%' |
| 67 |
], |
| 68 |
] |
| 69 |
); |
| 70 |
// Change default border radius to zero |
| 71 |
$this->update_control( 'item_border_radius', [ |
| 72 |
'default' => [ |
| 73 |
'top' => 0, |
| 74 |
'right' => 0, |
| 75 |
'bottom' => 0, |
| 76 |
'left' => 0, |
| 77 |
'unit' => 'px', |
| 78 |
'isLinked' => true, |
| 79 |
], |
| 80 |
]); |
| 81 |
// Remove item entrance and hover animation |
| 82 |
$this->remove_control('item_hover_animation'); |
| 83 |
|
| 84 |
} |
| 85 |
} |
| 86 |
\Elementor\Plugin::instance()->widgets_manager->register(new TestimonialSlider()); |