dep
1 month ago
premium-banner.php
1 month ago
premium-blog.php
1 month ago
premium-button.php
1 month ago
premium-carousel.php
1 month ago
premium-contactform.php
1 month ago
premium-countdown.php
1 month ago
premium-counter.php
1 month ago
premium-dual-header.php
1 month ago
premium-fancytext.php
1 month ago
premium-grid.php
1 month ago
premium-icon-list.php
1 month ago
premium-image-button.php
1 month ago
premium-image-scroll.php
1 month ago
premium-image-separator.php
1 month ago
premium-lottie.php
1 month ago
premium-maps.php
1 month ago
premium-media-wheel.php
1 month ago
premium-mobile-menu.php
1 month ago
premium-modalbox.php
1 month ago
premium-nav-menu.php
1 month ago
premium-notifications.php
1 month ago
premium-person.php
1 month ago
premium-pinterest-feed.php
1 month ago
premium-post-ticker.php
1 month ago
premium-pricing-table.php
1 month ago
premium-progressbar.php
1 month ago
premium-search-form.php
1 month ago
premium-svg-drawer.php
1 month ago
premium-tcloud.php
1 month ago
premium-testimonials.php
1 month ago
premium-textual-showcase.php
1 month ago
premium-tiktok-feed.php
1 month ago
premium-title.php
1 month ago
premium-videobox.php
1 month ago
premium-vscroll.php
2 months ago
premium-weather.php
1 month ago
premium-world-clock.php
1 month ago
premium-fancytext.php
1585 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 string 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 | do_action( 'pa_atext_highlight_controls', $this ); |
| 671 | |
| 672 | $this->add_control( |
| 673 | 'highlighted_hover_pause', |
| 674 | array( |
| 675 | 'label' => __( 'Pause on Hover', 'premium-addons-for-elementor' ), |
| 676 | 'type' => Controls_Manager::SWITCHER, |
| 677 | 'prefix_class' => 'premium-atext__paused-', |
| 678 | 'render_type' => 'template', |
| 679 | 'condition' => array( |
| 680 | 'highlight_effect!' => array( 'underline', 'shape' ), |
| 681 | ), |
| 682 | ) |
| 683 | ); |
| 684 | |
| 685 | $this->end_controls_section(); |
| 686 | |
| 687 | $this->start_controls_section( |
| 688 | 'section_pa_docs', |
| 689 | array( |
| 690 | 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ), |
| 691 | ) |
| 692 | ); |
| 693 | |
| 694 | $docs = array( |
| 695 | 'https://premiumaddons.com/docs/elementor-animated-text-widget-tutorial/' => __( 'Getting started »', 'premium-addons-for-elementor' ), |
| 696 | 'https://www.youtube.com/watch?v=Q5aRlJdXFw0' => __( 'Check the video tutorial »', 'premium-addons-for-elementor' ), |
| 697 | ); |
| 698 | |
| 699 | $doc_index = 1; |
| 700 | foreach ( $docs as $url => $title ) { |
| 701 | |
| 702 | $doc_url = Helper_Functions::get_campaign_link( $url, 'fancy-text-widget', 'wp-editor', 'get-support' ); |
| 703 | |
| 704 | $this->add_control( |
| 705 | 'doc_' . $doc_index, |
| 706 | array( |
| 707 | 'type' => Controls_Manager::RAW_HTML, |
| 708 | 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ), |
| 709 | 'content_classes' => 'editor-pa-doc', |
| 710 | ) |
| 711 | ); |
| 712 | |
| 713 | ++$doc_index; |
| 714 | |
| 715 | } |
| 716 | |
| 717 | Helper_Functions::register_element_feedback_controls( $this ); |
| 718 | |
| 719 | $this->end_controls_section(); |
| 720 | |
| 721 | Helper_Functions::register_papro_promotion_controls( $this, 'fancy-text' ); |
| 722 | |
| 723 | $this->start_controls_section( |
| 724 | 'animated_text_style_section', |
| 725 | array( |
| 726 | 'label' => __( 'Animated Text', 'premium-addons-for-elementor' ), |
| 727 | 'tab' => Controls_Manager::TAB_STYLE, |
| 728 | ) |
| 729 | ); |
| 730 | |
| 731 | $this->add_group_control( |
| 732 | Group_Control_Typography::get_type(), |
| 733 | array( |
| 734 | 'name' => 'fancy_text_typography', |
| 735 | 'label' => __( 'Headline Typography', 'premium-addons-for-elementor' ), |
| 736 | 'selector' => '{{WRAPPER}} .premium-atext__headline, {{WRAPPER}} .premium-atext__text svg g > text', |
| 737 | 'global' => array( |
| 738 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 739 | ), |
| 740 | ) |
| 741 | ); |
| 742 | |
| 743 | $this->add_control( |
| 744 | 'premium_fancy_text_color', |
| 745 | array( |
| 746 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 747 | 'type' => Controls_Manager::COLOR, |
| 748 | 'global' => array( |
| 749 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 750 | ), |
| 751 | 'selectors' => array( |
| 752 | '{{WRAPPER}} .premium-atext__text' => 'color: {{VALUE}};', |
| 753 | '{{WRAPPER}} .premium-fancy-svg-text .premium-fancy-list-items, {{WRAPPER}} .text' => 'fill : {{VALUE}};', |
| 754 | ), |
| 755 | 'conditions' => array( |
| 756 | 'relation' => 'or', |
| 757 | 'terms' => array( |
| 758 | array( |
| 759 | 'name' => 'style', |
| 760 | 'value' => 'switch', |
| 761 | ), |
| 762 | array( |
| 763 | 'terms' => array( |
| 764 | array( |
| 765 | 'name' => 'style', |
| 766 | 'value' => 'highlight', |
| 767 | ), |
| 768 | array( |
| 769 | 'name' => 'highlight_effect', |
| 770 | 'operator' => '!==', |
| 771 | 'value' => 'fill', |
| 772 | ), |
| 773 | array( |
| 774 | 'name' => 'highlight_effect', |
| 775 | 'operator' => '!==', |
| 776 | 'value' => 'reveal', |
| 777 | ), |
| 778 | ), |
| 779 | ), |
| 780 | ), |
| 781 | ), |
| 782 | ) |
| 783 | ); |
| 784 | |
| 785 | $this->add_group_control( |
| 786 | Premium_Background::get_type(), |
| 787 | array( |
| 788 | 'name' => 'fill_background', |
| 789 | 'types' => array( 'classic', 'gradient' ), |
| 790 | 'condition' => array( |
| 791 | 'style' => 'highlight', |
| 792 | 'highlight_effect' => 'fill', |
| 793 | ), |
| 794 | 'selector' => '{{WRAPPER}} .premium-atext__text', |
| 795 | ) |
| 796 | ); |
| 797 | |
| 798 | $this->add_control( |
| 799 | 'highlight_color', |
| 800 | array( |
| 801 | 'label' => __( 'Highlight Color', 'premium-addons-for-elementor' ), |
| 802 | 'type' => Controls_Manager::COLOR, |
| 803 | 'selectors' => array( |
| 804 | '{{WRAPPER}} .premium-atext__text::after' => 'background-color: {{VALUE}}', |
| 805 | ), |
| 806 | 'condition' => array( |
| 807 | 'style' => 'highlight', |
| 808 | 'highlight_effect' => 'underline', |
| 809 | ), |
| 810 | ) |
| 811 | ); |
| 812 | |
| 813 | $this->add_control( |
| 814 | 'shadow_first_color', |
| 815 | array( |
| 816 | 'label' => __( 'First Color', 'premium-addons-for-elementor' ), |
| 817 | 'type' => Controls_Manager::COLOR, |
| 818 | 'global' => array( |
| 819 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 820 | ), |
| 821 | 'selectors' => array( |
| 822 | '{{WRAPPER}} .premium-atext__text' => '--pa-atext-fc: {{VALUE}}', |
| 823 | ), |
| 824 | 'condition' => array( |
| 825 | 'style' => 'highlight', |
| 826 | 'highlight_effect' => array( 'shadow', 'pattern', 'lines' ), |
| 827 | ), |
| 828 | ) |
| 829 | ); |
| 830 | |
| 831 | $this->add_control( |
| 832 | 'shadow_second_color', |
| 833 | array( |
| 834 | 'label' => __( 'Second Color', 'premium-addons-for-elementor' ), |
| 835 | 'type' => Controls_Manager::COLOR, |
| 836 | 'global' => array( |
| 837 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 838 | ), |
| 839 | 'selectors' => array( |
| 840 | '{{WRAPPER}} .premium-atext__text, {{WRAPPER}} .premium-atext__pattern .premium-atext__text::after' => '--pa-atext-sc: {{VALUE}}', |
| 841 | ), |
| 842 | 'condition' => array( |
| 843 | 'style' => 'highlight', |
| 844 | 'highlight_effect' => array( 'shadow', 'pattern', 'lines' ), |
| 845 | ), |
| 846 | ) |
| 847 | ); |
| 848 | |
| 849 | $this->add_control( |
| 850 | 'shadow_third_color', |
| 851 | array( |
| 852 | 'label' => __( 'Third Color', 'premium-addons-for-elementor' ), |
| 853 | 'type' => Controls_Manager::COLOR, |
| 854 | 'global' => array( |
| 855 | 'default' => Global_Colors::COLOR_TEXT, |
| 856 | ), |
| 857 | 'selectors' => array( |
| 858 | '{{WRAPPER}} .premium-atext__text' => '--pa-atext-tc: {{VALUE}}', |
| 859 | ), |
| 860 | 'condition' => array( |
| 861 | 'style' => 'highlight', |
| 862 | 'highlight_effect' => array( 'shadow', 'lines' ), |
| 863 | ), |
| 864 | ) |
| 865 | ); |
| 866 | |
| 867 | $this->add_control( |
| 868 | 'shadow_fourth_color', |
| 869 | array( |
| 870 | 'label' => __( 'Fourth Color', 'premium-addons-for-elementor' ), |
| 871 | 'type' => Controls_Manager::COLOR, |
| 872 | 'global' => array( |
| 873 | 'default' => Global_Colors::COLOR_ACCENT, |
| 874 | ), |
| 875 | 'selectors' => array( |
| 876 | '{{WRAPPER}} .premium-atext__text' => '--pa-atext-foc: {{VALUE}}', |
| 877 | ), |
| 878 | 'condition' => array( |
| 879 | 'style' => 'highlight', |
| 880 | 'highlight_effect' => array( 'shadow', 'lines' ), |
| 881 | ), |
| 882 | ) |
| 883 | ); |
| 884 | |
| 885 | $this->add_control( |
| 886 | 'shadow_fifth_color', |
| 887 | array( |
| 888 | 'label' => __( 'Fifth Color', 'premium-addons-for-elementor' ), |
| 889 | 'type' => Controls_Manager::COLOR, |
| 890 | 'selectors' => array( |
| 891 | '{{WRAPPER}} .premium-atext__text' => '--pa-atext-fic: {{VALUE}}', |
| 892 | ), |
| 893 | 'condition' => array( |
| 894 | 'style' => 'highlight', |
| 895 | 'highlight_effect' => 'lines', |
| 896 | ), |
| 897 | ) |
| 898 | ); |
| 899 | |
| 900 | $this->add_control( |
| 901 | 'premium_fancy_text_background_color', |
| 902 | array( |
| 903 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 904 | 'type' => Controls_Manager::COLOR, |
| 905 | 'selectors' => array( |
| 906 | '{{WRAPPER}} .premium-atext__text' => 'background-color: {{VALUE}}', |
| 907 | ), |
| 908 | 'conditions' => array( |
| 909 | 'relation' => 'or', |
| 910 | 'terms' => array( |
| 911 | array( |
| 912 | 'name' => 'style', |
| 913 | 'value' => 'switch', |
| 914 | ), |
| 915 | array( |
| 916 | 'terms' => array( |
| 917 | array( |
| 918 | 'name' => 'style', |
| 919 | 'value' => 'highlight', |
| 920 | ), |
| 921 | array( |
| 922 | 'name' => 'highlight_effect', |
| 923 | 'operator' => '!==', |
| 924 | 'value' => 'fill', |
| 925 | ), |
| 926 | ), |
| 927 | ), |
| 928 | ), |
| 929 | ), |
| 930 | ) |
| 931 | ); |
| 932 | |
| 933 | $this->add_control( |
| 934 | 'text_lq_effect', |
| 935 | array( |
| 936 | 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ), |
| 937 | 'type' => Controls_Manager::SELECT, |
| 938 | 'description' => sprintf( |
| 939 | /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */ |
| 940 | 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' ), |
| 941 | '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">', |
| 942 | '</a>' |
| 943 | ), |
| 944 | 'options' => array( |
| 945 | 'none' => __( 'None', 'premium-addons-for-elementor' ), |
| 946 | 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ), |
| 947 | 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ), |
| 948 | 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ), |
| 949 | 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ), |
| 950 | 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ), |
| 951 | 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ), |
| 952 | ), |
| 953 | 'default' => 'none', |
| 954 | 'label_block' => true, |
| 955 | 'conditions' => array( |
| 956 | 'relation' => 'or', |
| 957 | 'terms' => array( |
| 958 | array( |
| 959 | 'name' => 'style', |
| 960 | 'value' => 'switch', |
| 961 | ), |
| 962 | array( |
| 963 | 'terms' => array( |
| 964 | array( |
| 965 | 'name' => 'style', |
| 966 | 'value' => 'highlight', |
| 967 | ), |
| 968 | array( |
| 969 | 'name' => 'highlight_effect', |
| 970 | 'operator' => '!==', |
| 971 | 'value' => 'fill', |
| 972 | ), |
| 973 | ), |
| 974 | ), |
| 975 | ), |
| 976 | ), |
| 977 | ) |
| 978 | ); |
| 979 | |
| 980 | $this->add_group_control( |
| 981 | Group_Control_Text_Shadow::get_type(), |
| 982 | array( |
| 983 | 'name' => 'text_shadow', |
| 984 | 'selector' => '{{WRAPPER}} .premium-atext__text', |
| 985 | 'conditions' => array( |
| 986 | 'relation' => 'or', |
| 987 | 'terms' => array( |
| 988 | array( |
| 989 | 'name' => 'style', |
| 990 | 'value' => 'switch', |
| 991 | ), |
| 992 | array( |
| 993 | 'terms' => array( |
| 994 | array( |
| 995 | 'name' => 'style', |
| 996 | 'value' => 'highlight', |
| 997 | ), |
| 998 | array( |
| 999 | 'name' => 'highlight_effect', |
| 1000 | 'operator' => '!==', |
| 1001 | 'value' => 'shadow', |
| 1002 | ), |
| 1003 | array( |
| 1004 | 'name' => 'highlight_effect', |
| 1005 | 'operator' => '!==', |
| 1006 | 'value' => 'lines', |
| 1007 | ), |
| 1008 | ), |
| 1009 | ), |
| 1010 | ), |
| 1011 | ), |
| 1012 | ) |
| 1013 | ); |
| 1014 | |
| 1015 | $this->add_control( |
| 1016 | 'stroke_width', |
| 1017 | array( |
| 1018 | 'label' => __( 'Stroke Width', 'premium-addons-for-elementor' ), |
| 1019 | 'type' => Controls_Manager::SLIDER, |
| 1020 | 'selectors' => array( |
| 1021 | '{{WRAPPER}} .premium-atext__text' => '-webkit-text-stroke-width: {{SIZE}}px', |
| 1022 | '{{WRAPPER}} .text' => 'stroke-width: {{SIZE}}', |
| 1023 | ), |
| 1024 | ) |
| 1025 | ); |
| 1026 | |
| 1027 | $this->add_control( |
| 1028 | 'stroke_text_color', |
| 1029 | array( |
| 1030 | 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), |
| 1031 | 'type' => Controls_Manager::COLOR, |
| 1032 | 'conditions' => array( |
| 1033 | 'relation' => 'or', |
| 1034 | 'terms' => array( |
| 1035 | array( |
| 1036 | 'name' => 'style', |
| 1037 | 'value' => 'switch', |
| 1038 | ), |
| 1039 | array( |
| 1040 | 'terms' => array( |
| 1041 | array( |
| 1042 | 'name' => 'style', |
| 1043 | 'value' => 'highlight', |
| 1044 | ), |
| 1045 | array( |
| 1046 | 'name' => 'highlight_effect', |
| 1047 | 'operator' => '!==', |
| 1048 | 'value' => 'lines', |
| 1049 | ), |
| 1050 | ), |
| 1051 | ), |
| 1052 | ), |
| 1053 | ), |
| 1054 | 'selectors' => array( |
| 1055 | '{{WRAPPER}} .premium-atext__text' => '-webkit-text-stroke-color: {{VALUE}}', |
| 1056 | ), |
| 1057 | ) |
| 1058 | ); |
| 1059 | |
| 1060 | $this->add_control( |
| 1061 | 'animation_speed', |
| 1062 | array( |
| 1063 | 'label' => __( 'Animation Speed (sec)', 'premium-addons-for-elementor' ), |
| 1064 | 'type' => Controls_Manager::SLIDER, |
| 1065 | 'range' => array( |
| 1066 | 'px' => array( |
| 1067 | 'min' => 0, |
| 1068 | 'max' => 15, |
| 1069 | 'step' => 0.1, |
| 1070 | ), |
| 1071 | ), |
| 1072 | 'selectors' => array( |
| 1073 | '{{WRAPPER}} .premium-atext__text, {{WRAPPER}} .premium-atext__text::after, {{WRAPPER}} .premium-atext__letter, {{WRAPPER}} .text' => 'animation-duration: {{SIZE}}s', |
| 1074 | '{{WRAPPER}} .premium-atext__shape svg path' => '--pa-animation-duration: {{SIZE}}s', |
| 1075 | '{{WRAPPER}}' => '--pa-animation-duration: {{SIZE}}', |
| 1076 | ), |
| 1077 | 'condition' => array( |
| 1078 | 'style' => 'highlight', |
| 1079 | 'highlight_effect!' => 'underline', |
| 1080 | ), |
| 1081 | ) |
| 1082 | ); |
| 1083 | |
| 1084 | $this->add_control( |
| 1085 | 'animation_delay', |
| 1086 | array( |
| 1087 | 'label' => __( 'Animation Delay (sec)', 'premium-addons-for-elementor' ), |
| 1088 | 'type' => Controls_Manager::SLIDER, |
| 1089 | 'range' => array( |
| 1090 | 's' => array( |
| 1091 | 'min' => 0, |
| 1092 | 'max' => 15, |
| 1093 | ), |
| 1094 | ), |
| 1095 | 'selectors' => array( |
| 1096 | '{{WRAPPER}}' => '--pa-animation-delay: {{SIZE}}', |
| 1097 | ), |
| 1098 | 'condition' => array( |
| 1099 | 'style' => 'highlight', |
| 1100 | 'highlight_effect' => 'shape', |
| 1101 | ), |
| 1102 | ) |
| 1103 | ); |
| 1104 | |
| 1105 | $this->add_responsive_control( |
| 1106 | 'text_margin', |
| 1107 | array( |
| 1108 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1109 | 'type' => Controls_Manager::DIMENSIONS, |
| 1110 | 'size_units' => array( 'px', 'em', '%' ), |
| 1111 | 'selectors' => array( |
| 1112 | '{{WRAPPER}} .premium-atext__text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1113 | ), |
| 1114 | ) |
| 1115 | ); |
| 1116 | |
| 1117 | $this->end_controls_section(); |
| 1118 | |
| 1119 | do_action( 'pa_atext_shape_style', $this ); |
| 1120 | |
| 1121 | $this->start_controls_section( |
| 1122 | 'premium_fancy_cursor_text_style_tab', |
| 1123 | array( |
| 1124 | 'label' => __( 'Cursor', 'premium-addons-for-elementor' ), |
| 1125 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1126 | 'condition' => array( |
| 1127 | 'style' => 'switch', |
| 1128 | // 'premium_fancy_text_cursor_text!' => '', |
| 1129 | 'premium_fancy_text_effect' => 'typing', |
| 1130 | ), |
| 1131 | ) |
| 1132 | ); |
| 1133 | |
| 1134 | $this->add_control( |
| 1135 | 'premium_fancy_text_cursor_color', |
| 1136 | array( |
| 1137 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1138 | 'type' => Controls_Manager::COLOR, |
| 1139 | 'global' => array( |
| 1140 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1141 | ), |
| 1142 | 'selectors' => array( |
| 1143 | '{{WRAPPER}} .typed-cursor' => 'color: {{VALUE}};', |
| 1144 | ), |
| 1145 | ) |
| 1146 | ); |
| 1147 | |
| 1148 | $this->add_group_control( |
| 1149 | Group_Control_Typography::get_type(), |
| 1150 | array( |
| 1151 | 'name' => 'fancy_text_cursor_typography', |
| 1152 | 'selector' => '{{WRAPPER}} .typed-cursor', |
| 1153 | ) |
| 1154 | ); |
| 1155 | |
| 1156 | $this->add_control( |
| 1157 | 'premium_fancy_text_cursor_background', |
| 1158 | array( |
| 1159 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1160 | 'type' => Controls_Manager::COLOR, |
| 1161 | 'selectors' => array( |
| 1162 | '{{WRAPPER}} .typed-cursor' => 'background-color: {{VALUE}};', |
| 1163 | ), |
| 1164 | ) |
| 1165 | ); |
| 1166 | |
| 1167 | $this->end_controls_section(); |
| 1168 | |
| 1169 | $this->start_controls_section( |
| 1170 | 'premium_prefix_suffix_style_tab', |
| 1171 | array( |
| 1172 | 'label' => __( 'Before & After Text', 'premium-addons-for-elementor' ), |
| 1173 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1174 | ) |
| 1175 | ); |
| 1176 | |
| 1177 | $this->add_control( |
| 1178 | 'premium_prefix_text_color', |
| 1179 | array( |
| 1180 | 'label' => __( 'Before Text Color', 'premium-addons-for-elementor' ), |
| 1181 | 'type' => Controls_Manager::COLOR, |
| 1182 | 'global' => array( |
| 1183 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1184 | ), |
| 1185 | 'selectors' => array( |
| 1186 | '{{WRAPPER}} .premium-prefix-text' => 'color: {{VALUE}};', |
| 1187 | ), |
| 1188 | ) |
| 1189 | ); |
| 1190 | |
| 1191 | $this->add_control( |
| 1192 | 'premium_suffix_text_color', |
| 1193 | array( |
| 1194 | 'label' => __( 'After Text Color', 'premium-addons-for-elementor' ), |
| 1195 | 'type' => Controls_Manager::COLOR, |
| 1196 | 'global' => array( |
| 1197 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1198 | ), |
| 1199 | 'selectors' => array( |
| 1200 | '{{WRAPPER}} .premium-suffix-text' => 'color: {{VALUE}};', |
| 1201 | ), |
| 1202 | ) |
| 1203 | ); |
| 1204 | |
| 1205 | $this->add_group_control( |
| 1206 | Group_Control_Typography::get_type(), |
| 1207 | array( |
| 1208 | 'name' => 'prefix_suffix_typography', |
| 1209 | 'selector' => '{{WRAPPER}} .premium-prefix-text, {{WRAPPER}} .premium-suffix-text', |
| 1210 | 'global' => array( |
| 1211 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1212 | ), |
| 1213 | 'exclude' => array( 'font_size' ), |
| 1214 | ) |
| 1215 | ); |
| 1216 | |
| 1217 | $this->end_controls_section(); |
| 1218 | |
| 1219 | $this->start_controls_section( |
| 1220 | 'loading_bar_style', |
| 1221 | array( |
| 1222 | 'label' => __( 'Loading Bar', 'premium-addons-for-elementor' ), |
| 1223 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1224 | 'condition' => array( |
| 1225 | 'style' => 'switch', |
| 1226 | 'loading_bar' => 'yes', |
| 1227 | 'premium_fancy_text_effect!' => 'typing', |
| 1228 | ), |
| 1229 | ) |
| 1230 | ); |
| 1231 | |
| 1232 | $this->add_control( |
| 1233 | 'loading_bar_color', |
| 1234 | array( |
| 1235 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1236 | 'type' => Controls_Manager::COLOR, |
| 1237 | 'global' => array( |
| 1238 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1239 | ), |
| 1240 | 'selectors' => array( |
| 1241 | '{{WRAPPER}}.premium-atext__loading-yes .premium-loading-bar' => 'background-color: {{VALUE}};', |
| 1242 | ), |
| 1243 | ) |
| 1244 | ); |
| 1245 | |
| 1246 | $this->add_responsive_control( |
| 1247 | 'loading_bar_height', |
| 1248 | array( |
| 1249 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 1250 | 'type' => Controls_Manager::SLIDER, |
| 1251 | 'range' => array( |
| 1252 | 'px' => array( |
| 1253 | 'min' => 0, |
| 1254 | 'max' => 10, |
| 1255 | ), |
| 1256 | ), |
| 1257 | 'selectors' => array( |
| 1258 | '{{WRAPPER}}.premium-atext__loading-yes .premium-loading-bar' => 'height: {{SIZE}}{{UNIT}}', |
| 1259 | ), |
| 1260 | ) |
| 1261 | ); |
| 1262 | |
| 1263 | $this->end_controls_section(); |
| 1264 | } |
| 1265 | |
| 1266 | /** |
| 1267 | * Render Fancy Text widget output on the frontend. |
| 1268 | * |
| 1269 | * Written in PHP and used to generate the final HTML. |
| 1270 | * |
| 1271 | * @since 1.0.0 |
| 1272 | * @access protected |
| 1273 | */ |
| 1274 | protected function render() { |
| 1275 | |
| 1276 | $settings = $this->get_settings_for_display(); |
| 1277 | |
| 1278 | $papro_activated = Helper_Functions::check_papro_version(); |
| 1279 | |
| 1280 | if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.18', '<' ) ) { |
| 1281 | |
| 1282 | if ( ( 'switch' === $settings['style'] && 'clip' === $settings['premium_fancy_text_effect'] ) || ( 'highlight' === $settings['style'] && ! in_array( $settings['highlight_effect'], array( 'shadow', 'pattern', 'fill', 'tilt' ), true ) ) ) { |
| 1283 | |
| 1284 | ?> |
| 1285 | <div class="premium-error-notice"> |
| 1286 | <?php |
| 1287 | $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' ); |
| 1288 | echo wp_kses_post( $message ); |
| 1289 | ?> |
| 1290 | </div> |
| 1291 | <?php |
| 1292 | return false; |
| 1293 | |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | $effect = $settings['premium_fancy_text_effect']; |
| 1298 | |
| 1299 | $title_tag = Helper_Functions::validate_html_tag( $settings['text_tag'] ); |
| 1300 | |
| 1301 | $this->add_render_attribute( 'wrapper', 'class', 'premium-atext__wrapper' ); |
| 1302 | |
| 1303 | if ( 'switch' === $settings['style'] ) { |
| 1304 | |
| 1305 | $this->add_render_attribute( 'wrapper', 'data-start-effect', $settings['trigger'] ); |
| 1306 | |
| 1307 | $loading_bar = 'yes' === $settings['loading_bar']; |
| 1308 | |
| 1309 | $pause = ''; |
| 1310 | |
| 1311 | if ( 'typing' === $effect ) { |
| 1312 | |
| 1313 | $show_cursor = ( ! empty( $settings['premium_fancy_text_show_cursor'] ) ) ? true : false; |
| 1314 | |
| 1315 | // $cursor_text = addslashes( $settings['premium_fancy_text_cursor_text'] ); |
| 1316 | |
| 1317 | $loop = ! empty( $settings['premium_fancy_text_type_loop'] ) ? true : false; |
| 1318 | |
| 1319 | $strings = array(); |
| 1320 | |
| 1321 | foreach ( $settings['premium_fancy_text_strings'] as $item ) { |
| 1322 | if ( ! empty( $item['premium_text_strings_text_field'] ) ) { |
| 1323 | $strings[] = str_replace( '\'', ''', $item['premium_text_strings_text_field'] ); |
| 1324 | } |
| 1325 | } |
| 1326 | |
| 1327 | // $cursor_text = html_entity_decode( $cursor_text ); |
| 1328 | $atext_settings = array( |
| 1329 | 'effect' => $effect, |
| 1330 | 'strings' => $strings, |
| 1331 | 'typeSpeed' => $settings['premium_fancy_text_type_speed'], |
| 1332 | 'backSpeed' => $settings['premium_fancy_text_back_speed'], |
| 1333 | 'startDelay' => $settings['premium_fancy_text_start_delay'], |
| 1334 | 'backDelay' => $settings['premium_fancy_text_back_delay'], |
| 1335 | 'showCursor' => $show_cursor, |
| 1336 | 'loop' => $loop, |
| 1337 | ); |
| 1338 | |
| 1339 | } elseif ( 'slide' === $effect ) { |
| 1340 | |
| 1341 | $this->add_render_attribute( 'prefix', 'class', 'premium-atext__span-align' ); |
| 1342 | $this->add_render_attribute( 'suffix', 'class', 'premium-atext__span-align' ); |
| 1343 | |
| 1344 | $mouse_pause = 'yes' === $settings['premium_slide_up_hover_pause'] ? true : false; |
| 1345 | $pause = $mouse_pause ? 'pause' : ''; |
| 1346 | $atext_settings = array( |
| 1347 | 'effect' => $effect, |
| 1348 | 'speed' => $settings['premium_slide_up_speed'], |
| 1349 | 'showItems' => $settings['premium_slide_up_shown_items'], |
| 1350 | 'pause' => $settings['premium_slide_up_pause_time'], |
| 1351 | 'mousePause' => $mouse_pause, |
| 1352 | ); |
| 1353 | } else { |
| 1354 | |
| 1355 | $atext_settings = array( |
| 1356 | 'effect' => $effect, |
| 1357 | 'delay' => $settings['premium_fancy_text_zoom_delay'], |
| 1358 | 'count' => $settings['loop_count'], |
| 1359 | ); |
| 1360 | |
| 1361 | if ( 'custom' === $effect ) { |
| 1362 | $atext_settings['animation'] = $settings['custom_animation']; |
| 1363 | } elseif ( 'clip' === $effect ) { |
| 1364 | $atext_settings['speed'] = $settings['premium_fancy_text_zoom_speed']; |
| 1365 | } |
| 1366 | } |
| 1367 | |
| 1368 | $atext_settings['loading'] = $loading_bar; |
| 1369 | $atext_settings['style'] = $settings['style']; |
| 1370 | |
| 1371 | $this->add_render_attribute( |
| 1372 | 'wrapper', |
| 1373 | array( |
| 1374 | 'class' => array( |
| 1375 | 'premium-atext__' . $effect, |
| 1376 | $pause, |
| 1377 | ), |
| 1378 | 'data-settings' => wp_json_encode( $atext_settings ), |
| 1379 | ) |
| 1380 | ); |
| 1381 | |
| 1382 | } else { |
| 1383 | |
| 1384 | $this->add_render_attribute( 'wrapper', 'class', 'premium-atext' ); |
| 1385 | |
| 1386 | $effect = $settings['highlight_effect']; |
| 1387 | |
| 1388 | $atext_settings = array( |
| 1389 | 'effect' => $effect, |
| 1390 | 'style' => $settings['style'], |
| 1391 | ); |
| 1392 | |
| 1393 | $this->add_render_attribute( |
| 1394 | 'wrapper', |
| 1395 | array( |
| 1396 | 'class' => array( |
| 1397 | 'premium-atext__' . $effect, |
| 1398 | ), |
| 1399 | 'data-settings' => wp_json_encode( $atext_settings ), |
| 1400 | ) |
| 1401 | ); |
| 1402 | |
| 1403 | } |
| 1404 | |
| 1405 | if ( ! empty( $settings['link']['url'] ) ) { |
| 1406 | $this->add_link_attributes( 'url', $settings['link'] ); |
| 1407 | } |
| 1408 | |
| 1409 | ?> |
| 1410 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'wrapper' ) ); ?>> |
| 1411 | |
| 1412 | <<?php echo wp_kses_post( $title_tag ); ?> class="premium-atext__headline"> |
| 1413 | <?php if ( ! empty( $settings['premium_fancy_prefix_text'] ) ) : ?> |
| 1414 | <span class="premium-prefix-text"> |
| 1415 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'prefix' ) ); ?>><?php echo wp_kses( ( $settings['premium_fancy_prefix_text'] ), true ); ?></span> |
| 1416 | </span> |
| 1417 | <?php endif; ?> |
| 1418 | |
| 1419 | <?php |
| 1420 | if ( 'highlight' === $settings['style'] ) : |
| 1421 | $this->render_highlight_text(); |
| 1422 | else : |
| 1423 | $this->render_switch_text(); |
| 1424 | endif; |
| 1425 | ?> |
| 1426 | |
| 1427 | <?php if ( ! empty( $settings['premium_fancy_suffix_text'] ) ) : ?> |
| 1428 | <span class="premium-suffix-text"> |
| 1429 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'suffix' ) ); ?>><?php echo wp_kses( ( $settings['premium_fancy_suffix_text'] ), true ); ?></span> |
| 1430 | </span> |
| 1431 | <?php endif; ?> |
| 1432 | |
| 1433 | <?php if ( ! empty( $settings['link']['url'] ) ) : ?> |
| 1434 | <a <?php $this->print_render_attribute_string( 'url' ); ?>></a> |
| 1435 | <?php endif; ?> |
| 1436 | |
| 1437 | </<?php echo wp_kses_post( $title_tag ); ?>> |
| 1438 | </div> |
| 1439 | <?php |
| 1440 | } |
| 1441 | |
| 1442 | /** |
| 1443 | * Render Highlight Text |
| 1444 | * |
| 1445 | * @since 4.10.34 |
| 1446 | * @access protected |
| 1447 | */ |
| 1448 | protected function render_switch_text() { |
| 1449 | |
| 1450 | $settings = $this->get_settings_for_display(); |
| 1451 | |
| 1452 | $effect = $settings['premium_fancy_text_effect']; |
| 1453 | |
| 1454 | $this->add_render_attribute( 'switch_text', 'class', 'premium-atext__text' ); |
| 1455 | |
| 1456 | if ( 'none' !== $settings['text_lq_effect'] ) { |
| 1457 | $this->add_render_attribute( 'switch_text', 'class', 'premium-con-lq__' . $settings['text_lq_effect'] ); |
| 1458 | } |
| 1459 | |
| 1460 | if ( 'typing' === $effect ) : |
| 1461 | ?> |
| 1462 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'switch_text' ) ); ?>></span> |
| 1463 | <?php else : ?> |
| 1464 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'switch_text' ) ); ?> style='display: inline-block; text-align: center'> |
| 1465 | <ul class="premium-atext__items-wrapper"> |
| 1466 | <?php |
| 1467 | foreach ( $settings['premium_fancy_text_strings'] as $index => $item ) : |
| 1468 | if ( ! empty( $item['premium_text_strings_text_field'] ) ) : |
| 1469 | $this->add_render_attribute( 'text_' . $item['_id'], 'class', 'premium-fancy-list-items' ); |
| 1470 | |
| 1471 | if ( ( 'typing' !== $effect && 'slide' !== $effect ) && 0 !== $index ) { |
| 1472 | $this->add_render_attribute( 'text_' . $item['_id'], 'class', 'premium-fancy-item-hidden' ); |
| 1473 | } else { |
| 1474 | $this->add_render_attribute( 'text_' . $item['_id'], 'class', 'premium-fancy-item-visible' ); |
| 1475 | } |
| 1476 | |
| 1477 | ?> |
| 1478 | <li <?php echo wp_kses_post( $this->get_render_attribute_string( 'text_' . $item['_id'] ) ); ?>> |
| 1479 | <?php echo wp_kses_post( $item['premium_text_strings_text_field'] ); ?> |
| 1480 | </li> |
| 1481 | <?php |
| 1482 | endif; |
| 1483 | endforeach; |
| 1484 | ?> |
| 1485 | </ul> |
| 1486 | </div> |
| 1487 | <?php |
| 1488 | endif; |
| 1489 | } |
| 1490 | |
| 1491 | /** |
| 1492 | * Render Switch Text |
| 1493 | * |
| 1494 | * @since 4.10.34 |
| 1495 | * @access protected |
| 1496 | */ |
| 1497 | protected function render_highlight_text() { |
| 1498 | |
| 1499 | $settings = $this->get_settings_for_display(); |
| 1500 | |
| 1501 | $this->add_render_attribute( |
| 1502 | 'text', |
| 1503 | array( |
| 1504 | 'class' => 'premium-atext__text', |
| 1505 | 'data-text' => $settings['text'], |
| 1506 | ) |
| 1507 | ); |
| 1508 | |
| 1509 | if ( 'reveal' === $settings['highlight_effect'] ) { |
| 1510 | |
| 1511 | $image_url = PREMIUM_ADDONS_URL . 'assets/frontend/images/reveal_background.jpg'; |
| 1512 | $this->add_render_attribute( 'text', 'style', "background-image: url('$image_url')" ); |
| 1513 | |
| 1514 | } |
| 1515 | |
| 1516 | if ( 'none' !== $settings['text_lq_effect'] && 'fill' !== $settings['highlight_effect'] ) { |
| 1517 | $this->add_render_attribute( 'text', 'class', 'premium-con-lq__' . $settings['text_lq_effect'] ); |
| 1518 | } |
| 1519 | |
| 1520 | ?> |
| 1521 | |
| 1522 | <?php if ( 'lines' !== $settings['highlight_effect'] ) : ?> |
| 1523 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'text' ) ); ?>> |
| 1524 | <?php echo wp_kses_post( $settings['text'] ); ?> |
| 1525 | <?php if ( 'shape' === $settings['highlight_effect'] ) : ?> |
| 1526 | <?php $this->render_draw_shape(); ?> |
| 1527 | <?php endif; ?> |
| 1528 | </span> |
| 1529 | |
| 1530 | <?php else : ?> |
| 1531 | <span class="elementor-screen-only"><?php echo wp_kses_post( $settings['text'] ); ?></span> |
| 1532 | <svg class="premium-atext__text" aria-hidden="true" focusable="false"> |
| 1533 | <!-- Symbol --> |
| 1534 | <symbol id="s-text"> |
| 1535 | <text text-anchor="middle" x="50%" y="50%" dy=".35em"> |
| 1536 | <?php echo wp_kses_post( $settings['text'] ); ?> |
| 1537 | </text> |
| 1538 | </symbol> |
| 1539 | |
| 1540 | <!-- Duplicate symbols --> |
| 1541 | <use xlink:href="#s-text" class="text"></use> |
| 1542 | <use xlink:href="#s-text" class="text"></use> |
| 1543 | <use xlink:href="#s-text" class="text"></use> |
| 1544 | <use xlink:href="#s-text" class="text"></use> |
| 1545 | <use xlink:href="#s-text" class="text"></use> |
| 1546 | |
| 1547 | </svg> |
| 1548 | <?php endif; ?> |
| 1549 | |
| 1550 | <?php |
| 1551 | } |
| 1552 | |
| 1553 | /** |
| 1554 | * Render Draw shape |
| 1555 | * |
| 1556 | * @since 4.10.34 |
| 1557 | * @access protected |
| 1558 | */ |
| 1559 | protected function render_draw_shape() { |
| 1560 | |
| 1561 | $settings = $this->get_settings_for_display(); |
| 1562 | |
| 1563 | $shape = $settings['shape']; |
| 1564 | |
| 1565 | $shapes_array = array( |
| 1566 | '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>', |
| 1567 | |
| 1568 | '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>', |
| 1569 | |
| 1570 | '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>', |
| 1571 | |
| 1572 | '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>', |
| 1573 | |
| 1574 | '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>', |
| 1575 | |
| 1576 | '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>', |
| 1577 | |
| 1578 | '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>', |
| 1579 | |
| 1580 | ); |
| 1581 | |
| 1582 | echo $shapes_array[ $shape ]; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 1583 | } |
| 1584 | } |
| 1585 |