Adv_Accordion.php
2 months ago
Adv_Tabs.php
2 months ago
Advanced_Data_Table.php
2 weeks ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
3 months ago
Betterdocs_Category_Grid.php
3 months ago
Betterdocs_Search_Form.php
2 months ago
Breadcrumbs.php
2 months ago
Business_Reviews.php
6 days ago
Caldera_Forms.php
2 months ago
Career_Page.php
4 years ago
Code_Snippet.php
4 months ago
Contact_Form_7.php
2 months ago
Content_Ticker.php
4 months ago
Countdown.php
2 months ago
Creative_Button.php
1 month ago
Cta_Box.php
2 months ago
Data_Table.php
2 months ago
Dual_Color_Header.php
6 days ago
EmbedPress.php
4 years ago
Event_Calendar.php
1 week ago
Facebook_Feed.php
4 months ago
Fancy_Text.php
2 months ago
Feature_List.php
4 months ago
Filterable_Gallery.php
6 days ago
Flip_Box.php
2 months ago
FluentForm.php
2 months ago
Formstack.php
2 months ago
GravityForms.php
6 days ago
Image_Accordion.php
2 months ago
Info_Box.php
6 days ago
Interactive_Circle.php
2 months ago
Login_Register.php
6 days ago
NFT_Gallery.php
4 months ago
NinjaForms.php
2 months ago
Post_Grid.php
4 months ago
Post_Timeline.php
10 months ago
Pricing_Table.php
2 months ago
Product_Grid.php
3 weeks ago
Progress_Bar.php
2 months ago
SVG_Draw.php
4 months ago
Simple_Menu.php
6 days ago
Sticky_Video.php
4 months ago
Team_Member.php
4 months ago
Testimonial.php
2 months ago
Tooltip.php
2 months ago
Twitter_Feed.php
4 months ago
TypeForm.php
5 months ago
WeForms.php
1 year ago
Woo_Add_To_Cart.php
2 months ago
Woo_Cart.php
4 months ago
Woo_Checkout.php
4 months ago
Woo_Product_Carousel.php
1 month ago
Woo_Product_Compare.php
1 year ago
Woo_Product_Gallery.php
4 months ago
Woo_Product_Images.php
1 month ago
Woo_Product_List.php
2 months ago
Woo_Product_Price.php
2 months ago
Woo_Product_Rating.php
2 months ago
WpForms.php
2 months ago
index.php
3 years ago
Fancy_Text.php
677 lines
| 1 | <?php |
| 2 | namespace Essential_Addons_Elementor\Elements; |
| 3 | |
| 4 | // If this file is called directly, abort. |
| 5 | if (!defined('ABSPATH')) { |
| 6 | exit; |
| 7 | } |
| 8 | |
| 9 | use \Elementor\Controls_Manager; |
| 10 | use \Elementor\Group_Control_Background; |
| 11 | use \Elementor\Group_Control_Border; |
| 12 | use \Elementor\Group_Control_Typography; |
| 13 | use \Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 14 | use \Elementor\Widget_Base; |
| 15 | use \Elementor\Repeater; |
| 16 | use Essential_Addons_Elementor\Classes\Helper as HelperClass; |
| 17 | |
| 18 | |
| 19 | class Fancy_Text extends Widget_Base { |
| 20 | |
| 21 | |
| 22 | public function get_name() { |
| 23 | return 'eael-fancy-text'; |
| 24 | } |
| 25 | |
| 26 | public function get_title() { |
| 27 | return esc_html__( 'Fancy Text', 'essential-addons-for-elementor-lite'); |
| 28 | } |
| 29 | |
| 30 | public function get_icon() { |
| 31 | return 'eaicon-fancy-text'; |
| 32 | } |
| 33 | |
| 34 | public function get_categories() { |
| 35 | return [ 'essential-addons-elementor' ]; |
| 36 | } |
| 37 | |
| 38 | public function get_keywords() { |
| 39 | return [ |
| 40 | 'ea fancy text', |
| 41 | 'ea typing text', |
| 42 | 'animated headline', |
| 43 | 'Headline', |
| 44 | 'typewriter', |
| 45 | 'text effect', |
| 46 | 'text typing effect', |
| 47 | 'text animation', |
| 48 | 'animated heading', |
| 49 | 'ea', |
| 50 | 'essential addons' |
| 51 | ]; |
| 52 | } |
| 53 | |
| 54 | public function get_style_depends() { |
| 55 | return [ |
| 56 | 'e-animations', |
| 57 | ]; |
| 58 | } |
| 59 | |
| 60 | protected function is_dynamic_content():bool { |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | public function has_widget_inner_wrapper(): bool { |
| 65 | return ! HelperClass::eael_e_optimized_markup(); |
| 66 | } |
| 67 | |
| 68 | public function get_custom_help_url() { |
| 69 | return 'https://essential-addons.com/elementor/docs/fancy-text/'; |
| 70 | } |
| 71 | |
| 72 | protected function register_controls() { |
| 73 | |
| 74 | // Content Controls |
| 75 | $this->start_controls_section( |
| 76 | 'eael_fancy_text_content', |
| 77 | [ |
| 78 | 'label' => esc_html__( 'Fancy Text', 'essential-addons-for-elementor-lite') |
| 79 | ] |
| 80 | ); |
| 81 | |
| 82 | |
| 83 | $this->add_control( |
| 84 | 'eael_fancy_text_prefix', |
| 85 | [ |
| 86 | 'label' => esc_html__( 'Prefix Text', 'essential-addons-for-elementor-lite'), |
| 87 | 'placeholder' => esc_html__( 'Place your prefix text', 'essential-addons-for-elementor-lite'), |
| 88 | 'type' => Controls_Manager::TEXT, |
| 89 | 'default' => esc_html__( 'This is the ', 'essential-addons-for-elementor-lite'), |
| 90 | 'dynamic' => [ 'active' => true ], |
| 91 | 'ai' => [ |
| 92 | 'active' => true, |
| 93 | ], |
| 94 | ] |
| 95 | ); |
| 96 | |
| 97 | $repeater = new Repeater(); |
| 98 | |
| 99 | $repeater->add_control( |
| 100 | 'eael_fancy_text_strings_text_field', |
| 101 | [ |
| 102 | 'label' => esc_html__( 'Fancy String', 'essential-addons-for-elementor-lite'), |
| 103 | 'type' => Controls_Manager::TEXT, |
| 104 | 'label_block' => true, |
| 105 | 'dynamic' => [ 'active' => true ], |
| 106 | 'ai' => [ |
| 107 | 'active' => true, |
| 108 | ], |
| 109 | ] |
| 110 | ); |
| 111 | |
| 112 | $this->add_control( |
| 113 | 'eael_fancy_text_strings', |
| 114 | [ |
| 115 | 'label' => __( 'Fancy Text Strings', 'essential-addons-for-elementor-lite'), |
| 116 | 'type' => Controls_Manager::REPEATER, |
| 117 | 'show_label' => true, |
| 118 | 'fields' => $repeater->get_controls(), |
| 119 | 'title_field' => '{{ eael_fancy_text_strings_text_field }}', |
| 120 | 'default' => [ |
| 121 | [ |
| 122 | 'eael_fancy_text_strings_text_field' => __( 'First string', 'essential-addons-for-elementor-lite'), |
| 123 | ], |
| 124 | [ |
| 125 | 'eael_fancy_text_strings_text_field' => __( 'Second string', 'essential-addons-for-elementor-lite'), |
| 126 | ], |
| 127 | [ |
| 128 | 'eael_fancy_text_strings_text_field' => __( 'Third string', 'essential-addons-for-elementor-lite'), |
| 129 | ] |
| 130 | ], |
| 131 | ] |
| 132 | ); |
| 133 | |
| 134 | $this->add_control( |
| 135 | 'eael_fancy_text_suffix', |
| 136 | [ |
| 137 | 'label' => esc_html__( 'Suffix Text', 'essential-addons-for-elementor-lite'), |
| 138 | 'placeholder' => esc_html__( 'Place your suffix text', 'essential-addons-for-elementor-lite'), |
| 139 | 'type' => Controls_Manager::TEXT, |
| 140 | 'default' => esc_html__( ' of the sentence.', 'essential-addons-for-elementor-lite'), |
| 141 | 'dynamic' => [ 'active' => true ], |
| 142 | 'ai' => [ |
| 143 | 'active' => true, |
| 144 | ], |
| 145 | ] |
| 146 | ); |
| 147 | |
| 148 | $this->end_controls_section(); |
| 149 | |
| 150 | // Settings Control |
| 151 | $this->start_controls_section( |
| 152 | 'eael_fancy_text_settings', |
| 153 | [ |
| 154 | 'label' => esc_html__( 'Fancy Text Settings', 'essential-addons-for-elementor-lite') |
| 155 | ] |
| 156 | ); |
| 157 | |
| 158 | $style_options = apply_filters( |
| 159 | // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound |
| 160 | 'fancy_text_style_types', |
| 161 | [ |
| 162 | 'styles' => [ |
| 163 | 'style-1' => esc_html__( 'Style 1', 'essential-addons-for-elementor-lite'), |
| 164 | 'style-2' => esc_html__( 'Style 2 (Pro)', 'essential-addons-for-elementor-lite'), |
| 165 | ], |
| 166 | 'conditions' => ['style-2'] |
| 167 | ] |
| 168 | ); |
| 169 | |
| 170 | $this->add_control( |
| 171 | 'eael_fancy_text_style', |
| 172 | [ |
| 173 | 'label' => esc_html__( 'Style Type', 'essential-addons-for-elementor-lite'), |
| 174 | 'type' => Controls_Manager::SELECT, |
| 175 | 'default' => 'style-1', |
| 176 | 'options' => $style_options['styles'] |
| 177 | ] |
| 178 | ); |
| 179 | |
| 180 | $this->add_control( |
| 181 | 'eael_fancy_text_style_pro_alert', |
| 182 | [ |
| 183 | 'label' => esc_html__( 'Only available in pro version!', 'essential-addons-for-elementor-lite'), |
| 184 | 'type' => Controls_Manager::HEADING, |
| 185 | 'condition' => [ |
| 186 | 'eael_fancy_text_style' => $style_options['conditions'], |
| 187 | ] |
| 188 | ] |
| 189 | ); |
| 190 | |
| 191 | $this->add_responsive_control( |
| 192 | 'eael_fancy_text_alignment', |
| 193 | [ |
| 194 | 'label' => esc_html__( 'Alignment', 'essential-addons-for-elementor-lite'), |
| 195 | 'type' => Controls_Manager::CHOOSE, |
| 196 | 'options' => [ |
| 197 | 'left' => [ |
| 198 | 'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'), |
| 199 | 'icon' => 'eicon-text-align-left', |
| 200 | ], |
| 201 | 'center' => [ |
| 202 | 'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite'), |
| 203 | 'icon' => 'eicon-text-align-center', |
| 204 | ], |
| 205 | 'right' => [ |
| 206 | 'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'), |
| 207 | 'icon' => 'eicon-text-align-right', |
| 208 | ], |
| 209 | ], |
| 210 | 'default' => 'center', |
| 211 | 'selectors' => [ |
| 212 | '{{WRAPPER}} .eael-fancy-text-container' => 'text-align: {{VALUE}}', |
| 213 | ], |
| 214 | ] |
| 215 | ); |
| 216 | |
| 217 | $this->add_control( |
| 218 | 'eael_fancy_text_transition_type', |
| 219 | [ |
| 220 | 'label' => esc_html__( 'Animation Type', 'essential-addons-for-elementor-lite'), |
| 221 | 'type' => Controls_Manager::SELECT, |
| 222 | 'default' => 'typing', |
| 223 | 'options' => [ |
| 224 | 'typing' => esc_html__( 'Typing', 'essential-addons-for-elementor-lite'), |
| 225 | 'fadeIn' => esc_html__( 'Fade', 'essential-addons-for-elementor-lite'), |
| 226 | 'fadeInUp' => esc_html__( 'Fade Up', 'essential-addons-for-elementor-lite'), |
| 227 | 'fadeInDown' => esc_html__( 'Fade Down', 'essential-addons-for-elementor-lite'), |
| 228 | 'fadeInLeft' => esc_html__( 'Fade Left', 'essential-addons-for-elementor-lite'), |
| 229 | 'fadeInRight' => esc_html__( 'Fade Right', 'essential-addons-for-elementor-lite'), |
| 230 | 'zoomIn' => esc_html__( 'Zoom', 'essential-addons-for-elementor-lite'), |
| 231 | 'bounceIn' => esc_html__( 'Bounce', 'essential-addons-for-elementor-lite'), |
| 232 | 'swing' => esc_html__( 'Swing', 'essential-addons-for-elementor-lite'), |
| 233 | ], |
| 234 | ] |
| 235 | ); |
| 236 | |
| 237 | $this->add_control( |
| 238 | 'eael_fancy_text_animation_start_on', |
| 239 | [ |
| 240 | 'label' => esc_html__( 'Animation Starts', 'essential-addons-for-elementor-lite' ), |
| 241 | 'type' => Controls_Manager::SELECT, |
| 242 | 'options' => [ |
| 243 | 'page_load' => esc_html__( 'On Page Load', 'essential-addons-for-elementor-lite'), |
| 244 | 'view_port' => esc_html__( 'When in View Port', 'essential-addons-for-elementor-lite'), |
| 245 | ], |
| 246 | 'default' => 'page_load', |
| 247 | ] |
| 248 | ); |
| 249 | |
| 250 | |
| 251 | $this->add_control( |
| 252 | 'eael_fancy_text_speed', |
| 253 | [ |
| 254 | 'label' => esc_html__( 'Typing Speed', 'essential-addons-for-elementor-lite'), |
| 255 | 'type' => Controls_Manager::NUMBER, |
| 256 | 'default' => '50', |
| 257 | 'condition' => [ |
| 258 | 'eael_fancy_text_transition_type' => 'typing', |
| 259 | ], |
| 260 | ] |
| 261 | ); |
| 262 | |
| 263 | $this->add_control( |
| 264 | 'eael_fancy_text_delay', |
| 265 | [ |
| 266 | 'label' => esc_html__( 'Delay on Change', 'essential-addons-for-elementor-lite'), |
| 267 | 'type' => Controls_Manager::NUMBER, |
| 268 | 'default' => '2500' |
| 269 | ] |
| 270 | ); |
| 271 | |
| 272 | $this->add_control( |
| 273 | 'eael_fancy_text_loop', |
| 274 | [ |
| 275 | 'label' => esc_html__( 'Loop the animation', 'essential-addons-for-elementor-lite'), |
| 276 | 'type' => Controls_Manager::SWITCHER, |
| 277 | 'return_value' => 'yes', |
| 278 | 'default' => 'yes' |
| 279 | ] |
| 280 | ); |
| 281 | |
| 282 | $this->add_control( |
| 283 | 'eael_fancy_text_cursor', |
| 284 | [ |
| 285 | 'label' => esc_html__( 'Display Type Cursor', 'essential-addons-for-elementor-lite'), |
| 286 | 'type' => Controls_Manager::SWITCHER, |
| 287 | 'return_value' => 'yes', |
| 288 | 'default' => 'yes', |
| 289 | 'condition' => [ |
| 290 | 'eael_fancy_text_transition_type' => 'typing', |
| 291 | ], |
| 292 | ] |
| 293 | ); |
| 294 | |
| 295 | |
| 296 | $this->end_controls_section(); |
| 297 | |
| 298 | |
| 299 | if(!apply_filters('eael/pro_enabled', false)) { |
| 300 | $this->start_controls_section( |
| 301 | 'eael_section_pro', |
| 302 | [ |
| 303 | 'label' => __( 'Go Premium for More Features', 'essential-addons-for-elementor-lite') |
| 304 | ] |
| 305 | ); |
| 306 | |
| 307 | $this->add_control( |
| 308 | 'eael_control_get_pro', |
| 309 | [ |
| 310 | 'label' => __( 'Unlock more possibilities', 'essential-addons-for-elementor-lite'), |
| 311 | 'type' => Controls_Manager::CHOOSE, |
| 312 | 'options' => [ |
| 313 | '1' => [ |
| 314 | 'title' => '', |
| 315 | 'icon' => 'fa fa-unlock-alt', |
| 316 | ], |
| 317 | ], |
| 318 | 'default' => '1', |
| 319 | 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>' |
| 320 | ] |
| 321 | ); |
| 322 | |
| 323 | $this->end_controls_section(); |
| 324 | } |
| 325 | |
| 326 | |
| 327 | $this->start_controls_section( |
| 328 | 'eael_fancy_text_prefix_styles', |
| 329 | [ |
| 330 | 'label' => esc_html__( 'Prefix Text Styles', 'essential-addons-for-elementor-lite'), |
| 331 | 'tab' => Controls_Manager::TAB_STYLE |
| 332 | ] |
| 333 | ); |
| 334 | |
| 335 | $this->add_control( |
| 336 | 'eael_fancy_text_prefix_color', |
| 337 | [ |
| 338 | 'label' => esc_html__( 'Prefix Text Color', 'essential-addons-for-elementor-lite'), |
| 339 | 'type' => Controls_Manager::COLOR, |
| 340 | 'selectors' => [ |
| 341 | '{{WRAPPER}} .eael-fancy-text-prefix' => 'color: {{VALUE}};', |
| 342 | ], |
| 343 | ] |
| 344 | ); |
| 345 | |
| 346 | $this->add_group_control( |
| 347 | Group_Control_Typography::get_type(), |
| 348 | [ |
| 349 | 'name' => 'typography', |
| 350 | 'global' => [ |
| 351 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY |
| 352 | ], |
| 353 | 'fields_options' => [ |
| 354 | 'typography' => ['default' => 'yes'], |
| 355 | 'font_size' => ['default' => ['size' => 22]], |
| 356 | 'font_weight' => ['default' => 600], |
| 357 | 'line_height' => ['default' => ['size' => 1]], |
| 358 | ], |
| 359 | 'selector' => '{{WRAPPER}} .eael-fancy-text-prefix', |
| 360 | ] |
| 361 | ); |
| 362 | |
| 363 | |
| 364 | $this->end_controls_section(); |
| 365 | |
| 366 | |
| 367 | $this->start_controls_section( |
| 368 | 'eael_fancy_text_strings_styles', |
| 369 | [ |
| 370 | 'label' => esc_html__( 'Fancy Text Styles', 'essential-addons-for-elementor-lite'), |
| 371 | 'tab' => Controls_Manager::TAB_STYLE |
| 372 | ] |
| 373 | ); |
| 374 | |
| 375 | $this->add_control( |
| 376 | 'eael_fancy_text_color_selector', |
| 377 | [ |
| 378 | 'label' => esc_html__('Choose Background Type', 'essential-addons-for-elementor-lite'), |
| 379 | 'type' => Controls_Manager::CHOOSE, |
| 380 | 'options' => [ |
| 381 | 'solid-color' => [ |
| 382 | 'title' => __('Color', 'essential-addons-for-elementor-lite'), |
| 383 | 'icon' => 'eicon-paint-brush', |
| 384 | ], |
| 385 | 'gradient-color' => [ |
| 386 | 'title' => __('Gradient', 'essential-addons-for-elementor-lite'), |
| 387 | 'icon' => 'eicon-barcode', |
| 388 | ], |
| 389 | ], |
| 390 | 'toggle' => true, |
| 391 | 'default' => 'solid-color', |
| 392 | 'condition' => [ |
| 393 | 'eael_fancy_text_style' => 'style-1', |
| 394 | ] |
| 395 | ] |
| 396 | ); |
| 397 | |
| 398 | $this->add_control( |
| 399 | 'eael_fancy_text_strings_background_color', |
| 400 | [ |
| 401 | 'label' => esc_html__( 'Background', 'essential-addons-for-elementor-lite'), |
| 402 | 'type' => Controls_Manager::COLOR, |
| 403 | 'default' => '', |
| 404 | 'selectors' => [ |
| 405 | '{{WRAPPER}} .eael-fancy-text-strings' => 'background: {{VALUE}};', |
| 406 | ], |
| 407 | 'conditions' => [ |
| 408 | 'relation' => 'or', |
| 409 | 'terms' => [ |
| 410 | [ |
| 411 | 'terms' => [ |
| 412 | [ |
| 413 | 'name' => 'eael_fancy_text_color_selector', |
| 414 | 'operator' => '==', |
| 415 | 'value' => 'solid-color', |
| 416 | ], |
| 417 | ], |
| 418 | ], |
| 419 | [ |
| 420 | 'name' => 'eael_fancy_text_style', |
| 421 | 'operator' => '==', |
| 422 | 'value' => 'style-2', |
| 423 | ], |
| 424 | ], |
| 425 | ], |
| 426 | ] |
| 427 | ); |
| 428 | |
| 429 | $this->add_group_control( |
| 430 | Group_Control_Background::get_type(), |
| 431 | [ |
| 432 | 'name' => 'eael_fancy_text_color_gradient', |
| 433 | 'types' => ['gradient'], |
| 434 | 'fields_options' => [ |
| 435 | 'background' => [ |
| 436 | 'label' => _x( 'Gradient Color', 'Text Shadow Control', 'essential-addons-for-elementor-lite' ), |
| 437 | 'toggle' => false, |
| 438 | 'default' => 'gradient', |
| 439 | ], |
| 440 | 'color' => [ |
| 441 | 'default' => '#062ACA', |
| 442 | ], |
| 443 | 'color_b' => [ |
| 444 | 'default' => '#9401D9', |
| 445 | ] |
| 446 | ], |
| 447 | 'selector' => '{{WRAPPER}} .eael-fancy-text-strings', |
| 448 | 'condition' => [ |
| 449 | 'eael_fancy_text_color_selector' => 'gradient-color', |
| 450 | 'eael_fancy_text_style' => 'style-1', |
| 451 | ] |
| 452 | ] |
| 453 | ); |
| 454 | |
| 455 | $this->add_group_control( |
| 456 | Group_Control_Typography::get_type(), |
| 457 | [ |
| 458 | 'name' => 'eael_fancy_text_strings_typography', |
| 459 | 'global' => [ |
| 460 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY |
| 461 | ], |
| 462 | 'fields_options' => [ |
| 463 | 'typography' => ['default' => 'yes'], |
| 464 | 'font_size' => ['default' => ['size' => 22]], |
| 465 | 'font_weight' => ['default' => 600], |
| 466 | ], |
| 467 | 'selector' => '{{WRAPPER}} .eael-fancy-text-strings, {{WRAPPER}} .typed-cursor', |
| 468 | ] |
| 469 | ); |
| 470 | |
| 471 | $this->add_control( |
| 472 | 'eael_fancy_text_strings_color', |
| 473 | [ |
| 474 | 'label' => esc_html__( 'Solid Color', 'essential-addons-for-elementor-lite'), |
| 475 | 'type' => Controls_Manager::COLOR, |
| 476 | 'selectors' => [ |
| 477 | '{{WRAPPER}} .eael-fancy-text-strings' => 'color: {{VALUE}};', |
| 478 | ], |
| 479 | 'conditions' => [ |
| 480 | 'relation' => 'or', |
| 481 | 'terms' => [ |
| 482 | [ |
| 483 | 'terms' => [ |
| 484 | [ |
| 485 | 'name' => 'eael_fancy_text_style', |
| 486 | 'operator' => '==', |
| 487 | 'value' => 'style-1', |
| 488 | ] |
| 489 | ], |
| 490 | ], |
| 491 | [ |
| 492 | 'name' => 'eael_fancy_text_style', |
| 493 | 'operator' => '==', |
| 494 | 'value' => 'style-2', |
| 495 | ], |
| 496 | ], |
| 497 | ], |
| 498 | ] |
| 499 | ); |
| 500 | |
| 501 | $this->add_control( |
| 502 | 'eael_fancy_text_cursor_color', |
| 503 | [ |
| 504 | 'label' => esc_html__( 'Typing Cursor Color', 'essential-addons-for-elementor-lite'), |
| 505 | 'type' => Controls_Manager::COLOR, |
| 506 | 'selectors' => [ |
| 507 | '{{WRAPPER}} .eael-fancy-text-strings::after' => 'color: {{VALUE}};', |
| 508 | ], |
| 509 | 'condition' => [ |
| 510 | 'eael_fancy_text_cursor' => 'yes', |
| 511 | ], |
| 512 | ] |
| 513 | ); |
| 514 | |
| 515 | $this->add_responsive_control( |
| 516 | 'eael_fancy_text_strings_padding', |
| 517 | [ |
| 518 | 'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite'), |
| 519 | 'type' => Controls_Manager::DIMENSIONS, |
| 520 | 'size_units' => [ 'px', 'em', '%' ], |
| 521 | 'selectors' => [ |
| 522 | '{{WRAPPER}} .eael-fancy-text-strings' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 523 | ], |
| 524 | ] |
| 525 | ); |
| 526 | |
| 527 | $this->add_responsive_control( |
| 528 | 'eael_fancy_text_strings_margin', |
| 529 | [ |
| 530 | 'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'), |
| 531 | 'type' => Controls_Manager::DIMENSIONS, |
| 532 | 'size_units' => [ 'px', 'em', '%' ], |
| 533 | 'selectors' => [ |
| 534 | '{{WRAPPER}} .eael-fancy-text-strings' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 535 | ], |
| 536 | ] |
| 537 | ); |
| 538 | |
| 539 | |
| 540 | |
| 541 | $this->add_group_control( |
| 542 | Group_Control_Border::get_type(), |
| 543 | [ |
| 544 | 'name' => 'eael_fancy_text_strings_border', |
| 545 | 'selector' => '{{WRAPPER}} .eael-fancy-text-strings', |
| 546 | ] |
| 547 | ); |
| 548 | |
| 549 | |
| 550 | $this->add_control( |
| 551 | 'eael_fancy_text_strings_border_radius', |
| 552 | [ |
| 553 | 'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite'), |
| 554 | 'type' => Controls_Manager::SLIDER, |
| 555 | 'range' => [ |
| 556 | 'px' => [ |
| 557 | 'min' => 0, |
| 558 | 'max' => 100, |
| 559 | ], |
| 560 | ], |
| 561 | 'selectors' => [ |
| 562 | '{{WRAPPER}} .eael-fancy-text-strings' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 563 | ], |
| 564 | ] |
| 565 | ); |
| 566 | |
| 567 | |
| 568 | $this->end_controls_section(); |
| 569 | |
| 570 | |
| 571 | |
| 572 | $this->start_controls_section( |
| 573 | 'eael_fancy_text_suffix_styles', |
| 574 | [ |
| 575 | 'label' => esc_html__( 'Suffix Text Styles', 'essential-addons-for-elementor-lite'), |
| 576 | 'tab' => Controls_Manager::TAB_STYLE |
| 577 | ] |
| 578 | ); |
| 579 | |
| 580 | $this->add_control( |
| 581 | 'eael_fancy_text_suffix_color', |
| 582 | [ |
| 583 | 'label' => esc_html__( 'Suffix Text Color', 'essential-addons-for-elementor-lite'), |
| 584 | 'type' => Controls_Manager::COLOR, |
| 585 | 'selectors' => [ |
| 586 | '{{WRAPPER}} .eael-fancy-text-suffix' => 'color: {{VALUE}};', |
| 587 | ], |
| 588 | ] |
| 589 | ); |
| 590 | |
| 591 | $this->add_group_control( |
| 592 | Group_Control_Typography::get_type(), |
| 593 | [ |
| 594 | 'name' => 'ending_typography', |
| 595 | 'global' => [ |
| 596 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY |
| 597 | ], |
| 598 | 'fields_options' => [ |
| 599 | 'typography' => ['default' => 'yes'], |
| 600 | 'font_size' => ['default' => ['size' => 22]], |
| 601 | 'font_weight' => ['default' => 600], |
| 602 | 'line_height' => ['default' => ['size' => 1]], |
| 603 | ], |
| 604 | 'selector' => '{{WRAPPER}} .eael-fancy-text-suffix', |
| 605 | ] |
| 606 | ); |
| 607 | |
| 608 | |
| 609 | $this->end_controls_section(); |
| 610 | |
| 611 | } |
| 612 | |
| 613 | public function fancy_text($settings) { |
| 614 | $fancy_text = array(""); |
| 615 | foreach ( $settings as $item ) { |
| 616 | if ( ! empty( $item['eael_fancy_text_strings_text_field'] ) ) { |
| 617 | $fancy_text[] = HelperClass::eael_wp_kses( html_entity_decode( $item['eael_fancy_text_strings_text_field'] ) ); |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | $fancy_text = implode("|",$fancy_text); |
| 622 | return str_replace( '&', '&', $fancy_text); |
| 623 | } |
| 624 | |
| 625 | protected function render() { |
| 626 | $settings = $this->get_settings_for_display(); |
| 627 | $fancy_text = $this->fancy_text($settings['eael_fancy_text_strings']); |
| 628 | if(!apply_filters('eael/pro_enabled', false)) { $settings['eael_fancy_text_style'] = 'style-1'; } |
| 629 | $this->add_render_attribute( 'fancy-text', 'class', 'eael-fancy-text-container' ); |
| 630 | $this->add_render_attribute( 'fancy-text', 'class', esc_attr($settings['eael_fancy_text_style']) ); |
| 631 | $this->add_render_attribute( 'fancy-text', 'data-fancy-text-id', esc_attr($this->get_id()) ); |
| 632 | $this->add_render_attribute( 'fancy-text', 'data-fancy-text', $fancy_text ); |
| 633 | $this->add_render_attribute( 'fancy-text', 'data-fancy-text-transition-type', $settings['eael_fancy_text_transition_type'] ); |
| 634 | $this->add_render_attribute( 'fancy-text', 'data-fancy-text-speed', $settings['eael_fancy_text_speed'] ); |
| 635 | $this->add_render_attribute( 'fancy-text', 'data-fancy-text-delay', $settings['eael_fancy_text_delay'] ); |
| 636 | $this->add_render_attribute( 'fancy-text', 'data-fancy-text-cursor', $settings['eael_fancy_text_cursor'] ); |
| 637 | $this->add_render_attribute( 'fancy-text', 'data-fancy-text-loop', $settings['eael_fancy_text_loop'] ); |
| 638 | $this->add_render_attribute( 'fancy-text', 'data-fancy-text-action', $settings['eael_fancy_text_animation_start_on'] ); |
| 639 | ?> |
| 640 | |
| 641 | <div <?php $this->print_render_attribute_string( 'fancy-text' ); ?> > |
| 642 | <?php if ( ! empty( $settings['eael_fancy_text_prefix'] ) ) : ?> |
| 643 | <span class="eael-fancy-text-prefix"><?php echo wp_kses( $settings['eael_fancy_text_prefix'], HelperClass::eael_allowed_tags() ); ?> </span> |
| 644 | <?php endif; ?> |
| 645 | |
| 646 | <?php if ( $settings['eael_fancy_text_transition_type'] == 'fancy' ) : ?> |
| 647 | <span id="eael-fancy-text-<?php echo esc_attr($this->get_id()); ?>" class="eael-fancy-text-strings |
| 648 | <?php echo esc_attr( $settings['eael_fancy_text_color_selector'] ) ?>"></span> |
| 649 | <?php endif; ?> |
| 650 | |
| 651 | <?php if ( $settings['eael_fancy_text_transition_type'] != 'fancy' ) : ?> |
| 652 | <span id="eael-fancy-text-<?php echo esc_attr($this->get_id()); ?>" class="eael-fancy-text-strings <?php echo esc_attr( $settings['eael_fancy_text_color_selector'] ); ?>"> |
| 653 | <noscript> |
| 654 | <?php |
| 655 | $eael_fancy_text_strings_list = ""; |
| 656 | foreach ( $settings['eael_fancy_text_strings'] as $item ) { |
| 657 | $eael_fancy_text_strings_list .= $item['eael_fancy_text_strings_text_field'] . ', '; |
| 658 | } |
| 659 | echo wp_kses( rtrim($eael_fancy_text_strings_list, ", "), HelperClass::eael_allowed_tags() ); |
| 660 | ?> |
| 661 | </noscript> |
| 662 | </span> |
| 663 | <?php endif; ?> |
| 664 | |
| 665 | <?php if ( ! empty( $settings['eael_fancy_text_suffix'] ) ) : ?> |
| 666 | <span class="eael-fancy-text-suffix"> <?php echo wp_kses( $settings['eael_fancy_text_suffix'], HelperClass::eael_allowed_tags() ); ?></span> |
| 667 | <?php endif; ?> |
| 668 | </div><!-- close .eael-fancy-text-container --> |
| 669 | |
| 670 | <div class="clearfix"></div> |
| 671 | |
| 672 | <?php |
| 673 | |
| 674 | } |
| 675 | |
| 676 | } |
| 677 |