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-textual-showcase.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-textual-showcase.php
2694 lines
1 <?php
2 /**
3 * Premium Textual Showcase.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Utils;
10 use Elementor\Repeater;
11 use Elementor\Plugin;
12 use Elementor\Widget_Base;
13 use Elementor\Icons_Manager;
14 use Elementor\Controls_Manager;
15 use Elementor\Group_Control_Border;
16 use Elementor\Group_Control_Image_Size;
17 use Elementor\Group_Control_Typography;
18 use Elementor\Group_Control_Css_Filter;
19 use Elementor\Group_Control_Box_Shadow;
20 use Elementor\Group_Control_Text_Shadow;
21
22 // PremiumAddons Classes.
23 use PremiumAddons\Includes\Helper_Functions;
24 use PremiumAddons\Admin\Includes\Admin_Helper;
25 use PremiumAddons\Includes\Controls\Premium_Post_Filter;
26 use PremiumAddons\Includes\Controls\Premium_Background;
27
28 if ( ! defined( 'ABSPATH' ) ) {
29 exit; // If this file is called directly, abort.
30 }
31
32 /**
33 * Class Premium_Textual_Showcase.
34 */
35 class Premium_Textual_Showcase extends Widget_Base {
36
37 /**
38 * Check if the icon draw is enabled.
39 *
40 * @since 4.9.26
41 * @access private
42 *
43 * @var bool
44 */
45 private $is_draw_enabled = null;
46
47 /**
48 * Check Icon Draw Option.
49 *
50 * @since 4.9.26
51 * @access public
52 */
53 public function check_icon_draw() {
54
55 if ( null === $this->is_draw_enabled ) {
56 $this->is_draw_enabled = Admin_Helper::check_svg_draw( 'premium-textual-showcase' );
57 }
58
59 return $this->is_draw_enabled;
60 }
61
62 /**
63 * Retrieve Widget Name.
64 *
65 * @since 1.0.0
66 * @access public
67 */
68 public function get_name() {
69 return 'premium-textual-showcase';
70 }
71
72 /**
73 * Retrieve Widget Title.
74 *
75 * @since 1.0.0
76 * @access public
77 */
78 public function get_title() {
79 return __( 'Textual Showcase', 'premium-addons-for-elementor' );
80 }
81
82 /**
83 * Retrieve Widget Icon.
84 *
85 * @since 1.0.0
86 * @access public
87 *
88 * @return string widget icon.
89 */
90 public function get_icon() {
91 return 'pa-showcase';
92 }
93
94 /**
95 * Retrieve Widget Dependent CSS.
96 *
97 * @since 1.0.0
98 * @access public
99 *
100 * @return array CSS style handles.
101 */
102 public function get_style_depends() {
103 return array(
104 'pa-glass',
105 'font-awesome-5-all',
106 'pa-btn',
107 'premium-addons',
108 );
109 }
110
111 /**
112 * Retrieve Widget Dependent JS.
113 *
114 * @since 1.0.0
115 * @access public
116 *
117 * @return array JS script handles.
118 */
119 public function get_script_depends() {
120
121 $is_edit = Helper_Functions::is_edit_mode();
122
123 $scripts = array();
124
125 if ( $is_edit ) {
126
127 $draw_scripts = $this->check_icon_draw() ? array( 'pa-tweenmax', 'pa-motionpath' ) : array();
128
129 $scripts = array_merge( $draw_scripts, array( 'pa-glass', 'lottie-js' ) );
130
131 } else {
132 $settings = $this->get_settings();
133
134 if ( ! empty( $settings['content'] ) ) {
135 foreach ( $settings['content'] as $item ) {
136
137 if ( 'yes' === $item['draw_svg'] || 'yes' === $item['draw_svg_hov'] ) {
138 $scripts[] = 'pa-tweenmax';
139 $scripts[] = 'pa-motionpath';
140 $draw_js = true;
141 }
142
143 if ( 'lottie' === $item['item_type'] || 'lottie' === $item['item_type_hov'] ) {
144 $scripts[] = 'lottie-js';
145 $lottie_js = true;
146 }
147
148 if ( 'none' !== $item['item_lq_effect'] ) {
149 $scripts[] = 'pa-glass';
150 }
151
152 if ( isset( $draw_js ) && isset( $lottie_js ) ) {
153 break;
154 }
155 }
156 }
157 }
158
159 $scripts[] = 'premium-addons';
160
161 return $scripts;
162 }
163
164 /**
165 * Retrieve Widget Categories.
166 *
167 * @since 1.5.1
168 * @access public
169 *
170 * @return array Widget categories.
171 */
172 public function get_categories() {
173 return array( 'premium-elements' );
174 }
175
176 /**
177 * Retrieve Widget Dependent CSS.
178 *
179 * @since 1.0.0
180 * @access public
181 *
182 * @return array CSS style handles.
183 */
184 public function get_keywords() {
185 return array( 'pa', 'premium', 'premium textual showcase', 'textual', 'showcase', 'image' );
186 }
187
188 protected function is_dynamic_content(): bool {
189 return false;
190 }
191
192 /**
193 * Retrieve Widget Support URL.
194 *
195 * @access public
196 *
197 * @return string support URL.
198 */
199 public function get_custom_help_url() {
200 return 'https://premiumaddons.com/support/';
201 }
202
203 public function has_widget_inner_wrapper(): bool {
204 return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' );
205 }
206
207 /**
208 * Register Tiktok Feed controls.
209 *
210 * @since 1.0.0
211 * @access protected
212 */
213 protected function register_controls() {
214
215 $this->add_general_controls();
216
217 $this->add_help_controls();
218
219 $this->add_content_style_controls();
220 $this->add_item_container_style_controls();
221 }
222
223 /**
224 * Add general controls.
225 *
226 * @access private
227 */
228 private function add_general_controls() {
229
230 $papro_activated = Helper_Functions::check_papro_version();
231
232 $this->start_controls_section(
233 'sect_gen_controls',
234 array(
235 'label' => __( 'Content', 'premium-addons-for-elementor' ),
236 )
237 );
238
239 $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-textual-showcase-widget/', 'showcase', 'wp-editor', 'demo' );
240 Helper_Functions::add_templates_controls( $this, 'textual-showcase', $demo );
241
242 $draw_icon = $this->check_icon_draw();
243
244 $svg_draw_conds = array(
245 'relation' => 'or',
246 'terms' => array(
247 array(
248 'name' => 'item_type',
249 'value' => 'svg',
250 ),
251 array(
252 'terms' => array(
253 array(
254 'name' => 'item_type',
255 'value' => 'icon',
256 ),
257 array(
258 'name' => 'icon[library]',
259 'operator' => '!==',
260 'value' => 'svg',
261 ),
262 ),
263 ),
264 ),
265 );
266
267 $svg_draw_conds_hov = array(
268 'relation' => 'or',
269 'terms' => array(
270 array(
271 'name' => 'item_type_hov',
272 'value' => 'svg',
273 ),
274 array(
275 'terms' => array(
276 array(
277 'name' => 'item_type_hov',
278 'value' => 'icon',
279 ),
280 array(
281 'name' => 'icon_hov[library]',
282 'operator' => '!==',
283 'value' => 'svg',
284 ),
285 ),
286 ),
287 ),
288 );
289
290 $repeater = new Repeater();
291
292 $repeater->start_controls_tabs( 'item_tabs' );
293
294 $repeater->start_controls_tab(
295 'normal_state',
296 array(
297 'label' => __( 'Element', 'premium-addons-for-elementor' ),
298 )
299 );
300
301 $repeater->add_control(
302 'item_type',
303 array(
304 'label' => __( 'Type', 'premium-addons-for-elementor' ),
305 'type' => Controls_Manager::SELECT,
306 'render_type' => 'template',
307 'options' => array(
308 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
309 'text' => __( 'Text', 'premium-addons-for-elementor' ),
310 'image' => __( 'Image', 'premium-addons-for-elementor' ),
311 'lottie' => __( 'Lottie', 'premium-addons-for-elementor' ),
312 'svg' => apply_filters( 'pa_pro_label', __( 'SVG Code (Pro)', 'premium-addons-for-elementor' ) ),
313 ),
314 'default' => 'text',
315 )
316 );
317
318 $repeater->add_control(
319 'item_txt',
320 array(
321 'label' => __( 'Text', 'premium-addons-for-elementor' ),
322 'type' => Controls_Manager::TEXT,
323 'dynamic' => array( 'active' => true ),
324 'label_block' => true,
325 'condition' => array(
326 'item_type' => 'text',
327 ),
328 )
329 );
330
331 $repeater->add_control(
332 'item_txt_tag',
333 array(
334 'label' => __( 'HTML Tag', 'premium-addons-for-elementor' ),
335 'description' => __( 'Select an HTML tag for the text.', 'premium-addons-for-elementor' ),
336 'type' => Controls_Manager::SELECT,
337 'options' => array(
338 'h1' => 'H1',
339 'h2' => 'H2',
340 'h3' => 'H3',
341 'h4' => 'H4',
342 'h5' => 'H5',
343 'h6' => 'H6',
344 'div' => 'div',
345 'span' => 'span',
346 'p' => 'p',
347 ),
348 'default' => 'span',
349 'label_block' => true,
350 'condition' => array(
351 'item_type' => 'text',
352 ),
353 )
354 );
355
356 $repeater->add_control(
357 'content_image',
358 array(
359 'label' => __( 'Choose Image', 'premium-addons-for-elementor' ),
360 'type' => Controls_Manager::MEDIA,
361 'label_block' => true,
362 'default' => array(
363 'url' => Utils::get_placeholder_image_src(),
364 ),
365 'dynamic' => array( 'active' => true ),
366 'condition' => array(
367 'item_type' => 'image',
368 ),
369 )
370 );
371
372 $repeater->add_group_control(
373 Group_Control_Image_Size::get_type(),
374 array(
375 'name' => 'thumbnail',
376 'default' => 'full',
377 'condition' => array(
378 'item_type' => 'image',
379 ),
380 )
381 );
382
383 $repeater->add_control(
384 'item_img_fit',
385 array(
386 'label' => __( 'Image Fit', 'premium-addons-for-elementor' ),
387 'type' => Controls_Manager::SELECT,
388 'options' => array(
389 '' => __( 'Default', 'premium-addons-for-elementor' ),
390 'cover' => __( 'Cover', 'premium-addons-for-elementor' ),
391 'fill' => __( 'Fill', 'premium-addons-for-elementor' ),
392 'contain' => __( 'Contain', 'premium-addons-for-elementor' ),
393 ),
394 'default' => '',
395 'selectors' => array(
396 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item' => 'object-fit:{{VALUE}};',
397 ),
398 'condition' => array(
399 'item_type' => 'image',
400 ),
401 )
402 );
403
404 $repeater->add_control(
405 'icon',
406 array(
407 'label' => __( 'Choose Icon', 'premium-addons-for-elementor' ),
408 'type' => Controls_Manager::ICONS,
409 'skin' => 'inline',
410 'default' => array(
411 'value' => 'fas fa-star',
412 'library' => 'fa-solid',
413 ),
414 'label_block' => false,
415 'condition' => array(
416 'item_type' => 'icon',
417 ),
418 )
419 );
420
421 if ( $papro_activated ) {
422
423 do_action( 'pa_showcase_svg', $repeater );
424
425 }
426
427 $repeater->add_control(
428 'draw_svg',
429 array(
430 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
431 'type' => Controls_Manager::SWITCHER,
432 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
433 'description' => __( 'Use this option to draw your Font Awesome/SVG Icons.', 'premium-addons-for-elementor' ),
434 'conditions' => $svg_draw_conds,
435 )
436 );
437
438 if ( $draw_icon ) {
439
440 $repeater->add_control(
441 'path_width',
442 array(
443 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
444 'type' => Controls_Manager::SLIDER,
445 'range' => array(
446 'px' => array(
447 'min' => 0,
448 'max' => 50,
449 'step' => 0.1,
450 ),
451 ),
452 'conditions' => array(
453 'terms' => array(
454 $svg_draw_conds,
455 ),
456 ),
457 'selectors' => array(
458 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item.premium-drawable-icon *' => 'stroke-width: {{SIZE}};',
459 ),
460 )
461 );
462
463 $repeater->add_control(
464 'svg_sync',
465 array(
466 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
467 'type' => Controls_Manager::SWITCHER,
468 'condition' => array(
469 'draw_svg' => 'yes',
470 'item_type' => 'svg',
471 ),
472 )
473 );
474
475 $repeater->add_control(
476 'frames',
477 array(
478 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
479 'type' => Controls_Manager::NUMBER,
480 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
481 'default' => 5,
482 'min' => 1,
483 'max' => 100,
484 'conditions' => array(
485 'terms' => array(
486 array(
487 'name' => 'draw_svg',
488 'value' => 'yes',
489 ),
490 $svg_draw_conds,
491 ),
492 ),
493 )
494 );
495
496 $repeater->add_control(
497 'stroke_colors',
498 array(
499 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
500 'type' => Controls_Manager::COLOR,
501 'conditions' => array(
502 'terms' => array(
503 $svg_draw_conds,
504 ),
505 ),
506 'selectors' => array(
507 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item.premium-drawable-icon *' => 'stroke: {{VALUE}};',
508 ),
509 )
510 );
511
512 $repeater->add_control(
513 'svg_color',
514 array(
515 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
516 'type' => Controls_Manager::COLOR,
517 'global' => false,
518 'conditions' => array(
519 'terms' => array(
520 array(
521 'name' => 'draw_svg',
522 'value' => 'yes',
523 ),
524 $svg_draw_conds,
525 ),
526 ),
527 )
528 );
529 } else {
530 Helper_Functions::get_draw_svg_notice(
531 $repeater,
532 'textual',
533 $svg_draw_conds,
534 '',
535 'conditions'
536 );
537 }
538
539 $repeater->add_control(
540 'lottie_url',
541 array(
542 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
543 'type' => Controls_Manager::TEXT,
544 'dynamic' => array( 'active' => true ),
545 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
546 'label_block' => true,
547 'condition' => array(
548 'item_type' => 'lottie',
549 ),
550 )
551 );
552
553 $lottie_cond = array(
554 'relation' => 'or',
555 'terms' => array(
556 array(
557 'name' => 'item_type',
558 'value' => 'lottie',
559 ),
560 array(
561 'terms' => array(
562 array(
563 'name' => 'draw_svg',
564 'value' => 'yes',
565 ),
566 $svg_draw_conds,
567 ),
568 ),
569 ),
570 );
571
572 $repeater->add_control(
573 'lottie_loop',
574 array(
575 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
576 'type' => Controls_Manager::SWITCHER,
577 'return_value' => 'true',
578 'default' => 'true',
579 'conditions' => $lottie_cond,
580 )
581 );
582
583 $repeater->add_control(
584 'lottie_reverse',
585 array(
586 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
587 'type' => Controls_Manager::SWITCHER,
588 'return_value' => 'true',
589 'conditions' => $lottie_cond,
590 )
591 );
592
593 if ( $draw_icon ) {
594 $repeater->add_control(
595 'start_point',
596 array(
597 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
598 'type' => Controls_Manager::SLIDER,
599 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
600 'default' => array(
601 'unit' => '%',
602 'size' => 0,
603 ),
604 'conditions' => array(
605 'terms' => array(
606 array(
607 'name' => 'draw_svg',
608 'value' => 'yes',
609 ),
610 array(
611 'name' => 'lottie_reverse',
612 'operator' => '!==',
613 'value' => 'true',
614 ),
615 $svg_draw_conds,
616 ),
617 ),
618 )
619 );
620
621 $repeater->add_control(
622 'end_point',
623 array(
624 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
625 'type' => Controls_Manager::SLIDER,
626 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
627 'default' => array(
628 'unit' => '%',
629 'size' => 0,
630 ),
631 'conditions' => array(
632 'terms' => array(
633 array(
634 'name' => 'draw_svg',
635 'value' => 'yes',
636 ),
637 array(
638 'name' => 'lottie_reverse',
639 'value' => 'true',
640 ),
641 $svg_draw_conds,
642 ),
643 ),
644 )
645 );
646
647 $repeater->add_control(
648 'svg_yoyo',
649 array(
650 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
651 'type' => Controls_Manager::SWITCHER,
652 'conditions' => array(
653 'terms' => array(
654 array(
655 'name' => 'draw_svg',
656 'value' => 'yes',
657 ),
658 array(
659 'name' => 'lottie_loop',
660 'value' => 'true',
661 ),
662 $svg_draw_conds,
663 ),
664 ),
665 )
666 );
667 }
668
669 $repeater->add_control(
670 'style',
671 array(
672 'label' => esc_html__( 'Element Style', 'premium-addons-for-elementor' ),
673 'type' => Controls_Manager::HEADING,
674 'separator' => 'before',
675 )
676 );
677
678 $repeater->add_responsive_control(
679 'item_txt_align',
680 array(
681 'label' => __( 'Text Alignment', 'premium-addons-for-elementor' ),
682 'type' => Controls_Manager::CHOOSE,
683 'options' => array(
684 'left' => array(
685 'title' => __( 'Left', 'premium-addons-for-elementor' ),
686 'icon' => 'eicon-text-align-left',
687 ),
688 'center' => array(
689 'title' => __( 'Center', 'premium-addons-for-elementor' ),
690 'icon' => 'eicon-text-align-center',
691 ),
692 'right' => array(
693 'title' => __( 'Right', 'premium-addons-for-elementor' ),
694 'icon' => 'eicon-text-align-right',
695 ),
696 ),
697 'default' => 'center',
698 'toggle' => false,
699 'selectors' => array(
700 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item.pa-txt-sc__item-text' => 'text-align: {{VALUE}}',
701 ),
702 'condition' => array(
703 'item_type' => 'text',
704 ),
705 )
706 );
707
708 $repeater->add_responsive_control(
709 'content_size',
710 array(
711 'label' => __( 'Size', 'premium-addons-for-elementor' ),
712 'type' => Controls_Manager::SLIDER,
713 'size_units' => array( 'px', 'em', '%' ),
714 'label_block' => true,
715 'range' => array(
716 'px' => array(
717 'min' => 0,
718 'max' => 1000,
719 ),
720 ),
721 'default' => array(
722 'size' => 50,
723 'unit' => 'px',
724 ),
725 'selectors' => array(
726 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item i' => 'font-size: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
727 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
728 ),
729 'condition' => array(
730 'item_type' => array( 'icon', 'svg' ),
731 ),
732 )
733 );
734
735 $repeater->add_control(
736 'item_icon_color',
737 array(
738 'label' => __( 'Color', 'premium-addons-for-elementor' ),
739 'type' => Controls_Manager::COLOR,
740 'selectors' => array(
741 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item i' => 'color: {{VALUE}};',
742 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item svg, {{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item svg *' => 'fill: {{VALUE}};',
743 ),
744 'condition' => array(
745 'item_type' => array( 'icon', 'svg' ),
746 ),
747 )
748 );
749
750 $repeater->add_control(
751 'item_text_color',
752 array(
753 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
754 'type' => Controls_Manager::COLOR,
755 'selectors' => array(
756 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-text.pa-txt-sc__main-item' => 'color: {{VALUE}};',
757 ),
758 'condition' => array(
759 'item_type' => 'text',
760 ),
761 )
762 );
763
764 $repeater->add_group_control(
765 Group_Control_Typography::get_type(),
766 array(
767 'name' => 'item_text_typo',
768 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-text.pa-txt-sc__main-item',
769 'condition' => array(
770 'item_type' => 'text',
771 ),
772 )
773 );
774
775 $repeater->add_group_control(
776 Group_Control_Text_Shadow::get_type(),
777 array(
778 'name' => 'item_text_shadow',
779 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-text.pa-txt-sc__main-item',
780 'condition' => array(
781 'item_type' => 'text',
782 ),
783 )
784 );
785
786 $repeater->add_responsive_control(
787 'item_img_width',
788 array(
789 'label' => __( 'Width', 'premium-addons-for-elementor' ),
790 'type' => Controls_Manager::SLIDER,
791 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
792 'range' => array(
793 'px' => array(
794 'min' => 1,
795 'max' => 1000,
796 ),
797 ),
798 'default' => array(
799 'size' => 100,
800 'unit' => 'px',
801 ),
802 'selectors' => array(
803 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item' => 'width: {{SIZE}}{{UNIT}}',
804 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-img.pa-txt-sc__main-item' => 'max-width: {{SIZE}}{{UNIT}}',
805 ),
806 'condition' => array(
807 'item_type' => array( 'image', 'lottie' ),
808 ),
809 )
810 );
811
812 $repeater->add_responsive_control(
813 'item_img_height',
814 array(
815 'label' => __( 'Height', 'premium-addons-for-elementor' ),
816 'type' => Controls_Manager::SLIDER,
817 'size_units' => array( 'px', 'em', '%' ),
818 'range' => array(
819 'px' => array(
820 'min' => 1,
821 'max' => 1000,
822 ),
823 ),
824 'selectors' => array(
825 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item' => 'height: {{SIZE}}{{UNIT}}',
826 ),
827 'condition' => array(
828 'item_type' => array( 'image', 'lottie' ),
829 ),
830 )
831 );
832
833 $repeater->add_control(
834 'opacity',
835 array(
836 'label' => __( 'Opacity', 'premium-addons-for-elementor' ),
837 'type' => Controls_Manager::SLIDER,
838 'range' => array(
839 'px' => array(
840 'min' => 0,
841 'max' => 1,
842 'step' => 0.1,
843 ),
844 ),
845 'selectors' => array(
846 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item' => 'opacity: {{SIZE}};',
847 ),
848 )
849 );
850
851 $repeater->add_control(
852 'stroke_sw',
853 array(
854 'label' => __( 'Stroke', 'premium-addons-for-elementor' ),
855 'type' => Controls_Manager::SWITCHER,
856 'condition' => array(
857 'clipped_bg!' => 'yes',
858 'item_type' => 'text',
859 ),
860 )
861 );
862
863 $repeater->add_control(
864 'ts_stroke_text_color',
865 array(
866 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
867 'type' => Controls_Manager::COLOR,
868 'selectors' => array(
869 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item' => '-webkit-text-stroke-color: {{VALUE}};',
870 ),
871 'condition' => array(
872 'clipped_bg!' => 'yes',
873 'item_type' => 'text',
874 'stroke_sw' => 'yes',
875 ),
876 )
877 );
878
879 $repeater->add_responsive_control(
880 'stroke_width',
881 array(
882 'label' => __( 'Stroke Fill Width', 'premium-addons-for-elementor' ),
883 'type' => Controls_Manager::SLIDER,
884 'default' => array(
885 'size' => 1,
886 'unit' => 'px',
887 ),
888 'selectors' => array(
889 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item' => '-webkit-text-stroke-width: {{SIZE}}px',
890 ),
891 'condition' => array(
892 'clipped_bg!' => 'yes',
893 'item_type' => 'text',
894 'stroke_sw' => 'yes',
895 ),
896 )
897 );
898
899 $repeater->add_control(
900 'zindex',
901 array(
902 'label' => __( 'Z-Index', 'premium-addons-for-elementor' ),
903 'type' => Controls_Manager::NUMBER,
904 'selectors' => array(
905 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item' => 'z-index: {{VALUE}}',
906 ),
907 )
908 );
909
910 $repeater->add_control(
911 'hide_on_hov',
912 array(
913 'label' => __( 'Hide on Hover', 'premium-addons-for-elementor' ),
914 'type' => Controls_Manager::SWITCHER,
915 'separator' => 'before',
916 )
917 );
918
919 $repeater->end_controls_tab();
920
921 $repeater->start_controls_tab(
922 'hover_state',
923 array(
924 'label' => __( 'Hover Element', 'premium-addons-for-elementor' ),
925 )
926 );
927
928 $repeater->add_control(
929 'item_type_hov',
930 array(
931 'label' => __( 'Type', 'premium-addons-for-elementor' ),
932 'type' => Controls_Manager::SELECT,
933 'render_type' => 'template',
934 'options' => array(
935 'none' => __( 'None', 'premium-addons-for-elementor' ),
936 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
937 'text' => __( 'Text', 'premium-addons-for-elementor' ),
938 'image' => __( 'Image', 'premium-addons-for-elementor' ),
939 'lottie' => __( 'Lottie', 'premium-addons-for-elementor' ),
940 'svg' => apply_filters( 'pa_pro_label', __( 'SVG Code (Pro)', 'premium-addons-for-elementor' ) ),
941 ),
942 'default' => 'none',
943 )
944 );
945
946 $repeater->add_control(
947 'item_txt_hov',
948 array(
949 'label' => __( 'Text', 'premium-addons-for-elementor' ),
950 'type' => Controls_Manager::TEXT,
951 'dynamic' => array( 'active' => true ),
952 'label_block' => true,
953 'condition' => array(
954 'item_type_hov' => 'text',
955 ),
956 )
957 );
958
959 $repeater->add_control(
960 'item_txt_tag_hov',
961 array(
962 'label' => __( 'HTML Tag', 'premium-addons-for-elementor' ),
963 'description' => __( 'Select an HTML tag for the text.', 'premium-addons-for-elementor' ),
964 'type' => Controls_Manager::SELECT,
965 'options' => array(
966 'h1' => 'H1',
967 'h2' => 'H2',
968 'h3' => 'H3',
969 'h4' => 'H4',
970 'h5' => 'H5',
971 'h6' => 'H6',
972 'div' => 'div',
973 'span' => 'span',
974 'p' => 'p',
975 ),
976 'default' => 'span',
977 'label_block' => true,
978 'condition' => array(
979 'item_type_hov' => 'text',
980 ),
981 )
982 );
983
984 $repeater->add_control(
985 'content_image_hov',
986 array(
987 'label' => __( 'Choose Image', 'premium-addons-for-elementor' ),
988 'type' => Controls_Manager::MEDIA,
989 'label_block' => true,
990 'default' => array(
991 'url' => Utils::get_placeholder_image_src(),
992 ),
993 'dynamic' => array( 'active' => true ),
994 'condition' => array(
995 'item_type_hov' => 'image',
996 ),
997 )
998 );
999
1000 $repeater->add_group_control(
1001 Group_Control_Image_Size::get_type(),
1002 array(
1003 'name' => 'thumbnail_hov',
1004 'default' => 'full',
1005 'condition' => array(
1006 'item_type_hov' => 'image',
1007 ),
1008 )
1009 );
1010
1011 $repeater->add_control(
1012 'item_img_fit_hov',
1013 array(
1014 'label' => __( 'Image Fit', 'premium-addons-for-elementor' ),
1015 'type' => Controls_Manager::SELECT,
1016 'options' => array(
1017 '' => __( 'Default', 'premium-addons-for-elementor' ),
1018 'cover' => __( 'Cover', 'premium-addons-for-elementor' ),
1019 'fill' => __( 'Fill', 'premium-addons-for-elementor' ),
1020 'contain' => __( 'Contain', 'premium-addons-for-elementor' ),
1021 ),
1022 'default' => '',
1023 'selectors' => array(
1024 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item' => 'object-fit:{{VALUE}};',
1025 ),
1026 'condition' => array(
1027 'item_type_hov' => 'image',
1028 ),
1029 )
1030 );
1031
1032 $repeater->add_control(
1033 'icon_hov',
1034 array(
1035 'label' => __( 'Choose Icon', 'premium-addons-for-elementor' ),
1036 'type' => Controls_Manager::ICONS,
1037 'skin' => 'inline',
1038 'default' => array(
1039 'value' => 'fas fa-star',
1040 'library' => 'fa-solid',
1041 ),
1042 'label_block' => false,
1043 'condition' => array(
1044 'item_type_hov' => 'icon',
1045 ),
1046 )
1047 );
1048
1049 if ( $papro_activated ) {
1050
1051 do_action( 'pa_showcase_svg_hover', $repeater );
1052
1053 }
1054
1055 $repeater->add_control(
1056 'draw_svg_hov',
1057 array(
1058 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
1059 'type' => Controls_Manager::SWITCHER,
1060 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
1061 'description' => __( 'Use this option to draw your Font Awesome/SVG Icons.', 'premium-addons-for-elementor' ),
1062 'conditions' => $svg_draw_conds_hov,
1063 )
1064 );
1065
1066 if ( $draw_icon ) {
1067
1068 $repeater->add_control(
1069 'path_width_hov',
1070 array(
1071 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
1072 'type' => Controls_Manager::SLIDER,
1073 'range' => array(
1074 'px' => array(
1075 'min' => 0,
1076 'max' => 50,
1077 'step' => 0.1,
1078 ),
1079 ),
1080 'conditions' => array(
1081 'terms' => array(
1082 $svg_draw_conds_hov,
1083 ),
1084 ),
1085 'selectors' => array(
1086 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item.premium-drawable-icon *' => 'stroke-width: {{SIZE}};',
1087 ),
1088 )
1089 );
1090
1091 $repeater->add_control(
1092 'svg_sync_hov',
1093 array(
1094 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
1095 'type' => Controls_Manager::SWITCHER,
1096 'condition' => array(
1097 'draw_svg_hov' => 'yes',
1098 'item_type_hov' => 'svg',
1099 ),
1100 )
1101 );
1102
1103 $repeater->add_control(
1104 'frames_hov',
1105 array(
1106 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
1107 'type' => Controls_Manager::NUMBER,
1108 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
1109 'default' => 5,
1110 'min' => 1,
1111 'max' => 100,
1112 'conditions' => array(
1113 'terms' => array(
1114 array(
1115 'name' => 'draw_svg_hov',
1116 'value' => 'yes',
1117 ),
1118 $svg_draw_conds_hov,
1119 ),
1120 ),
1121 )
1122 );
1123
1124 $repeater->add_control(
1125 'stroke_colors_hov',
1126 array(
1127 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1128 'type' => Controls_Manager::COLOR,
1129 'conditions' => array(
1130 'terms' => array(
1131 $svg_draw_conds,
1132 ),
1133 ),
1134 'selectors' => array(
1135 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item.premium-drawable-icon *' => 'stroke: {{VALUE}};',
1136 ),
1137 )
1138 );
1139
1140 $repeater->add_control(
1141 'svg_color_hov',
1142 array(
1143 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
1144 'type' => Controls_Manager::COLOR,
1145 'global' => false,
1146 'conditions' => array(
1147 'terms' => array(
1148 array(
1149 'name' => 'draw_svg_hov',
1150 'value' => 'yes',
1151 ),
1152 $svg_draw_conds_hov,
1153 ),
1154 ),
1155 )
1156 );
1157 } else {
1158 Helper_Functions::get_draw_svg_notice(
1159 $repeater,
1160 'textual',
1161 $svg_draw_conds_hov,
1162 '',
1163 'conditions'
1164 );
1165 }
1166
1167 $repeater->add_control(
1168 'lottie_url_hov',
1169 array(
1170 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
1171 'type' => Controls_Manager::TEXT,
1172 'dynamic' => array( 'active' => true ),
1173 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
1174 'label_block' => true,
1175 'condition' => array(
1176 'item_type_hov' => 'lottie',
1177 ),
1178 )
1179 );
1180
1181 $lottie_cond_hov = array(
1182 'relation' => 'or',
1183 'terms' => array(
1184 array(
1185 'name' => 'item_type_hov',
1186 'value' => 'lottie',
1187 ),
1188 array(
1189 'terms' => array(
1190 array(
1191 'name' => 'draw_svg_hov',
1192 'value' => 'yes',
1193 ),
1194 $svg_draw_conds_hov,
1195 ),
1196 ),
1197 ),
1198 );
1199
1200 $repeater->add_control(
1201 'lottie_loop_hov',
1202 array(
1203 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
1204 'type' => Controls_Manager::SWITCHER,
1205 'return_value' => 'true',
1206 'default' => 'true',
1207 'conditions' => $lottie_cond_hov,
1208 )
1209 );
1210
1211 $repeater->add_control(
1212 'lottie_reverse_hov',
1213 array(
1214 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
1215 'type' => Controls_Manager::SWITCHER,
1216 'return_value' => 'true',
1217 'conditions' => $lottie_cond_hov,
1218 )
1219 );
1220
1221 if ( $draw_icon ) {
1222 $repeater->add_control(
1223 'start_point_hov',
1224 array(
1225 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
1226 'type' => Controls_Manager::SLIDER,
1227 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
1228 'default' => array(
1229 'unit' => '%',
1230 'size' => 0,
1231 ),
1232 'conditions' => array(
1233 'terms' => array(
1234 array(
1235 'name' => 'draw_svg_hov',
1236 'value' => 'yes',
1237 ),
1238 array(
1239 'name' => 'lottie_reverse_hov',
1240 'operator' => '!==',
1241 'value' => 'true',
1242 ),
1243 $svg_draw_conds_hov,
1244 ),
1245 ),
1246 )
1247 );
1248
1249 $repeater->add_control(
1250 'end_point_hov',
1251 array(
1252 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
1253 'type' => Controls_Manager::SLIDER,
1254 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
1255 'default' => array(
1256 'unit' => '%',
1257 'size' => 0,
1258 ),
1259 'conditions' => array(
1260 'terms' => array(
1261 array(
1262 'name' => 'draw_svg_hov',
1263 'value' => 'yes',
1264 ),
1265 array(
1266 'name' => 'lottie_reverse_hov',
1267 'value' => 'true',
1268 ),
1269 $svg_draw_conds_hov,
1270 ),
1271 ),
1272 )
1273 );
1274
1275 $repeater->add_control(
1276 'svg_yoyo_hov',
1277 array(
1278 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
1279 'type' => Controls_Manager::SWITCHER,
1280 'conditions' => array(
1281 'terms' => array(
1282 array(
1283 'name' => 'draw_svg_hov',
1284 'value' => 'yes',
1285 ),
1286 array(
1287 'name' => 'lottie_loop_hov',
1288 'value' => 'true',
1289 ),
1290 $svg_draw_conds_hov,
1291 ),
1292 ),
1293 )
1294 );
1295 }
1296
1297 $repeater->add_control(
1298 'style_hov',
1299 array(
1300 'label' => esc_html__( 'Element Style', 'premium-addons-for-elementor' ),
1301 'type' => Controls_Manager::HEADING,
1302 'separator' => 'before',
1303 )
1304 );
1305
1306 $repeater->add_responsive_control(
1307 'item_txt_align_hov',
1308 array(
1309 'label' => __( 'Text Alignment', 'premium-addons-for-elementor' ),
1310 'type' => Controls_Manager::CHOOSE,
1311 'options' => array(
1312 'left' => array(
1313 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1314 'icon' => 'eicon-text-align-left',
1315 ),
1316 'center' => array(
1317 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1318 'icon' => 'eicon-text-align-center',
1319 ),
1320 'right' => array(
1321 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1322 'icon' => 'eicon-text-align-right',
1323 ),
1324 ),
1325 'default' => 'center',
1326 'toggle' => false,
1327 'selectors' => array(
1328 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-text.pa-txt-sc__hov-item' => 'justify-content: {{VALUE}}',
1329 ),
1330 'condition' => array(
1331 'item_type_hov' => 'text',
1332 ),
1333 )
1334 );
1335
1336 $repeater->add_responsive_control(
1337 'content_size_hov',
1338 array(
1339 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1340 'type' => Controls_Manager::SLIDER,
1341 'size_units' => array( 'px', 'em', '%' ),
1342 'label_block' => true,
1343 'range' => array(
1344 'px' => array(
1345 'min' => 0,
1346 'max' => 1000,
1347 ),
1348 ),
1349 'default' => array(
1350 'size' => 50,
1351 'unit' => 'px',
1352 ),
1353 'selectors' => array(
1354 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item i' => 'font-size: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
1355 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
1356 ),
1357 'condition' => array(
1358 'item_type_hov' => array( 'icon', 'svg' ),
1359 ),
1360 )
1361 );
1362
1363 $repeater->add_control(
1364 'item_icon_color_hov',
1365 array(
1366 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1367 'type' => Controls_Manager::COLOR,
1368 'selectors' => array(
1369 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item i' => 'color: {{VALUE}};',
1370 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item svg, {{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item svg *' => 'fill: {{VALUE}};',
1371 ),
1372 'condition' => array(
1373 'item_type_hov' => array( 'icon', 'svg' ),
1374 ),
1375 )
1376 );
1377
1378 $repeater->add_control(
1379 'item_text_color_hov',
1380 array(
1381 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
1382 'type' => Controls_Manager::COLOR,
1383 'selectors' => array(
1384 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-text.pa-txt-sc__hov-item' => 'color: {{VALUE}};',
1385 ),
1386 'condition' => array(
1387 'item_type_hov' => 'text',
1388 ),
1389 )
1390 );
1391
1392 $repeater->add_group_control(
1393 Group_Control_Typography::get_type(),
1394 array(
1395 'name' => 'item_text_typo_hov',
1396 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-text.pa-txt-sc__hov-item',
1397 'condition' => array(
1398 'item_type_hov' => 'text',
1399 ),
1400 )
1401 );
1402
1403 $repeater->add_group_control(
1404 Group_Control_Text_Shadow::get_type(),
1405 array(
1406 'name' => 'item_text_shadow_hov',
1407 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-text.pa-txt-sc__hov-item',
1408 'condition' => array(
1409 'item_type_hov' => 'text',
1410 ),
1411 )
1412 );
1413
1414 $repeater->add_responsive_control(
1415 'item_img_width_hov',
1416 array(
1417 'label' => __( 'Width', 'premium-addons-for-elementor' ),
1418 'type' => Controls_Manager::SLIDER,
1419 'size_units' => array( 'px', 'em', '%' ),
1420 'range' => array(
1421 'px' => array(
1422 'min' => 1,
1423 'max' => 1000,
1424 ),
1425 ),
1426 'default' => array(
1427 'size' => 100,
1428 'unit' => 'px',
1429 ),
1430 'selectors' => array(
1431 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item' => 'width: {{SIZE}}{{UNIT}}',
1432 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__item-img.pa-txt-sc__hov-item' => 'max-width: {{SIZE}}{{UNIT}}',
1433 ),
1434 'condition' => array(
1435 'item_type_hov' => array( 'image', 'lottie' ),
1436 ),
1437 )
1438 );
1439
1440 $repeater->add_responsive_control(
1441 'item_img_height_hov',
1442 array(
1443 'label' => __( 'Height', 'premium-addons-for-elementor' ),
1444 'type' => Controls_Manager::SLIDER,
1445 'size_units' => array( 'px', 'em' ),
1446 'range' => array(
1447 'px' => array(
1448 'min' => 1,
1449 'max' => 1000,
1450 ),
1451 ),
1452 'selectors' => array(
1453 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item' => 'height: {{SIZE}}{{UNIT}}',
1454 ),
1455 'condition' => array(
1456 'item_type_hov' => array( 'image', 'lottie' ),
1457 ),
1458 )
1459 );
1460
1461 $repeater->add_control(
1462 'opacity_hov',
1463 array(
1464 'label' => __( 'Opacity', 'premium-addons-for-elementor' ),
1465 'type' => Controls_Manager::SLIDER,
1466 'range' => array(
1467 'px' => array(
1468 'min' => 0,
1469 'max' => 1,
1470 'step' => 0.1,
1471 ),
1472 ),
1473 'default' => array(
1474 'size' => 1,
1475 'unit' => 'px',
1476 ),
1477 'selectors' => array(
1478 '{{WRAPPER}} {{CURRENT_ITEM}}:hover .pa-txt-sc__hov-item' => 'opacity: {{SIZE}};',
1479 ),
1480 )
1481 );
1482
1483 $repeater->add_control(
1484 'stroke_sw_hov',
1485 array(
1486 'label' => __( 'Stroke', 'premium-addons-for-elementor' ),
1487 'type' => Controls_Manager::SWITCHER,
1488 'condition' => array(
1489 'clipped_bg_hov!' => 'yes',
1490 'item_type_hov' => 'text',
1491 ),
1492 )
1493 );
1494
1495 $repeater->add_control(
1496 'ts_stroke_text_color_hov',
1497 array(
1498 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1499 'type' => Controls_Manager::COLOR,
1500 'selectors' => array(
1501 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item' => '-webkit-text-stroke-color: {{VALUE}};',
1502 ),
1503 'condition' => array(
1504 'clipped_bg_hov!' => 'yes',
1505 'item_type_hov' => 'text',
1506 'stroke_sw_hov' => 'yes',
1507 ),
1508 )
1509 );
1510
1511 $repeater->add_responsive_control(
1512 'stroke_width_hov',
1513 array(
1514 'label' => __( 'Stroke Fill Width', 'premium-addons-for-elementor' ),
1515 'type' => Controls_Manager::SLIDER,
1516 'default' => array(
1517 'size' => 1,
1518 'unit' => 'px',
1519 ),
1520 'selectors' => array(
1521 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item' => '-webkit-text-stroke-width: {{SIZE}}px',
1522 ),
1523 'condition' => array(
1524 'clipped_bg_hov!' => 'yes',
1525 'item_type_hov' => 'text',
1526 'stroke_sw_hov' => 'yes',
1527 ),
1528 )
1529 );
1530
1531 $repeater->add_control(
1532 'zindex_hov',
1533 array(
1534 'label' => __( 'Z-Index', 'premium-addons-for-elementor' ),
1535 'type' => Controls_Manager::NUMBER,
1536 'selectors' => array(
1537 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'z-index: {{VALUE}}',
1538 ),
1539 )
1540 );
1541
1542 $repeater->add_control(
1543 'transition',
1544 array(
1545 'label' => __( 'Transition (sec)', 'premium-addons-for-elementor' ),
1546 'type' => Controls_Manager::SLIDER,
1547 'size_units' => array( 's' ),
1548 'default' => array(
1549 'unit' => 's',
1550 'size' => 0,
1551 ),
1552 'range' => array(
1553 's' => array(
1554 'min' => 0,
1555 'max' => 50,
1556 'step' => 0.1,
1557 ),
1558 ),
1559 'selectors' => array(
1560 '{{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__hov-item, {{WRAPPER}} {{CURRENT_ITEM}} .pa-txt-sc__main-item' => 'transition-duration: {{SIZE}}s',
1561 ),
1562 )
1563 );
1564
1565 $repeater->end_controls_tab();
1566
1567 $repeater->end_controls_tabs();
1568
1569 $repeater->add_control(
1570 'additional_heading',
1571 array(
1572 'label' => esc_html__( 'Additional Options', 'premium-addons-for-elementor' ),
1573 'type' => Controls_Manager::HEADING,
1574 'separator' => 'before',
1575 )
1576 );
1577
1578 $repeater->add_control(
1579 'link_switcher',
1580 array(
1581 'label' => __( 'Link', 'premium-addons-for-elementor' ),
1582 'type' => Controls_Manager::SWITCHER,
1583 )
1584 );
1585
1586 $repeater->add_control(
1587 'link_type',
1588 array(
1589 'label' => __( 'Link Type', 'premium-addons-for-elementor' ),
1590 'type' => Controls_Manager::SELECT,
1591 'options' => array(
1592 'url' => __( 'URL', 'premium-addons-for-elementor' ),
1593 'link' => __( 'Existing Page', 'premium-addons-for-elementor' ),
1594 ),
1595 'default' => 'url',
1596 'label_block' => true,
1597 'condition' => array(
1598 'link_switcher' => 'yes',
1599 ),
1600 )
1601 );
1602
1603 $repeater->add_control(
1604 'link',
1605 array(
1606 'label' => __( 'URL', 'premium-addons-for-elementor' ),
1607 'type' => Controls_Manager::URL,
1608 'dynamic' => array( 'active' => true ),
1609 'placeholder' => 'https://premiumaddons.com/',
1610 'condition' => array(
1611 'link_type' => 'url',
1612 'link_switcher' => 'yes',
1613 ),
1614 'label_block' => true,
1615 )
1616 );
1617
1618 $repeater->add_control(
1619 'link_existing',
1620 array(
1621 'label' => __( 'Existing Page', 'premium-addons-for-elementor' ),
1622 'type' => Premium_Post_Filter::TYPE,
1623 'label_block' => true,
1624 'multiple' => false,
1625 'source' => array( 'post', 'page' ),
1626 'condition' => array(
1627 'link_type' => 'link',
1628 'link_switcher' => 'yes',
1629 ),
1630 )
1631 );
1632
1633 $repeater->add_control(
1634 'effect',
1635 array(
1636 'label' => __( 'Effects', 'premium-addons-for-elementor' ),
1637 'type' => Controls_Manager::SELECT,
1638 'render_type' => 'template',
1639 'separator' => 'before',
1640 'options' => array(
1641 'none' => __( 'None', 'premium-addons-for-elementor' ),
1642 'hvr-pulse-grow' => __( 'Pulse', 'premium-addons-for-elementor' ),
1643 'rotate' => __( 'Rotate', 'premium-addons-for-elementor' ),
1644 'hvr-buzz' => apply_filters( 'pa_pro_label', __( 'Buzz (Pro)', 'premium-addons-for-elementor' ) ),
1645 'grow' => apply_filters( 'pa_pro_label', __( 'Grow (Pro)', 'premium-addons-for-elementor' ) ),
1646 'd-rotate' => apply_filters( 'pa_pro_label', __( '3D Rotate (Pro)', 'premium-addons-for-elementor' ) ),
1647 'hvr-float-shadow' => apply_filters( 'pa_pro_label', __( 'Drop Shadow (Pro)', 'premium-addons-for-elementor' ) ),
1648 'hvr-wobble-vertical' => apply_filters( 'pa_pro_label', __( 'Wobble Vertical (Pro)', 'premium-addons-for-elementor' ) ),
1649 ),
1650 'default' => 'none',
1651 'condition' => array(
1652 'item_type!' => 'text',
1653 ),
1654 )
1655 );
1656
1657 $repeater->add_control(
1658 'txt_effect',
1659 array(
1660 'label' => __( 'Highlight Effects', 'premium-addons-for-elementor' ),
1661 'type' => Controls_Manager::SELECT,
1662 'render_type' => 'template',
1663 'separator' => 'before',
1664 'options' => array(
1665 'none' => __( 'None', 'premium-addons-for-elementor' ),
1666 'strikethrough' => __( 'Strikethrough', 'premium-addons-for-elementor' ),
1667 'underline' => __( 'Underline', 'premium-addons-for-elementor' ),
1668 'min-mask' => apply_filters( 'pa_pro_label', __( 'Minimal Mask (Pro)', 'premium-addons-for-elementor' ) ),
1669 'circle' => apply_filters( 'pa_pro_label', __( 'Circle (Pro)', 'premium-addons-for-elementor' ) ),
1670 'curly' => apply_filters( 'pa_pro_label', __( 'Curly (Pro)', 'premium-addons-for-elementor' ) ),
1671 'h-underline' => apply_filters( 'pa_pro_label', __( 'Hand-drawn Underline (Pro)', 'premium-addons-for-elementor' ) ),
1672 'outline' => apply_filters( 'pa_pro_label', __( 'Outline (Pro)', 'premium-addons-for-elementor' ) ),
1673 'double-underline' => apply_filters( 'pa_pro_label', __( 'Double Underline (Pro)', 'premium-addons-for-elementor' ) ),
1674 'underline-zigzag' => apply_filters( 'pa_pro_label', __( 'Underline Zigzag (Pro)', 'premium-addons-for-elementor' ) ),
1675 'diagonal' => apply_filters( 'pa_pro_label', __( 'Diagonal (Pro)', 'premium-addons-for-elementor' ) ),
1676 'x' => apply_filters( 'pa_pro_label', 'X (Pro)' ),
1677 ),
1678 'default' => 'none',
1679 'condition' => array(
1680 'item_type' => 'text',
1681 ),
1682 )
1683 );
1684
1685 $repeater->add_control(
1686 'min_mask_notice',
1687 array(
1688 'raw' => __( 'Please note that Minimal Mask Effect works only on Text Elements ', 'premium-addons-for-elementor' ),
1689 'type' => Controls_Manager::RAW_HTML,
1690 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1691 'condition' => array(
1692 'enable_background_overlay' => 'yes',
1693 ),
1694 )
1695 );
1696
1697 $repeater->add_control(
1698 'effect_color',
1699 array(
1700 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1701 'type' => Controls_Manager::COLOR,
1702 'render_type' => 'template',
1703 'selectors' => array(
1704 '{{WRAPPER}} {{CURRENT_ITEM}} svg.outline-svg.outline' => 'stroke: {{VALUE}};',
1705 '{{WRAPPER}} {{CURRENT_ITEM}} .premium-mask-span::after, {{WRAPPER}} {{CURRENT_ITEM}}.underline::after' => 'background-color: {{VALUE}};',
1706 ),
1707 'condition' => array(
1708 'item_type' => 'text',
1709 ),
1710 )
1711 );
1712
1713 $repeater->add_control(
1714 'mask_dir',
1715 array(
1716 'label' => __( 'Direction', 'premium-addons-for-elementor' ),
1717 'type' => Controls_Manager::SELECT,
1718 'default' => 'tr',
1719 'render_type' => 'template',
1720 'options' => array(
1721 'tr' => __( 'To Right', 'premium-addons-for-elementor' ),
1722 'tl' => __( 'To Left', 'premium-addons-for-elementor' ),
1723 'tt' => __( 'To Top', 'premium-addons-for-elementor' ),
1724 'tb' => __( 'To Bottom', 'premium-addons-for-elementor' ),
1725 ),
1726 'condition' => array(
1727 'txt_effect' => 'min-mask',
1728 'item_type' => 'text',
1729 ),
1730 )
1731 );
1732
1733 $repeater->add_control(
1734 'line_stroke_width',
1735 array(
1736 'label' => __( 'Line Thickness', 'premium-addons-for-elementor' ),
1737 'type' => Controls_Manager::SLIDER,
1738 'size_units' => array( 'px' ),
1739 'label_block' => true,
1740 'selectors' => array(
1741 '{{WRAPPER}} {{CURRENT_ITEM}} svg.outline-svg' => 'stroke-width: {{SIZE}}{{UNIT}};',
1742 '{{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-underline::after' => 'height: {{SIZE}}{{UNIT}};',
1743 ),
1744 'condition' => array(
1745 'item_type' => 'text',
1746 ),
1747 )
1748 );
1749
1750 $repeater->add_control(
1751 'anim_speed',
1752 array(
1753 'label' => __( 'Animation Speed', 'premium-addons-for-elementor' ),
1754 'type' => Controls_Manager::SLIDER,
1755 'size_units' => array( 's' ),
1756 'render_type' => 'template',
1757 'range' => array(
1758 'px' => array(
1759 'min' => 0,
1760 'max' => 50,
1761 'step' => 0.1,
1762 ),
1763 ),
1764 'label_block' => true,
1765 'selectors' => array(
1766 '{{WRAPPER}} {{CURRENT_ITEM}} svg.outline-svg path, {{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-hvr-pulse-grow.hvr-pulse-grow,
1767 {{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-hvr-buzz.hvr-buzz' => 'animation-duration: {{SIZE}}s;',
1768 '{{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-underline::after,
1769 {{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-grow, {{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-rotate,
1770 {{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-d-rotate, {{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-hvr-wobble-vertical.hvr-wobble-vertical,
1771 {{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-hvr-float-shadow, {{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__effect-hvr-float-shadow::after' => 'transition: {{SIZE}}s;',
1772 ),
1773 'conditions' => array(
1774 'relation' => 'or',
1775 'terms' => array(
1776 array(
1777 'terms' => array(
1778 array(
1779 'name' => 'item_type',
1780 'value' => 'text',
1781 ),
1782 array(
1783 'name' => 'txt_effect',
1784 'operator' => '!in',
1785 'value' => array( 'none', 'min-mask' ),
1786 ),
1787 ),
1788 ),
1789 array(
1790 'terms' => array(
1791 array(
1792 'name' => 'item_type',
1793 'operator' => '!==',
1794 'value' => 'text',
1795 ),
1796 array(
1797 'name' => 'effect',
1798 'operator' => '!==',
1799 'value' => 'none',
1800 ),
1801 ),
1802 ),
1803 ),
1804 ),
1805 )
1806 );
1807
1808 $repeater->add_control(
1809 'con_style_heading',
1810 array(
1811 'label' => esc_html__( 'Item Container Style', 'premium-addons-for-elementor' ),
1812 'type' => Controls_Manager::HEADING,
1813 'separator' => 'before',
1814 )
1815 );
1816
1817 $repeater->add_responsive_control(
1818 'item_width',
1819 array(
1820 'label' => __( 'Item Width', 'premium-addons-for-elementor' ),
1821 'type' => Controls_Manager::SLIDER,
1822 'size_units' => array( 'px', 'vw', 'custom' ),
1823 'range' => array(
1824 'px' => array(
1825 'min' => 0,
1826 'max' => 1000,
1827 ),
1828 ),
1829 'label_block' => true,
1830 'selectors' => array(
1831 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};',
1832 ),
1833 )
1834 );
1835
1836 $repeater->add_control(
1837 'rotate',
1838 array(
1839 'label' => __( 'Rotate (deg)', 'premium-addons-for-elementor' ),
1840 'type' => Controls_Manager::SLIDER,
1841 'size_units' => array( 'deg' ),
1842 'default' => array(
1843 'unit' => 'deg',
1844 'size' => 0,
1845 ),
1846 'range' => array(
1847 'deg' => array(
1848 'min' => -180,
1849 'max' => 180,
1850 ),
1851 ),
1852 'selectors' => array(
1853 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'transform: rotate({{SIZE}}deg)',
1854 ),
1855 'condition' => array(
1856 'effect!' => array( 'rotate', 'd-rotate', 'hvr-float-shadow' ),
1857 ),
1858 )
1859 );
1860
1861 $repeater->add_control(
1862 'clipped_bg',
1863 array(
1864 'label' => apply_filters( 'pa_pro_label', __( 'Clipped Background (Pro)', 'premium-addons-for-elementor' ) ),
1865 'type' => Controls_Manager::SWITCHER,
1866 'conditions' => array(
1867 'relation' => 'or',
1868 'terms' => array(
1869 array(
1870 'name' => 'item_type',
1871 'value' => 'text',
1872 ),
1873 array(
1874 'name' => 'item_type_hov',
1875 'value' => 'text',
1876 ),
1877 ),
1878 ),
1879 )
1880 );
1881
1882 $repeater->add_group_control(
1883 Premium_Background::get_type(),
1884 array(
1885 'name' => 'item_background',
1886 'types' => array( 'classic', 'gradient' ),
1887 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__item-container:not(.pa-clipped-bg) ,{{WRAPPER}} {{CURRENT_ITEM}}.pa-clipped-bg span ',
1888 )
1889 );
1890
1891 $repeater->add_control(
1892 'item_lq_effect',
1893 array(
1894 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
1895 'type' => Controls_Manager::SELECT,
1896 'description' => sprintf(
1897 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
1898 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' ),
1899 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
1900 '</a>'
1901 ),
1902 'options' => array(
1903 'none' => __( 'None', 'premium-addons-for-elementor' ),
1904 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
1905 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
1906 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
1907 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
1908 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
1909 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
1910 ),
1911 'default' => 'none',
1912 'label_block' => true,
1913 'condition' => array(
1914 'clipped_bg!' => 'yes',
1915 ),
1916 )
1917 );
1918
1919 $repeater->add_group_control(
1920 Group_Control_Border::get_type(),
1921 array(
1922 'name' => 'item_border',
1923 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__item-container',
1924 )
1925 );
1926
1927 $repeater->add_control(
1928 'item_border_rad',
1929 array(
1930 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1931 'type' => Controls_Manager::SLIDER,
1932 'size_units' => array( 'px', '%', 'em' ),
1933 'selectors' => array(
1934 '{{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__item-container' => 'border-radius: {{SIZE}}{{UNIT}};',
1935 ),
1936 )
1937 );
1938
1939 $repeater->add_responsive_control(
1940 'item_margin',
1941 array(
1942 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1943 'type' => Controls_Manager::DIMENSIONS,
1944 'size_units' => array( 'px', 'em' ),
1945 'selectors' => array(
1946 '{{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__item-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1947 ),
1948 )
1949 );
1950
1951 $repeater->add_responsive_control(
1952 'item_padding',
1953 array(
1954 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1955 'type' => Controls_Manager::DIMENSIONS,
1956 'size_units' => array( 'px', 'em' ),
1957 'selectors' => array(
1958 '{{WRAPPER}} {{CURRENT_ITEM}}.pa-txt-sc__item-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1959 ),
1960 )
1961 );
1962
1963 $this->add_control(
1964 'content',
1965 array(
1966 'label' => __( 'Items', 'premium-addons-for-elementor' ),
1967 'type' => Controls_Manager::REPEATER,
1968 'default' => array(
1969 array(
1970 'item_type' => 'text',
1971 'item_txt' => 'Premium',
1972 ),
1973 array(
1974 'item_type' => 'image',
1975 'content_image' => Utils::get_placeholder_image_src(),
1976 ),
1977 array(
1978 'item_type' => 'text',
1979 'item_txt' => 'Addons',
1980 ),
1981 array(
1982 'item_type' => 'image',
1983 'content_image' => Utils::get_placeholder_image_src(),
1984 ),
1985 ),
1986 'fields' => $repeater->get_controls(),
1987 'title_field' => '<# if ( "icon" === item_type ) { #> {{{ elementor.helpers.renderIcon( this, icon, {}, "i", "panel" ) }}}<#} else if( "text" === item_type ) { #> {{item_txt}} <# } else if( "image" === item_type) {#> <img class="editor-pa-img" src="{{content_image.url}}"> <# } else if ("svg" === item_type) { #> {{ "SVG Code" }} <# } else { #> {{ "Lottie" }} <# }#>',
1988 'prevent_empty' => false,
1989 )
1990 );
1991
1992 $this->add_responsive_control(
1993 'cont_col_gap',
1994 array(
1995 'label' => __( 'Horizontal Spacing', 'premium-addons-for-elementor' ),
1996 'type' => Controls_Manager::SLIDER,
1997 'separator' => 'before',
1998 'size_units' => array( 'px', 'em' ),
1999 'selectors' => array(
2000 '{{WRAPPER}} .pa-txt-sc__outer-container' => 'column-gap: {{SIZE}}{{UNIT}};',
2001 ),
2002 )
2003 );
2004
2005 $this->add_responsive_control(
2006 'cont_row_gap',
2007 array(
2008 'label' => __( 'Vertical Spacing', 'premium-addons-for-elementor' ),
2009 'type' => Controls_Manager::SLIDER,
2010 'size_units' => array( 'px', 'em' ),
2011 'selectors' => array(
2012 '{{WRAPPER}} .pa-txt-sc__outer-container' => 'row-gap: {{SIZE}}{{UNIT}};',
2013 ),
2014 )
2015 );
2016
2017 $this->add_responsive_control(
2018 'content_align',
2019 array(
2020 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
2021 'type' => Controls_Manager::CHOOSE,
2022 'options' => array(
2023 'flex-start' => array(
2024 'title' => __( 'Start', 'premium-addons-for-elementor' ),
2025 'icon' => 'eicon-order-start',
2026 ),
2027 'center' => array(
2028 'title' => __( 'Center', 'premium-addons-for-elementor' ),
2029 'icon' => 'eicon-h-align-center',
2030 ),
2031 'flex-end' => array(
2032 'title' => __( 'End', 'premium-addons-for-elementor' ),
2033 'icon' => 'eicon-order-end',
2034 ),
2035 ),
2036 'default' => 'center',
2037 'selectors' => array(
2038 '{{WRAPPER}} .pa-txt-sc__outer-container' => 'justify-content: {{VALUE}};',
2039 ),
2040 )
2041 );
2042
2043 $this->add_control(
2044 'entrance_animation',
2045 array(
2046 'label' => __( 'Entrance Animation', 'premium-addons-for-elementor' ),
2047 'type' => Controls_Manager::ANIMATION,
2048 'separator' => 'before',
2049 'default' => '',
2050 'label_block' => true,
2051 'render_type' => 'template',
2052 )
2053 );
2054
2055 $this->add_control(
2056 'en_anime_dur',
2057 array(
2058 'label' => __( 'Animation Duration', 'premium-addons-for-elementor' ),
2059 'type' => Controls_Manager::SELECT,
2060 'default' => '',
2061 'options' => array(
2062 'slow' => __( 'Slow', 'premium-addons-for-elementor' ),
2063 '' => __( 'Normal', 'premium-addons-for-elementor' ),
2064 'fast' => __( 'Fast', 'premium-addons-for-elementor' ),
2065 ),
2066 'condition' => array(
2067 'entrance_animation!' => array( '', 'none' ),
2068 ),
2069 )
2070 );
2071
2072 $this->add_control(
2073 'en_anime_delay',
2074 array(
2075 'label' => __( 'Animation Delay in Between (s)', 'premium-addons-for-elementor' ),
2076 'type' => Controls_Manager::NUMBER,
2077 'default' => 0,
2078 'step' => 0.1,
2079 'condition' => array(
2080 'entrance_animation!' => array( '', 'none' ),
2081 ),
2082 )
2083 );
2084
2085 $this->add_control(
2086 'trigger',
2087 array(
2088 'label' => __( 'Trigger Animation on', 'premium-addons-for-elementor' ),
2089 'type' => Controls_Manager::SELECT,
2090 'render_type' => 'template',
2091 'separator' => 'before',
2092 'description' => __( 'Note that the following animations are always triggered on viewport: <b>Grow, Minimal Mask</b>', 'premium-addons-for-elementor' ),
2093 'options' => array(
2094 'viewport' => __( 'Viewport', 'premium-addons-for-elementor' ),
2095 'hover' => apply_filters( 'pa_pro_label', __( 'Hover (Pro)', 'premium-addons-for-elementor' ) ),
2096 ),
2097 'default' => 'viewport',
2098 )
2099 );
2100
2101 $this->end_controls_section();
2102 }
2103
2104 private function add_help_controls() {
2105
2106 $this->start_controls_section(
2107 'section_pa_docs',
2108 array(
2109 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
2110 )
2111 );
2112
2113 $docs = array(
2114 'https://premiumaddons.com/docs/elementor-textual-showcase-widget-tutorial/' => __( 'Getting started »', 'premium-addons-for-elementor' ),
2115 'https://www.youtube.com/watch?v=xaMVSB3KV4w' => __( 'Video tutorial »', 'premium-addons-for-elementor' ),
2116 );
2117
2118 $doc_index = 1;
2119 foreach ( $docs as $url => $title ) {
2120
2121 $doc_url = Helper_Functions::get_campaign_link( $url, 'showcase', 'wp-editor', 'get-support' );
2122
2123 $this->add_control(
2124 'doc_' . $doc_index,
2125 array(
2126 'type' => Controls_Manager::RAW_HTML,
2127 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
2128 'content_classes' => 'editor-pa-doc',
2129 )
2130 );
2131
2132 ++$doc_index;
2133
2134 }
2135
2136 Helper_Functions::register_element_feedback_controls( $this );
2137
2138 $this->end_controls_section();
2139 }
2140
2141 /**
2142 * Add content style.
2143 *
2144 * @access private
2145 */
2146 private function add_content_style_controls() {
2147
2148 $this->start_controls_section(
2149 'content_style_sec',
2150 array(
2151 'label' => __( 'Item Content', 'premium-addons-for-elementor' ),
2152 'tab' => Controls_Manager::TAB_STYLE,
2153 )
2154 );
2155
2156 $this->add_control(
2157 'txt_heading',
2158 array(
2159 'label' => __( 'Text', 'premium-addons-for-elementor' ),
2160 'type' => Controls_Manager::HEADING,
2161 )
2162 );
2163
2164 /**Text Style */
2165 $this->add_control(
2166 'text_color',
2167 array(
2168 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
2169 'type' => Controls_Manager::COLOR,
2170 'selectors' => array(
2171 '{{WRAPPER}} .pa-txt-sc__item-text' => 'color: {{VALUE}};',
2172 ),
2173 )
2174 );
2175
2176 $this->add_group_control(
2177 Group_Control_Typography::get_type(),
2178 array(
2179 'name' => 'text_typo',
2180 'selector' => '{{WRAPPER}} .pa-txt-sc__item-text',
2181 )
2182 );
2183
2184 $this->add_group_control(
2185 Group_Control_Text_Shadow::get_type(),
2186 array(
2187 'name' => 'text_shadow',
2188 'selector' => '{{WRAPPER}} .pa-txt-sc__item-text',
2189 )
2190 );
2191
2192 $this->add_group_control(
2193 Group_Control_Css_Filter::get_type(),
2194 array(
2195 'name' => 'css_filters',
2196 'separator' => 'before',
2197 'selector' => '{{WRAPPER}} .pa-txt-sc__item-container:not(.has-text)',
2198 )
2199 );
2200
2201 $this->add_group_control(
2202 Group_Control_Css_Filter::get_type(),
2203 array(
2204 'name' => 'hover_css_filters',
2205 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ),
2206 'selector' => '{{WRAPPER}} .pa-txt-sc__item-container:not(.has-text):hover',
2207 )
2208 );
2209
2210 $this->add_control(
2211 'transition',
2212 array(
2213 'label' => __( 'Transition (sec)', 'premium-addons-for-elementor' ),
2214 'type' => Controls_Manager::SLIDER,
2215 'size_units' => array( 's' ),
2216 'range' => array(
2217 's' => array(
2218 'min' => 0,
2219 'max' => 3,
2220 'step' => 0.1,
2221 ),
2222 ),
2223 'selectors' => array(
2224 '{{WRAPPER}} .pa-txt-sc__item-container:not(.has-text)' => 'transition-duration: {{SIZE}}s',
2225 ),
2226 )
2227 );
2228
2229 $this->end_controls_section();
2230 }
2231
2232 /**
2233 * Add item container style controls.
2234 *
2235 * @access private
2236 */
2237 private function add_item_container_style_controls() {
2238
2239 $this->start_controls_section(
2240 'cont_style_sec',
2241 array(
2242 'label' => __( 'Item Container', 'premium-addons-for-elementor' ),
2243 'tab' => Controls_Manager::TAB_STYLE,
2244 )
2245 );
2246
2247 $this->add_group_control(
2248 Group_Control_Box_Shadow::get_type(),
2249 array(
2250 'name' => 'cont_shadow',
2251 'selector' => '{{WRAPPER}} .pa-txt-sc__item-container',
2252 )
2253 );
2254
2255 $this->add_group_control(
2256 Premium_Background::get_type(),
2257 array(
2258 'name' => 'cont_background',
2259 'types' => array( 'classic', 'gradient' ),
2260 'selector' => '{{WRAPPER}} .pa-txt-sc__item-container',
2261 )
2262 );
2263
2264 $this->add_group_control(
2265 Group_Control_Border::get_type(),
2266 array(
2267 'name' => 'cont_border',
2268 'selector' => '{{WRAPPER}} .pa-txt-sc__item-container',
2269 )
2270 );
2271
2272 $this->add_control(
2273 'cont_border_rad',
2274 array(
2275 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2276 'type' => Controls_Manager::SLIDER,
2277 'size_units' => array( 'px', '%', 'em' ),
2278 'selectors' => array(
2279 '{{WRAPPER}} .pa-txt-sc__item-container' => 'border-radius: {{SIZE}}{{UNIT}};',
2280 ),
2281 )
2282 );
2283
2284 $this->add_responsive_control(
2285 'cont_margin',
2286 array(
2287 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2288 'type' => Controls_Manager::DIMENSIONS,
2289 'size_units' => array( 'px', 'em' ),
2290 'selectors' => array(
2291 '{{WRAPPER}} .pa-txt-sc__item-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2292 ),
2293 )
2294 );
2295
2296 $this->add_responsive_control(
2297 'cont_padding',
2298 array(
2299 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2300 'type' => Controls_Manager::DIMENSIONS,
2301 'size_units' => array( 'px', 'em' ),
2302 'selectors' => array(
2303 '{{WRAPPER}} .pa-txt-sc__item-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2304 ),
2305 )
2306 );
2307
2308 $this->end_controls_section();
2309 }
2310
2311 /**
2312 * Render title widget output on the frontend.
2313 *
2314 * Written in PHP and used to generate the final HTML.
2315 *
2316 * @since 1.0.0
2317 * @access protected
2318 */
2319 protected function render() {
2320
2321 $widget_id = $this->get_id();
2322
2323 $settings = $this->get_settings_for_display();
2324
2325 $papro_activated = Helper_Functions::check_papro_version();
2326
2327 if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.10', '<' ) ) {
2328
2329 if ( 'hover' === $settings['trigger'] ) {
2330
2331 ?>
2332 <div class="premium-error-notice">
2333 <?php
2334 $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' );
2335 echo wp_kses_post( $message );
2336 ?>
2337 </div>
2338 <?php
2339 return false;
2340
2341 }
2342 }
2343
2344 $content = $settings['content'];
2345 $entrance_animation = $settings['entrance_animation'];
2346 $delay = 0;
2347
2348 $this->add_render_attribute( 'container', 'class', 'pa-txt-sc__outer-container pa-trigger-on-' . $settings['trigger'] );
2349
2350 if ( $entrance_animation ) {
2351 $anime_dur = 'animated-' . $settings['en_anime_dur'];
2352 $this->add_render_attribute( 'container', 'data-list-animation', array( $entrance_animation, $anime_dur ) );
2353 }
2354
2355 ?>
2356 <div <?php $this->print_render_attribute_string( 'container' ); ?>>
2357 <?php
2358 foreach ( $content as $index => $item ) {
2359
2360 if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.10', '<' ) ) {
2361
2362 if ( 'svg' === $item['item_type'] ||
2363 ( 'text' === $item['item_type'] && 'yes' === $item['clipped_bg'] ) ||
2364 ( 'text' === $item['item_type'] && ! in_array( $item['txt_effect'], array( 'none', 'strikethrough', 'underline' ), true ) ) ||
2365 ( 'text' !== $item['item_type'] && ! in_array( $item['effect'], array( 'none', 'hvr-pulse-grow', 'rotate' ), true ) )
2366 ) {
2367
2368 ?>
2369 <div class="premium-error-notice">
2370 <?php
2371 $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' );
2372 echo wp_kses_post( $message );
2373 ?>
2374 </div>
2375 <?php
2376 return false;
2377
2378 }
2379 }
2380
2381 $has_hover_elem = 'none' !== $item['item_type_hov'];
2382 $has_link = 'yes' === $item['link_switcher'];
2383 $hide_on_hov = 'yes' === $item['hide_on_hov'] ? 'pa-txt-sc__hov-hide' : '';
2384 $has_hov_svg_draw = in_array( $item['item_type_hov'], array( 'icon', 'svg' ), true ) && 'yes' === $item['draw_svg_hov'];
2385
2386 $effect = 'text' === $item['item_type'] ? $item['txt_effect'] : $item['effect'];
2387 $has_txt = ( 'text' === $item['item_type'] || 'text' === $item['item_type_hov'] ) ? 'has-text' : '';
2388 $clipped_bg = ( 'text' === $item['item_type'] || 'text' === $item['item_type_hov'] ) && 'yes' === $item['clipped_bg'];
2389 $has_clipped_bg = $clipped_bg ? 'pa-clipped-bg' : '';
2390
2391 if ( $has_link ) {
2392
2393 $link_type = $item['link_type'];
2394 $link_url = 'url' === $link_type ? $item['link'] : get_permalink( $item['link_existing'] );
2395
2396 $this->add_render_attribute( 'link' . $item['_id'], 'class', 'pa-txt-sc__link' );
2397
2398 if ( 'url' === $link_type ) {
2399 $this->add_link_attributes( 'link' . $item['_id'], $link_url );
2400 } else {
2401 $this->add_render_attribute( 'link' . $item['_id'], 'href', $link_url );
2402 }
2403 }
2404
2405 $this->add_render_attribute(
2406 'item-container' . $item['_id'],
2407 'class',
2408 array(
2409 'pa-txt-sc__item-container',
2410 'elementor-repeater-item-' . $item['_id'],
2411 'pa-txt-sc__effect-' . $effect,
2412 $hide_on_hov,
2413 $has_clipped_bg,
2414 $has_txt,
2415 )
2416 );
2417
2418 if ( 'none' !== $item['item_lq_effect'] ) {
2419 $this->add_render_attribute( 'item-container' . $item['_id'], 'class', 'premium-lq__' . $item['item_lq_effect'] );
2420 }
2421
2422 if ( $entrance_animation ) {
2423
2424 $this->add_render_attribute(
2425 'item-container' . $item['_id'],
2426 'data-delay',
2427 array(
2428 $delay,
2429 )
2430 );
2431
2432 $this->add_render_attribute( 'item-container' . $item['_id'], 'style', 'opacity: 0' );
2433 $delay += $settings['en_anime_delay'] * 1000;
2434 }
2435
2436 ?>
2437 <div <?php $this->print_render_attribute_string( 'item-container' . $item['_id'] ); ?>>
2438 <?php
2439
2440 $this->render_item_elements( $index, $item );
2441
2442 if ( $has_hover_elem ) {
2443 $this->render_item_elements( $index, $item, '_hov' );
2444 }
2445
2446 if ( $has_link ) {
2447 ?>
2448 <a <?php $this->print_render_attribute_string( 'link' . $item['_id'] ); ?>></a>
2449 <?php
2450 }
2451 ?>
2452 </div>
2453 <?php
2454 }
2455 ?>
2456 </div>
2457 <?php
2458 }
2459
2460 /**
2461 * Render Item Element.
2462 *
2463 * @access private
2464 * @since
2465 *
2466 * @param string $index repeater item index.
2467 * @param array $item repeater item settings.
2468 * @param string $elem_type normal or hover element.
2469 */
2470 private function render_item_elements( $index, $item, $elem_type = '' ) {
2471
2472 $settings = $this->get_settings_for_display();
2473 $type = $item[ 'item_type' . $elem_type ];
2474 $draw_svg = false;
2475 $item_cls = empty( $elem_type ) ? 'pa-txt-sc__main-item' : 'pa-txt-sc__hov-item';
2476 $item_style = empty( $elem_type ) ? '' : 'visibility:hidden;';
2477 $draw_icon = $this->check_icon_draw();
2478
2479 $this->add_render_attribute(
2480 'item-content-' . $item['_id'] . $elem_type,
2481 array(
2482 'class' => $item_cls,
2483 'style' => $item_style,
2484 )
2485 );
2486
2487 if ( in_array( $type, array( 'icon', 'svg' ), true ) ) {
2488
2489 $draw_svg = $draw_icon && 'yes' === $item[ 'draw_svg' . $elem_type ];
2490
2491 $this->add_render_attribute( 'item-content-' . $item['_id'] . $elem_type, 'class', 'premium-drawable-icon pa-txt-sc__item-' . $type );
2492
2493 if ( $draw_svg ) {
2494 $hov_drawer_cls = ! empty( $elem_type ) ? ' premium-drawer-hover' : '';
2495 $this->add_render_attribute(
2496 'item-content-' . $item['_id'] . $elem_type,
2497 array(
2498 'class' => 'premium-svg-drawer',
2499 'data-svg-reverse' => $item[ 'lottie_reverse' . $elem_type ],
2500 'data-svg-loop' => $item[ 'lottie_loop' . $elem_type ],
2501 'data-svg-sync' => $item[ 'svg_sync' . $elem_type ],
2502 'data-svg-hover' => ! empty( $elem_type ), // always play the hover element on hover.
2503 'data-svg-fill' => $item[ 'svg_color' . $elem_type ],
2504 'data-svg-frames' => $item[ 'frames' . $elem_type ],
2505 'data-svg-yoyo' => $item[ 'svg_yoyo' . $elem_type ],
2506 'data-svg-point' => $item[ 'lottie_reverse' . $elem_type ] ? $item[ 'end_point' . $elem_type ]['size'] : $item[ 'start_point' . $elem_type ]['size'],
2507 )
2508 );
2509
2510 } else {
2511 $this->add_render_attribute( 'item-content-' . $item['_id'] . $elem_type, 'class', 'premium-svg-nodraw' );
2512 }
2513 }
2514
2515 switch ( $type ) {
2516
2517 case 'icon':
2518 $this->render_item_icon( $item, $draw_svg, $elem_type );
2519 break;
2520
2521 case 'text':
2522 $this->render_item_txt( $item, $elem_type );
2523 break;
2524
2525 case 'image':
2526 $this->render_item_image( $item, $settings, $elem_type );
2527 break;
2528
2529 case 'lottie':
2530 $this->render_item_lottie( $item, $elem_type );
2531 break;
2532
2533 default:
2534 $this->render_item_svg( $item, $index, $elem_type );
2535 break;
2536 }
2537 }
2538
2539 /**
2540 * Render Item Icon.
2541 *
2542 * @access private
2543 * @since
2544 *
2545 * @param array $item repeater item settings.
2546 * @param boolean $svg_draw true if svg draw is enabled.
2547 * @param string $elem_type element type.
2548 */
2549 private function render_item_icon( $item, $svg_draw, $elem_type ) {
2550 $item_hov_class = empty( $elem_type ) ? 'pa-txt-sc__main-item' : 'pa-txt-sc__hov-item';
2551 $item_hov_style = empty( $elem_type ) ? '' : 'visibility:hidden;';
2552
2553 if ( $svg_draw ) {
2554 ?>
2555 <div <?php $this->print_render_attribute_string( 'item-content-' . $item['_id'] . $elem_type ); ?>>
2556 <?php echo Helper_Functions::get_svg_by_icon( $item[ 'icon' . $elem_type ] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_svg_by_icon() returns sanitized inline SVG/icon markup. ?>
2557 </div>
2558 <?php
2559 } else {
2560 ?>
2561 <div class="premium-svg-nodraw premium-drawable-icon pa-txt-sc__item-icon <?php echo esc_attr( $item_hov_class ); ?>">
2562 <?php
2563 Icons_Manager::render_icon(
2564 $item[ 'icon' . $elem_type ],
2565 array(
2566 'aria-hidden' => 'true',
2567 )
2568 );
2569 ?>
2570 </div>
2571 <?php
2572 }
2573 }
2574
2575 /**
2576 * Render Item SVG.
2577 *
2578 * @access private
2579 * @since
2580 *
2581 * @param array $item repeater item settings.
2582 * @param string $index item index.
2583 * @param string $elem_type element type.
2584 */
2585 private function render_item_svg( $item, $index, $elem_type ) {
2586 ?>
2587 <div <?php $this->print_render_attribute_string( 'item-content-' . $item['_id'] . $elem_type ); ?>>
2588 <?php echo Helper_Functions::sanitize_svg( $item[ 'custom_svg' . $elem_type ] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- sanitize_svg passes through wp_kses with a strict SVG allowlist. ?>
2589 </div>
2590 <?php
2591 }
2592
2593 /**
2594 * Render Item Text.
2595 *
2596 * @access private
2597 * @since
2598 *
2599 * @param array $item repeater item settings.
2600 * @param string $elem_type element type.
2601 */
2602 private function render_item_txt( $item, $elem_type ) {
2603
2604 $effect = $item['txt_effect'];
2605
2606 $txt_tag = Helper_Functions::validate_html_tag( $item[ 'item_txt_tag' . $elem_type ] );
2607
2608 $min_mask_cls = empty( $elem_type ) && 'min-mask' === $effect ? 'premium-mask-' . $item['mask_dir'] : '';
2609
2610 if ( empty( $elem_type ) && ! in_array( $effect, array( 'none', 'min-mask', 'underline' ), true ) ) {
2611 echo $this->get_effect_svg( $effect ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_effect_svg() returns a hard-coded inline SVG from a fixed allowlist.
2612 }
2613
2614 $this->add_render_attribute( 'item-content-' . $item['_id'] . $elem_type, 'class', 'pa-txt-sc__item-text ' . $min_mask_cls );
2615
2616 ?>
2617 <<?php echo wp_kses_post( $txt_tag . ' ' . $this->get_render_attribute_string( 'item-content-' . $item['_id'] . $elem_type ) ); ?>> <?php echo esc_html( $item[ 'item_txt' . $elem_type ] ); ?></<?php echo wp_kses_post( $txt_tag ); ?>>
2618 <?php
2619 }
2620
2621 private function get_effect_svg( $effect ) {
2622
2623 $effects_svg = apply_filters(
2624 'pa_showcase_highlights',
2625 array(
2626 'strikethrough' => '<svg class="outline-svg" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 150" preserveAspectRatio="none"><path d="M3,75h493.5"></path></svg>',
2627 )
2628 );
2629
2630 return $effects_svg[ $effect ];
2631 }
2632 /**
2633 * Render Item Image.
2634 *
2635 * @access private
2636 * @since
2637 *
2638 * @param array $item repeater item settings.
2639 * @param array $settings widget settings.
2640 * @param string $elem_type element type.
2641 */
2642 private function render_item_image( $item, $settings, $elem_type ) {
2643
2644 $image_src = $item[ 'content_image' . $elem_type ]['url'];
2645 $image_id = attachment_url_to_postid( $image_src ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.attachment_url_to_postid_attachment_url_to_postid -- Core fn; wpcom_vip_attachment_url_to_postid() only exists on WP VIP.
2646 $item_cls = empty( $elem_type ) ? ' pa-txt-sc__main-item' : ' pa-txt-sc__hov-item';
2647 $item_style = empty( $elem_type ) ? '' : 'visibility:hidden;';
2648
2649 if ( $image_id && ! empty( $image_src ) ) {
2650 $image_html = wp_get_attachment_image(
2651 $image_id,
2652 $item[ 'thumbnail' . $elem_type . '_size' ],
2653 false,
2654 array(
2655 'class' => 'pa-txt-sc__item-img' . $item_cls,
2656 'visibility' => 'hidden',
2657 )
2658 );
2659 } else {
2660 $image_html = '<img src="' . $image_src . '" class="pa-txt-sc__item-img' . $item_cls . '">'; // render elementor's placeholders.
2661 }
2662
2663 echo wp_kses_post( $image_html );
2664 }
2665
2666 /**
2667 * Render Item Lottie.
2668 *
2669 * @access private
2670 * @since
2671 *
2672 * @param array $item repeater item settings.
2673 * @param string $elem_type element type.
2674 */
2675 private function render_item_lottie( $item, $elem_type ) {
2676
2677 $this->add_render_attribute(
2678 'item-content-' . $item['_id'] . $elem_type,
2679 array(
2680 'class' => array(
2681 'pa-txt-sc__item-lottie',
2682 'premium-lottie-animation',
2683 ),
2684 'data-lottie-url' => $item[ 'lottie_url' . $elem_type ],
2685 'data-lottie-loop' => $item[ 'lottie_loop' . $elem_type ],
2686 'data-lottie-reverse' => $item[ 'lottie_reverse' . $elem_type ],
2687 )
2688 );
2689 ?>
2690 <div <?php $this->print_render_attribute_string( 'item-content-' . $item['_id'] . $elem_type ); ?>></div>
2691 <?php
2692 }
2693 }
2694