dep
3 years ago
premium-banner.php
3 years ago
premium-blog.php
3 years ago
premium-button.php
3 years ago
premium-carousel.php
3 years ago
premium-contactform.php
3 years ago
premium-countdown.php
3 years ago
premium-counter.php
3 years ago
premium-dual-header.php
3 years ago
premium-fancytext.php
3 years ago
premium-grid.php
3 years ago
premium-icon-list.php
3 years ago
premium-image-button.php
3 years ago
premium-image-scroll.php
3 years ago
premium-image-separator.php
3 years ago
premium-lottie.php
3 years ago
premium-maps.php
3 years ago
premium-modalbox.php
3 years ago
premium-nav-menu.php
3 years ago
premium-person.php
3 years ago
premium-pricing-table.php
3 years ago
premium-progressbar.php
3 years ago
premium-svg-drawer.php
3 years ago
premium-testimonials.php
3 years ago
premium-title.php
3 years ago
premium-videobox.php
3 years ago
premium-vscroll.php
3 years ago
premium-title.php
2309 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Premium Title. |
| 4 | */ |
| 5 | |
| 6 | namespace PremiumAddons\Widgets; |
| 7 | |
| 8 | // Elementor Classes. |
| 9 | use Elementor\Widget_Base; |
| 10 | use Elementor\Utils; |
| 11 | use Elementor\Icons_Manager; |
| 12 | use Elementor\Controls_Manager; |
| 13 | use Elementor\Control_Media; |
| 14 | use Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 15 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 16 | use Elementor\Group_Control_Border; |
| 17 | use Elementor\Group_Control_Typography; |
| 18 | use Elementor\Group_Control_Text_Shadow; |
| 19 | use Elementor\Group_Control_Background; |
| 20 | |
| 21 | // PremiumAddons Classes. |
| 22 | use PremiumAddons\Admin\Includes\Admin_Helper; |
| 23 | use PremiumAddons\Includes\Helper_Functions; |
| 24 | use PremiumAddons\Includes\Premium_Template_Tags; |
| 25 | |
| 26 | if ( ! defined( 'ABSPATH' ) ) { |
| 27 | exit; // If this file is called directly, abort. |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Class Premium_Title |
| 32 | */ |
| 33 | class Premium_Title extends Widget_Base { |
| 34 | |
| 35 | /** |
| 36 | * Check Icon Draw Option. |
| 37 | * |
| 38 | * @since 4.9.26 |
| 39 | * @access public |
| 40 | */ |
| 41 | public function check_icon_draw() { |
| 42 | $is_enabled = Admin_Helper::check_svg_draw( 'premium-title' ); |
| 43 | return $is_enabled; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Get Elementor Helper Instance. |
| 48 | * |
| 49 | * @since 1.0.0 |
| 50 | * @access public |
| 51 | */ |
| 52 | public function getTemplateInstance() { |
| 53 | $this->template_instance = Premium_Template_Tags::getInstance(); |
| 54 | return $this->template_instance; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Retrieve Widget Name. |
| 59 | * |
| 60 | * @since 1.0.0 |
| 61 | * @access public |
| 62 | */ |
| 63 | public function get_name() { |
| 64 | return 'premium-addon-title'; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Retrieve Widget Title. |
| 69 | * |
| 70 | * @since 1.0.0 |
| 71 | * @access public |
| 72 | */ |
| 73 | public function get_title() { |
| 74 | return __( 'Heading', 'premium-addons-for-elementor' ); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Retrieve Widget Icon. |
| 79 | * |
| 80 | * @since 1.0.0 |
| 81 | * @access public |
| 82 | * |
| 83 | * @return string widget icon. |
| 84 | */ |
| 85 | public function get_icon() { |
| 86 | return 'pa-title'; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Retrieve Widget Dependent CSS. |
| 91 | * |
| 92 | * @since 1.0.0 |
| 93 | * @access public |
| 94 | * |
| 95 | * @return array CSS style handles. |
| 96 | */ |
| 97 | public function get_style_depends() { |
| 98 | return array( |
| 99 | 'premium-addons', |
| 100 | ); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Retrieve Widget Dependent JS. |
| 105 | * |
| 106 | * @since 1.0.0 |
| 107 | * @access public |
| 108 | * |
| 109 | * @return array JS script handles. |
| 110 | */ |
| 111 | public function get_script_depends() { |
| 112 | |
| 113 | $draw_scripts = $this->check_icon_draw() ? array( |
| 114 | 'pa-fontawesome-all', |
| 115 | 'pa-tweenmax', |
| 116 | 'pa-motionpath', |
| 117 | ) : array(); |
| 118 | |
| 119 | return array_merge( |
| 120 | $draw_scripts, |
| 121 | array( |
| 122 | 'premium-addons', |
| 123 | 'elementor-waypoints', |
| 124 | 'lottie-js', |
| 125 | ) |
| 126 | ); |
| 127 | |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Retrieve Widget Categories. |
| 132 | * |
| 133 | * @since 1.5.1 |
| 134 | * @access public |
| 135 | * |
| 136 | * @return array Widget categories. |
| 137 | */ |
| 138 | public function get_categories() { |
| 139 | return array( 'premium-elements' ); |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Retrieve Widget Dependent CSS. |
| 144 | * |
| 145 | * @since 1.0.0 |
| 146 | * @access public |
| 147 | * |
| 148 | * @return array CSS style handles. |
| 149 | */ |
| 150 | public function get_keywords() { |
| 151 | return array( 'pa', 'premium', 'title', 'text', 'headline' ); |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Retrieve Widget Support URL. |
| 156 | * |
| 157 | * @access public |
| 158 | * |
| 159 | * @return string support URL. |
| 160 | */ |
| 161 | public function get_custom_help_url() { |
| 162 | return 'https://premiumaddons.com/support/'; |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Register Title controls. |
| 167 | * |
| 168 | * @since 1.0.0 |
| 169 | * @access protected |
| 170 | */ |
| 171 | protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
| 172 | |
| 173 | $draw_icon = $this->check_icon_draw(); |
| 174 | |
| 175 | $this->start_controls_section( |
| 176 | 'premium_title_content', |
| 177 | array( |
| 178 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 179 | ) |
| 180 | ); |
| 181 | |
| 182 | $this->add_control( |
| 183 | 'premium_title_text', |
| 184 | array( |
| 185 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 186 | 'type' => Controls_Manager::TEXT, |
| 187 | 'default' => __( 'Premium Title', 'premium-addons-for-elementor' ), |
| 188 | 'label_block' => true, |
| 189 | 'dynamic' => array( 'active' => true ), |
| 190 | ) |
| 191 | ); |
| 192 | |
| 193 | $this->add_control( |
| 194 | 'premium_title_style', |
| 195 | array( |
| 196 | 'label' => __( 'Style', 'premium-addons-for-elementor' ), |
| 197 | 'type' => Controls_Manager::SELECT, |
| 198 | 'default' => 'style1', |
| 199 | 'options' => array( |
| 200 | 'style1' => __( 'Style 1', 'premium-addons-for-elementor' ), |
| 201 | 'style2' => __( 'Style 2', 'premium-addons-for-elementor' ), |
| 202 | 'style3' => __( 'Style 3', 'premium-addons-for-elementor' ), |
| 203 | 'style4' => __( 'Style 4', 'premium-addons-for-elementor' ), |
| 204 | 'style5' => __( 'Style 5', 'premium-addons-for-elementor' ), |
| 205 | 'style6' => __( 'Style 6', 'premium-addons-for-elementor' ), |
| 206 | 'style7' => __( 'Style 7', 'premium-addons-for-elementor' ), |
| 207 | 'style8' => __( 'Style 8', 'premium-addons-for-elementor' ), |
| 208 | 'style9' => __( 'Style 9', 'premium-addons-for-elementor' ), |
| 209 | ), |
| 210 | 'label_block' => true, |
| 211 | ) |
| 212 | ); |
| 213 | |
| 214 | $this->add_control( |
| 215 | 'premium_title_icon_switcher', |
| 216 | array( |
| 217 | 'label' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 218 | 'type' => Controls_Manager::SWITCHER, |
| 219 | ) |
| 220 | ); |
| 221 | |
| 222 | $this->add_control( |
| 223 | 'icon_type', |
| 224 | array( |
| 225 | 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ), |
| 226 | 'type' => Controls_Manager::SELECT, |
| 227 | 'options' => array( |
| 228 | 'icon' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 229 | 'image' => __( 'Image', 'premium-addons-for-elementor' ), |
| 230 | 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ), |
| 231 | 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ), |
| 232 | ), |
| 233 | 'default' => 'icon', |
| 234 | 'condition' => array( |
| 235 | 'premium_title_icon_switcher' => 'yes', |
| 236 | ), |
| 237 | ) |
| 238 | ); |
| 239 | |
| 240 | $common_conditions = array( |
| 241 | 'premium_title_icon_switcher' => 'yes', |
| 242 | ); |
| 243 | |
| 244 | $this->add_control( |
| 245 | 'premium_title_icon_updated', |
| 246 | array( |
| 247 | 'label' => __( 'Font Awesome Icon', 'premium-addons-for-elementor' ), |
| 248 | 'type' => Controls_Manager::ICONS, |
| 249 | 'fa4compatibility' => 'premium_title_icon', |
| 250 | 'default' => array( |
| 251 | 'value' => 'fas fa-bars', |
| 252 | 'library' => 'fa-solid', |
| 253 | ), |
| 254 | 'label_block' => true, |
| 255 | 'condition' => array_merge( |
| 256 | $common_conditions, |
| 257 | array( |
| 258 | 'icon_type' => 'icon', |
| 259 | ) |
| 260 | ), |
| 261 | ) |
| 262 | ); |
| 263 | |
| 264 | $this->add_control( |
| 265 | 'image_upload', |
| 266 | array( |
| 267 | 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ), |
| 268 | 'type' => Controls_Manager::MEDIA, |
| 269 | 'default' => array( |
| 270 | 'url' => Utils::get_placeholder_image_src(), |
| 271 | ), |
| 272 | 'condition' => array_merge( |
| 273 | $common_conditions, |
| 274 | array( |
| 275 | 'icon_type' => 'image', |
| 276 | ) |
| 277 | ), |
| 278 | ) |
| 279 | ); |
| 280 | |
| 281 | $this->add_control( |
| 282 | 'custom_svg', |
| 283 | array( |
| 284 | 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ), |
| 285 | 'type' => Controls_Manager::TEXTAREA, |
| 286 | 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>', |
| 287 | 'condition' => array_merge( |
| 288 | $common_conditions, |
| 289 | array( |
| 290 | 'icon_type' => 'svg', |
| 291 | ) |
| 292 | ), |
| 293 | ) |
| 294 | ); |
| 295 | |
| 296 | $this->add_control( |
| 297 | 'lottie_url', |
| 298 | array( |
| 299 | 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ), |
| 300 | 'type' => Controls_Manager::TEXT, |
| 301 | 'dynamic' => array( 'active' => true ), |
| 302 | 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>', |
| 303 | 'label_block' => true, |
| 304 | 'condition' => array_merge( |
| 305 | $common_conditions, |
| 306 | array( |
| 307 | 'icon_type' => 'animation', |
| 308 | ) |
| 309 | ), |
| 310 | ) |
| 311 | ); |
| 312 | |
| 313 | $animation_conds = array( |
| 314 | 'terms' => array( |
| 315 | array( |
| 316 | 'name' => 'premium_title_icon_switcher', |
| 317 | 'value' => 'yes', |
| 318 | ), |
| 319 | array( |
| 320 | 'relation' => 'or', |
| 321 | 'terms' => array( |
| 322 | array( |
| 323 | 'name' => 'icon_type', |
| 324 | 'value' => 'animation', |
| 325 | ), |
| 326 | array( |
| 327 | 'terms' => array( |
| 328 | array( |
| 329 | 'relation' => 'or', |
| 330 | 'terms' => array( |
| 331 | array( |
| 332 | 'name' => 'icon_type', |
| 333 | 'value' => 'icon', |
| 334 | ), |
| 335 | array( |
| 336 | 'name' => 'icon_type', |
| 337 | 'value' => 'svg', |
| 338 | ), |
| 339 | ), |
| 340 | ), |
| 341 | array( |
| 342 | 'name' => 'draw_svg', |
| 343 | 'value' => 'yes', |
| 344 | ), |
| 345 | ), |
| 346 | ), |
| 347 | ), |
| 348 | ), |
| 349 | ), |
| 350 | ); |
| 351 | |
| 352 | $this->add_control( |
| 353 | 'draw_svg', |
| 354 | array( |
| 355 | 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ), |
| 356 | 'type' => Controls_Manager::SWITCHER, |
| 357 | 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled', |
| 358 | 'condition' => array_merge( |
| 359 | $common_conditions, |
| 360 | array( |
| 361 | 'icon_type' => array( 'icon', 'svg' ), |
| 362 | 'premium_title_icon_updated[library]!' => 'svg', |
| 363 | ) |
| 364 | ), |
| 365 | ) |
| 366 | ); |
| 367 | |
| 368 | if ( $draw_icon ) { |
| 369 | |
| 370 | $this->add_control( |
| 371 | 'path_width', |
| 372 | array( |
| 373 | 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ), |
| 374 | 'type' => Controls_Manager::SLIDER, |
| 375 | 'range' => array( |
| 376 | 'px' => array( |
| 377 | 'min' => 0, |
| 378 | 'max' => 50, |
| 379 | 'step' => 0.1, |
| 380 | ), |
| 381 | ), |
| 382 | 'condition' => array_merge( |
| 383 | $common_conditions, |
| 384 | array( |
| 385 | 'icon_type' => array( 'icon', 'svg' ), |
| 386 | ) |
| 387 | ), |
| 388 | 'selectors' => array( |
| 389 | '{{WRAPPER}} .premium-title-header svg *' => 'stroke-width: {{SIZE}}', |
| 390 | ), |
| 391 | ) |
| 392 | ); |
| 393 | |
| 394 | $this->add_control( |
| 395 | 'svg_sync', |
| 396 | array( |
| 397 | 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ), |
| 398 | 'type' => Controls_Manager::SWITCHER, |
| 399 | 'condition' => array_merge( |
| 400 | $common_conditions, |
| 401 | array( |
| 402 | 'icon_type' => array( 'icon', 'svg' ), |
| 403 | 'draw_svg' => 'yes', |
| 404 | ) |
| 405 | ), |
| 406 | ) |
| 407 | ); |
| 408 | |
| 409 | $this->add_control( |
| 410 | 'frames', |
| 411 | array( |
| 412 | 'label' => __( 'Speed', 'premium-addons-for-elementor' ), |
| 413 | 'type' => Controls_Manager::NUMBER, |
| 414 | 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ), |
| 415 | 'default' => 5, |
| 416 | 'min' => 1, |
| 417 | 'max' => 100, |
| 418 | 'condition' => array_merge( |
| 419 | $common_conditions, |
| 420 | array( |
| 421 | 'icon_type' => array( 'icon', 'svg' ), |
| 422 | 'draw_svg' => 'yes', |
| 423 | ) |
| 424 | ), |
| 425 | ) |
| 426 | ); |
| 427 | |
| 428 | } else { |
| 429 | |
| 430 | Helper_Functions::get_draw_svg_notice( |
| 431 | $this, |
| 432 | 'heading', |
| 433 | array_merge( |
| 434 | $common_conditions, |
| 435 | array( |
| 436 | 'icon_type' => array( 'icon', 'svg' ), |
| 437 | 'premium_title_icon_updated[library]!' => 'svg', |
| 438 | ) |
| 439 | ) |
| 440 | ); |
| 441 | |
| 442 | } |
| 443 | |
| 444 | $this->add_control( |
| 445 | 'lottie_loop', |
| 446 | array( |
| 447 | 'label' => __( 'Loop', 'premium-addons-for-elementor' ), |
| 448 | 'type' => Controls_Manager::SWITCHER, |
| 449 | 'return_value' => 'true', |
| 450 | 'default' => 'true', |
| 451 | 'conditions' => $animation_conds, |
| 452 | ) |
| 453 | ); |
| 454 | |
| 455 | $this->add_control( |
| 456 | 'lottie_reverse', |
| 457 | array( |
| 458 | 'label' => __( 'Reverse', 'premium-addons-for-elementor' ), |
| 459 | 'type' => Controls_Manager::SWITCHER, |
| 460 | 'return_value' => 'true', |
| 461 | 'conditions' => $animation_conds, |
| 462 | ) |
| 463 | ); |
| 464 | |
| 465 | if ( $draw_icon ) { |
| 466 | $this->add_control( |
| 467 | 'start_point', |
| 468 | array( |
| 469 | 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ), |
| 470 | 'type' => Controls_Manager::SLIDER, |
| 471 | 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ), |
| 472 | 'default' => array( |
| 473 | 'unit' => '%', |
| 474 | 'size' => 0, |
| 475 | ), |
| 476 | 'condition' => array_merge( |
| 477 | $common_conditions, |
| 478 | array( |
| 479 | 'icon_type' => array( 'icon', 'svg' ), |
| 480 | 'draw_svg' => 'yes', |
| 481 | 'lottie_reverse!' => 'true', |
| 482 | ) |
| 483 | ), |
| 484 | ) |
| 485 | ); |
| 486 | |
| 487 | $this->add_control( |
| 488 | 'end_point', |
| 489 | array( |
| 490 | 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ), |
| 491 | 'type' => Controls_Manager::SLIDER, |
| 492 | 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ), |
| 493 | 'default' => array( |
| 494 | 'unit' => '%', |
| 495 | 'size' => 0, |
| 496 | ), |
| 497 | 'condition' => array_merge( |
| 498 | $common_conditions, |
| 499 | array( |
| 500 | 'icon_type' => array( 'icon', 'svg' ), |
| 501 | 'draw_svg' => 'yes', |
| 502 | 'lottie_reverse' => 'true', |
| 503 | ) |
| 504 | ), |
| 505 | |
| 506 | ) |
| 507 | ); |
| 508 | |
| 509 | $this->add_control( |
| 510 | 'svg_hover', |
| 511 | array( |
| 512 | 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ), |
| 513 | 'type' => Controls_Manager::SWITCHER, |
| 514 | 'return_value' => 'true', |
| 515 | 'condition' => array_merge( |
| 516 | $common_conditions, |
| 517 | array( |
| 518 | 'icon_type' => array( 'icon', 'svg' ), |
| 519 | 'draw_svg' => 'yes', |
| 520 | ) |
| 521 | ), |
| 522 | ) |
| 523 | ); |
| 524 | |
| 525 | $this->add_control( |
| 526 | 'svg_yoyo', |
| 527 | array( |
| 528 | 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ), |
| 529 | 'type' => Controls_Manager::SWITCHER, |
| 530 | 'condition' => array_merge( |
| 531 | $common_conditions, |
| 532 | array( |
| 533 | 'icon_type' => array( 'icon', 'svg' ), |
| 534 | 'draw_svg' => 'yes', |
| 535 | 'lottie_loop' => 'true', |
| 536 | ) |
| 537 | ), |
| 538 | ) |
| 539 | ); |
| 540 | } |
| 541 | |
| 542 | $this->add_responsive_control( |
| 543 | 'icon_position', |
| 544 | array( |
| 545 | 'label' => __( 'Icon Position', 'premium-addons-for-elementor' ), |
| 546 | 'type' => Controls_Manager::SELECT, |
| 547 | 'options' => array( |
| 548 | 'row' => __( 'Before', 'premium-addons-for-elementor' ), |
| 549 | 'row-reverse' => __( 'After', 'premium-addons-for-elementor' ), |
| 550 | 'column' => __( 'Top', 'premium-addons-for-elementor' ), |
| 551 | ), |
| 552 | 'default' => 'row', |
| 553 | 'toggle' => false, |
| 554 | 'render_type' => 'template', |
| 555 | 'prefix_class' => 'premium-title-icon-', |
| 556 | 'selectors' => array( |
| 557 | '{{WRAPPER}} .premium-title-header:not(.premium-title-style7), {{WRAPPER}} .premium-title-style7-inner' => 'flex-direction: {{VALUE}}', |
| 558 | ), |
| 559 | 'condition' => array( |
| 560 | 'premium_title_icon_switcher' => 'yes', |
| 561 | ), |
| 562 | ) |
| 563 | ); |
| 564 | |
| 565 | $this->add_responsive_control( |
| 566 | 'top_icon_align', |
| 567 | array( |
| 568 | 'label' => __( 'Icon Alignment', 'premium-addons-for-elementor' ), |
| 569 | 'type' => Controls_Manager::CHOOSE, |
| 570 | 'options' => array( |
| 571 | 'flex-start' => array( |
| 572 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 573 | 'icon' => 'eicon-text-align-left', |
| 574 | ), |
| 575 | 'center' => array( |
| 576 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 577 | 'icon' => 'eicon-text-align-center', |
| 578 | ), |
| 579 | 'flex-end' => array( |
| 580 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 581 | 'icon' => 'eicon-text-align-right', |
| 582 | ), |
| 583 | ), |
| 584 | 'default' => 'center', |
| 585 | 'toggle' => false, |
| 586 | 'selectors' => array( |
| 587 | '{{WRAPPER}}.premium-title-icon-column .premium-title-header:not(.premium-title-style7)' => 'align-items: {{VALUE}}', |
| 588 | '{{WRAPPER}}.premium-title-icon-column .premium-title-style7 .premium-title-icon' => 'align-self: {{VALUE}}', |
| 589 | ), |
| 590 | 'condition' => array( |
| 591 | 'premium_title_icon_switcher' => 'yes', |
| 592 | 'icon_position' => 'column', |
| 593 | 'premium_title_style!' => array( 'style3', 'style4' ), |
| 594 | ), |
| 595 | ) |
| 596 | ); |
| 597 | |
| 598 | $this->add_control( |
| 599 | 'premium_title_tag', |
| 600 | array( |
| 601 | 'label' => __( 'HTML Tag', 'premium-addons-for-elementor' ), |
| 602 | 'type' => Controls_Manager::SELECT, |
| 603 | 'default' => 'h2', |
| 604 | 'options' => array( |
| 605 | 'h1' => 'H1', |
| 606 | 'h2' => 'H2', |
| 607 | 'h3' => 'H3', |
| 608 | 'h4' => 'H4', |
| 609 | 'h5' => 'H5', |
| 610 | 'h6' => 'H6', |
| 611 | 'div' => 'div', |
| 612 | 'span' => 'span', |
| 613 | ), |
| 614 | 'separator' => 'before', |
| 615 | ) |
| 616 | ); |
| 617 | |
| 618 | $inline_flex = array( 'style1', 'style2', 'style5', 'style6', 'style7', 'style8', 'style9' ); |
| 619 | |
| 620 | $this->add_responsive_control( |
| 621 | 'premium_title_align', |
| 622 | array( |
| 623 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 624 | 'type' => Controls_Manager::CHOOSE, |
| 625 | 'options' => array( |
| 626 | 'left' => array( |
| 627 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 628 | 'icon' => 'eicon-text-align-left', |
| 629 | ), |
| 630 | 'center' => array( |
| 631 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 632 | 'icon' => 'eicon-text-align-center', |
| 633 | ), |
| 634 | 'right' => array( |
| 635 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 636 | 'icon' => 'eicon-text-align-right', |
| 637 | ), |
| 638 | ), |
| 639 | 'default' => 'left', |
| 640 | 'toggle' => false, |
| 641 | 'selectors' => array( |
| 642 | '{{WRAPPER}} .premium-title-container' => 'text-align: {{VALUE}};', |
| 643 | ), |
| 644 | 'condition' => array( |
| 645 | 'premium_title_style' => $inline_flex, |
| 646 | ), |
| 647 | ) |
| 648 | ); |
| 649 | |
| 650 | $this->add_responsive_control( |
| 651 | 'premium_title_align_flex', |
| 652 | array( |
| 653 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 654 | 'type' => Controls_Manager::CHOOSE, |
| 655 | 'options' => array( |
| 656 | 'flex-start' => array( |
| 657 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 658 | 'icon' => 'eicon-text-align-left', |
| 659 | ), |
| 660 | 'center' => array( |
| 661 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 662 | 'icon' => 'eicon-text-align-center', |
| 663 | ), |
| 664 | 'flex-end' => array( |
| 665 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 666 | 'icon' => 'eicon-text-align-right', |
| 667 | ), |
| 668 | ), |
| 669 | 'default' => 'flex-start', |
| 670 | 'toggle' => false, |
| 671 | 'selectors' => array( |
| 672 | '{{WRAPPER}}:not(.premium-title-icon-column) .premium-title-header' => 'justify-content: {{VALUE}}', |
| 673 | '{{WRAPPER}}.premium-title-icon-column .premium-title-header' => 'align-items: {{VALUE}}', |
| 674 | ), |
| 675 | 'condition' => array( |
| 676 | 'premium_title_style' => array( 'style3', 'style4' ), |
| 677 | ), |
| 678 | ) |
| 679 | ); |
| 680 | |
| 681 | $this->add_control( |
| 682 | 'alignment_notice', |
| 683 | array( |
| 684 | 'raw' => __( 'Please note that left/right alignment is reversed when Icon Position is set to After.', 'premium-addons-for-elementor' ), |
| 685 | 'type' => Controls_Manager::RAW_HTML, |
| 686 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 687 | 'condition' => array( |
| 688 | 'premium_title_icon_switcher' => 'yes', |
| 689 | 'icon_position' => 'row-reverse', |
| 690 | 'premium_title_style' => array( 'style3', 'style4' ), |
| 691 | ), |
| 692 | ) |
| 693 | ); |
| 694 | |
| 695 | $this->add_control( |
| 696 | 'premium_title_stripe_pos', |
| 697 | array( |
| 698 | 'label' => __( 'Stripe Position', 'premium-addons-for-elementor' ), |
| 699 | 'type' => Controls_Manager::SELECT, |
| 700 | 'options' => array( |
| 701 | 'top' => __( 'Top', 'premium-addons-for-elementor' ), |
| 702 | 'bottom' => __( 'Bottom', 'premium-addons-for-elementor' ), |
| 703 | ), |
| 704 | 'selectors_dictionary' => array( |
| 705 | 'top' => 'initial', |
| 706 | 'bottom' => '2', |
| 707 | ), |
| 708 | 'default' => 'top', |
| 709 | 'label_block' => true, |
| 710 | 'separator' => 'before', |
| 711 | 'condition' => array( |
| 712 | 'premium_title_style' => 'style7', |
| 713 | ), |
| 714 | 'selectors' => array( |
| 715 | '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'order: {{VALUE}}', |
| 716 | ), |
| 717 | ) |
| 718 | ); |
| 719 | |
| 720 | $this->add_responsive_control( |
| 721 | 'premium_title_style7_strip_width', |
| 722 | array( |
| 723 | 'label' => __( 'Stripe Width (PX)', 'premium-addons-for-elementor' ), |
| 724 | 'type' => Controls_Manager::SLIDER, |
| 725 | 'size_units' => array( 'px', '%', 'em' ), |
| 726 | 'default' => array( |
| 727 | 'unit' => 'px', |
| 728 | 'size' => '120', |
| 729 | ), |
| 730 | 'selectors' => array( |
| 731 | '{{WRAPPER}} .premium-title-style7-stripe' => 'width: {{SIZE}}{{UNIT}};', |
| 732 | ), |
| 733 | 'label_block' => true, |
| 734 | 'condition' => array( |
| 735 | 'premium_title_style' => 'style7', |
| 736 | ), |
| 737 | ) |
| 738 | ); |
| 739 | |
| 740 | $this->add_responsive_control( |
| 741 | 'premium_title_style7_strip_height', |
| 742 | array( |
| 743 | 'label' => __( 'Stripe Height (PX)', 'premium-addons-for-elementor' ), |
| 744 | 'type' => Controls_Manager::SLIDER, |
| 745 | 'size_units' => array( 'px', 'em' ), |
| 746 | 'default' => array( |
| 747 | 'unit' => 'px', |
| 748 | 'size' => '5', |
| 749 | ), |
| 750 | 'label_block' => true, |
| 751 | 'selectors' => array( |
| 752 | '{{WRAPPER}} .premium-title-style7-stripe' => 'height: {{SIZE}}{{UNIT}};', |
| 753 | ), |
| 754 | 'condition' => array( |
| 755 | 'premium_title_style' => 'style7', |
| 756 | ), |
| 757 | ) |
| 758 | ); |
| 759 | |
| 760 | $this->add_responsive_control( |
| 761 | 'premium_title_style7_strip_top_spacing', |
| 762 | array( |
| 763 | 'label' => __( 'Stripe Top Spacing (PX)', 'premium-addons-for-elementor' ), |
| 764 | 'type' => Controls_Manager::SLIDER, |
| 765 | 'size_units' => array( 'px', '%', 'em' ), |
| 766 | 'selectors' => array( |
| 767 | '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'margin-top: {{SIZE}}{{UNIT}};', |
| 768 | ), |
| 769 | 'label_block' => true, |
| 770 | 'condition' => array( |
| 771 | 'premium_title_style' => 'style7', |
| 772 | ), |
| 773 | ) |
| 774 | ); |
| 775 | |
| 776 | $this->add_responsive_control( |
| 777 | 'premium_title_style7_strip_bottom_spacing', |
| 778 | array( |
| 779 | 'label' => __( 'Stripe Bottom Spacing (PX)', 'premium-addons-for-elementor' ), |
| 780 | 'type' => Controls_Manager::SLIDER, |
| 781 | 'size_units' => array( 'px', '%', 'em' ), |
| 782 | 'label_block' => true, |
| 783 | 'selectors' => array( |
| 784 | '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 785 | ), |
| 786 | 'condition' => array( |
| 787 | 'premium_title_style' => 'style7', |
| 788 | ), |
| 789 | ) |
| 790 | ); |
| 791 | |
| 792 | $this->add_responsive_control( |
| 793 | 'premium_title_style7_strip_align', |
| 794 | array( |
| 795 | 'label' => __( 'Stripe Alignment', 'premium-addons-for-elementor' ), |
| 796 | 'type' => Controls_Manager::CHOOSE, |
| 797 | 'options' => array( |
| 798 | 'flex-start' => array( |
| 799 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 800 | 'icon' => 'eicon-text-align-left', |
| 801 | ), |
| 802 | 'center' => array( |
| 803 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 804 | 'icon' => 'eicon-text-align-center', |
| 805 | ), |
| 806 | 'flex-end' => array( |
| 807 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 808 | 'icon' => 'eicon-text-align-right', |
| 809 | ), |
| 810 | ), |
| 811 | 'toggle' => false, |
| 812 | 'default' => 'center', |
| 813 | 'selectors' => array( |
| 814 | '{{WRAPPER}}:not(.premium-title-icon-column) .premium-title-style7-stripe-wrap' => 'justify-content: {{VALUE}}', |
| 815 | '{{WRAPPER}}.premium-title-icon-column .premium-title-style7-stripe-wrap' => 'align-self: {{VALUE}}', |
| 816 | ), |
| 817 | 'condition' => array( |
| 818 | 'premium_title_style' => 'style7', |
| 819 | ), |
| 820 | ) |
| 821 | ); |
| 822 | |
| 823 | $this->add_control( |
| 824 | 'link_switcher', |
| 825 | array( |
| 826 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 827 | 'type' => Controls_Manager::SWITCHER, |
| 828 | ) |
| 829 | ); |
| 830 | |
| 831 | $this->add_control( |
| 832 | 'link_selection', |
| 833 | array( |
| 834 | 'label' => __( 'Link Type', 'premium-addons-for-elementor' ), |
| 835 | 'type' => Controls_Manager::SELECT, |
| 836 | 'options' => array( |
| 837 | 'url' => __( 'URL', 'premium-addons-for-elementor' ), |
| 838 | 'link' => __( 'Existing Page', 'premium-addons-for-elementor' ), |
| 839 | ), |
| 840 | 'default' => 'url', |
| 841 | 'label_block' => true, |
| 842 | 'condition' => array( |
| 843 | 'link_switcher' => 'yes', |
| 844 | ), |
| 845 | ) |
| 846 | ); |
| 847 | |
| 848 | $this->add_control( |
| 849 | 'custom_link', |
| 850 | array( |
| 851 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 852 | 'type' => Controls_Manager::URL, |
| 853 | 'dynamic' => array( 'active' => true ), |
| 854 | 'default' => array( |
| 855 | 'url' => '#', |
| 856 | ), |
| 857 | 'placeholder' => 'https://premiumaddons.com/', |
| 858 | 'label_block' => true, |
| 859 | 'separator' => 'after', |
| 860 | 'condition' => array( |
| 861 | 'link_switcher' => 'yes', |
| 862 | 'link_selection' => 'url', |
| 863 | ), |
| 864 | ) |
| 865 | ); |
| 866 | |
| 867 | $this->add_control( |
| 868 | 'existing_link', |
| 869 | array( |
| 870 | 'label' => __( 'Existing Page', 'premium-addons-for-elementor' ), |
| 871 | 'type' => Controls_Manager::SELECT2, |
| 872 | 'options' => $this->getTemplateInstance()->get_all_posts(), |
| 873 | 'condition' => array( |
| 874 | 'link_switcher' => 'yes', |
| 875 | 'link_selection' => 'link', |
| 876 | ), |
| 877 | 'multiple' => false, |
| 878 | 'label_block' => true, |
| 879 | ) |
| 880 | ); |
| 881 | |
| 882 | $this->add_control( |
| 883 | 'background_text_switcher', |
| 884 | array( |
| 885 | 'label' => __( 'Background Text', 'premium-addons-for-elementor' ), |
| 886 | 'type' => Controls_Manager::SWITCHER, |
| 887 | ) |
| 888 | ); |
| 889 | |
| 890 | $this->add_control( |
| 891 | 'background_text', |
| 892 | array( |
| 893 | 'label' => __( 'Text', 'premium-addons-for-elementor' ), |
| 894 | 'type' => Controls_Manager::TEXT, |
| 895 | 'default' => __( 'Awesome Title', 'premium-addons-for-elementor' ), |
| 896 | 'condition' => array( |
| 897 | 'background_text_switcher' => 'yes', |
| 898 | ), |
| 899 | ) |
| 900 | ); |
| 901 | |
| 902 | $this->add_control( |
| 903 | 'background_text_width', |
| 904 | array( |
| 905 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 906 | 'type' => Controls_Manager::SELECT, |
| 907 | 'options' => array( |
| 908 | 'auto' => __( 'Auto', 'premium-addons-for-elementor' ), |
| 909 | '100%' => __( 'Full Width', 'premium-addons-for-elementor' ), |
| 910 | ), |
| 911 | 'default' => 'auto', |
| 912 | 'label_block' => true, |
| 913 | 'selectors' => array( |
| 914 | '{{WRAPPER}} .premium-title-bg-text:before' => 'width: {{VALUE}}', |
| 915 | ), |
| 916 | 'condition' => array( |
| 917 | 'background_text_switcher' => 'yes', |
| 918 | ), |
| 919 | ) |
| 920 | ); |
| 921 | |
| 922 | $this->add_responsive_control( |
| 923 | 'background_text_left', |
| 924 | array( |
| 925 | 'label' => __( 'Horizontal Offset', 'premium-addons-for-elementor' ), |
| 926 | 'type' => Controls_Manager::SLIDER, |
| 927 | 'size_units' => array( 'px', 'em', '%' ), |
| 928 | 'range' => array( |
| 929 | 'px' => array( |
| 930 | 'min' => -500, |
| 931 | 'max' => 500, |
| 932 | ), |
| 933 | 'em' => array( |
| 934 | 'min' => -50, |
| 935 | 'max' => 50, |
| 936 | ), |
| 937 | '%' => array( |
| 938 | 'min' => -100, |
| 939 | 'max' => 100, |
| 940 | ), |
| 941 | ), |
| 942 | 'selectors' => array( |
| 943 | '{{WRAPPER}} .premium-title-bg-text:before' => 'left: {{SIZE}}{{UNIT}}', |
| 944 | ), |
| 945 | 'condition' => array( |
| 946 | 'background_text_switcher' => 'yes', |
| 947 | ), |
| 948 | ) |
| 949 | ); |
| 950 | |
| 951 | $this->add_responsive_control( |
| 952 | 'background_text_top', |
| 953 | array( |
| 954 | 'label' => __( 'Vertical Offset', 'premium-addons-for-elementor' ), |
| 955 | 'type' => Controls_Manager::SLIDER, |
| 956 | 'size_units' => array( 'px', 'em', '%' ), |
| 957 | 'range' => array( |
| 958 | 'px' => array( |
| 959 | 'min' => -500, |
| 960 | 'max' => 500, |
| 961 | ), |
| 962 | 'em' => array( |
| 963 | 'min' => -50, |
| 964 | 'max' => 50, |
| 965 | ), |
| 966 | '%' => array( |
| 967 | 'min' => -100, |
| 968 | 'max' => 100, |
| 969 | ), |
| 970 | ), |
| 971 | 'selectors' => array( |
| 972 | '{{WRAPPER}} .premium-title-bg-text:before' => 'top: {{SIZE}}{{UNIT}}', |
| 973 | ), |
| 974 | 'condition' => array( |
| 975 | 'background_text_switcher' => 'yes', |
| 976 | ), |
| 977 | ) |
| 978 | ); |
| 979 | |
| 980 | $this->add_responsive_control( |
| 981 | 'background_text_rotate', |
| 982 | array( |
| 983 | 'label' => __( 'Rotate (degrees)', 'premium-addons-for-elementor' ), |
| 984 | 'type' => Controls_Manager::SLIDER, |
| 985 | 'size_units' => array( 'deg' ), |
| 986 | 'default' => array( |
| 987 | 'unit' => 'deg', |
| 988 | 'size' => 0, |
| 989 | ), |
| 990 | 'selectors' => array( |
| 991 | '{{WRAPPER}} .premium-title-bg-text:before' => 'transform: rotate({{SIZE}}{{UNIT}})', |
| 992 | ), |
| 993 | 'condition' => array( |
| 994 | 'background_text_switcher' => 'yes', |
| 995 | ), |
| 996 | ) |
| 997 | ); |
| 998 | |
| 999 | $this->add_control( |
| 1000 | 'mask_switcher', |
| 1001 | array( |
| 1002 | 'label' => __( 'Minimal Mask Effect', 'premium-addons-for-elementor' ), |
| 1003 | 'type' => Controls_Manager::SWITCHER, |
| 1004 | 'description' => __( 'Note: This effect takes place once the element is in the viewport', 'premium-addons-for-elementor' ), |
| 1005 | 'render_type' => 'template', |
| 1006 | 'prefix_class' => 'premium-mask-', |
| 1007 | 'condition' => array( |
| 1008 | 'premium_title_style!' => 'style9', |
| 1009 | ), |
| 1010 | ) |
| 1011 | ); |
| 1012 | |
| 1013 | $this->add_control( |
| 1014 | 'mask_title_color', |
| 1015 | array( |
| 1016 | 'label' => __( 'Mask Color', 'premium-addons-for-elementor' ), |
| 1017 | 'type' => Controls_Manager::COLOR, |
| 1018 | 'render_type' => 'template', |
| 1019 | 'selectors' => array( |
| 1020 | '{{WRAPPER}}.premium-mask-yes .premium-mask-span::after' => 'background: {{VALUE}};', |
| 1021 | ), |
| 1022 | 'condition' => array( |
| 1023 | 'mask_switcher' => 'yes', |
| 1024 | 'premium_title_style!' => 'style9', |
| 1025 | ), |
| 1026 | ) |
| 1027 | ); |
| 1028 | |
| 1029 | $this->add_control( |
| 1030 | 'mask_title_dir', |
| 1031 | array( |
| 1032 | 'label' => __( 'Direction', 'premium-addons-for-elementor' ), |
| 1033 | 'type' => Controls_Manager::SELECT, |
| 1034 | 'default' => 'tr', |
| 1035 | 'prefix_class' => 'premium-mask-', |
| 1036 | 'render_type' => 'template', |
| 1037 | 'options' => array( |
| 1038 | 'tr' => __( 'To Right', 'premium-addons-for-elementor' ), |
| 1039 | 'tl' => __( 'To Left', 'premium-addons-for-elementor' ), |
| 1040 | 'tt' => __( 'To Top', 'premium-addons-for-elementor' ), |
| 1041 | 'tb' => __( 'To Bottom', 'premium-addons-for-elementor' ), |
| 1042 | ), |
| 1043 | 'condition' => array( |
| 1044 | 'mask_switcher' => 'yes', |
| 1045 | 'premium_title_style!' => 'style9', |
| 1046 | ), |
| 1047 | ) |
| 1048 | ); |
| 1049 | |
| 1050 | $this->add_responsive_control( |
| 1051 | 'mask_title_padding', |
| 1052 | array( |
| 1053 | 'label' => __( 'Words Padding', 'premium-addons-for-elementor' ), |
| 1054 | 'type' => Controls_Manager::DIMENSIONS, |
| 1055 | 'size_units' => array( 'px', 'em', '%' ), |
| 1056 | 'selectors' => array( |
| 1057 | '{{WRAPPER}} .premium-mask-span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1058 | ), |
| 1059 | 'condition' => array( |
| 1060 | 'mask_switcher' => 'yes', |
| 1061 | 'premium_title_style!' => 'style9', |
| 1062 | ), |
| 1063 | ) |
| 1064 | ); |
| 1065 | |
| 1066 | $this->add_control( |
| 1067 | 'gradient_text_switcher', |
| 1068 | array( |
| 1069 | 'label' => __( 'Animated Gradient', 'premium-addons-for-elementor' ), |
| 1070 | 'type' => Controls_Manager::SWITCHER, |
| 1071 | 'prefix_class' => 'premium-title-gradient-', |
| 1072 | 'separator' => 'before', |
| 1073 | 'condition' => array( |
| 1074 | 'premium_title_style!' => array( 'style8', 'style9' ), |
| 1075 | 'mask_switcher!' => 'yes', |
| 1076 | 'stroke_switcher!' => 'yes', |
| 1077 | 'background_style' => 'color', |
| 1078 | ), |
| 1079 | ) |
| 1080 | ); |
| 1081 | |
| 1082 | $this->add_control( |
| 1083 | 'animation_transition_speed', |
| 1084 | array( |
| 1085 | 'label' => __( 'Animation Speed (sec)', 'premium-addons-for-elementor' ), |
| 1086 | 'type' => Controls_Manager::SLIDER, |
| 1087 | 'range' => array( |
| 1088 | 'px' => array( |
| 1089 | 'min' => 0, |
| 1090 | 'max' => 10, |
| 1091 | 'step' => .1, |
| 1092 | ), |
| 1093 | ), |
| 1094 | 'selectors' => array( |
| 1095 | '{{WRAPPER}}.premium-title-gradient-yes .premium-title-text ,{{WRAPPER}}.premium-title-gradient-yes .premium-title-icon' => 'animation-duration: {{SIZE}}s ', |
| 1096 | ), |
| 1097 | 'condition' => array( |
| 1098 | 'gradient_text_switcher' => 'yes', |
| 1099 | 'premium_title_style!' => array( 'style8', 'style9' ), |
| 1100 | 'mask_switcher!' => 'yes', |
| 1101 | 'stroke_switcher!' => 'yes', |
| 1102 | 'background_style' => 'color', |
| 1103 | ), |
| 1104 | ) |
| 1105 | ); |
| 1106 | |
| 1107 | $this->add_group_control( |
| 1108 | Group_Control_Background::get_type(), |
| 1109 | array( |
| 1110 | 'name' => 'text_gradient', |
| 1111 | 'types' => array( 'gradient' ), |
| 1112 | 'selector' => '{{WRAPPER}}.premium-title-gradient-yes .premium-title-text, {{WRAPPER}}.premium-title-gradient-yes .premium-title-icon', |
| 1113 | 'condition' => array( |
| 1114 | 'gradient_text_switcher' => 'yes', |
| 1115 | 'premium_title_style!' => array( 'style8', 'style9' ), |
| 1116 | 'mask_switcher!' => 'yes', |
| 1117 | 'stroke_switcher!' => 'yes', |
| 1118 | 'background_style' => 'color', |
| 1119 | ), |
| 1120 | ) |
| 1121 | ); |
| 1122 | |
| 1123 | $this->end_controls_section(); |
| 1124 | |
| 1125 | $this->start_controls_section( |
| 1126 | 'premium_title_style_section', |
| 1127 | array( |
| 1128 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 1129 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1130 | ) |
| 1131 | ); |
| 1132 | |
| 1133 | $this->add_control( |
| 1134 | 'premium_title_color', |
| 1135 | array( |
| 1136 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1137 | 'type' => Controls_Manager::COLOR, |
| 1138 | 'global' => array( |
| 1139 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1140 | ), |
| 1141 | 'selectors' => array( |
| 1142 | '{{WRAPPER}} .premium-title-header' => 'color: {{VALUE}}', |
| 1143 | '{{WRAPPER}}.premium-title-stroke-yes .premium-title-text' => '-webkit-text-fill-color: {{VALUE}}', |
| 1144 | '{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--base-color: {{VALUE}}', |
| 1145 | ), |
| 1146 | ) |
| 1147 | ); |
| 1148 | |
| 1149 | $this->add_control( |
| 1150 | 'premium_title_blur_color', |
| 1151 | array( |
| 1152 | 'label' => __( 'Blur Color', 'booster-addons' ), |
| 1153 | 'type' => Controls_Manager::COLOR, |
| 1154 | 'default' => '#000', |
| 1155 | 'selectors' => array( '{{WRAPPER}} .premium-title-header' => '--shadow-color: {{VALUE}};' ), |
| 1156 | 'condition' => array( |
| 1157 | 'premium_title_style' => 'style9', |
| 1158 | ), |
| 1159 | ) |
| 1160 | ); |
| 1161 | |
| 1162 | $this->add_control( |
| 1163 | 'shining_shiny_color_title', |
| 1164 | array( |
| 1165 | 'label' => __( 'Shiny Color', 'premium-addons-for-elementor' ), |
| 1166 | 'type' => Controls_Manager::COLOR, |
| 1167 | 'default' => '#fff', |
| 1168 | 'condition' => array( |
| 1169 | 'premium_title_style' => 'style8', |
| 1170 | ), |
| 1171 | 'selectors' => array( '{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--shiny-color: {{VALUE}}' ), |
| 1172 | ) |
| 1173 | ); |
| 1174 | |
| 1175 | $this->add_group_control( |
| 1176 | Group_Control_Typography::get_type(), |
| 1177 | array( |
| 1178 | 'name' => 'title_typography', |
| 1179 | 'global' => array( |
| 1180 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1181 | ), |
| 1182 | 'selector' => '{{WRAPPER}} .premium-title-header', |
| 1183 | ) |
| 1184 | ); |
| 1185 | |
| 1186 | $this->add_group_control( |
| 1187 | Group_Control_Border::get_type(), |
| 1188 | array( |
| 1189 | 'name' => 'style_one_border', |
| 1190 | 'fields_options' => array( |
| 1191 | 'border' => array( |
| 1192 | 'default' => 'solid', |
| 1193 | ), |
| 1194 | ), |
| 1195 | 'selector' => '{{WRAPPER}} .premium-title-style1', |
| 1196 | 'condition' => array( |
| 1197 | 'premium_title_style' => 'style1', |
| 1198 | ), |
| 1199 | ) |
| 1200 | ); |
| 1201 | |
| 1202 | $this->add_control( |
| 1203 | 'background_style', |
| 1204 | array( |
| 1205 | 'label' => __( 'Background Style', 'premium-addons-for-elementor' ), |
| 1206 | 'type' => Controls_Manager::SELECT, |
| 1207 | 'description' => __( 'Choose ‘Normal’ to add a background behind the text and ‘Clipped’ so the background will be clipped on the text.', 'premium-addons-for-elementor' ), |
| 1208 | 'options' => array( |
| 1209 | 'color' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 1210 | 'clipped' => __( 'Clipped', 'premium-addons-for-elementor' ), |
| 1211 | ), |
| 1212 | 'prefix_class' => 'premium-title-', |
| 1213 | 'label_block' => true, |
| 1214 | 'separator' => 'before', |
| 1215 | 'condition' => array( |
| 1216 | 'premium_title_style!' => array( 'style8', 'style9' ), |
| 1217 | ), |
| 1218 | ) |
| 1219 | ); |
| 1220 | |
| 1221 | $this->add_group_control( |
| 1222 | Group_Control_Background::get_type(), |
| 1223 | array( |
| 1224 | 'name' => 'title_background', |
| 1225 | 'types' => array( 'classic', 'gradient' ), |
| 1226 | 'condition' => array( |
| 1227 | 'premium_title_style!' => array( 'style8', 'style9' ), |
| 1228 | 'background_style!' => '', |
| 1229 | ), |
| 1230 | 'selector' => '{{WRAPPER}} .premium-title-header', |
| 1231 | ) |
| 1232 | ); |
| 1233 | |
| 1234 | $this->add_control( |
| 1235 | 'premium_title_style2_background_color', |
| 1236 | array( |
| 1237 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1238 | 'type' => Controls_Manager::COLOR, |
| 1239 | 'global' => array( |
| 1240 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1241 | ), |
| 1242 | 'selectors' => array( |
| 1243 | '{{WRAPPER}} .premium-title-style2' => 'background-color: {{VALUE}};', |
| 1244 | ), |
| 1245 | 'condition' => array( |
| 1246 | 'premium_title_style' => 'style2', |
| 1247 | 'background_style' => '', |
| 1248 | ), |
| 1249 | ) |
| 1250 | ); |
| 1251 | |
| 1252 | $this->add_control( |
| 1253 | 'premium_title_style3_background_color', |
| 1254 | array( |
| 1255 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1256 | 'type' => Controls_Manager::COLOR, |
| 1257 | 'global' => array( |
| 1258 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1259 | ), |
| 1260 | 'selectors' => array( |
| 1261 | '{{WRAPPER}} .premium-title-style3' => 'background-color: {{VALUE}};', |
| 1262 | ), |
| 1263 | 'condition' => array( |
| 1264 | 'premium_title_style' => 'style3', |
| 1265 | 'background_style' => '', |
| 1266 | ), |
| 1267 | ) |
| 1268 | ); |
| 1269 | |
| 1270 | $this->add_control( |
| 1271 | 'premium_title_style5_header_line_color', |
| 1272 | array( |
| 1273 | 'label' => __( 'Line Color', 'premium-addons-for-elementor' ), |
| 1274 | 'type' => Controls_Manager::COLOR, |
| 1275 | 'global' => array( |
| 1276 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1277 | ), |
| 1278 | 'selectors' => array( |
| 1279 | '{{WRAPPER}} .premium-title-style5' => 'border-bottom: 2px solid {{VALUE}};', |
| 1280 | ), |
| 1281 | 'condition' => array( |
| 1282 | 'premium_title_style' => 'style5', |
| 1283 | ), |
| 1284 | ) |
| 1285 | ); |
| 1286 | |
| 1287 | $this->add_group_control( |
| 1288 | Group_Control_Border::get_type(), |
| 1289 | array( |
| 1290 | 'name' => 'style_five_border', |
| 1291 | 'selector' => '{{WRAPPER}} .premium-title-container', |
| 1292 | 'condition' => array( |
| 1293 | 'premium_title_style' => array( 'style2', 'style4', 'style5', 'style6' ), |
| 1294 | ), |
| 1295 | ) |
| 1296 | ); |
| 1297 | |
| 1298 | $this->add_control( |
| 1299 | 'premium_title_style6_header_line_color', |
| 1300 | array( |
| 1301 | 'label' => __( 'Line Color', 'premium-addons-for-elementor' ), |
| 1302 | 'type' => Controls_Manager::COLOR, |
| 1303 | 'global' => array( |
| 1304 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1305 | ), |
| 1306 | 'selectors' => array( |
| 1307 | '{{WRAPPER}} .premium-title-style6' => 'border-bottom: 2px solid {{VALUE}};', |
| 1308 | ), |
| 1309 | 'condition' => array( |
| 1310 | 'premium_title_style' => 'style6', |
| 1311 | ), |
| 1312 | ) |
| 1313 | ); |
| 1314 | |
| 1315 | $this->add_control( |
| 1316 | 'premium_title_style6_triangle_color', |
| 1317 | array( |
| 1318 | 'label' => __( 'Triangle Color', 'premium-addons-for-elementor' ), |
| 1319 | 'type' => Controls_Manager::COLOR, |
| 1320 | 'global' => array( |
| 1321 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1322 | ), |
| 1323 | 'selectors' => array( |
| 1324 | '{{WRAPPER}} .premium-title-style6:before' => 'border-bottom-color: {{VALUE}};', |
| 1325 | ), |
| 1326 | 'condition' => array( |
| 1327 | 'premium_title_style' => 'style6', |
| 1328 | ), |
| 1329 | ) |
| 1330 | ); |
| 1331 | |
| 1332 | $this->add_control( |
| 1333 | 'premium_title_style7_strip_color', |
| 1334 | array( |
| 1335 | 'label' => __( 'Stripe Color', 'premium-addons-for-elementor' ), |
| 1336 | 'type' => Controls_Manager::COLOR, |
| 1337 | 'global' => array( |
| 1338 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1339 | ), |
| 1340 | 'selectors' => array( |
| 1341 | '{{WRAPPER}} .premium-title-style7-stripe' => 'background-color: {{VALUE}};', |
| 1342 | ), |
| 1343 | 'condition' => array( |
| 1344 | 'premium_title_style' => 'style7', |
| 1345 | ), |
| 1346 | ) |
| 1347 | ); |
| 1348 | |
| 1349 | $this->add_group_control( |
| 1350 | Group_Control_Text_Shadow::get_type(), |
| 1351 | array( |
| 1352 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 1353 | 'name' => 'premium_title_text_shadow', |
| 1354 | 'selector' => '{{WRAPPER}} .premium-title-header', |
| 1355 | ) |
| 1356 | ); |
| 1357 | |
| 1358 | $this->add_control( |
| 1359 | 'premium_title_shadow_value', |
| 1360 | array( |
| 1361 | 'label' => esc_html__( 'Blur Shadow Value (px)', 'booster-addons' ), |
| 1362 | 'type' => Controls_Manager::NUMBER, |
| 1363 | 'min' => '10', |
| 1364 | 'max' => '500', |
| 1365 | 'step' => '10', |
| 1366 | 'dynamic' => array( 'active' => true ), |
| 1367 | 'selectors' => array( '{{WRAPPER}} .premium-title-header' => '--shadow-value: {{VALUE}}px;' ), |
| 1368 | 'default' => '120', |
| 1369 | 'condition' => array( |
| 1370 | 'premium_title_style' => 'style9', |
| 1371 | ), |
| 1372 | ) |
| 1373 | ); |
| 1374 | |
| 1375 | $this->add_control( |
| 1376 | 'premium_title_delay', |
| 1377 | array( |
| 1378 | 'label' => esc_html__( 'Animation Delay (s)', 'premium-addons-for-elementor' ), |
| 1379 | 'type' => Controls_Manager::NUMBER, |
| 1380 | 'min' => '1', |
| 1381 | 'max' => '30', |
| 1382 | 'step' => 0.5, |
| 1383 | 'condition' => array( |
| 1384 | 'premium_title_style' => array( 'style8', 'style9' ), |
| 1385 | ), |
| 1386 | 'render_type' => 'template', |
| 1387 | 'dynamic' => array( 'active' => true ), |
| 1388 | 'default' => '2', |
| 1389 | ) |
| 1390 | ); |
| 1391 | |
| 1392 | $this->add_control( |
| 1393 | 'shining_animation_duration', |
| 1394 | array( |
| 1395 | 'label' => __( 'Animation Duration (s)', 'premium-addons-for-elementor' ), |
| 1396 | 'type' => Controls_Manager::NUMBER, |
| 1397 | 'default' => '1', |
| 1398 | 'step' => 0.5, |
| 1399 | 'condition' => array( |
| 1400 | 'premium_title_style' => 'style8', |
| 1401 | ), |
| 1402 | 'frontend_available' => true, |
| 1403 | 'render_type' => 'template', |
| 1404 | 'selectors' => array( |
| 1405 | '{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--animation-speed: {{VALUE}}s ', |
| 1406 | ), |
| 1407 | ) |
| 1408 | ); |
| 1409 | |
| 1410 | $this->add_responsive_control( |
| 1411 | 'premium_title_margin', |
| 1412 | array( |
| 1413 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1414 | 'type' => Controls_Manager::DIMENSIONS, |
| 1415 | 'size_units' => array( 'px', 'em', '%' ), |
| 1416 | 'selectors' => array( |
| 1417 | '{{WRAPPER}} .premium-title-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1418 | ), |
| 1419 | ) |
| 1420 | ); |
| 1421 | |
| 1422 | $this->add_responsive_control( |
| 1423 | 'premium_title_padding', |
| 1424 | array( |
| 1425 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1426 | 'type' => Controls_Manager::DIMENSIONS, |
| 1427 | 'size_units' => array( 'px', 'em', '%' ), |
| 1428 | 'selectors' => array( |
| 1429 | '{{WRAPPER}} .premium-title-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1430 | ), |
| 1431 | ) |
| 1432 | ); |
| 1433 | |
| 1434 | $this->add_control( |
| 1435 | 'stroke_switcher', |
| 1436 | array( |
| 1437 | 'label' => __( 'Stroke', 'premium-addons-for-elementor' ), |
| 1438 | 'type' => Controls_Manager::SWITCHER, |
| 1439 | 'prefix_class' => 'premium-title-stroke-', |
| 1440 | 'condition' => array( |
| 1441 | 'premium_title_style!' => 'style9', |
| 1442 | 'background_style' => 'color', |
| 1443 | ), |
| 1444 | ) |
| 1445 | ); |
| 1446 | |
| 1447 | $this->add_control( |
| 1448 | 'stroke_text_color', |
| 1449 | array( |
| 1450 | 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), |
| 1451 | 'type' => Controls_Manager::COLOR, |
| 1452 | 'condition' => array( |
| 1453 | 'stroke_switcher' => 'yes', |
| 1454 | 'background_style' => 'color', |
| 1455 | 'premium_title_style!' => 'style9', |
| 1456 | ), |
| 1457 | 'selectors' => array( |
| 1458 | '{{WRAPPER}} .premium-title-text' => '-webkit-text-stroke-color: {{VALUE}};', |
| 1459 | ), |
| 1460 | ) |
| 1461 | ); |
| 1462 | |
| 1463 | $this->add_responsive_control( |
| 1464 | 'stroke_width', |
| 1465 | array( |
| 1466 | 'label' => __( 'Stroke Fill Width', 'premium-addons-for-elementor' ), |
| 1467 | 'type' => Controls_Manager::SLIDER, |
| 1468 | 'condition' => array( |
| 1469 | 'stroke_switcher' => 'yes', |
| 1470 | 'background_style' => 'color', |
| 1471 | 'premium_title_style!' => 'style9', |
| 1472 | ), |
| 1473 | 'default' => array( |
| 1474 | 'size' => 1, |
| 1475 | 'unit' => 'px', |
| 1476 | ), |
| 1477 | 'selectors' => array( |
| 1478 | '{{WRAPPER}} .premium-title-text' => '-webkit-text-stroke-width: {{SIZE}}px', |
| 1479 | ), |
| 1480 | ) |
| 1481 | ); |
| 1482 | |
| 1483 | $this->end_controls_section(); |
| 1484 | |
| 1485 | $this->start_controls_section( |
| 1486 | 'premium_title_icon_style_section', |
| 1487 | array( |
| 1488 | 'label' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 1489 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1490 | 'condition' => array( |
| 1491 | 'premium_title_icon_switcher' => 'yes', |
| 1492 | ), |
| 1493 | ) |
| 1494 | ); |
| 1495 | |
| 1496 | $this->add_control( |
| 1497 | 'premium_title_icon_color', |
| 1498 | array( |
| 1499 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1500 | 'type' => Controls_Manager::COLOR, |
| 1501 | 'global' => array( |
| 1502 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1503 | ), |
| 1504 | 'selectors' => array( |
| 1505 | '{{WRAPPER}} .premium-title-icon' => 'color: {{VALUE}}', |
| 1506 | '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} svg:not([class*="premium-"])' => 'fill: {{VALUE}};', |
| 1507 | ), |
| 1508 | 'condition' => array( |
| 1509 | 'icon_type' => array( 'icon', 'svg' ), |
| 1510 | ), |
| 1511 | ) |
| 1512 | ); |
| 1513 | |
| 1514 | if ( $draw_icon ) { |
| 1515 | $this->add_control( |
| 1516 | 'stroke_color', |
| 1517 | array( |
| 1518 | 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), |
| 1519 | 'type' => Controls_Manager::COLOR, |
| 1520 | 'global' => array( |
| 1521 | 'default' => Global_Colors::COLOR_ACCENT, |
| 1522 | ), |
| 1523 | 'condition' => array( |
| 1524 | 'icon_type' => array( 'icon', 'svg' ), |
| 1525 | ), |
| 1526 | 'selectors' => array( |
| 1527 | '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} svg:not([class*="premium-"])' => 'stroke: {{VALUE}};', |
| 1528 | ), |
| 1529 | ) |
| 1530 | ); |
| 1531 | |
| 1532 | $this->add_control( |
| 1533 | 'svg_color', |
| 1534 | array( |
| 1535 | 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ), |
| 1536 | 'type' => Controls_Manager::COLOR, |
| 1537 | 'global' => false, |
| 1538 | 'separator' => 'after', |
| 1539 | 'condition' => array( |
| 1540 | 'icon_type' => array( 'icon', 'svg' ), |
| 1541 | 'draw_svg' => 'yes', |
| 1542 | ), |
| 1543 | ) |
| 1544 | ); |
| 1545 | } |
| 1546 | |
| 1547 | $this->add_responsive_control( |
| 1548 | 'premium_title_icon_size', |
| 1549 | array( |
| 1550 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1551 | 'type' => Controls_Manager::SLIDER, |
| 1552 | 'size_units' => array( 'px', 'em', '%' ), |
| 1553 | 'range' => array( |
| 1554 | 'px' => array( |
| 1555 | 'min' => 10, |
| 1556 | 'max' => 300, |
| 1557 | ), |
| 1558 | 'em' => array( |
| 1559 | 'min' => 1, |
| 1560 | 'max' => 30, |
| 1561 | ), |
| 1562 | ), |
| 1563 | 'condition' => array( |
| 1564 | 'icon_type!' => 'svg', |
| 1565 | ), |
| 1566 | 'selectors' => array( |
| 1567 | '{{WRAPPER}} .premium-title-header i' => 'font-size: {{SIZE}}{{UNIT}}', |
| 1568 | '{{WRAPPER}} .premium-title-header svg, {{WRAPPER}} .premium-title-header img' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important', |
| 1569 | ), |
| 1570 | ) |
| 1571 | ); |
| 1572 | |
| 1573 | $this->add_responsive_control( |
| 1574 | 'svg_icon_width', |
| 1575 | array( |
| 1576 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 1577 | 'type' => Controls_Manager::SLIDER, |
| 1578 | 'size_units' => array( 'px', 'em', '%' ), |
| 1579 | 'range' => array( |
| 1580 | 'px' => array( |
| 1581 | 'min' => 1, |
| 1582 | 'max' => 600, |
| 1583 | ), |
| 1584 | 'em' => array( |
| 1585 | 'min' => 1, |
| 1586 | 'max' => 30, |
| 1587 | ), |
| 1588 | ), |
| 1589 | 'default' => array( |
| 1590 | 'size' => 100, |
| 1591 | 'unit' => 'px', |
| 1592 | ), |
| 1593 | 'condition' => array( |
| 1594 | 'icon_type' => 'svg', |
| 1595 | ), |
| 1596 | 'selectors' => array( |
| 1597 | '{{WRAPPER}} .premium-title-header svg' => 'width: {{SIZE}}{{UNIT}};', |
| 1598 | ), |
| 1599 | ) |
| 1600 | ); |
| 1601 | |
| 1602 | $this->add_responsive_control( |
| 1603 | 'svg_icon_height', |
| 1604 | array( |
| 1605 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 1606 | 'type' => Controls_Manager::SLIDER, |
| 1607 | 'size_units' => array( 'px', 'em' ), |
| 1608 | 'range' => array( |
| 1609 | 'px' => array( |
| 1610 | 'min' => 1, |
| 1611 | 'max' => 300, |
| 1612 | ), |
| 1613 | 'em' => array( |
| 1614 | 'min' => 1, |
| 1615 | 'max' => 30, |
| 1616 | ), |
| 1617 | ), |
| 1618 | 'condition' => array( |
| 1619 | 'icon_type' => 'svg', |
| 1620 | ), |
| 1621 | 'selectors' => array( |
| 1622 | '{{WRAPPER}} .premium-title-header svg' => 'height: {{SIZE}}{{UNIT}}', |
| 1623 | ), |
| 1624 | ) |
| 1625 | ); |
| 1626 | |
| 1627 | $this->add_group_control( |
| 1628 | Group_Control_Background::get_type(), |
| 1629 | array( |
| 1630 | 'name' => 'premium_title_icon_background', |
| 1631 | 'types' => array( 'classic', 'gradient' ), |
| 1632 | 'selector' => '{{WRAPPER}} .premium-title-icon', |
| 1633 | ) |
| 1634 | ); |
| 1635 | |
| 1636 | $this->add_group_control( |
| 1637 | Group_Control_Border::get_type(), |
| 1638 | array( |
| 1639 | 'name' => 'premium_title_icon_border', |
| 1640 | 'selector' => '{{WRAPPER}} .premium-title-icon', |
| 1641 | ) |
| 1642 | ); |
| 1643 | |
| 1644 | $this->add_control( |
| 1645 | 'premium_title_icon_border_radius', |
| 1646 | array( |
| 1647 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1648 | 'type' => Controls_Manager::SLIDER, |
| 1649 | 'size_units' => array( 'px', '%', 'em' ), |
| 1650 | 'selectors' => array( |
| 1651 | '{{WRAPPER}} .premium-title-icon' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1652 | ), |
| 1653 | 'condition' => array( |
| 1654 | 'icon_adv_radius!' => 'yes', |
| 1655 | ), |
| 1656 | ) |
| 1657 | ); |
| 1658 | |
| 1659 | $this->add_control( |
| 1660 | 'icon_adv_radius', |
| 1661 | array( |
| 1662 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 1663 | 'type' => Controls_Manager::SWITCHER, |
| 1664 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>', |
| 1665 | ) |
| 1666 | ); |
| 1667 | |
| 1668 | $this->add_control( |
| 1669 | 'icon_adv_radius_value', |
| 1670 | array( |
| 1671 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1672 | 'type' => Controls_Manager::TEXT, |
| 1673 | 'dynamic' => array( 'active' => true ), |
| 1674 | 'selectors' => array( |
| 1675 | '{{WRAPPER}} .premium-title-icon' => 'border-radius: {{VALUE}};', |
| 1676 | ), |
| 1677 | 'condition' => array( |
| 1678 | 'icon_adv_radius' => 'yes', |
| 1679 | ), |
| 1680 | ) |
| 1681 | ); |
| 1682 | |
| 1683 | $this->add_responsive_control( |
| 1684 | 'premium_title_icon_margin', |
| 1685 | array( |
| 1686 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1687 | 'type' => Controls_Manager::DIMENSIONS, |
| 1688 | 'size_units' => array( 'px', 'em', '%' ), |
| 1689 | 'selectors' => array( |
| 1690 | '{{WRAPPER}} .premium-title-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1691 | ), |
| 1692 | ) |
| 1693 | ); |
| 1694 | |
| 1695 | $this->add_responsive_control( |
| 1696 | 'premium_title_icon_padding', |
| 1697 | array( |
| 1698 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1699 | 'type' => Controls_Manager::DIMENSIONS, |
| 1700 | 'size_units' => array( 'px', 'em', '%' ), |
| 1701 | 'selectors' => array( |
| 1702 | '{{WRAPPER}} .premium-title-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1703 | ), |
| 1704 | ) |
| 1705 | ); |
| 1706 | |
| 1707 | $this->add_group_control( |
| 1708 | Group_Control_Text_Shadow::get_type(), |
| 1709 | array( |
| 1710 | 'label' => __( 'Icon Shadow', 'premium-addons-for-elementor' ), |
| 1711 | 'name' => 'premium_title_icon_text_shadow', |
| 1712 | 'selector' => '{{WRAPPER}} .premium-title-icon', |
| 1713 | 'condition' => array( |
| 1714 | 'icon_type' => 'icon', |
| 1715 | ), |
| 1716 | ) |
| 1717 | ); |
| 1718 | |
| 1719 | $this->end_controls_section(); |
| 1720 | |
| 1721 | $this->start_controls_section( |
| 1722 | 'background_text_style_section', |
| 1723 | array( |
| 1724 | 'label' => __( 'Background Text', 'premium-addons-for-elementor' ), |
| 1725 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1726 | 'condition' => array( |
| 1727 | 'background_text_switcher' => 'yes', |
| 1728 | ), |
| 1729 | ) |
| 1730 | ); |
| 1731 | |
| 1732 | $this->add_control( |
| 1733 | 'background_text_color', |
| 1734 | array( |
| 1735 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1736 | 'type' => Controls_Manager::COLOR, |
| 1737 | 'global' => array( |
| 1738 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1739 | ), |
| 1740 | 'selectors' => array( |
| 1741 | '{{WRAPPER}} .premium-title-bg-text:before' => 'color: {{VALUE}}', |
| 1742 | ), |
| 1743 | ) |
| 1744 | ); |
| 1745 | |
| 1746 | $this->add_group_control( |
| 1747 | Group_Control_Typography::get_type(), |
| 1748 | array( |
| 1749 | 'name' => 'background_text_typography', |
| 1750 | 'global' => array( |
| 1751 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1752 | ), |
| 1753 | 'selector' => '{{WRAPPER}} .premium-title-bg-text:before', |
| 1754 | ) |
| 1755 | ); |
| 1756 | |
| 1757 | $this->add_group_control( |
| 1758 | Group_Control_Text_Shadow::get_type(), |
| 1759 | array( |
| 1760 | 'name' => 'background_text_shadow', |
| 1761 | 'selector' => '{{WRAPPER}} .premium-title-bg-text:before', |
| 1762 | ) |
| 1763 | ); |
| 1764 | |
| 1765 | $this->add_control( |
| 1766 | 'bg_stroke_switcher', |
| 1767 | array( |
| 1768 | 'label' => __( 'Stroke', 'premium-addons-for-elementor' ), |
| 1769 | 'type' => Controls_Manager::SWITCHER, |
| 1770 | 'prefix_class' => 'premium-title-bg-stroke-', |
| 1771 | ) |
| 1772 | ); |
| 1773 | |
| 1774 | $this->add_control( |
| 1775 | 'bg_stroke_text_color', |
| 1776 | array( |
| 1777 | 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), |
| 1778 | 'type' => Controls_Manager::COLOR, |
| 1779 | 'condition' => array( |
| 1780 | 'bg_stroke_switcher' => 'yes', |
| 1781 | ), |
| 1782 | 'selectors' => array( |
| 1783 | '{{WRAPPER}} .premium-title-bg-text::before' => '-webkit-text-stroke-color: {{VALUE}};', |
| 1784 | ), |
| 1785 | ) |
| 1786 | ); |
| 1787 | |
| 1788 | $this->add_responsive_control( |
| 1789 | 'bg_stroke_width', |
| 1790 | array( |
| 1791 | 'label' => __( 'Stroke Fill Width', 'premium-addons-for-elementor' ), |
| 1792 | 'type' => Controls_Manager::SLIDER, |
| 1793 | 'default' => array( |
| 1794 | 'size' => 1, |
| 1795 | 'unit' => 'px', |
| 1796 | ), |
| 1797 | 'condition' => array( |
| 1798 | 'bg_stroke_switcher' => 'yes', |
| 1799 | ), |
| 1800 | 'selectors' => array( |
| 1801 | '{{WRAPPER}} .premium-title-bg-text::before' => '-webkit-text-stroke-width: {{SIZE}}px', |
| 1802 | ), |
| 1803 | ) |
| 1804 | ); |
| 1805 | |
| 1806 | $this->add_control( |
| 1807 | 'background_text_mix_blend', |
| 1808 | array( |
| 1809 | 'label' => __( 'Blend Mode', 'elementor' ), |
| 1810 | 'type' => Controls_Manager::SELECT, |
| 1811 | 'options' => array( |
| 1812 | '' => __( 'Normal', 'elementor' ), |
| 1813 | 'multiply' => 'Multiply', |
| 1814 | 'screen' => 'Screen', |
| 1815 | 'overlay' => 'Overlay', |
| 1816 | 'darken' => 'Darken', |
| 1817 | 'lighten' => 'Lighten', |
| 1818 | 'color-dodge' => 'Color Dodge', |
| 1819 | 'saturation' => 'Saturation', |
| 1820 | 'color' => 'Color', |
| 1821 | 'luminosity' => 'Luminosity', |
| 1822 | ), |
| 1823 | 'separator' => 'before', |
| 1824 | 'selectors' => array( |
| 1825 | '{{WRAPPER}} .premium-title-bg-text:before' => 'mix-blend-mode: {{VALUE}}', |
| 1826 | ), |
| 1827 | ) |
| 1828 | ); |
| 1829 | |
| 1830 | $this->add_control( |
| 1831 | 'background_text_zindex', |
| 1832 | array( |
| 1833 | 'label' => __( 'z-Index', 'premium-addons-for-elementor' ), |
| 1834 | 'type' => Controls_Manager::NUMBER, |
| 1835 | 'min' => -10, |
| 1836 | 'max' => 20, |
| 1837 | 'step' => 1, |
| 1838 | 'selectors' => array( |
| 1839 | '{{WRAPPER}} .premium-title-bg-text:before' => 'z-index: {{VALUE}}', |
| 1840 | ), |
| 1841 | ) |
| 1842 | ); |
| 1843 | |
| 1844 | $this->end_controls_section(); |
| 1845 | |
| 1846 | } |
| 1847 | |
| 1848 | /** |
| 1849 | * Render title widget output on the frontend. |
| 1850 | * |
| 1851 | * Written in PHP and used to generate the final HTML. |
| 1852 | * |
| 1853 | * @since 1.0.0 |
| 1854 | * @access protected |
| 1855 | */ |
| 1856 | protected function render() { |
| 1857 | |
| 1858 | $settings = $this->get_settings_for_display(); |
| 1859 | |
| 1860 | $this->add_inline_editing_attributes( 'premium_title_text', 'none' ); |
| 1861 | |
| 1862 | $this->add_render_attribute( 'premium_title_text', 'class', 'premium-title-text' ); |
| 1863 | |
| 1864 | $title_tag = Helper_Functions::validate_html_tag( $settings['premium_title_tag'] ); |
| 1865 | |
| 1866 | $selected_style = $settings['premium_title_style']; |
| 1867 | |
| 1868 | $this->add_render_attribute( 'container', 'class', array( 'premium-title-container', $selected_style ) ); |
| 1869 | |
| 1870 | $this->add_render_attribute( 'title', 'class', array( 'premium-title-header', 'premium-title-' . $selected_style ) ); |
| 1871 | |
| 1872 | if ( 'style8' === $selected_style ) { |
| 1873 | |
| 1874 | $this->add_render_attribute( |
| 1875 | 'premium_title_text', |
| 1876 | array( |
| 1877 | 'data-shiny-delay' => $settings['premium_title_delay'], |
| 1878 | 'data-shiny-dur' => $settings['shining_animation_duration'], |
| 1879 | ) |
| 1880 | ); |
| 1881 | |
| 1882 | } elseif ( 'style9' === $selected_style ) { |
| 1883 | |
| 1884 | $this->add_render_attribute( 'title', 'data-blur-delay', $settings['premium_title_delay'] ); |
| 1885 | |
| 1886 | } |
| 1887 | |
| 1888 | $icon_position = ''; |
| 1889 | |
| 1890 | if ( 'yes' === $settings['premium_title_icon_switcher'] ) { |
| 1891 | |
| 1892 | $icon_type = $settings['icon_type']; |
| 1893 | |
| 1894 | $icon_position = $settings['icon_position']; |
| 1895 | |
| 1896 | if ( 'icon' === $icon_type || 'svg' === $icon_type ) { |
| 1897 | |
| 1898 | $this->add_render_attribute( 'icon', 'class', 'premium-drawable-icon' ); |
| 1899 | |
| 1900 | if ( 'icon' === $icon_type ) { |
| 1901 | |
| 1902 | if ( ! empty( $settings['premium_title_icon'] ) ) { |
| 1903 | |
| 1904 | $this->add_render_attribute( |
| 1905 | 'icon', |
| 1906 | array( |
| 1907 | 'class' => array( |
| 1908 | 'premium-title-icon', |
| 1909 | $settings['premium_title_icon'], |
| 1910 | ), |
| 1911 | 'aria-hidden' => 'true', |
| 1912 | ) |
| 1913 | ); |
| 1914 | |
| 1915 | } |
| 1916 | |
| 1917 | $migrated = isset( $settings['__fa4_migrated']['premium_title_icon_updated'] ); |
| 1918 | $is_new = empty( $settings['premium_title_icon'] ) && Icons_Manager::is_migration_allowed(); |
| 1919 | |
| 1920 | } |
| 1921 | |
| 1922 | if ( ( 'yes' === $settings['draw_svg'] && 'icon' === $icon_type ) || 'svg' === $icon_type ) { |
| 1923 | $this->add_render_attribute( 'icon', 'class', 'premium-title-icon' ); |
| 1924 | } |
| 1925 | |
| 1926 | if ( 'yes' === $settings['draw_svg'] ) { |
| 1927 | |
| 1928 | $this->add_render_attribute( |
| 1929 | 'container', |
| 1930 | 'class', |
| 1931 | array( |
| 1932 | 'elementor-invisible', |
| 1933 | 'premium-drawer-hover', |
| 1934 | ) |
| 1935 | ); |
| 1936 | |
| 1937 | if ( 'icon' === $icon_type ) { |
| 1938 | |
| 1939 | $this->add_render_attribute( 'icon', 'class', $settings['premium_title_icon_updated']['value'] ); |
| 1940 | |
| 1941 | } |
| 1942 | |
| 1943 | $this->add_render_attribute( |
| 1944 | 'icon', |
| 1945 | array( |
| 1946 | 'class' => 'premium-svg-drawer', |
| 1947 | 'data-svg-reverse' => $settings['lottie_reverse'], |
| 1948 | 'data-svg-loop' => $settings['lottie_loop'], |
| 1949 | 'data-svg-sync' => $settings['svg_sync'], |
| 1950 | 'data-svg-hover' => $settings['svg_hover'], |
| 1951 | 'data-svg-fill' => $settings['svg_color'], |
| 1952 | 'data-svg-frames' => $settings['frames'], |
| 1953 | 'data-svg-yoyo' => $settings['svg_yoyo'], |
| 1954 | 'data-svg-point' => $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'], |
| 1955 | ) |
| 1956 | ); |
| 1957 | |
| 1958 | } else { |
| 1959 | $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' ); |
| 1960 | } |
| 1961 | } elseif ( 'animation' === $icon_type ) { |
| 1962 | $this->add_render_attribute( |
| 1963 | 'title_lottie', |
| 1964 | array( |
| 1965 | 'class' => array( |
| 1966 | 'premium-title-icon', |
| 1967 | 'premium-lottie-animation', |
| 1968 | ), |
| 1969 | 'data-lottie-url' => $settings['lottie_url'], |
| 1970 | 'data-lottie-loop' => $settings['lottie_loop'], |
| 1971 | 'data-lottie-reverse' => $settings['lottie_reverse'], |
| 1972 | ) |
| 1973 | ); |
| 1974 | } else { |
| 1975 | |
| 1976 | $src = $settings['image_upload']['url']; |
| 1977 | |
| 1978 | $alt = Control_Media::get_image_alt( $settings['image_upload'] ); |
| 1979 | |
| 1980 | $this->add_render_attribute( |
| 1981 | 'title_img', |
| 1982 | array( |
| 1983 | 'class' => 'premium-title-icon', |
| 1984 | 'src' => $src, |
| 1985 | 'alt' => $alt, |
| 1986 | ) |
| 1987 | ); |
| 1988 | } |
| 1989 | } |
| 1990 | |
| 1991 | if ( 'yes' === $settings['link_switcher'] ) { |
| 1992 | |
| 1993 | $link = ''; |
| 1994 | |
| 1995 | if ( 'link' === $settings['link_selection'] ) { |
| 1996 | |
| 1997 | $link = get_permalink( $settings['existing_link'] ); |
| 1998 | |
| 1999 | } else { |
| 2000 | |
| 2001 | $link = $settings['custom_link']['url']; |
| 2002 | |
| 2003 | } |
| 2004 | |
| 2005 | $this->add_render_attribute( 'link', 'href', $link ); |
| 2006 | |
| 2007 | if ( ! empty( $settings['custom_link']['is_external'] ) ) { |
| 2008 | $this->add_render_attribute( 'link', 'target', '_blank' ); |
| 2009 | } |
| 2010 | |
| 2011 | if ( ! empty( $settings['custom_link']['nofollow'] ) ) { |
| 2012 | $this->add_render_attribute( 'link', 'rel', 'nofollow' ); |
| 2013 | } |
| 2014 | } |
| 2015 | |
| 2016 | if ( 'yes' === $settings['background_text_switcher'] ) { |
| 2017 | $this->add_render_attribute( |
| 2018 | 'container', |
| 2019 | array( |
| 2020 | 'class' => 'premium-title-bg-text', |
| 2021 | 'data-background' => $settings['background_text'], |
| 2022 | ) |
| 2023 | ); |
| 2024 | } |
| 2025 | |
| 2026 | ?> |
| 2027 | |
| 2028 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'container' ) ); ?>> |
| 2029 | <<?php echo wp_kses_post( $title_tag . ' ' . $this->get_render_attribute_string( 'title' ) ); ?>> |
| 2030 | <?php if ( 'style7' === $selected_style ) : ?> |
| 2031 | <?php if ( 'column' !== $icon_position ) : ?> |
| 2032 | <span class="premium-title-style7-stripe-wrap"> |
| 2033 | <span class="premium-title-style7-stripe"></span> |
| 2034 | </span> |
| 2035 | <?php endif; ?> |
| 2036 | <div class="premium-title-style7-inner"> |
| 2037 | <?php endif; ?> |
| 2038 | |
| 2039 | <?php if ( 'yes' === $settings['premium_title_icon_switcher'] ) : ?> |
| 2040 | <?php if ( 'icon' === $icon_type ) : ?> |
| 2041 | <?php |
| 2042 | if ( ( $is_new || $migrated ) && 'yes' !== $settings['draw_svg'] ) : |
| 2043 | Icons_Manager::render_icon( |
| 2044 | $settings['premium_title_icon_updated'], |
| 2045 | array( |
| 2046 | 'class' => array( 'premium-title-icon', 'premium-svg-nodraw', 'premium-drawable-icon' ), |
| 2047 | 'aria-hidden' => 'true', |
| 2048 | ) |
| 2049 | ); |
| 2050 | else : |
| 2051 | ?> |
| 2052 | <i <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>></i> |
| 2053 | <?php endif; ?> |
| 2054 | |
| 2055 | <?php elseif ( 'svg' === $icon_type ) : ?> |
| 2056 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>> |
| 2057 | <?php $this->print_unescaped_setting( 'custom_svg' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 2058 | </div> |
| 2059 | <?php elseif ( 'animation' === $icon_type ) : ?> |
| 2060 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'title_lottie' ) ); ?>></div> |
| 2061 | <?php else : ?> |
| 2062 | <?php if ( 'yes' === $settings['mask_switcher'] ) : ?> |
| 2063 | <span class="premium-title-img"> |
| 2064 | <?php endif; ?> |
| 2065 | <img <?php echo wp_kses_post( $this->get_render_attribute_string( 'title_img' ) ); ?>></span> |
| 2066 | <?php if ( 'yes' === $settings['mask_switcher'] ) : ?> |
| 2067 | </span> |
| 2068 | <?php endif; ?> |
| 2069 | <?php endif; ?> |
| 2070 | <?php endif; ?> |
| 2071 | |
| 2072 | <?php if ( 'style7' === $selected_style ) : ?> |
| 2073 | <?php if ( 'column' === $icon_position ) : ?> |
| 2074 | <span class="premium-title-style7-stripe-wrap"> |
| 2075 | <span class="premium-title-style7-stripe"></span> |
| 2076 | </span> |
| 2077 | <?php endif; ?> |
| 2078 | <?php endif; ?> |
| 2079 | <?php if ( 'style9' !== $selected_style ) : ?> |
| 2080 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_title_text' ) ); ?> > |
| 2081 | <?php echo wp_kses_post( $settings['premium_title_text'] ); ?> |
| 2082 | </span> |
| 2083 | <?php |
| 2084 | else : |
| 2085 | $letters_html = '<span class="premium-letters-container"' . $this->get_render_attribute_string( 'premium_title_text' ) . '>'; |
| 2086 | $title_array = preg_split( '//u', $settings['premium_title_text'], null, PREG_SPLIT_NO_EMPTY ); |
| 2087 | foreach ( $title_array as $key => $letter ) : |
| 2088 | $key = $key++; |
| 2089 | $letters_html .= '<span class="premium-title-style9-letter" data-letter-index="' . esc_attr( $key + 1 ) . '" data-letter="' . esc_attr( $letter ) . '">' . $letter . '</span>'; |
| 2090 | endforeach; |
| 2091 | $the_title = $letters_html . '</span>'; |
| 2092 | echo wp_kses_post( $the_title ); |
| 2093 | ?> |
| 2094 | <?php endif; ?> |
| 2095 | |
| 2096 | <?php if ( 'style7' === $selected_style ) : ?> |
| 2097 | </div> |
| 2098 | <?php endif; ?> |
| 2099 | <?php if ( 'yes' === $settings['link_switcher'] && ! empty( $link ) ) : ?> |
| 2100 | <a <?php echo wp_kses_post( $this->get_render_attribute_string( 'link' ) ); ?>></a> |
| 2101 | <?php endif; ?> |
| 2102 | </<?php echo wp_kses_post( $title_tag ); ?>> |
| 2103 | </div> |
| 2104 | |
| 2105 | <?php |
| 2106 | } |
| 2107 | |
| 2108 | /** |
| 2109 | * Render Title widget output in the editor. |
| 2110 | * |
| 2111 | * Written as a Backbone JavaScript template and used to generate the live preview. |
| 2112 | * |
| 2113 | * @since 1.0.0 |
| 2114 | * @access protected |
| 2115 | */ |
| 2116 | protected function content_template() { |
| 2117 | ?> |
| 2118 | <# |
| 2119 | |
| 2120 | view.addInlineEditingAttributes('premium_title_text', 'none'); |
| 2121 | |
| 2122 | view.addRenderAttribute('premium_title_text', 'class', 'premium-title-text'); |
| 2123 | |
| 2124 | var titleTag = elementor.helpers.validateHTMLTag( settings.premium_title_tag ), |
| 2125 | |
| 2126 | selectedStyle = settings.premium_title_style, |
| 2127 | |
| 2128 | titleIcon = settings.premium_title_icon, |
| 2129 | |
| 2130 | titleText = settings.premium_title_text; |
| 2131 | |
| 2132 | view.addRenderAttribute( 'container', 'class', [ 'premium-title-container', selectedStyle ] ); |
| 2133 | |
| 2134 | view.addRenderAttribute( 'premium_title', 'class', [ 'premium-title-header', 'premium-title-' + selectedStyle ] ); |
| 2135 | |
| 2136 | if ( selectedStyle === 'style9' ) { |
| 2137 | view.addRenderAttribute( 'premium_title', 'data-blur-delay', settings.premium_title_delay ); |
| 2138 | } else if( selectedStyle === 'style8') { |
| 2139 | view.addRenderAttribute( 'premium_title_text', 'data-shiny-delay', settings.premium_title_delay ); |
| 2140 | view.addRenderAttribute( 'premium_title_text', 'data-shiny-dur', settings.shining_animation_duration ); |
| 2141 | } |
| 2142 | |
| 2143 | view.addRenderAttribute( 'icon', 'class', [ 'premium-title-icon', titleIcon ] ); |
| 2144 | |
| 2145 | var iconPosition = ''; |
| 2146 | |
| 2147 | if( 'yes' === settings.premium_title_icon_switcher ) { |
| 2148 | |
| 2149 | var iconType = settings.icon_type; |
| 2150 | |
| 2151 | iconPosition = settings.icon_position; |
| 2152 | |
| 2153 | if( 'icon' === iconType || 'svg' === iconType ) { |
| 2154 | |
| 2155 | view.addRenderAttribute( 'icon', 'class', 'premium-drawable-icon' ); |
| 2156 | |
| 2157 | if( 'icon' === iconType ) { |
| 2158 | |
| 2159 | var iconHTML = 'yes' !== settings.draw_svg ? elementor.helpers.renderIcon( view, settings.premium_title_icon_updated, { 'class': ['premium-title-icon', 'premium-svg-nodraw', 'premium-drawable-icon'], 'aria-hidden': true }, 'i' , 'object' ) : false, |
| 2160 | migrated = elementor.helpers.isIconMigrated( settings, 'premium_title_icon_updated' ); |
| 2161 | |
| 2162 | } |
| 2163 | |
| 2164 | if( ( 'yes' === settings.draw_svg && 'icon' === iconType ) || 'svg' === iconType ) { |
| 2165 | view.addRenderAttribute( 'icon', 'class', 'premium-title-icon' ); |
| 2166 | } |
| 2167 | |
| 2168 | if ( 'yes' === settings.draw_svg ) { |
| 2169 | |
| 2170 | view.addRenderAttribute( 'container', 'class', 'premium-drawer-hover' ); |
| 2171 | |
| 2172 | if ( 'icon' === iconType ) { |
| 2173 | |
| 2174 | view.addRenderAttribute( 'icon', 'class', settings.premium_title_icon_updated.value ); |
| 2175 | |
| 2176 | } |
| 2177 | |
| 2178 | view.addRenderAttribute( |
| 2179 | 'icon', |
| 2180 | { |
| 2181 | 'class' : 'premium-svg-drawer', |
| 2182 | 'data-svg-reverse' : settings.lottie_reverse, |
| 2183 | 'data-svg-loop' : settings.lottie_loop, |
| 2184 | 'data-svg-sync' : settings.svg_sync, |
| 2185 | 'data-svg-hover' : settings.svg_hover, |
| 2186 | 'data-svg-fill' : settings.svg_color, |
| 2187 | 'data-svg-frames' : settings.frames, |
| 2188 | 'data-svg-yoyo' : settings.svg_yoyo, |
| 2189 | 'data-svg-point' : settings.lottie_reverse ? settings.end_point.size : settings.start_point.size, |
| 2190 | } |
| 2191 | ); |
| 2192 | |
| 2193 | } else { |
| 2194 | view.addRenderAttribute( 'icon', 'class', 'premium-svg-nodraw' ); |
| 2195 | } |
| 2196 | |
| 2197 | } else if( 'animation' === iconType ) { |
| 2198 | |
| 2199 | view.addRenderAttribute( 'title_lottie', { |
| 2200 | 'class': [ |
| 2201 | 'premium-title-icon', |
| 2202 | 'premium-lottie-animation' |
| 2203 | ], |
| 2204 | 'data-lottie-url': settings.lottie_url, |
| 2205 | 'data-lottie-loop': settings.lottie_loop, |
| 2206 | 'data-lottie-reverse': settings.lottie_reverse |
| 2207 | }); |
| 2208 | |
| 2209 | } else { |
| 2210 | |
| 2211 | view.addRenderAttribute( 'title_img', { |
| 2212 | 'class': 'premium-title-icon', |
| 2213 | 'src': settings.image_upload.url |
| 2214 | }); |
| 2215 | |
| 2216 | } |
| 2217 | |
| 2218 | } |
| 2219 | |
| 2220 | if( 'yes' === settings.link_switcher ) { |
| 2221 | |
| 2222 | var link = ''; |
| 2223 | |
| 2224 | if( settings.link_selection === 'link' ) { |
| 2225 | |
| 2226 | link = settings.existing_link; |
| 2227 | |
| 2228 | } else { |
| 2229 | |
| 2230 | link = settings.custom_link.url; |
| 2231 | |
| 2232 | } |
| 2233 | |
| 2234 | view.addRenderAttribute( 'link', 'href', link ); |
| 2235 | |
| 2236 | } |
| 2237 | |
| 2238 | if( 'yes' === settings.background_text_switcher ) { |
| 2239 | view.addRenderAttribute( 'container', { |
| 2240 | 'class': 'premium-title-bg-text', |
| 2241 | 'data-background': settings.background_text |
| 2242 | }); |
| 2243 | } |
| 2244 | |
| 2245 | #> |
| 2246 | <div {{{ view.getRenderAttributeString('container') }}}> |
| 2247 | <{{{titleTag}}} {{{view.getRenderAttributeString('premium_title')}}}> |
| 2248 | <# if( 'style7' === selectedStyle ) { #> |
| 2249 | <# if( 'column' !== iconPosition ) { #> |
| 2250 | <span class="premium-title-style7-stripe-wrap"> |
| 2251 | <span class="premium-title-style7-stripe"></span> |
| 2252 | </span> |
| 2253 | <# } #> |
| 2254 | <div class="premium-title-style7-inner"> |
| 2255 | <# } |
| 2256 | if( 'yes' === settings.premium_title_icon_switcher ) { #> |
| 2257 | <# if( 'icon' === iconType ) { #> |
| 2258 | <# if ( iconHTML && iconHTML.rendered && ( ! settings.premium_title_icon || migrated ) ) { #> |
| 2259 | {{{ iconHTML.value }}} |
| 2260 | <# } else { #> |
| 2261 | <i {{{ view.getRenderAttributeString( 'icon' ) }}}></i> |
| 2262 | <# } #> |
| 2263 | |
| 2264 | <# } else if( 'svg' === iconType ) { #> |
| 2265 | <div {{{ view.getRenderAttributeString('icon') }}}> |
| 2266 | {{{ settings.custom_svg }}} |
| 2267 | </div> |
| 2268 | <# } else if( 'animation' === iconType ) { #> |
| 2269 | <div {{{ view.getRenderAttributeString('title_lottie') }}}></div> |
| 2270 | <# } else { #> |
| 2271 | <span class="premium-title-img"><img {{{ view.getRenderAttributeString('title_img') }}}></span> |
| 2272 | <# } #> |
| 2273 | <# } #> |
| 2274 | <# if( 'style7' === selectedStyle ) { #> |
| 2275 | <# if( 'column' === iconPosition ) { #> |
| 2276 | <span class="premium-title-style7-stripe-wrap"> |
| 2277 | <span class="premium-title-style7-stripe"></span> |
| 2278 | </span> |
| 2279 | <# } #> |
| 2280 | <# } #> |
| 2281 | <# if( selectedStyle !== 'style9' ) {#> |
| 2282 | <span {{{ view.getRenderAttributeString('premium_title_text') }}} >{{{ titleText }}}</span> |
| 2283 | <# } else { |
| 2284 | lettersHtml = '<span class="premium-letters-container"'+ view.getRenderAttributeString('premium_title_text') +'>'; |
| 2285 | text = titleText; |
| 2286 | titleArray = text.split(''); |
| 2287 | key = 0; |
| 2288 | titleArray.forEach(function (item) { |
| 2289 | key = key + 1; |
| 2290 | lettersHtml +='<span class="premium-title-style9-letter" data-letter-index="'+(key+1)+'" data-letter="'+(item)+'">'+item+'</span>'; |
| 2291 | }); |
| 2292 | theTitle = lettersHtml + '</span>'; #> |
| 2293 | {{{theTitle}}} |
| 2294 | <# |
| 2295 | } |
| 2296 | #> |
| 2297 | <# if( 'style7' === selectedStyle ) { #> |
| 2298 | </div> |
| 2299 | <# } #> |
| 2300 | <# if( 'yes' === settings.link_switcher && '' !== link ) { #> |
| 2301 | <a {{{ view.getRenderAttributeString('link') }}}></a> |
| 2302 | <# } #> |
| 2303 | </{{{titleTag}}}> |
| 2304 | </div> |
| 2305 | |
| 2306 | <?php |
| 2307 | } |
| 2308 | } |
| 2309 |