| 1 |
<?php |
| 2 |
|
| 3 |
namespace Wpxero\Marqueex\Traits\AnimatedWordRoller; |
| 4 |
|
| 5 |
use Elementor\Controls_Manager; |
| 6 |
use Wpxero\Marqueex\Core\Upsell; |
| 7 |
|
| 8 |
if (!defined('ABSPATH')) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
trait AdditionalOptionsControls { |
| 13 |
|
| 14 |
private function register_additional_options_section_controls() { |
| 15 |
$this->start_controls_section( |
| 16 |
'marqueex_word_roller_additional_section', |
| 17 |
[ |
| 18 |
'label' => __('Additional Options', 'marqueex'), |
| 19 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 20 |
] |
| 21 |
); |
| 22 |
|
| 23 |
$this->add_control( |
| 24 |
'marqueex_word_roller_delay', |
| 25 |
[ |
| 26 |
'label' => __('Active Word Duration', 'marqueex'), |
| 27 |
'description' => __('Time each word stays active (in seconds).', 'marqueex'), |
| 28 |
'type' => Controls_Manager::NUMBER, |
| 29 |
'min' => 1, |
| 30 |
'max' => 10, |
| 31 |
'step' => 1, |
| 32 |
'default' => 1, |
| 33 |
] |
| 34 |
); |
| 35 |
|
| 36 |
$this->add_control( |
| 37 |
'marqueex_word_roller_visible_words', |
| 38 |
[ |
| 39 |
'label' => __('Visible Words', 'marqueex'), |
| 40 |
'type' => Controls_Manager::NUMBER, |
| 41 |
'min' => 1, |
| 42 |
'max' => 50, |
| 43 |
'step' => 1, |
| 44 |
'default' => 5, |
| 45 |
] |
| 46 |
); |
| 47 |
|
| 48 |
$free_animations = [ |
| 49 |
'vertical' => __('Vertical Scroll', 'marqueex'), |
| 50 |
]; |
| 51 |
|
| 52 |
$pro_animations = [ |
| 53 |
'horizontal' => __('Horizontal Scroll', 'marqueex'), |
| 54 |
'fade' => __('Fade', 'marqueex'), |
| 55 |
'slide' => __('Slide', 'marqueex'), |
| 56 |
'zoom' => __('Zoom', 'marqueex'), |
| 57 |
]; |
| 58 |
|
| 59 |
$this->add_control( |
| 60 |
'marqueex_word_roller_animation_type', |
| 61 |
[ |
| 62 |
'label' => __('Animation Type', 'marqueex'), |
| 63 |
'type' => Controls_Manager::SELECT, |
| 64 |
'default' => 'vertical', |
| 65 |
'options' => Upsell::merge_select_options($free_animations, $pro_animations), |
| 66 |
] |
| 67 |
); |
| 68 |
|
| 69 |
Upsell::add_elementor_notice($this, 'marqueex_word_roller_pro_notice', [ |
| 70 |
'title' => __('4 more word transitions', 'marqueex'), |
| 71 |
'description' => __('Roll words sideways, or swap them with a fade, slide or zoom instead of a vertical scroll.', 'marqueex'), |
| 72 |
'items' => array_values($pro_animations), |
| 73 |
'cta' => __('Unlock these transitions', 'marqueex'), |
| 74 |
'source' => 'elementor-word-roller', |
| 75 |
]); |
| 76 |
|
| 77 |
$this->add_control( |
| 78 |
'marqueex_word_roller_pause_on_hover', |
| 79 |
[ |
| 80 |
'label' => __('Pause on Hover', 'marqueex'), |
| 81 |
'type' => Controls_Manager::SWITCHER, |
| 82 |
'label_on' => __('Yes', 'marqueex'), |
| 83 |
'label_off' => __('No', 'marqueex'), |
| 84 |
'return_value' => 'yes', |
| 85 |
'default' => 'no', |
| 86 |
] |
| 87 |
); |
| 88 |
|
| 89 |
$this->add_control( |
| 90 |
'marqueex_word_roller_notice', |
| 91 |
[ |
| 92 |
'type' => Controls_Manager::ALERT, |
| 93 |
'alert_type' => 'warning', |
| 94 |
'heading' => __('Visible Words Notice', 'marqueex'), |
| 95 |
'content' => __('Please make sure to select an odd number that is less than or equal to the total number of words in your list.', 'marqueex'), |
| 96 |
] |
| 97 |
); |
| 98 |
|
| 99 |
$this->end_controls_section(); |
| 100 |
} |
| 101 |
} |
| 102 |
|