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