| 1 |
<?php |
| 2 |
|
| 3 |
namespace Wpxero\Marqueex\Traits\AnimatedWordRoller; |
| 4 |
|
| 5 |
use Elementor\Controls_Manager; |
| 6 |
use Elementor\Repeater; |
| 7 |
|
| 8 |
if (!defined('ABSPATH')) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
trait ContentControls { |
| 13 |
|
| 14 |
private function register_content_section_controls() { |
| 15 |
$this->start_controls_section( |
| 16 |
'marqueex_word_roller_content_section', |
| 17 |
[ |
| 18 |
'label' => __('Content', 'marqueex'), |
| 19 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 20 |
] |
| 21 |
); |
| 22 |
|
| 23 |
$this->add_control( |
| 24 |
'marqueex_word_roller_title', |
| 25 |
[ |
| 26 |
'label' => __('Title', 'marqueex'), |
| 27 |
'type' => Controls_Manager::TEXT, |
| 28 |
'default' => __('The Ultimate Solution for', 'marqueex'), |
| 29 |
'placeholder' => __('Type your title here', 'marqueex'), |
| 30 |
'label_block' => true, |
| 31 |
] |
| 32 |
); |
| 33 |
|
| 34 |
$word_repeater = new Repeater(); |
| 35 |
|
| 36 |
$word_repeater->add_control( |
| 37 |
'marqueex_word_roller_text', |
| 38 |
[ |
| 39 |
'label' => __('Word', 'marqueex'), |
| 40 |
'type' => Controls_Manager::TEXT, |
| 41 |
'default' => __('Default title', 'marqueex'), |
| 42 |
'placeholder' => __('Type your word here', 'marqueex'), |
| 43 |
'label_block' => true, |
| 44 |
] |
| 45 |
); |
| 46 |
|
| 47 |
$word_repeater->add_control( |
| 48 |
'marqueex_word_roller_icon', |
| 49 |
[ |
| 50 |
'label' => __('Text Icon', 'marqueex'), |
| 51 |
'type' => Controls_Manager::ICONS, |
| 52 |
'label_block' => true, |
| 53 |
'skin' => 'inline', |
| 54 |
'default' => [ |
| 55 |
'value' => 'fas fa-heart', |
| 56 |
'library' => 'fa-solid', |
| 57 |
], |
| 58 |
] |
| 59 |
); |
| 60 |
|
| 61 |
$this->add_control( |
| 62 |
'marqueex_word_roller_words', |
| 63 |
[ |
| 64 |
'label' => __('Word Lists', 'marqueex'), |
| 65 |
'type' => Controls_Manager::REPEATER, |
| 66 |
'fields' => $word_repeater->get_controls(), |
| 67 |
'default' => [ |
| 68 |
[ |
| 69 |
'marqueex_word_roller_text' => __('Developers', 'marqueex'), |
| 70 |
], |
| 71 |
[ |
| 72 |
'marqueex_word_roller_text' => __('Designers', 'marqueex'), |
| 73 |
], |
| 74 |
[ |
| 75 |
'marqueex_word_roller_text' => __('Legal Experts', 'marqueex'), |
| 76 |
], |
| 77 |
[ |
| 78 |
'marqueex_word_roller_text' => __('Doctors', 'marqueex'), |
| 79 |
], |
| 80 |
[ |
| 81 |
'marqueex_word_roller_text' => __('Teachers', 'marqueex'), |
| 82 |
], |
| 83 |
[ |
| 84 |
'marqueex_word_roller_text' => __('Attorneys', 'marqueex'), |
| 85 |
], |
| 86 |
], |
| 87 |
'title_field' => '{{{ marqueex_word_roller_text }}}', |
| 88 |
] |
| 89 |
); |
| 90 |
|
| 91 |
$this->add_control( |
| 92 |
'marqueex_word_roller_html_tag', |
| 93 |
[ |
| 94 |
'label' => __('Title HTML Tag', 'marqueex'), |
| 95 |
'type' => Controls_Manager::SELECT, |
| 96 |
'default' => 'h2', |
| 97 |
'options' => [ |
| 98 |
'h1' => __('H1', 'marqueex'), |
| 99 |
'h2' => __('H2', 'marqueex'), |
| 100 |
'h3' => __('H3', 'marqueex'), |
| 101 |
'h4' => __('H4', 'marqueex'), |
| 102 |
'h5' => __('H5', 'marqueex'), |
| 103 |
'h6' => __('H6', 'marqueex'), |
| 104 |
'div' => __('div', 'marqueex'), |
| 105 |
] |
| 106 |
] |
| 107 |
); |
| 108 |
|
| 109 |
$this->add_control( |
| 110 |
'marqueex_word_roller_alignment', |
| 111 |
[ |
| 112 |
'label' => __('Alignment', 'marqueex'), |
| 113 |
'type' => Controls_Manager::CHOOSE, |
| 114 |
'options' => [ |
| 115 |
'left' => [ |
| 116 |
'title' => __('Left', 'marqueex'), |
| 117 |
'icon' => 'eicon-text-align-left', |
| 118 |
], |
| 119 |
'center' => [ |
| 120 |
'title' => __('Center', 'marqueex'), |
| 121 |
'icon' => 'eicon-text-align-center', |
| 122 |
], |
| 123 |
'right' => [ |
| 124 |
'title' => __('Right', 'marqueex'), |
| 125 |
'icon' => 'eicon-text-align-right', |
| 126 |
], |
| 127 |
], |
| 128 |
'default' => 'center', |
| 129 |
'toggle' => true, |
| 130 |
'selectors' => [ |
| 131 |
'{{WRAPPER}} .marqueex-word-roller-container' => 'justify-content: {{VALUE}};', |
| 132 |
], |
| 133 |
] |
| 134 |
); |
| 135 |
|
| 136 |
$this->end_controls_section(); |
| 137 |
} |
| 138 |
} |
| 139 |
|