PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.84
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.84
4.11.84 4.11.83 4.11.82 4.11.80 4.11.81 4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-fancytext.php
premium-addons-for-elementor / widgets Last commit date
dep 3 weeks ago premium-banner.php 1 day ago premium-blog.php 2 weeks ago premium-button.php 2 weeks ago premium-carousel.php 2 weeks ago premium-contactform.php 2 weeks ago premium-countdown.php 2 weeks ago premium-counter.php 2 weeks ago premium-dual-header.php 2 weeks ago premium-fancytext.php 2 weeks ago premium-grid.php 2 weeks ago premium-icon-list.php 2 weeks ago premium-image-button.php 2 weeks ago premium-image-scroll.php 2 weeks ago premium-image-separator.php 2 weeks ago premium-lottie.php 2 weeks ago premium-maps.php 2 days ago premium-media-wheel.php 2 weeks ago premium-mobile-menu.php 2 weeks ago premium-modalbox.php 2 days ago premium-nav-menu.php 2 weeks ago premium-notifications.php 2 weeks ago premium-person.php 2 weeks ago premium-pinterest-feed.php 2 weeks ago premium-post-ticker.php 2 weeks ago premium-pricing-table.php 2 days ago premium-progressbar.php 2 weeks ago premium-search-form.php 2 days ago premium-svg-drawer.php 2 weeks ago premium-tcloud.php 2 weeks ago premium-testimonials.php 2 weeks ago premium-textual-showcase.php 2 weeks ago premium-tiktok-feed.php 2 weeks ago premium-title.php 2 days ago premium-videobox.php 2 weeks ago premium-vscroll.php 2 weeks ago premium-weather.php 2 weeks ago premium-world-clock.php 2 weeks ago
premium-fancytext.php
1596 lines
1 <?php
2 /**
3 * Premium Fancy Text.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Plugin;
10 use Elementor\Widget_Base;
11 use Elementor\Controls_Manager;
12 use Elementor\Repeater;
13 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
14 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
15 use Elementor\Group_Control_Typography;
16 use Elementor\Group_Control_Text_Shadow;
17
18 // PremiumAddons Classes.
19 use PremiumAddons\Includes\Helper_Functions;
20 use PremiumAddons\Includes\Controls\Premium_Background;
21
22
23 if ( ! defined( 'ABSPATH' ) ) {
24 exit; // If this file is called directly, abort.
25 }
26
27 /**
28 * Class Premium_Fancytext
29 */
30 class Premium_Fancytext extends Widget_Base {
31
32
33 /**
34 * Retrieve Widget Name.
35 *
36 * @since 1.0.0
37 * @access public
38 */
39 public function get_name() {
40 return 'premium-addon-fancy-text';
41 }
42
43 /**
44 * Retrieve Widget Title.
45 *
46 * @since 1.0.0
47 * @access public
48 */
49 public function get_title() {
50 return __( 'Animated Text', 'premium-addons-for-elementor' );
51 }
52
53 /**
54 * Retrieve Widget Icon.
55 *
56 * @since 1.0.0
57 * @access public
58 *
59 * @return string widget icon.
60 */
61 public function get_icon() {
62 return 'pa-fancy-text';
63 }
64
65 /**
66 * Retrieve Widget Dependent CSS.
67 *
68 * @since 1.0.0
69 * @access public
70 *
71 * @return array CSS style handles.
72 */
73 public function get_style_depends() {
74 return array(
75 'pa-glass',
76 'premium-addons',
77 );
78 }
79
80 /**
81 * Retrieve Widget Dependent JS.
82 *
83 * @since 1.0.0
84 * @access public
85 *
86 * @return array JS script handles.
87 */
88 public function get_script_depends() {
89
90 $is_edit = Helper_Functions::is_edit_mode();
91
92 $scripts = array();
93
94 if ( $is_edit ) {
95
96 $scripts = array( 'pa-glass', 'pa-typed', 'pa-vticker' );
97
98 } else {
99 $settings = $this->get_settings();
100
101 if ( 'switch' === $settings['style'] ) {
102 if ( 'typing' === $settings['premium_fancy_text_effect'] ) {
103 $scripts[] = 'pa-typed';
104 } elseif ( 'slide' === $settings['premium_fancy_text_effect'] ) {
105 $scripts[] = 'pa-vticker';
106 }
107 }
108
109 if ( 'none' !== $settings['text_lq_effect'] ) {
110 $scripts[] = 'pa-glass';
111 }
112 }
113
114 $scripts[] = 'premium-addons';
115
116 return $scripts;
117 }
118
119 /**
120 * Retrieve Widget Keywords.
121 *
122 * @since 1.0.0
123 * @access public
124 *
125 * @return array Widget keywords.
126 */
127 public function get_keywords() {
128 return array( 'pa', 'premium', 'premium animated text', 'fancy', 'typing', 'headline', 'heading', 'animation' );
129 }
130
131 protected function is_dynamic_content(): bool {
132 return false;
133 }
134
135 /**
136 * Retrieve Widget Categories.
137 *
138 * @since 1.5.1
139 * @access public
140 *
141 * @return array Widget categories.
142 */
143 public function get_categories() {
144 return array( 'premium-elements' );
145 }
146
147 /**
148 * Widget preview refresh button.
149 *
150 * @since 1.0.0
151 * @access public
152 */
153 public function is_reload_preview_required() {
154 return true;
155 }
156
157 /**
158 * Retrieve Widget Support URL.
159 *
160 * @access public
161 *
162 * @return string support URL.
163 */
164 public function get_custom_help_url() {
165 return 'https://premiumaddons.com/support/';
166 }
167
168 public function has_widget_inner_wrapper(): bool {
169 return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' );
170 }
171
172 /**
173 * Register Testimonials controls.
174 *
175 * @since 1.0.0
176 * @access protected
177 */
178 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
179
180 $this->start_controls_section(
181 'general_section',
182 array(
183 'label' => __( 'General', 'premium-addons-for-elementor' ),
184 )
185 );
186
187 $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-animated-text-widget/', 'fancy-text', 'wp-editor', 'demo' );
188 Helper_Functions::add_templates_controls( $this, 'animated-text', $demo );
189
190 $this->add_control(
191 'style',
192 array(
193 'label' => __( 'Text Style', 'premium-addons-for-elementor' ),
194 'type' => Controls_Manager::SELECT,
195 'prefix_class' => 'premium-atext__',
196 'options' => array(
197 'switch' => __( 'Switched', 'premium-addons-for-elementor' ),
198 'highlight' => __( 'Highlighted', 'premium-addons-for-elementor' ),
199 ),
200 'default' => 'switch',
201 'render_type' => 'template',
202 )
203 );
204
205 $this->add_control(
206 'premium_fancy_prefix_text',
207 array(
208 'label' => __( 'Before Text', 'premium-addons-for-elementor' ),
209 'type' => Controls_Manager::TEXT,
210 'dynamic' => array( 'active' => true ),
211 'default' => __( 'This is', 'premium-addons-for-elementor' ),
212 'label_block' => true,
213 )
214 );
215
216 $this->add_control(
217 'text',
218 array(
219 'label' => __( 'Highlighted Text', 'premium-addons-for-elementor' ),
220 'type' => Controls_Manager::TEXT,
221 'dynamic' => array( 'active' => true ),
222 'separator' => 'before',
223 'default' => __( 'animated', 'premium-addons-for-elementor' ),
224 'label_block' => true,
225 'condition' => array(
226 'style' => 'highlight',
227 ),
228 )
229 );
230
231 $repeater = new REPEATER();
232
233 $repeater->add_control(
234 'premium_text_strings_text_field',
235 array(
236 'label' => __( 'Fancy String', 'premium-addons-for-elementor' ),
237 'dynamic' => array( 'active' => true ),
238 'type' => Controls_Manager::TEXT,
239 'label_block' => true,
240 )
241 );
242
243 $this->add_control(
244 'premium_fancy_text_strings',
245 array(
246 'label' => __( 'Animated Text', 'premium-addons-for-elementor' ),
247 'type' => Controls_Manager::REPEATER,
248 'default' => array(
249 array(
250 'premium_text_strings_text_field' => __( 'Designer', 'premium-addons-for-elementor' ),
251 ),
252 array(
253 'premium_text_strings_text_field' => __( 'Developer', 'premium-addons-for-elementor' ),
254 ),
255 array(
256 'premium_text_strings_text_field' => __( 'Awesome', 'premium-addons-for-elementor' ),
257 ),
258 ),
259 'fields' => $repeater->get_controls(),
260 'title_field' => '{{{ premium_text_strings_text_field }}}',
261 'condition' => array(
262 'style' => 'switch',
263 ),
264 )
265 );
266
267 $this->add_control(
268 'premium_fancy_suffix_text',
269 array(
270 'label' => __( 'After Text', 'premium-addons-for-elementor' ),
271 'type' => Controls_Manager::TEXT,
272 'dynamic' => array( 'active' => true ),
273 'default' => __( 'Text', 'premium-addons-for-elementor' ),
274 'label_block' => true,
275 )
276 );
277
278 $this->add_control(
279 'link',
280 array(
281 'label' => __( 'Link', 'premium-addons-for-elementor' ),
282 'type' => Controls_Manager::URL,
283 'dynamic' => array(
284 'active' => true,
285 ),
286 'separator' => 'before',
287 )
288 );
289
290 $this->add_responsive_control(
291 'display',
292 array(
293 'label' => __( 'Display', 'premium-addons-for-elementor' ),
294 'type' => Controls_Manager::SELECT,
295 'options' => array(
296 'inline' => __( 'Inline', 'premium-addons-for-elementor' ),
297 'block' => __( 'Block', 'premium-addons-for-elementor' ),
298 ),
299 'default' => 'inline',
300 'selectors' => array(
301 '{{WRAPPER}} .premium-prefix-text, {{WRAPPER}} .premium-suffix-text' => 'display: {{VALUE}}',
302 ),
303 'label_block' => true,
304 )
305 );
306
307 $this->add_responsive_control(
308 'premium_fancy_text_align',
309 array(
310 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
311 'type' => Controls_Manager::CHOOSE,
312 'options' => array(
313 'left' => array(
314 'title' => __( 'Left', 'premium-addons-for-elementor' ),
315 'icon' => 'eicon-text-align-left',
316 ),
317 'center' => array(
318 'title' => __( 'Center', 'premium-addons-for-elementor' ),
319 'icon' => 'eicon-text-align-center',
320 ),
321 'right' => array(
322 'title' => __( 'Right', 'premium-addons-for-elementor' ),
323 'icon' => 'eicon-text-align-right',
324 ),
325 ),
326 'default' => 'center',
327 'toggle' => false,
328 'selectors' => array(
329 '{{WRAPPER}} .premium-atext__headline' => 'text-align: {{VALUE}};',
330 ),
331 )
332 );
333
334 $this->add_control(
335 'text_tag',
336 array(
337 'label' => __( 'HTML Tag', 'premium-addons-for-elementor' ),
338 'type' => Controls_Manager::SELECT,
339 'default' => 'h3',
340 'options' => array(
341 'h1' => 'H1',
342 'h2' => 'H2',
343 'h3' => 'H3',
344 'h4' => 'H4',
345 'h5' => 'H5',
346 'h6' => 'H6',
347 'div' => 'div',
348 'span' => 'span',
349 'p' => 'p',
350 ),
351 'label_block' => true,
352 'separator' => 'after',
353 )
354 );
355
356 $this->end_controls_section();
357
358 $this->start_controls_section(
359 'switched_settings',
360 array(
361 'label' => __( 'Switched Settings', 'premium-addons-for-elementor' ),
362 'condition' => array(
363 'style' => 'switch',
364 ),
365 )
366 );
367
368 $this->add_control(
369 'trigger',
370 array(
371 'label' => __( 'Trigger On', 'premium-addons-for-elementor' ),
372 'type' => Controls_Manager::SELECT,
373 'options' => array(
374 'page_load' => __( 'Page Load', 'premium-addons-for-elementor' ),
375 'viewport' => __( 'Visible on Viewport', 'premium-addons-for-elementor' ),
376 ),
377 'default' => 'page_load',
378 )
379 );
380
381 $this->add_control(
382 'premium_fancy_text_effect',
383 array(
384 'label' => __( 'Effect', 'premium-addons-for-elementor' ),
385 'type' => Controls_Manager::SELECT,
386 'options' => array(
387 'typing' => __( 'Typing', 'premium-addons-for-elementor' ),
388 'clip' => apply_filters( 'pa_pro_label', __( 'Clip (Pro)', 'premium-addons-for-elementor' ) ),
389 'slide' => __( 'Slide Up', 'premium-addons-for-elementor' ),
390 'zoomout' => __( 'Zoom Out', 'premium-addons-for-elementor' ),
391 'rotate' => __( 'Rotate', 'premium-addons-for-elementor' ),
392 'custom' => __( 'Custom', 'premium-addons-for-elementor' ),
393 ),
394 'default' => 'typing',
395 'render_type' => 'template',
396 'label_block' => true,
397 )
398 );
399
400 $this->add_control(
401 'custom_animation',
402 array(
403 'label' => __( 'Animations', 'premium-addons-for-elementor' ),
404 'type' => Controls_Manager::ANIMATION,
405 'render_type' => 'template',
406 'default' => 'fadeIn',
407 'condition' => array(
408 'premium_fancy_text_effect' => 'custom',
409 ),
410 )
411 );
412
413 $this->add_control(
414 'premium_fancy_text_type_speed',
415 array(
416 'label' => __( 'Type Speed', 'premium-addons-for-elementor' ),
417 'type' => Controls_Manager::NUMBER,
418 'default' => 30,
419 'description' => __( 'Set typing effect speed in milliseconds.', 'premium-addons-for-elementor' ),
420 'condition' => array(
421 'premium_fancy_text_effect' => 'typing',
422 ),
423 )
424 );
425
426 $this->add_control(
427 'premium_fancy_text_zoom_speed',
428 array(
429 'label' => __( 'Animation Speed', 'premium-addons-for-elementor' ),
430 'type' => Controls_Manager::NUMBER,
431 'render_type' => 'template',
432 'description' => __( 'Set animation speed in milliseconds. Default value is 1000', 'premium-addons-for-elementor' ),
433 'condition' => array(
434 'premium_fancy_text_effect!' => array( 'typing', 'slide' ),
435 ),
436 'selectors' => array(
437 '{{WRAPPER}} .premium-atext__wrapper:not(.premium-atext__typing):not(.premium-atext__slide) .premium-fancy-list-items' => 'animation-duration: {{VALUE}}ms',
438 ),
439 )
440 );
441
442 $this->add_control(
443 'premium_fancy_text_zoom_delay',
444 array(
445 'label' => __( 'Animation Delay', 'premium-addons-for-elementor' ),
446 'type' => Controls_Manager::NUMBER,
447 'description' => __( 'Set animation delay in milliseconds. Default value is 2500', 'premium-addons-for-elementor' ),
448 'condition' => array(
449 'premium_fancy_text_effect!' => array( 'typing', 'slide' ),
450 ),
451 )
452 );
453
454 $this->add_control(
455 'loop_count',
456 array(
457 'label' => __( 'Loop Count', 'premium-addons-for-elementor' ),
458 'type' => Controls_Manager::NUMBER,
459 'condition' => array(
460 'premium_fancy_text_effect!' => array( 'typing', 'slide' ),
461 ),
462 )
463 );
464
465 $this->add_control(
466 'premium_fancy_text_back_speed',
467 array(
468 'label' => __( 'Back Speed', 'premium-addons-for-elementor' ),
469 'type' => Controls_Manager::NUMBER,
470 'default' => 30,
471 'description' => __( 'Set a speed for backspace effect in milliseconds.', 'premium-addons-for-elementor' ),
472 'condition' => array(
473 'premium_fancy_text_effect' => 'typing',
474 ),
475 )
476 );
477
478 $this->add_control(
479 'premium_fancy_text_start_delay',
480 array(
481 'label' => __( 'Start Delay', 'premium-addons-for-elementor' ),
482 'type' => Controls_Manager::NUMBER,
483 'default' => 30,
484 'description' => __( 'If you set it on 5000 milliseconds, the first word/string will appear after 5 seconds.', 'premium-addons-for-elementor' ),
485 'condition' => array(
486 'premium_fancy_text_effect' => 'typing',
487 ),
488 )
489 );
490
491 $this->add_control(
492 'premium_fancy_text_back_delay',
493 array(
494 'label' => __( 'Back Delay', 'premium-addons-for-elementor' ),
495 'type' => Controls_Manager::NUMBER,
496 'default' => 30,
497 'description' => __( 'If you set it on 5000 milliseconds, the word/string will remain visible for 5 seconds before backspace effect.', 'premium-addons-for-elementor' ),
498 'condition' => array(
499 'premium_fancy_text_effect' => 'typing',
500 ),
501 )
502 );
503
504 $this->add_control(
505 'premium_fancy_text_type_loop',
506 array(
507 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
508 'type' => Controls_Manager::SWITCHER,
509 'default' => 'yes',
510 'condition' => array(
511 'premium_fancy_text_effect' => 'typing',
512 ),
513 )
514 );
515
516 $this->add_control(
517 'premium_fancy_text_show_cursor',
518 array(
519 'label' => __( 'Show Cursor', 'premium-addons-for-elementor' ),
520 'type' => Controls_Manager::SWITCHER,
521 'default' => 'yes',
522 'condition' => array(
523 'premium_fancy_text_effect' => 'typing',
524 ),
525 )
526 );
527
528 $this->add_control(
529 'premium_slide_up_speed',
530 array(
531 'label' => __( 'Animation Speed', 'premium-addons-for-elementor' ),
532 'type' => Controls_Manager::NUMBER,
533 'default' => 200,
534 'description' => __( 'Set a duration value in milliseconds for slide up effect.', 'premium-addons-for-elementor' ),
535 'condition' => array(
536 'premium_fancy_text_effect' => 'slide',
537 ),
538 )
539 );
540
541 $this->add_control(
542 'premium_slide_up_pause_time',
543 array(
544 'label' => __( 'Pause Time', 'premium-addons-for-elementor' ),
545 'type' => Controls_Manager::NUMBER,
546 'default' => 3000,
547 'description' => __( 'How long should the word/string stay visible? Set a value in milliseconds.', 'premium-addons-for-elementor' ),
548 'condition' => array(
549 'premium_fancy_text_effect' => 'slide',
550 ),
551 )
552 );
553
554 $this->add_control(
555 'premium_slide_up_shown_items',
556 array(
557 'label' => __( 'Show Items', 'premium-addons-for-elementor' ),
558 'type' => Controls_Manager::NUMBER,
559 'default' => 1,
560 'description' => __( 'How many items should be visible at a time?', 'premium-addons-for-elementor' ),
561 'condition' => array(
562 'premium_fancy_text_effect' => 'slide',
563 ),
564 )
565 );
566
567 $this->add_control(
568 'premium_slide_up_hover_pause',
569 array(
570 'label' => __( 'Pause on Hover', 'premium-addons-for-elementor' ),
571 'type' => Controls_Manager::SWITCHER,
572 'prefix_class' => 'premium-atext__paused-',
573 'render_type' => 'template',
574 'condition' => array(
575 'premium_fancy_text_effect' => 'slide',
576 ),
577 )
578 );
579
580 $this->add_control(
581 'loading_bar',
582 array(
583 'label' => __( 'Loading Bar', 'premium-addons-for-elementor' ),
584 'type' => Controls_Manager::SWITCHER,
585 'prefix_class' => 'premium-atext__loading-',
586 'render_type' => 'template',
587 'condition' => array(
588 'premium_fancy_text_effect!' => 'typing',
589 ),
590 )
591 );
592
593 $this->add_responsive_control(
594 'premium_fancy_slide_align',
595 array(
596 'label' => __( 'Animated Text Alignment', 'premium-addons-for-elementor' ),
597 'type' => Controls_Manager::CHOOSE,
598 'options' => array(
599 'left' => array(
600 'title' => __( 'Left', 'premium-addons-for-elementor' ),
601 'icon' => 'eicon-text-align-left',
602 ),
603 'center' => array(
604 'title' => __( 'Center', 'premium-addons-for-elementor' ),
605 'icon' => 'eicon-text-align-center',
606 ),
607 'right' => array(
608 'title' => __( 'Right', 'premium-addons-for-elementor' ),
609 'icon' => 'eicon-text-align-right',
610 ),
611 ),
612 'default' => 'center',
613 'toggle' => false,
614 'selectors' => array(
615 '{{WRAPPER}} .premium-fancy-list-items' => 'text-align: {{VALUE}}',
616 ),
617 'condition' => array(
618 'premium_fancy_text_effect' => 'slide',
619 ),
620 )
621 );
622
623 $this->end_controls_section();
624
625 $this->start_controls_section(
626 'highlighted_settings',
627 array(
628 'label' => __( 'Highlighted Settings', 'premium-addons-for-elementor' ),
629 'condition' => array(
630 'style' => 'highlight',
631 ),
632 )
633 );
634
635 $this->add_control(
636 'highlight_effect',
637 array(
638 'label' => __( 'Effect', 'premium-addons-for-elementor' ),
639 'type' => Controls_Manager::SELECT,
640 'options' => array(
641 'shadow' => __( 'Animated Shadow', 'premium-addons-for-elementor' ),
642 'pattern' => __( 'Animated Pattern', 'premium-addons-for-elementor' ),
643 'fill' => __( 'Animated Fill', 'premium-addons-for-elementor' ),
644 'tilt' => __( 'Tilt', 'premium-addons-for-elementor' ),
645 'flip' => apply_filters( 'pa_pro_label', __( 'Flip (Pro)', 'premium-addons-for-elementor' ) ),
646 'wave' => apply_filters( 'pa_pro_label', __( 'Wave (Pro)', 'premium-addons-for-elementor' ) ),
647 'pop' => apply_filters( 'pa_pro_label', __( 'Pop (Pro)', 'premium-addons-for-elementor' ) ),
648 'reveal' => apply_filters( 'pa_pro_label', __( 'Reveal (Pro)', 'premium-addons-for-elementor' ) ),
649 'lines' => apply_filters( 'pa_pro_label', __( 'Moving Lines (Pro)', 'premium-addons-for-elementor' ) ),
650 'underline' => apply_filters( 'pa_pro_label', __( 'Color Highlight (Pro)', 'premium-addons-for-elementor' ) ),
651 'shape' => apply_filters( 'pa_pro_label', __( 'Draw Shape (Pro)', 'premium-addons-for-elementor' ) ),
652 ),
653 'default' => 'shadow',
654 'label_block' => true,
655 )
656 );
657
658 $this->add_control(
659 'pattern_notice',
660 array(
661 'raw' => __( 'This effect works only with one word highlighted text.', 'premium-addons-for-elementor' ),
662 'type' => Controls_Manager::RAW_HTML,
663 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
664 'condition' => array(
665 'highlight_effect' => 'pattern',
666 ),
667 )
668 );
669
670 $this->add_control(
671 'highlight_loop_count',
672 array(
673 'label' => __( 'Loop Count', 'premium-addons-for-elementor' ),
674 'type' => Controls_Manager::NUMBER,
675 'description' => __( 'Set how many times the animation loops. Leave empty for infinite.', 'premium-addons-for-elementor' ),
676 'selectors' => array(
677 '{{WRAPPER}} .premium-atext__text, {{WRAPPER}} .premium-atext__text::after, {{WRAPPER}} .premium-atext__letter, {{WRAPPER}} .text' => 'animation-iteration-count: {{VALUE}};',
678 ),
679 'render_type' => 'template',
680 'condition' => array(
681 'highlight_effect!' => 'underline',
682 ),
683 )
684 );
685
686 do_action( 'pa_atext_highlight_controls', $this );
687
688 $this->add_control(
689 'highlighted_hover_pause',
690 array(
691 'label' => __( 'Pause on Hover', 'premium-addons-for-elementor' ),
692 'type' => Controls_Manager::SWITCHER,
693 'prefix_class' => 'premium-atext__paused-',
694 'render_type' => 'template',
695 'condition' => array(
696 'highlight_effect!' => array( 'underline', 'shape' ),
697 ),
698 )
699 );
700
701 $this->end_controls_section();
702
703 $this->start_controls_section(
704 'section_pa_docs',
705 array(
706 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
707 )
708 );
709
710 $docs = array(
711 'https://premiumaddons.com/docs/elementor-animated-text-widget-tutorial/' => __( 'Getting started »', 'premium-addons-for-elementor' ),
712 'https://www.youtube.com/watch?v=Q5aRlJdXFw0' => __( 'Check the video tutorial »', 'premium-addons-for-elementor' ),
713 );
714
715 $doc_index = 1;
716 foreach ( $docs as $url => $title ) {
717
718 $doc_url = Helper_Functions::get_campaign_link( $url, 'fancy-text-widget', 'wp-editor', 'get-support' );
719
720 $this->add_control(
721 'doc_' . $doc_index,
722 array(
723 'type' => Controls_Manager::RAW_HTML,
724 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
725 'content_classes' => 'editor-pa-doc',
726 )
727 );
728
729 ++$doc_index;
730
731 }
732
733 Helper_Functions::register_element_feedback_controls( $this );
734
735 $this->end_controls_section();
736
737 Helper_Functions::register_papro_promotion_controls( $this, 'fancy-text' );
738
739 $this->start_controls_section(
740 'animated_text_style_section',
741 array(
742 'label' => __( 'Animated Text', 'premium-addons-for-elementor' ),
743 'tab' => Controls_Manager::TAB_STYLE,
744 )
745 );
746
747 $this->add_group_control(
748 Group_Control_Typography::get_type(),
749 array(
750 'name' => 'fancy_text_typography',
751 'label' => __( 'Headline Typography', 'premium-addons-for-elementor' ),
752 'selector' => '{{WRAPPER}} .premium-atext__headline',
753 'global' => array(
754 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
755 ),
756 )
757 );
758
759 $this->add_control(
760 'premium_fancy_text_color',
761 array(
762 'label' => __( 'Color', 'premium-addons-for-elementor' ),
763 'type' => Controls_Manager::COLOR,
764 'global' => array(
765 'default' => Global_Colors::COLOR_PRIMARY,
766 ),
767 'selectors' => array(
768 '{{WRAPPER}} .premium-atext__text' => 'color: {{VALUE}};',
769 '{{WRAPPER}} .text' => 'fill : {{VALUE}};',
770 ),
771 'conditions' => array(
772 'relation' => 'or',
773 'terms' => array(
774 array(
775 'name' => 'style',
776 'value' => 'switch',
777 ),
778 array(
779 'terms' => array(
780 array(
781 'name' => 'style',
782 'value' => 'highlight',
783 ),
784 array(
785 'name' => 'highlight_effect',
786 'operator' => '!==',
787 'value' => 'fill',
788 ),
789 array(
790 'name' => 'highlight_effect',
791 'operator' => '!==',
792 'value' => 'reveal',
793 ),
794 ),
795 ),
796 ),
797 ),
798 )
799 );
800
801 $this->add_group_control(
802 Premium_Background::get_type(),
803 array(
804 'name' => 'fill_background',
805 'types' => array( 'classic', 'gradient' ),
806 'condition' => array(
807 'style' => 'highlight',
808 'highlight_effect' => 'fill',
809 ),
810 'selector' => '{{WRAPPER}} .premium-atext__text',
811 )
812 );
813
814 $this->add_control(
815 'highlight_color',
816 array(
817 'label' => __( 'Highlight Color', 'premium-addons-for-elementor' ),
818 'type' => Controls_Manager::COLOR,
819 'selectors' => array(
820 '{{WRAPPER}} .premium-atext__text::after' => 'background-color: {{VALUE}}',
821 ),
822 'condition' => array(
823 'style' => 'highlight',
824 'highlight_effect' => 'underline',
825 ),
826 )
827 );
828
829 $this->add_control(
830 'shadow_first_color',
831 array(
832 'label' => __( 'First Color', 'premium-addons-for-elementor' ),
833 'type' => Controls_Manager::COLOR,
834 'global' => array(
835 'default' => Global_Colors::COLOR_PRIMARY,
836 ),
837 'selectors' => array(
838 '{{WRAPPER}} .premium-atext__text' => '--pa-atext-fc: {{VALUE}}',
839 ),
840 'condition' => array(
841 'style' => 'highlight',
842 'highlight_effect' => array( 'shadow', 'pattern', 'lines' ),
843 ),
844 )
845 );
846
847 $this->add_control(
848 'shadow_second_color',
849 array(
850 'label' => __( 'Second Color', 'premium-addons-for-elementor' ),
851 'type' => Controls_Manager::COLOR,
852 'global' => array(
853 'default' => Global_Colors::COLOR_SECONDARY,
854 ),
855 'selectors' => array(
856 '{{WRAPPER}} .premium-atext__text, {{WRAPPER}} .premium-atext__pattern .premium-atext__text::after' => '--pa-atext-sc: {{VALUE}}',
857 ),
858 'condition' => array(
859 'style' => 'highlight',
860 'highlight_effect' => array( 'shadow', 'pattern', 'lines' ),
861 ),
862 )
863 );
864
865 $this->add_control(
866 'shadow_third_color',
867 array(
868 'label' => __( 'Third Color', 'premium-addons-for-elementor' ),
869 'type' => Controls_Manager::COLOR,
870 'global' => array(
871 'default' => Global_Colors::COLOR_TEXT,
872 ),
873 'selectors' => array(
874 '{{WRAPPER}} .premium-atext__text' => '--pa-atext-tc: {{VALUE}}',
875 ),
876 'condition' => array(
877 'style' => 'highlight',
878 'highlight_effect' => array( 'shadow', 'lines' ),
879 ),
880 )
881 );
882
883 $this->add_control(
884 'shadow_fourth_color',
885 array(
886 'label' => __( 'Fourth Color', 'premium-addons-for-elementor' ),
887 'type' => Controls_Manager::COLOR,
888 'global' => array(
889 'default' => Global_Colors::COLOR_ACCENT,
890 ),
891 'selectors' => array(
892 '{{WRAPPER}} .premium-atext__text' => '--pa-atext-foc: {{VALUE}}',
893 ),
894 'condition' => array(
895 'style' => 'highlight',
896 'highlight_effect' => array( 'shadow', 'lines' ),
897 ),
898 )
899 );
900
901 $this->add_control(
902 'shadow_fifth_color',
903 array(
904 'label' => __( 'Fifth Color', 'premium-addons-for-elementor' ),
905 'type' => Controls_Manager::COLOR,
906 'selectors' => array(
907 '{{WRAPPER}} .premium-atext__text' => '--pa-atext-fic: {{VALUE}}',
908 ),
909 'condition' => array(
910 'style' => 'highlight',
911 'highlight_effect' => 'lines',
912 ),
913 )
914 );
915
916 $this->add_control(
917 'premium_fancy_text_background_color',
918 array(
919 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
920 'type' => Controls_Manager::COLOR,
921 'selectors' => array(
922 '{{WRAPPER}} .premium-atext__text' => 'background-color: {{VALUE}}',
923 ),
924 'conditions' => array(
925 'relation' => 'or',
926 'terms' => array(
927 array(
928 'name' => 'style',
929 'value' => 'switch',
930 ),
931 array(
932 'terms' => array(
933 array(
934 'name' => 'style',
935 'value' => 'highlight',
936 ),
937 array(
938 'name' => 'highlight_effect',
939 'operator' => '!==',
940 'value' => 'fill',
941 ),
942 ),
943 ),
944 ),
945 ),
946 )
947 );
948
949 $this->add_control(
950 'text_lq_effect',
951 array(
952 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
953 'type' => Controls_Manager::SELECT,
954 'description' => sprintf(
955 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
956 esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ),
957 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
958 '</a>'
959 ),
960 'options' => array(
961 'none' => __( 'None', 'premium-addons-for-elementor' ),
962 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
963 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
964 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
965 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
966 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
967 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
968 ),
969 'default' => 'none',
970 'label_block' => true,
971 'conditions' => array(
972 'relation' => 'or',
973 'terms' => array(
974 array(
975 'name' => 'style',
976 'value' => 'switch',
977 ),
978 array(
979 'terms' => array(
980 array(
981 'name' => 'style',
982 'value' => 'highlight',
983 ),
984 array(
985 'name' => 'highlight_effect',
986 'operator' => '!==',
987 'value' => 'fill',
988 ),
989 ),
990 ),
991 ),
992 ),
993 )
994 );
995
996 $this->add_group_control(
997 Group_Control_Text_Shadow::get_type(),
998 array(
999 'name' => 'text_shadow',
1000 'selector' => '{{WRAPPER}} .premium-atext__text',
1001 'conditions' => array(
1002 'relation' => 'or',
1003 'terms' => array(
1004 array(
1005 'name' => 'style',
1006 'value' => 'switch',
1007 ),
1008 array(
1009 'terms' => array(
1010 array(
1011 'name' => 'style',
1012 'value' => 'highlight',
1013 ),
1014 array(
1015 'name' => 'highlight_effect',
1016 'operator' => '!==',
1017 'value' => 'shadow',
1018 ),
1019 array(
1020 'name' => 'highlight_effect',
1021 'operator' => '!==',
1022 'value' => 'lines',
1023 ),
1024 ),
1025 ),
1026 ),
1027 ),
1028 )
1029 );
1030
1031 $this->add_control(
1032 'stroke_width',
1033 array(
1034 'label' => __( 'Stroke Width', 'premium-addons-for-elementor' ),
1035 'type' => Controls_Manager::SLIDER,
1036 'selectors' => array(
1037 '{{WRAPPER}} .premium-atext__text' => '-webkit-text-stroke-width: {{SIZE}}px',
1038 '{{WRAPPER}} .text' => 'stroke-width: {{SIZE}}',
1039 ),
1040 )
1041 );
1042
1043 $this->add_control(
1044 'stroke_text_color',
1045 array(
1046 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1047 'type' => Controls_Manager::COLOR,
1048 'conditions' => array(
1049 'relation' => 'or',
1050 'terms' => array(
1051 array(
1052 'name' => 'style',
1053 'value' => 'switch',
1054 ),
1055 array(
1056 'terms' => array(
1057 array(
1058 'name' => 'style',
1059 'value' => 'highlight',
1060 ),
1061 array(
1062 'name' => 'highlight_effect',
1063 'operator' => '!==',
1064 'value' => 'lines',
1065 ),
1066 ),
1067 ),
1068 ),
1069 ),
1070 'selectors' => array(
1071 '{{WRAPPER}} .premium-atext__text' => '-webkit-text-stroke-color: {{VALUE}}',
1072 ),
1073 )
1074 );
1075
1076 $this->add_control(
1077 'animation_speed',
1078 array(
1079 'label' => __( 'Animation Speed (sec)', 'premium-addons-for-elementor' ),
1080 'type' => Controls_Manager::SLIDER,
1081 'range' => array(
1082 'px' => array(
1083 'min' => 0,
1084 'max' => 15,
1085 'step' => 0.1,
1086 ),
1087 ),
1088 'selectors' => array(
1089 '{{WRAPPER}} .premium-atext__text, {{WRAPPER}} .premium-atext__text::after, {{WRAPPER}} .premium-atext__letter, {{WRAPPER}} .text' => 'animation-duration: {{SIZE}}s',
1090 '{{WRAPPER}} .premium-atext__shape svg path' => '--pa-animation-duration: {{SIZE}}s',
1091 '{{WRAPPER}}' => '--pa-animation-duration: {{SIZE}}',
1092 ),
1093 'condition' => array(
1094 'style' => 'highlight',
1095 'highlight_effect!' => 'underline',
1096 ),
1097 )
1098 );
1099
1100 $this->add_control(
1101 'animation_delay',
1102 array(
1103 'label' => __( 'Animation Delay (sec)', 'premium-addons-for-elementor' ),
1104 'type' => Controls_Manager::SLIDER,
1105 'range' => array(
1106 's' => array(
1107 'min' => 0,
1108 'max' => 15,
1109 ),
1110 ),
1111 'selectors' => array(
1112 '{{WRAPPER}}' => '--pa-animation-delay: {{SIZE}}',
1113 ),
1114 'condition' => array(
1115 'style' => 'highlight',
1116 'highlight_effect' => 'shape',
1117 ),
1118 )
1119 );
1120
1121 $this->add_responsive_control(
1122 'text_margin',
1123 array(
1124 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1125 'type' => Controls_Manager::DIMENSIONS,
1126 'size_units' => array( 'px', 'em', '%' ),
1127 'selectors' => array(
1128 '{{WRAPPER}} .premium-atext__text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1129 ),
1130 )
1131 );
1132
1133 $this->end_controls_section();
1134
1135 do_action( 'pa_atext_shape_style', $this );
1136
1137 $this->start_controls_section(
1138 'premium_fancy_cursor_text_style_tab',
1139 array(
1140 'label' => __( 'Cursor', 'premium-addons-for-elementor' ),
1141 'tab' => Controls_Manager::TAB_STYLE,
1142 'condition' => array(
1143 'style' => 'switch',
1144 'premium_fancy_text_effect' => 'typing',
1145 ),
1146 )
1147 );
1148
1149 $this->add_control(
1150 'premium_fancy_text_cursor_color',
1151 array(
1152 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1153 'type' => Controls_Manager::COLOR,
1154 'global' => array(
1155 'default' => Global_Colors::COLOR_PRIMARY,
1156 ),
1157 'selectors' => array(
1158 '{{WRAPPER}} .typed-cursor' => 'color: {{VALUE}};',
1159 ),
1160 )
1161 );
1162
1163 $this->add_group_control(
1164 Group_Control_Typography::get_type(),
1165 array(
1166 'name' => 'fancy_text_cursor_typography',
1167 'selector' => '{{WRAPPER}} .typed-cursor',
1168 )
1169 );
1170
1171 $this->add_control(
1172 'premium_fancy_text_cursor_background',
1173 array(
1174 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1175 'type' => Controls_Manager::COLOR,
1176 'selectors' => array(
1177 '{{WRAPPER}} .typed-cursor' => 'background-color: {{VALUE}};',
1178 ),
1179 )
1180 );
1181
1182 $this->end_controls_section();
1183
1184 $this->start_controls_section(
1185 'premium_prefix_suffix_style_tab',
1186 array(
1187 'label' => __( 'Before & After Text', 'premium-addons-for-elementor' ),
1188 'tab' => Controls_Manager::TAB_STYLE,
1189 )
1190 );
1191
1192 $this->add_control(
1193 'premium_prefix_text_color',
1194 array(
1195 'label' => __( 'Before Text Color', 'premium-addons-for-elementor' ),
1196 'type' => Controls_Manager::COLOR,
1197 'global' => array(
1198 'default' => Global_Colors::COLOR_SECONDARY,
1199 ),
1200 'selectors' => array(
1201 '{{WRAPPER}} .premium-prefix-text' => 'color: {{VALUE}};',
1202 ),
1203 )
1204 );
1205
1206 $this->add_control(
1207 'premium_suffix_text_color',
1208 array(
1209 'label' => __( 'After Text Color', 'premium-addons-for-elementor' ),
1210 'type' => Controls_Manager::COLOR,
1211 'global' => array(
1212 'default' => Global_Colors::COLOR_SECONDARY,
1213 ),
1214 'selectors' => array(
1215 '{{WRAPPER}} .premium-suffix-text' => 'color: {{VALUE}};',
1216 ),
1217 )
1218 );
1219
1220 $this->add_group_control(
1221 Group_Control_Typography::get_type(),
1222 array(
1223 'name' => 'prefix_suffix_typography',
1224 'selector' => '{{WRAPPER}} .premium-prefix-text, {{WRAPPER}} .premium-suffix-text',
1225 'global' => array(
1226 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1227 ),
1228 'exclude' => array( 'font_size' ), // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor group-control key excluding the font_size control, not a get_posts() query arg.
1229 )
1230 );
1231
1232 $this->end_controls_section();
1233
1234 $this->start_controls_section(
1235 'loading_bar_style',
1236 array(
1237 'label' => __( 'Loading Bar', 'premium-addons-for-elementor' ),
1238 'tab' => Controls_Manager::TAB_STYLE,
1239 'condition' => array(
1240 'style' => 'switch',
1241 'loading_bar' => 'yes',
1242 'premium_fancy_text_effect!' => 'typing',
1243 ),
1244 )
1245 );
1246
1247 $this->add_control(
1248 'loading_bar_color',
1249 array(
1250 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1251 'type' => Controls_Manager::COLOR,
1252 'global' => array(
1253 'default' => Global_Colors::COLOR_PRIMARY,
1254 ),
1255 'selectors' => array(
1256 '{{WRAPPER}}.premium-atext__loading-yes .premium-loading-bar' => 'background-color: {{VALUE}};',
1257 ),
1258 )
1259 );
1260
1261 $this->add_responsive_control(
1262 'loading_bar_height',
1263 array(
1264 'label' => __( 'Height', 'premium-addons-for-elementor' ),
1265 'type' => Controls_Manager::SLIDER,
1266 'range' => array(
1267 'px' => array(
1268 'min' => 0,
1269 'max' => 10,
1270 ),
1271 ),
1272 'selectors' => array(
1273 '{{WRAPPER}}.premium-atext__loading-yes .premium-loading-bar' => 'height: {{SIZE}}{{UNIT}}',
1274 ),
1275 )
1276 );
1277
1278 $this->end_controls_section();
1279 }
1280
1281 /**
1282 * Render Fancy Text widget output on the frontend.
1283 *
1284 * Written in PHP and used to generate the final HTML.
1285 *
1286 * @since 1.0.0
1287 * @access protected
1288 */
1289 protected function render() {
1290
1291 $settings = $this->get_settings_for_display();
1292
1293 $papro_activated = Helper_Functions::check_papro_version();
1294
1295 if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.18', '<' ) ) {
1296
1297 if ( ( 'switch' === $settings['style'] && 'clip' === $settings['premium_fancy_text_effect'] ) || ( 'highlight' === $settings['style'] && ! in_array( $settings['highlight_effect'], array( 'shadow', 'pattern', 'fill', 'tilt' ), true ) ) ) {
1298
1299 ?>
1300 <div class="premium-error-notice">
1301 <?php
1302 $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' );
1303 echo wp_kses_post( $message );
1304 ?>
1305 </div>
1306 <?php
1307 return false;
1308
1309 }
1310 }
1311
1312 $effect = $settings['premium_fancy_text_effect'];
1313
1314 $title_tag = Helper_Functions::validate_html_tag( $settings['text_tag'] );
1315
1316 $this->add_render_attribute( 'wrapper', 'class', 'premium-atext__wrapper' );
1317
1318 if ( 'switch' === $settings['style'] ) {
1319
1320 $this->add_render_attribute( 'wrapper', 'data-start-effect', $settings['trigger'] );
1321
1322 $loading_bar = 'yes' === $settings['loading_bar'];
1323
1324 $pause = '';
1325
1326 if ( 'typing' === $effect ) {
1327
1328 $show_cursor = ( ! empty( $settings['premium_fancy_text_show_cursor'] ) ) ? true : false;
1329
1330 $loop = ! empty( $settings['premium_fancy_text_type_loop'] ) ? true : false;
1331
1332 $strings = array();
1333
1334 foreach ( $settings['premium_fancy_text_strings'] as $item ) {
1335 if ( ! empty( $item['premium_text_strings_text_field'] ) ) {
1336 $strings[] = str_replace( '\'', '&#39;', $item['premium_text_strings_text_field'] );
1337 }
1338 }
1339
1340 $atext_settings = array(
1341 'effect' => $effect,
1342 'strings' => $strings,
1343 'typeSpeed' => $settings['premium_fancy_text_type_speed'],
1344 'backSpeed' => $settings['premium_fancy_text_back_speed'],
1345 'startDelay' => $settings['premium_fancy_text_start_delay'],
1346 'backDelay' => $settings['premium_fancy_text_back_delay'],
1347 'showCursor' => $show_cursor,
1348 'loop' => $loop,
1349 );
1350
1351 } elseif ( 'slide' === $effect ) {
1352
1353 $this->add_render_attribute( 'prefix', 'class', 'premium-atext__span-align' );
1354 $this->add_render_attribute( 'suffix', 'class', 'premium-atext__span-align' );
1355
1356 $mouse_pause = 'yes' === $settings['premium_slide_up_hover_pause'] ? true : false;
1357 $pause = $mouse_pause ? 'pause' : '';
1358 $atext_settings = array(
1359 'effect' => $effect,
1360 'speed' => $settings['premium_slide_up_speed'],
1361 'showItems' => $settings['premium_slide_up_shown_items'],
1362 'pause' => $settings['premium_slide_up_pause_time'],
1363 'mousePause' => $mouse_pause,
1364 );
1365 } else {
1366
1367 $atext_settings = array(
1368 'effect' => $effect,
1369 'delay' => $settings['premium_fancy_text_zoom_delay'],
1370 'count' => $settings['loop_count'],
1371 );
1372
1373 if ( 'custom' === $effect ) {
1374 $atext_settings['animation'] = $settings['custom_animation'];
1375 } elseif ( 'clip' === $effect ) {
1376 $atext_settings['speed'] = $settings['premium_fancy_text_zoom_speed'];
1377 }
1378 }
1379
1380 $atext_settings['loading'] = $loading_bar;
1381 $atext_settings['style'] = $settings['style'];
1382
1383 $this->add_render_attribute(
1384 'wrapper',
1385 array(
1386 'class' => array(
1387 'premium-atext__' . $effect,
1388 $pause,
1389 ),
1390 'data-settings' => wp_json_encode( $atext_settings ),
1391 )
1392 );
1393
1394 } else {
1395
1396 $effect = $settings['highlight_effect'];
1397
1398 $atext_settings = array(
1399 'effect' => $effect,
1400 'style' => $settings['style'],
1401 'count' => $settings['highlight_loop_count'],
1402 );
1403
1404 $this->add_render_attribute(
1405 'wrapper',
1406 array(
1407 'class' => array(
1408 'premium-atext__' . $effect,
1409 ),
1410 'data-settings' => wp_json_encode( $atext_settings ),
1411 )
1412 );
1413
1414 }
1415
1416 if ( ! empty( $settings['link']['url'] ) ) {
1417 $this->add_link_attributes( 'url', $settings['link'] );
1418 }
1419
1420 ?>
1421 <div <?php $this->print_render_attribute_string( 'wrapper' ); ?>>
1422
1423 <<?php echo wp_kses_post( $title_tag ); ?> class="premium-atext__headline">
1424 <?php if ( ! empty( $settings['premium_fancy_prefix_text'] ) ) : ?>
1425 <span class="premium-prefix-text">
1426 <span <?php $this->print_render_attribute_string( 'prefix' ); ?>><?php echo wp_kses_post( $settings['premium_fancy_prefix_text'] ); ?></span>
1427 </span>
1428 <?php endif; ?>
1429
1430 <?php
1431 if ( 'highlight' === $settings['style'] ) :
1432 $this->render_highlight_text();
1433 else :
1434 $this->render_switch_text();
1435 endif;
1436 ?>
1437
1438 <?php if ( ! empty( $settings['premium_fancy_suffix_text'] ) ) : ?>
1439 <span class="premium-suffix-text">
1440 <span <?php $this->print_render_attribute_string( 'suffix' ); ?>><?php echo wp_kses_post( $settings['premium_fancy_suffix_text'] ); ?></span>
1441 </span>
1442 <?php endif; ?>
1443
1444 <?php if ( ! empty( $settings['link']['url'] ) ) : ?>
1445 <a <?php $this->print_render_attribute_string( 'url' ); ?>></a>
1446 <?php endif; ?>
1447
1448 </<?php echo wp_kses_post( $title_tag ); ?>>
1449 </div>
1450 <?php
1451 }
1452
1453 /**
1454 * Render Highlight Text
1455 *
1456 * @since 4.10.34
1457 * @access protected
1458 */
1459 protected function render_switch_text() {
1460
1461 $settings = $this->get_settings_for_display();
1462
1463 $effect = $settings['premium_fancy_text_effect'];
1464
1465 $this->add_render_attribute( 'switch_text', 'class', 'premium-atext__text' );
1466
1467 if ( 'none' !== $settings['text_lq_effect'] ) {
1468 $this->add_render_attribute( 'switch_text', 'class', 'premium-con-lq__' . $settings['text_lq_effect'] );
1469 }
1470
1471 if ( 'typing' === $effect ) :
1472 ?>
1473 <span <?php $this->print_render_attribute_string( 'switch_text' ); ?>></span>
1474 <?php else : ?>
1475 <div <?php $this->print_render_attribute_string( 'switch_text' ); ?>>
1476 <ul class="premium-atext__items-wrapper">
1477 <?php
1478 foreach ( $settings['premium_fancy_text_strings'] as $index => $item ) :
1479 if ( ! empty( $item['premium_text_strings_text_field'] ) ) :
1480 $this->add_render_attribute( 'text_' . $item['_id'], 'class', 'premium-fancy-list-items' );
1481
1482 if ( 'slide' !== $effect && 0 !== $index ) {
1483 $this->add_render_attribute( 'text_' . $item['_id'], 'class', 'premium-fancy-item-hidden' );
1484 } else {
1485 $this->add_render_attribute( 'text_' . $item['_id'], 'class', 'premium-fancy-item-visible' );
1486 }
1487
1488 ?>
1489 <li <?php $this->print_render_attribute_string( 'text_' . $item['_id'] ); ?>>
1490 <?php echo wp_kses_post( $item['premium_text_strings_text_field'] ); ?>
1491 </li>
1492 <?php
1493 endif;
1494 endforeach;
1495 ?>
1496 </ul>
1497 </div>
1498 <?php
1499 endif;
1500 }
1501
1502 /**
1503 * Render Switch Text
1504 *
1505 * @since 4.10.34
1506 * @access protected
1507 */
1508 protected function render_highlight_text() {
1509
1510 $settings = $this->get_settings_for_display();
1511
1512 $this->add_render_attribute(
1513 'text',
1514 array(
1515 'class' => 'premium-atext__text',
1516 'data-text' => $settings['text'],
1517 )
1518 );
1519
1520 if ( 'reveal' === $settings['highlight_effect'] ) {
1521
1522 $image_url = PREMIUM_ADDONS_URL . 'assets/frontend/images/reveal_background.jpg';
1523 $this->add_render_attribute( 'text', 'style', "background-image: url('$image_url')" );
1524
1525 }
1526
1527 if ( 'none' !== $settings['text_lq_effect'] && 'fill' !== $settings['highlight_effect'] ) {
1528 $this->add_render_attribute( 'text', 'class', 'premium-con-lq__' . $settings['text_lq_effect'] );
1529 }
1530
1531 ?>
1532
1533 <?php if ( 'lines' !== $settings['highlight_effect'] ) : ?>
1534 <span <?php $this->print_render_attribute_string( 'text' ); ?>>
1535 <?php echo wp_kses_post( $settings['text'] ); ?>
1536 <?php if ( 'shape' === $settings['highlight_effect'] ) : ?>
1537 <?php $this->render_draw_shape(); ?>
1538 <?php endif; ?>
1539 </span>
1540
1541 <?php else : ?>
1542 <span class="elementor-screen-only"><?php echo wp_kses_post( $settings['text'] ); ?></span>
1543 <svg class="premium-atext__text" aria-hidden="true" focusable="false">
1544 <!-- Symbol -->
1545 <symbol id="s-text">
1546 <text text-anchor="middle" x="50%" y="50%" dy=".35em">
1547 <?php echo wp_kses_post( $settings['text'] ); ?>
1548 </text>
1549 </symbol>
1550
1551 <!-- Duplicate symbols -->
1552 <use xlink:href="#s-text" class="text"></use>
1553 <use xlink:href="#s-text" class="text"></use>
1554 <use xlink:href="#s-text" class="text"></use>
1555 <use xlink:href="#s-text" class="text"></use>
1556 <use xlink:href="#s-text" class="text"></use>
1557
1558 </svg>
1559 <?php endif; ?>
1560
1561 <?php
1562 }
1563
1564 /**
1565 * Render Draw shape
1566 *
1567 * @since 4.10.34
1568 * @access protected
1569 */
1570 protected function render_draw_shape() {
1571
1572 $settings = $this->get_settings_for_display();
1573
1574 $shape = $settings['shape'];
1575
1576 $shapes_array = array(
1577 'circle' => '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 500 150" preserveAspectRatio="none"><path d="M325,18C228.7-8.3,118.5,8.3,78,21C22.4,38.4,4.6,54.6,5.6,77.6c1.4,32.4,52.2,54,142.6,63.7 c66.2,7.1,212.2,7.5,273.5-8.3c64.4-16.6,104.3-57.6,33.8-98.2C386.7-4.9,179.4-1.4,126.3,20.7"></path></svg>',
1578
1579 'wavy' => '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 500 150" preserveAspectRatio="none"><path d="M3,146.1c17.1-8.8,33.5-17.8,51.4-17.8c15.6,0,17.1,18.1,30.2,18.1c22.9,0,36-18.6,53.9-18.6 c17.1,0,21.3,18.5,37.5,18.5c21.3,0,31.8-18.6,49-18.6c22.1,0,18.8,18.8,36.8,18.8c18.8,0,37.5-18.6,49-18.6c20.4,0,17.1,19,36.8,19 c22.9,0,36.8-20.6,54.7-18.6c17.7,1.4,7.1,19.5,33.5,18.8c17.1,0,47.2-6.5,61.1-15.6"></path></svg>',
1580
1581 'underline' => '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 500 150" preserveAspectRatio="none"><path d="M7.7,145.6C109,125,299.9,116.2,401,121.3c42.1,2.2,87.6,11.8,87.3,25.7"></path></svg>',
1582
1583 'double' => '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 500 150" preserveAspectRatio="none"><path d="M5,125.4c30.5-3.8,137.9-7.6,177.3-7.6c117.2,0,252.2,4.7,312.7,7.6"></path><path d="M26.9,143.8c55.1-6.1,126-6.3,162.2-6.1c46.5,0.2,203.9,3.2,268.9,6.4"></path></svg>',
1584
1585 'zigzag' => '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 500 150" preserveAspectRatio="none"><path d="M9.3,127.3c49.3-3,150.7-7.6,199.7-7.4c121.9,0.4,189.9,0.4,282.3,7.2C380.1,129.6,181.2,130.6,70,139 c82.6-2.9,254.2-1,335.9,1.3c-56,1.4-137.2-0.3-197.1,9"></path></svg>',
1586
1587 'strike' => '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 500 150" preserveAspectRatio="none"><path d="M3,75h493.5"></path></svg>',
1588
1589 'cross' => '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 500 150" preserveAspectRatio="none"><path d="M497.4,23.9C301.6,40,155.9,80.6,4,144.4"></path><path d="M14.1,27.6c204.5,20.3,393.8,74,467.3,111.7"></path></svg>',
1590
1591 );
1592
1593 echo $shapes_array[ $shape ]; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1594 }
1595 }
1596