heading.php
1437 lines
| 1 | <?php |
| 2 | namespace Elementor; |
| 3 | |
| 4 | use \Elementor\ElementsKit_Widget_Heading_Handler as Handler; |
| 5 | use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager; |
| 6 | |
| 7 | defined('ABSPATH') || exit; |
| 8 | |
| 9 | |
| 10 | class ElementsKit_Widget_Heading extends Widget_Base { |
| 11 | use \ElementsKit_Lite\Widgets\Widget_Notice; |
| 12 | |
| 13 | public $base; |
| 14 | |
| 15 | public function get_name() { |
| 16 | return Handler::get_name(); |
| 17 | } |
| 18 | |
| 19 | public function get_title() { |
| 20 | return Handler::get_title(); |
| 21 | } |
| 22 | |
| 23 | public function get_icon() { |
| 24 | return Handler::get_icon(); |
| 25 | } |
| 26 | |
| 27 | public function get_categories() { |
| 28 | return Handler::get_categories(); |
| 29 | } |
| 30 | |
| 31 | public function get_keywords() { |
| 32 | return Handler::get_keywords(); |
| 33 | } |
| 34 | |
| 35 | public function get_help_url() { |
| 36 | return 'https://wpmet.com/doc/widget-documentation/'; |
| 37 | } |
| 38 | |
| 39 | public function get_style_depends() { |
| 40 | return ['ekit-heading']; |
| 41 | } |
| 42 | |
| 43 | protected function is_dynamic_content(): bool { |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | public function has_widget_inner_wrapper(): bool { |
| 48 | return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 49 | } |
| 50 | |
| 51 | protected function register_controls() { |
| 52 | |
| 53 | |
| 54 | $this->start_controls_section( |
| 55 | 'ekit_heading_section_title', |
| 56 | array( |
| 57 | 'label' => esc_html__( 'Title', 'elementskit-lite' ), |
| 58 | ) |
| 59 | ); |
| 60 | |
| 61 | $this->add_control( |
| 62 | 'ekit_heading_title', [ |
| 63 | 'label' => esc_html__( 'Heading Title', 'elementskit-lite' ), |
| 64 | 'type' => Controls_Manager::TEXTAREA, |
| 65 | 'dynamic' => [ |
| 66 | 'active' => true, |
| 67 | ], |
| 68 | 'description' => esc_html__( '"Focused Title" Settings will be worked, If you use this {{something}} format', 'elementskit-lite' ), |
| 69 | 'label_block' => true, |
| 70 | 'placeholder' => esc_html__( 'Grow your {{report}}', 'elementskit-lite' ), |
| 71 | 'default' => esc_html__( 'Grow your {{report}}', 'elementskit-lite' ), |
| 72 | |
| 73 | ] |
| 74 | ); |
| 75 | |
| 76 | $this->add_control( 'ekit_heading_link', [ |
| 77 | 'label' => esc_html__( 'Link', 'elementskit-lite' ), |
| 78 | 'type' => Controls_Manager::URL, |
| 79 | 'dynamic' => [ |
| 80 | 'active' => true, |
| 81 | ], |
| 82 | 'label_block' => true, |
| 83 | 'placeholder' => esc_html__( 'Paste URL or type', 'elementskit-lite' ), |
| 84 | 'autocomplete' => false, |
| 85 | 'options' => [ 'is_external', 'nofollow', 'custom_attributes' ], |
| 86 | ]); |
| 87 | |
| 88 | $this->add_control( |
| 89 | 'ekit_heading_title_tag', |
| 90 | [ |
| 91 | 'label' => esc_html__( 'Title HTML Tag', 'elementskit-lite' ), |
| 92 | 'type' => Controls_Manager::SELECT, |
| 93 | 'options' => [ |
| 94 | 'h1' => 'H1', |
| 95 | 'h2' => 'H2', |
| 96 | 'h3' => 'H3', |
| 97 | 'h4' => 'H4', |
| 98 | 'h5' => 'H5', |
| 99 | 'h6' => 'H6', |
| 100 | 'div' => 'div', |
| 101 | 'span' => 'span', |
| 102 | 'p' => 'p', |
| 103 | ], |
| 104 | 'default' => 'h2', |
| 105 | ] |
| 106 | ); |
| 107 | |
| 108 | |
| 109 | $this->add_control( 'show_title_border', [ |
| 110 | 'label' => esc_html__( 'Show Border', 'elementskit-lite' ), |
| 111 | 'type' => Controls_Manager::SWITCHER, |
| 112 | 'default' => 'no', |
| 113 | ]); |
| 114 | |
| 115 | $this->add_control( |
| 116 | 'title_border_position', |
| 117 | [ |
| 118 | 'label' => esc_html__( 'Border Position', 'elementskit-lite' ), |
| 119 | 'type' => Controls_Manager::SELECT, |
| 120 | 'default' => 'start', |
| 121 | 'options' => [ |
| 122 | 'start' => esc_html__( 'Start', 'elementskit-lite' ), |
| 123 | 'end' => esc_html__( 'End', 'elementskit-lite' ), |
| 124 | ], |
| 125 | 'condition' => [ |
| 126 | 'show_title_border' => 'yes' |
| 127 | ] |
| 128 | ] |
| 129 | ); |
| 130 | |
| 131 | $this->add_control( 'title_float_left', [ |
| 132 | 'label' => esc_html__( 'Float Left', 'elementskit-lite' ), |
| 133 | 'type' => Controls_Manager::SWITCHER, |
| 134 | 'default' => 'no', |
| 135 | ]); |
| 136 | |
| 137 | $this->add_responsive_control( 'title_float_left_width', [ |
| 138 | 'label' => __( 'Title Width', 'elementskit-lite' ), |
| 139 | 'type' => Controls_Manager::SLIDER, |
| 140 | 'size_units' => [ '%', 'px' ], |
| 141 | 'default' => [ 'unit' => '%', 'size' => '40' ], |
| 142 | 'range' => [ |
| 143 | '%' => [ |
| 144 | 'min' => 0, |
| 145 | 'max' => 200, |
| 146 | 'step' => 1, |
| 147 | ] |
| 148 | ], |
| 149 | 'selectors' => [ |
| 150 | '{{WRAPPER}} .ekit-heading__title-wrapper' => |
| 151 | 'width: {{SIZE}}{{UNIT}};' |
| 152 | ], |
| 153 | 'condition' => [ |
| 154 | 'title_float_left' => 'yes' |
| 155 | ], |
| 156 | ]); |
| 157 | |
| 158 | $this->end_controls_section(); |
| 159 | |
| 160 | $this->start_controls_section( |
| 161 | 'ekit_heading_section_subtitle', |
| 162 | array( |
| 163 | 'label' => esc_html__( 'Subtitle', 'elementskit-lite' ), |
| 164 | ) |
| 165 | ); |
| 166 | |
| 167 | $this->add_control( |
| 168 | 'ekit_heading_sub_title_show', |
| 169 | [ |
| 170 | 'label' => esc_html__( 'Show Sub Title', 'elementskit-lite' ), |
| 171 | 'type' => Controls_Manager::SWITCHER, |
| 172 | 'default' => 'no', |
| 173 | ] |
| 174 | ); |
| 175 | $this->add_control( |
| 176 | 'ekit_heading_sub_title_border', |
| 177 | [ |
| 178 | 'label' => esc_html__( 'Border Sub Title', 'elementskit-lite' ), |
| 179 | 'type' => Controls_Manager::SWITCHER, |
| 180 | 'default' => 'no', |
| 181 | 'condition' => [ |
| 182 | 'ekit_heading_sub_title_show' => 'yes', |
| 183 | //'ekit_heading_sub_title_outline' => '!yes' |
| 184 | ] |
| 185 | ] |
| 186 | ); |
| 187 | |
| 188 | $this->add_control( |
| 189 | 'ekit_heading_sub_title_outline', |
| 190 | [ |
| 191 | 'label' => esc_html__( 'Show Outline', 'elementskit-lite' ), |
| 192 | 'type' => Controls_Manager::SWITCHER, |
| 193 | 'default' => 'no', |
| 194 | 'condition' => [ |
| 195 | 'ekit_heading_sub_title_show' => 'yes', |
| 196 | 'ekit_heading_sub_title_border!' => 'yes' |
| 197 | ] |
| 198 | ] |
| 199 | ); |
| 200 | |
| 201 | $this->add_control( |
| 202 | 'ekit_heading_sub_title', [ |
| 203 | 'label' =>esc_html__( 'Heading Sub Title', 'elementskit-lite' ), |
| 204 | 'type' => Controls_Manager::TEXT, |
| 205 | 'dynamic' => [ |
| 206 | 'active' => true, |
| 207 | ], |
| 208 | 'label_block' => true, |
| 209 | 'placeholder' =>esc_html__( 'Time has changed', 'elementskit-lite' ), |
| 210 | 'default' =>esc_html__( 'Time has changed', 'elementskit-lite' ), |
| 211 | 'condition' => [ |
| 212 | 'ekit_heading_sub_title_show' => 'yes' |
| 213 | ], |
| 214 | |
| 215 | ] |
| 216 | ); |
| 217 | $this->add_control( |
| 218 | 'ekit_heading_sub_title_position', |
| 219 | [ |
| 220 | 'label' => esc_html__( 'Sub Title Position', 'elementskit-lite' ), |
| 221 | 'type' => Controls_Manager::SELECT, |
| 222 | 'default' => 'after_title', |
| 223 | 'options' => [ |
| 224 | 'before_title' => esc_html__( 'Before Title', 'elementskit-lite' ), |
| 225 | 'after_title' => esc_html__( 'After Title', 'elementskit-lite' ), |
| 226 | ], |
| 227 | 'condition' => [ |
| 228 | 'ekit_heading_sub_title_show' => 'yes' |
| 229 | ] |
| 230 | ] |
| 231 | ); |
| 232 | |
| 233 | $this->add_control( |
| 234 | 'ekit_heading_sub_title_tag', |
| 235 | [ |
| 236 | 'label' => esc_html__( 'Sub Title HTML Tag', 'elementskit-lite' ), |
| 237 | 'type' => Controls_Manager::SELECT, |
| 238 | 'options' => [ |
| 239 | 'h1' => 'H1', |
| 240 | 'h2' => 'H2', |
| 241 | 'h3' => 'H3', |
| 242 | 'h4' => 'H4', |
| 243 | 'h5' => 'H5', |
| 244 | 'h6' => 'H6', |
| 245 | 'div' => 'div', |
| 246 | 'span' => 'span', |
| 247 | 'p' => 'p', |
| 248 | ], |
| 249 | 'default' => 'h3', |
| 250 | 'condition' => [ |
| 251 | 'ekit_heading_sub_title_show' => 'yes' |
| 252 | ] |
| 253 | ] |
| 254 | ); |
| 255 | $this->end_controls_section(); |
| 256 | |
| 257 | //Title Description |
| 258 | $this->start_controls_section( |
| 259 | 'ekit_heading_section_extra_title', |
| 260 | array( |
| 261 | 'label' => esc_html__( 'Title Description', 'elementskit-lite' ), |
| 262 | ) |
| 263 | ); |
| 264 | |
| 265 | $this->add_control( |
| 266 | 'ekit_heading_section_extra_title_show', |
| 267 | [ |
| 268 | 'label' => esc_html__( 'Show Description', 'elementskit-lite' ), |
| 269 | 'type' => Controls_Manager::SWITCHER, |
| 270 | 'default' => 'no', |
| 271 | ] |
| 272 | ); |
| 273 | |
| 274 | $this->add_control( |
| 275 | 'ekit_heading_extra_title', |
| 276 | [ |
| 277 | 'label' => esc_html__( 'Heading Description', 'elementskit-lite' ), |
| 278 | 'type' => Controls_Manager::WYSIWYG, |
| 279 | 'dynamic' => [ |
| 280 | 'active' => true, |
| 281 | ], |
| 282 | 'rows' => 10, |
| 283 | 'label_block' => true, |
| 284 | 'default' =>esc_html__( 'A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradise ', 'elementskit-lite' ), |
| 285 | 'placeholder' =>esc_html__( 'Title Description', 'elementskit-lite' ), |
| 286 | 'condition' => [ |
| 287 | 'ekit_heading_section_extra_title_show' => 'yes' |
| 288 | ], |
| 289 | |
| 290 | ] |
| 291 | ); |
| 292 | |
| 293 | $this->add_responsive_control( 'desciption_width', [ |
| 294 | 'label' => __( 'Maximum Width', 'elementskit-lite' ), |
| 295 | 'type' => Controls_Manager::SLIDER, |
| 296 | 'size_units' => [ 'px', 'em', '%' ], |
| 297 | 'selectors' => [ |
| 298 | '{{WRAPPER}} .ekit-heading__description' => 'max-width: {{SIZE}}{{UNIT}};' |
| 299 | ], |
| 300 | 'condition' => [ |
| 301 | 'ekit_heading_section_extra_title_show' => 'yes' |
| 302 | ] |
| 303 | ]); |
| 304 | |
| 305 | $this->end_controls_section(); |
| 306 | |
| 307 | /** Start Heading shadow text setion */ |
| 308 | $this->start_controls_section( 'shadow_text_section', [ |
| 309 | 'label' => esc_html__( 'Shadow Text', 'elementskit-lite' ) |
| 310 | ]); |
| 311 | |
| 312 | $this->add_control( 'show_shadow_text', [ |
| 313 | 'label' => esc_html__( 'Show Shadow Text', 'elementskit-lite' ), |
| 314 | 'type' => Controls_Manager::SWITCHER, |
| 315 | 'default' => 'no', |
| 316 | ]); |
| 317 | |
| 318 | $this->add_control( 'shadow_text_content', [ |
| 319 | 'label' => esc_html__( 'Content', 'elementskit-lite' ), |
| 320 | 'label_block' => true, |
| 321 | 'type' => Controls_Manager::TEXT, |
| 322 | 'dynamic' => [ |
| 323 | 'active' => true, |
| 324 | ], |
| 325 | 'default' => esc_html__( 'bussiness', 'elementskit-lite' ), |
| 326 | 'condition' => [ |
| 327 | 'show_shadow_text' => 'yes' |
| 328 | ], |
| 329 | |
| 330 | ]); |
| 331 | |
| 332 | $this->end_controls_section(); |
| 333 | /** End Heading shadow text setion */ |
| 334 | |
| 335 | $this->start_controls_section( |
| 336 | 'ekit_heading_section_seperator', |
| 337 | array( |
| 338 | 'label' => esc_html__( 'Separator', 'elementskit-lite' ), |
| 339 | ) |
| 340 | ); |
| 341 | |
| 342 | |
| 343 | $this->add_control( |
| 344 | 'ekit_heading_show_seperator', [ |
| 345 | 'label' =>esc_html__( 'Show Separator', 'elementskit-lite' ), |
| 346 | 'type' => Controls_Manager::SWITCHER, |
| 347 | 'default' => 'yes', |
| 348 | 'label_on' =>esc_html__( 'Yes', 'elementskit-lite' ), |
| 349 | 'label_off' =>esc_html__( 'No', 'elementskit-lite' ), |
| 350 | ] |
| 351 | |
| 352 | ); |
| 353 | $this->add_control( |
| 354 | 'ekit_heading_seperator_style', |
| 355 | [ |
| 356 | 'label' => esc_html__( 'Separator Style', 'elementskit-lite' ), |
| 357 | 'type' => Controls_Manager::SELECT, |
| 358 | 'options' => [ |
| 359 | 'elementskit-border-divider ekit-dotted' => esc_html__( 'Dotted', 'elementskit-lite' ), |
| 360 | 'elementskit-border-divider elementskit-style-long' => esc_html__( 'Solid', 'elementskit-lite' ), |
| 361 | 'elementskit-border-star' => esc_html__( 'Solid with star', 'elementskit-lite' ), |
| 362 | 'elementskit-border-star elementskit-bullet' => esc_html__( 'Solid with bullet', 'elementskit-lite' ), |
| 363 | 'ekit_border_custom' => esc_html__( 'Custom', 'elementskit-lite' ), |
| 364 | ], |
| 365 | 'default' => 'elementskit-border-divider ekit-dotted', |
| 366 | 'condition' => [ |
| 367 | 'ekit_heading_show_seperator' => 'yes', |
| 368 | ], |
| 369 | ] |
| 370 | ); |
| 371 | |
| 372 | $this->add_control( |
| 373 | 'ekit_heading_seperator_position', |
| 374 | [ |
| 375 | 'label' => esc_html__( 'Separator Position', 'elementskit-lite' ), |
| 376 | 'type' => Controls_Manager::SELECT, |
| 377 | 'options' => [ |
| 378 | 'top' => esc_html__( 'Top', 'elementskit-lite' ), |
| 379 | 'before' => esc_html__( 'Before Title', 'elementskit-lite' ), |
| 380 | 'after' => esc_html__( 'After Title', 'elementskit-lite' ), |
| 381 | 'bottom' => esc_html__( 'Bottom', 'elementskit-lite' ), |
| 382 | ], |
| 383 | 'default' => 'after', |
| 384 | 'condition' => [ |
| 385 | 'ekit_heading_show_seperator' => 'yes', |
| 386 | ], |
| 387 | ] |
| 388 | ); |
| 389 | |
| 390 | $this->add_control( |
| 391 | 'ekit_heading_seperator_image', |
| 392 | [ |
| 393 | 'label' => esc_html__( 'Choose Image', 'elementskit-lite' ), |
| 394 | 'type' => Controls_Manager::MEDIA, |
| 395 | 'dynamic' => [ |
| 396 | 'active' => true, |
| 397 | ], |
| 398 | 'default' => [ |
| 399 | 'url' => '', |
| 400 | 'id' => -1 |
| 401 | ], |
| 402 | 'condition' => [ |
| 403 | 'ekit_heading_show_seperator' => 'yes', |
| 404 | 'ekit_heading_seperator_style' => 'ekit_border_custom', |
| 405 | ], |
| 406 | |
| 407 | ] |
| 408 | ); |
| 409 | |
| 410 | $this->add_group_control( |
| 411 | Group_Control_Image_Size::get_type(), |
| 412 | [ |
| 413 | 'name' => 'ekit_heading_seperator_image_size', |
| 414 | 'default' => 'large', |
| 415 | 'condition' => [ |
| 416 | 'ekit_heading_show_seperator' => 'yes', |
| 417 | 'ekit_heading_seperator_style' => 'ekit_border_custom', |
| 418 | ], |
| 419 | ] |
| 420 | ); |
| 421 | |
| 422 | $this->end_controls_section(); |
| 423 | |
| 424 | $this->start_controls_section( |
| 425 | 'ekit_heading_section_general', |
| 426 | array( |
| 427 | 'label' => esc_html__( 'General', 'elementskit-lite' ), |
| 428 | 'tab' => \Elementor\Controls_Manager::TAB_STYLE, |
| 429 | ) |
| 430 | ); |
| 431 | |
| 432 | $this->add_responsive_control( |
| 433 | 'ekit_heading_title_align', [ |
| 434 | 'label' =>esc_html__( 'Alignment', 'elementskit-lite' ), |
| 435 | 'type' => Controls_Manager::CHOOSE, |
| 436 | 'options' => [ |
| 437 | 'text_left' => [ |
| 438 | 'title' =>esc_html__( 'Left', 'elementskit-lite' ), |
| 439 | 'icon' => 'eicon-text-align-left', |
| 440 | ], |
| 441 | 'text_center' => [ |
| 442 | 'title' =>esc_html__( 'Center', 'elementskit-lite' ), |
| 443 | 'icon' => 'eicon-text-align-center', |
| 444 | ], |
| 445 | 'text_right' => [ |
| 446 | 'title' =>esc_html__( 'Right', 'elementskit-lite' ), |
| 447 | 'icon' => 'eicon-text-align-right', |
| 448 | ], |
| 449 | ], |
| 450 | 'default' => 'text_left', |
| 451 | ] |
| 452 | ); |
| 453 | |
| 454 | $this->end_controls_section(); |
| 455 | |
| 456 | |
| 457 | //Title Style Section |
| 458 | $this->start_controls_section( |
| 459 | 'ekit_heading_section_title_style', [ |
| 460 | 'label' => esc_html__( 'Title', 'elementskit-lite' ), |
| 461 | 'tab' => Controls_Manager::TAB_STYLE, |
| 462 | ] |
| 463 | ); |
| 464 | |
| 465 | $this->add_responsive_control( |
| 466 | 'ekit_heading_title_color', [ |
| 467 | 'label' =>esc_html__( 'Color', 'elementskit-lite' ), |
| 468 | 'type' => Controls_Manager::COLOR, |
| 469 | 'selectors' => [ |
| 470 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title' => 'color: {{VALUE}};', |
| 471 | ], |
| 472 | ] |
| 473 | ); |
| 474 | |
| 475 | $this->add_responsive_control( |
| 476 | 'ekit_heading_title_color_hover', [ |
| 477 | 'label' =>esc_html__( 'Hover Color', 'elementskit-lite' ), |
| 478 | 'type' => Controls_Manager::COLOR, |
| 479 | 'selectors' => [ |
| 480 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title:hover' => 'color: {{VALUE}};', |
| 481 | ], |
| 482 | ] |
| 483 | ); |
| 484 | |
| 485 | $this->add_group_control( |
| 486 | Group_Control_Text_Shadow::get_type(), |
| 487 | [ |
| 488 | 'name' => 'ekit_heading_title_shadow', |
| 489 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title', |
| 490 | |
| 491 | ] |
| 492 | ); |
| 493 | $this->add_responsive_control( |
| 494 | 'ekit_heading_title_margin', |
| 495 | array( |
| 496 | 'label' => esc_html__( 'Margin', 'elementskit-lite' ), |
| 497 | 'type' => Controls_Manager::DIMENSIONS, |
| 498 | 'size_units' => array( 'px', '%' ), |
| 499 | 'selectors' => array( |
| 500 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 501 | ), |
| 502 | ) |
| 503 | ); |
| 504 | $this->add_group_control( |
| 505 | Group_Control_Typography::get_type(), [ |
| 506 | 'name' => 'ekit_heading_title_typography', |
| 507 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title', |
| 508 | ] |
| 509 | ); |
| 510 | |
| 511 | $this->add_control( 'title_left_border_heading', [ |
| 512 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 513 | 'type' => Controls_Manager::HEADING, |
| 514 | 'separator' => 'before', |
| 515 | 'condition' => [ |
| 516 | 'show_title_border' => 'yes' |
| 517 | ] |
| 518 | ]); |
| 519 | |
| 520 | $this->add_control( 'title_left_border_width', [ |
| 521 | 'label' => __( 'Border Width', 'elementskit-lite' ), |
| 522 | 'type' => Controls_Manager::SLIDER, |
| 523 | 'size_units' => [ 'px', 'em' ], |
| 524 | 'range' => [ |
| 525 | 'px' => [ |
| 526 | 'min' => 0, |
| 527 | 'max' => 32, |
| 528 | 'step' => 1, |
| 529 | ] |
| 530 | ], |
| 531 | 'default' => [ 'unit' => 'px', 'size' => 5 ], |
| 532 | 'selectors' => [ |
| 533 | '{{WRAPPER}} .ekit-heading__title-has-border::before' => |
| 534 | 'width: {{SIZE}}{{UNIT}};' |
| 535 | ], |
| 536 | 'condition' => [ |
| 537 | 'show_title_border' => 'yes' |
| 538 | ] |
| 539 | ]); |
| 540 | |
| 541 | $this->add_control( 'title_left_border_height', [ |
| 542 | 'label' => __( 'Border Height', 'elementskit-lite' ), |
| 543 | 'type' => Controls_Manager::SLIDER, |
| 544 | 'size_units' => [ '%', 'px', 'em' ], |
| 545 | 'default' => [ 'unit' => '%', 'size' => 100 ], |
| 546 | 'selectors' => [ |
| 547 | '{{WRAPPER}} .ekit-heading__title-has-border::before' => |
| 548 | 'height: {{SIZE}}{{UNIT}};' |
| 549 | ], |
| 550 | 'condition' => [ |
| 551 | 'show_title_border' => 'yes' |
| 552 | ] |
| 553 | ]); |
| 554 | |
| 555 | $this->add_control( 'title_border_vertical_position', [ |
| 556 | 'label' => __( 'Vertical Position', 'elementskit-lite' ), |
| 557 | 'type' => Controls_Manager::SLIDER, |
| 558 | 'size_units' => [ '%', 'px', 'em' ], |
| 559 | 'default' => [ 'unit' => 'px', 'size' => 0 ], |
| 560 | 'selectors' => [ |
| 561 | '{{WRAPPER}} .ekit-heading__title-has-border::before' => |
| 562 | 'top: {{SIZE}}{{UNIT}};' |
| 563 | ], |
| 564 | 'condition' => [ |
| 565 | 'show_title_border' => 'yes' |
| 566 | ] |
| 567 | ]); |
| 568 | |
| 569 | $this->add_control( 'title_left_border_gap', [ |
| 570 | 'label' => __( 'Right Gap', 'elementskit-lite' ), |
| 571 | 'type' => Controls_Manager::SLIDER, |
| 572 | 'size_units' => [ 'px', 'em' ], |
| 573 | 'range' => [ |
| 574 | 'px' => [ |
| 575 | 'min' => 0, |
| 576 | 'max' => 128, |
| 577 | 'step' => 1, |
| 578 | ] |
| 579 | ], |
| 580 | 'default' => [ 'unit' => 'px', 'size' => 30 ], |
| 581 | 'selectors' => [ |
| 582 | '{{WRAPPER}} .ekit-heading__title-has-border' => |
| 583 | 'padding-left: {{SIZE}}{{UNIT}};', |
| 584 | '{{WRAPPER}} .ekit-heading__title-has-border ~ *' => |
| 585 | 'padding-left: {{SIZE}}{{UNIT}};', |
| 586 | '{{WRAPPER}} .ekit-heading__subtitle-has-border' => |
| 587 | 'margin-left: {{SIZE}}{{UNIT}};' |
| 588 | ], |
| 589 | 'condition' => [ |
| 590 | 'show_title_border' => 'yes', |
| 591 | 'title_border_position' => 'start', |
| 592 | 'ekit_heading_title_align!' => 'text_center' |
| 593 | ] |
| 594 | ]); |
| 595 | |
| 596 | $this->add_control( 'title_left_border_gap2', [ |
| 597 | 'label' => __( 'Left Gap', 'elementskit-lite' ), |
| 598 | 'type' => Controls_Manager::SLIDER, |
| 599 | 'size_units' => [ 'px', 'em' ], |
| 600 | 'range' => [ |
| 601 | 'px' => [ |
| 602 | 'min' => 0, |
| 603 | 'max' => 128, |
| 604 | 'step' => 1, |
| 605 | ] |
| 606 | ], |
| 607 | 'default' => [ 'unit' => 'px', 'size' => 30 ], |
| 608 | 'selectors' => [ |
| 609 | '{{WRAPPER}} .ekit-heading__title-has-border' => |
| 610 | 'padding-right: {{SIZE}}{{UNIT}};', |
| 611 | '{{WRAPPER}} .ekit-heading__title-has-border ~ *' => |
| 612 | 'padding-right: {{SIZE}}{{UNIT}};', |
| 613 | '{{WRAPPER}} .ekit-heading__subtitle-has-border' => |
| 614 | 'margin-right: {{SIZE}}{{UNIT}};' |
| 615 | ], |
| 616 | 'condition' => [ |
| 617 | 'show_title_border' => 'yes', |
| 618 | 'title_border_position' => 'end', |
| 619 | 'ekit_heading_title_align!' => 'text_center' |
| 620 | ] |
| 621 | ]); |
| 622 | |
| 623 | $this->add_group_control(Group_Control_Background::get_type(), |
| 624 | [ |
| 625 | 'name' => 'title_left_border_color', |
| 626 | 'label' => __( 'Background', 'elementskit-lite' ), |
| 627 | 'types' => [ 'classic', 'gradient', 'video' ], |
| 628 | 'selector' => '{{WRAPPER}} .ekit-heading__title-has-border::before', |
| 629 | 'types' => ['gradient'], |
| 630 | 'condition' => [ |
| 631 | 'show_title_border' => 'yes' |
| 632 | ] |
| 633 | ] |
| 634 | ); |
| 635 | |
| 636 | $this->end_controls_section(); |
| 637 | |
| 638 | //Focused Title Style Section |
| 639 | $this->start_controls_section( |
| 640 | 'ekit_heading_section_focused_title_style', [ |
| 641 | 'label' => esc_html__( 'Focused Title', 'elementskit-lite' ), |
| 642 | 'tab' => Controls_Manager::TAB_STYLE, |
| 643 | ] |
| 644 | ); |
| 645 | |
| 646 | $this->add_responsive_control( |
| 647 | 'ekit_heading_focused_title_color', [ |
| 648 | 'label' =>esc_html__( 'Color', 'elementskit-lite' ), |
| 649 | 'type' => Controls_Manager::COLOR, |
| 650 | 'default' => '#000000', |
| 651 | 'selectors' => [ |
| 652 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title > span' => 'color: {{VALUE}};', |
| 653 | ], |
| 654 | ] |
| 655 | ); |
| 656 | |
| 657 | $this->add_responsive_control( |
| 658 | 'ekit_heading_focused_title_color_hover', [ |
| 659 | 'label' =>esc_html__( 'Hover Color', 'elementskit-lite' ), |
| 660 | 'type' => Controls_Manager::COLOR, |
| 661 | 'default' => '#000000', |
| 662 | 'selectors' => [ |
| 663 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title:hover > span' => 'color: {{VALUE}};', |
| 664 | ], |
| 665 | ] |
| 666 | ); |
| 667 | |
| 668 | $this->add_group_control( |
| 669 | Group_Control_Typography::get_type(), [ |
| 670 | 'name' => 'ekit_heading_focused_title_typography', |
| 671 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title span:last-child, {{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title > span', |
| 672 | ] |
| 673 | ); |
| 674 | |
| 675 | $this->add_responsive_control( |
| 676 | 'ekit_heading_title_text_decoration_color', [ |
| 677 | 'label' =>esc_html__( 'Text decoration color', 'elementskit-lite' ), |
| 678 | 'type' => Controls_Manager::COLOR, |
| 679 | 'selectors' => [ |
| 680 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title span:last-child' => 'text-decoration-color: {{VALUE}};', |
| 681 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title > span' => 'text-decoration-color: {{VALUE}};', |
| 682 | ], |
| 683 | ] |
| 684 | ); |
| 685 | |
| 686 | $this->add_group_control( |
| 687 | Group_Control_Text_Shadow::get_type(), |
| 688 | [ |
| 689 | 'name' => 'ekit_heading_focus_title_shadow', |
| 690 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title > span', |
| 691 | |
| 692 | ] |
| 693 | ); |
| 694 | |
| 695 | $this->add_responsive_control( |
| 696 | 'ekit_heading_focused_title_secondary_spacing', |
| 697 | [ |
| 698 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 699 | 'type' => Controls_Manager::DIMENSIONS, |
| 700 | 'size_units' => [ 'px', '%' ], |
| 701 | 'selectors' => [ |
| 702 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 703 | ], |
| 704 | ] |
| 705 | ); |
| 706 | |
| 707 | $this->add_control( |
| 708 | 'ekit_heading_use_focused_title_bg', [ |
| 709 | 'label' =>esc_html__( 'Use background color on text', 'elementskit-lite' ), |
| 710 | 'type' => Controls_Manager::SWITCHER, |
| 711 | 'default' => 'no', |
| 712 | 'label_on' =>esc_html__( 'Yes', 'elementskit-lite' ), |
| 713 | 'label_off' =>esc_html__( 'No', 'elementskit-lite' ), |
| 714 | 'condition' => [ |
| 715 | 'ekit_heading_use_title_text_fill!' => 'yes' |
| 716 | ], |
| 717 | ] |
| 718 | ); |
| 719 | |
| 720 | $this->add_group_control( |
| 721 | Group_Control_Background::get_type(), |
| 722 | array( |
| 723 | 'name' => 'ekit_heading_focused_title_secondary_bg', |
| 724 | 'label' => esc_html__( 'Focused Title Secondary BG', 'elementskit-lite' ), |
| 725 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title > span', |
| 726 | 'condition' => [ |
| 727 | 'ekit_heading_use_focused_title_bg' => 'yes', |
| 728 | 'ekit_heading_use_title_text_fill!' => 'yes' |
| 729 | ], |
| 730 | ) |
| 731 | ); |
| 732 | |
| 733 | $this->add_control( |
| 734 | 'ekit_heading_focused_title_secondary_border_radius', |
| 735 | [ |
| 736 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 737 | 'type' => Controls_Manager::DIMENSIONS, |
| 738 | 'size_units' => [ 'px', '%', 'em' ], |
| 739 | 'selectors' => [ |
| 740 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 741 | ], |
| 742 | 'condition' => [ |
| 743 | 'ekit_heading_use_focused_title_bg' => 'yes', |
| 744 | 'ekit_heading_use_title_text_fill!' => 'yes' |
| 745 | ], |
| 746 | ] |
| 747 | ); |
| 748 | |
| 749 | $this->add_control( |
| 750 | 'ekit_heading_use_title_text_fill', [ |
| 751 | 'label' =>esc_html__( 'Use text fill', 'elementskit-lite' ), |
| 752 | 'type' => Controls_Manager::SWITCHER, |
| 753 | 'default' => 'no', |
| 754 | 'label_on' =>esc_html__( 'Yes', 'elementskit-lite' ), |
| 755 | 'label_off' =>esc_html__( 'No', 'elementskit-lite' ), |
| 756 | 'separator' => 'before', |
| 757 | 'condition' => [ |
| 758 | 'ekit_heading_use_focused_title_bg!' => 'yes' |
| 759 | ] |
| 760 | ] |
| 761 | ); |
| 762 | |
| 763 | $this->add_group_control( |
| 764 | Group_Control_Background::get_type(), |
| 765 | array( |
| 766 | 'name' => 'ekit_heading_title_secondary_bg', |
| 767 | 'label' => esc_html__( 'Focused Title Secondary BG', 'elementskit-lite' ), |
| 768 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-title.text_fill > span', |
| 769 | 'condition' => [ |
| 770 | 'ekit_heading_use_title_text_fill' => 'yes', |
| 771 | 'ekit_heading_use_focused_title_bg!' => 'yes' |
| 772 | ], |
| 773 | ) |
| 774 | ); |
| 775 | |
| 776 | $this->end_controls_section(); |
| 777 | |
| 778 | //Sub title Style Section |
| 779 | $this->start_controls_section( |
| 780 | 'ekit_heading_section_sub_title_style', [ |
| 781 | 'label' => esc_html__( 'Subtitle', 'elementskit-lite' ), |
| 782 | 'tab' => Controls_Manager::TAB_STYLE, |
| 783 | 'condition' => [ |
| 784 | 'ekit_heading_sub_title_show' => 'yes', |
| 785 | 'ekit_heading_sub_title!' => '' |
| 786 | ] |
| 787 | ] |
| 788 | ); |
| 789 | |
| 790 | $this->add_responsive_control( |
| 791 | 'ekit_heading_sub_title_color', [ |
| 792 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 793 | 'type' => Controls_Manager::COLOR, |
| 794 | 'selectors' => [ |
| 795 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-subtitle' => 'color: {{VALUE}};', |
| 796 | ], |
| 797 | ] |
| 798 | ); |
| 799 | |
| 800 | $this->add_group_control( |
| 801 | Group_Control_Typography::get_type(), [ |
| 802 | 'name' => 'ekit_heading_sub_title_typography', |
| 803 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-subtitle', |
| 804 | ] |
| 805 | ); |
| 806 | |
| 807 | $this->add_responsive_control( |
| 808 | 'ekit_heading_sub_title_margn', |
| 809 | [ |
| 810 | 'label' => esc_html__( 'Margin', 'elementskit-lite' ), |
| 811 | 'type' => Controls_Manager::DIMENSIONS, |
| 812 | 'size_units' => [ 'px', 'rem', '%' ], |
| 813 | 'selectors' => [ |
| 814 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-subtitle' => |
| 815 | 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 816 | ], |
| 817 | ] |
| 818 | ); |
| 819 | |
| 820 | $this->add_responsive_control( 'subheading_padding', [ |
| 821 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 822 | 'type' => Controls_Manager::DIMENSIONS, |
| 823 | 'size_units' => [ 'px', '%', 'em'], |
| 824 | 'default' => [ |
| 825 | 'top' => '8', 'right' => '32', |
| 826 | 'bottom' => '8', 'left' => '32', |
| 827 | 'unit' => 'px', 'isLinked' => false |
| 828 | ], |
| 829 | 'selectors' => [ |
| 830 | '{{WRAPPER}} .ekit-heading__subtitle-has-border' => |
| 831 | 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 832 | ], |
| 833 | 'condition' => [ |
| 834 | 'ekit_heading_sub_title_border!' => 'yes', |
| 835 | 'ekit_heading_sub_title_outline' => 'yes' |
| 836 | ] |
| 837 | ]); |
| 838 | |
| 839 | |
| 840 | $this->add_control( |
| 841 | 'ekit_heading_use_sub_title_text_fill', [ |
| 842 | 'label' =>esc_html__( 'Use text fill', 'elementskit-lite' ), |
| 843 | 'type' => Controls_Manager::SWITCHER, |
| 844 | 'default' => 'no', |
| 845 | 'label_on' =>esc_html__( 'Yes', 'elementskit-lite' ), |
| 846 | 'label_off' =>esc_html__( 'No', 'elementskit-lite' ), |
| 847 | |
| 848 | ] |
| 849 | ); |
| 850 | $this->add_group_control( |
| 851 | Group_Control_Background::get_type(), |
| 852 | array( |
| 853 | 'name' => 'ekit_heading_sub_title_secondary_bg', |
| 854 | 'label' => esc_html__( 'Sub Title', 'elementskit-lite' ), |
| 855 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-section-subtitle', |
| 856 | 'condition' => [ |
| 857 | 'ekit_heading_use_sub_title_text_fill' => 'yes', |
| 858 | ], |
| 859 | ) |
| 860 | ); |
| 861 | |
| 862 | $this->add_control( |
| 863 | 'ekit_heading_sub_title_border_hr', |
| 864 | [ |
| 865 | 'type' => Controls_Manager::DIVIDER, |
| 866 | 'style' => 'thick', |
| 867 | 'condition' => [ |
| 868 | 'ekit_heading_sub_title_border' => 'yes', |
| 869 | ], |
| 870 | ] |
| 871 | ); |
| 872 | |
| 873 | $this->add_control( |
| 874 | 'ekit_heading_sub_title_border_heading_title_left', |
| 875 | [ |
| 876 | 'label' => esc_html__( 'Subtitle Border Left', 'elementskit-lite' ), |
| 877 | 'type' => Controls_Manager::HEADING, |
| 878 | 'condition' => [ |
| 879 | 'ekit_heading_sub_title_border' => 'yes', |
| 880 | ], |
| 881 | ] |
| 882 | ); |
| 883 | |
| 884 | $this->add_group_control( |
| 885 | Group_Control_Background::get_type(), |
| 886 | array( |
| 887 | 'name' => 'ekit_heading_sub_title_border_color_left', |
| 888 | 'label' => esc_html__( 'Sub Title', 'elementskit-lite' ), |
| 889 | 'selector' => '{{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::before', |
| 890 | 'condition' => [ |
| 891 | 'ekit_heading_sub_title_border' => 'yes', |
| 892 | ], |
| 893 | ) |
| 894 | ); |
| 895 | |
| 896 | |
| 897 | $this->add_responsive_control( |
| 898 | 'ekit_heading_sub_title_border_left_width', |
| 899 | [ |
| 900 | 'label' => esc_html__( 'Width', 'elementskit-lite' ), |
| 901 | 'type' => Controls_Manager::SLIDER, |
| 902 | 'size_units' => [ 'px' ], |
| 903 | 'range' => [ |
| 904 | 'px' => [ |
| 905 | 'min' => 0, |
| 906 | 'max' => 100, |
| 907 | 'step' => 1, |
| 908 | ], |
| 909 | ], |
| 910 | 'default' => [ |
| 911 | 'unit' => 'px', |
| 912 | 'size' => 40, |
| 913 | ], |
| 914 | 'selectors' => [ |
| 915 | '{{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::before' => 'width: {{SIZE}}{{UNIT}};', |
| 916 | ], |
| 917 | 'condition' => [ |
| 918 | 'ekit_heading_sub_title_border' => 'yes', |
| 919 | ], |
| 920 | ] |
| 921 | ); |
| 922 | |
| 923 | $this->add_responsive_control( |
| 924 | 'ekit_heading_sub_title_border_heading_title_right_margin', |
| 925 | [ |
| 926 | 'label' => __( 'Margin', 'elementskit-lite' ), |
| 927 | 'type' => Controls_Manager::DIMENSIONS, |
| 928 | 'size_units' => [ 'px', '%', 'em' ], |
| 929 | 'selectors' => [ |
| 930 | '{{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::before' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 931 | ], |
| 932 | 'condition' => [ |
| 933 | 'ekit_heading_sub_title_border' => 'yes', |
| 934 | ], |
| 935 | ] |
| 936 | ); |
| 937 | |
| 938 | $this->add_control( |
| 939 | 'ekit_heading_sub_title_border_heading_title_right', |
| 940 | [ |
| 941 | 'label' => esc_html__( 'Subtitle Border Right color', 'elementskit-lite' ), |
| 942 | 'type' => Controls_Manager::HEADING, |
| 943 | 'condition' => [ |
| 944 | 'ekit_heading_sub_title_border' => 'yes', |
| 945 | ], |
| 946 | ] |
| 947 | ); |
| 948 | |
| 949 | $this->add_group_control( |
| 950 | Group_Control_Background::get_type(), |
| 951 | array( |
| 952 | 'name' => 'ekit_heading_sub_title_border_color_right', |
| 953 | 'label' => esc_html__( 'Sub Title', 'elementskit-lite' ), |
| 954 | 'selector' => '{{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::after', |
| 955 | 'condition' => [ |
| 956 | 'ekit_heading_sub_title_border' => 'yes', |
| 957 | ], |
| 958 | ) |
| 959 | ); |
| 960 | |
| 961 | $this->add_responsive_control( |
| 962 | 'ekit_heading_sub_title_border_right_width', |
| 963 | [ |
| 964 | 'label' => esc_html__( 'Width', 'elementskit-lite' ), |
| 965 | 'type' => Controls_Manager::SLIDER, |
| 966 | 'size_units' => [ 'px' ], |
| 967 | 'range' => [ |
| 968 | 'px' => [ |
| 969 | 'min' => 0, |
| 970 | 'max' => 100, |
| 971 | 'step' => 1, |
| 972 | ], |
| 973 | ], |
| 974 | 'default' => [ |
| 975 | 'unit' => 'px', |
| 976 | 'size' => 40, |
| 977 | ], |
| 978 | 'selectors' => [ |
| 979 | '{{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::after' => 'width: {{SIZE}}{{UNIT}};', |
| 980 | ], |
| 981 | 'condition' => [ |
| 982 | 'ekit_heading_sub_title_border' => 'yes', |
| 983 | ], |
| 984 | ] |
| 985 | ); |
| 986 | |
| 987 | $this->add_responsive_control( |
| 988 | 'ekit_heading_sub_title_border_heading_title_left_margin', |
| 989 | [ |
| 990 | 'label' => __( 'Margin', 'elementskit-lite' ), |
| 991 | 'type' => Controls_Manager::DIMENSIONS, |
| 992 | 'size_units' => [ 'px', '%', 'em' ], |
| 993 | 'selectors' => [ |
| 994 | '{{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::after' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 995 | ], |
| 996 | 'condition' => [ |
| 997 | 'ekit_heading_sub_title_border' => 'yes', |
| 998 | ], |
| 999 | ] |
| 1000 | ); |
| 1001 | |
| 1002 | $this->add_responsive_control( |
| 1003 | 'ekit_heading_sub_title_border_height', |
| 1004 | [ |
| 1005 | 'label' => esc_html__( 'Height', 'elementskit-lite' ), |
| 1006 | 'type' => Controls_Manager::SLIDER, |
| 1007 | 'size_units' => [ 'px' ], |
| 1008 | 'range' => [ |
| 1009 | 'px' => [ |
| 1010 | 'min' => 0, |
| 1011 | 'max' => 100, |
| 1012 | 'step' => 1, |
| 1013 | ], |
| 1014 | ], |
| 1015 | 'default' => [ |
| 1016 | 'unit' => 'px', |
| 1017 | 'size' => 3, |
| 1018 | ], |
| 1019 | 'selectors' => [ |
| 1020 | '{{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::before, {{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::after' => 'height: {{SIZE}}{{UNIT}};', |
| 1021 | ], |
| 1022 | 'condition' => [ |
| 1023 | 'ekit_heading_sub_title_border' => 'yes', |
| 1024 | ], |
| 1025 | ] |
| 1026 | ); |
| 1027 | |
| 1028 | $this->add_responsive_control( |
| 1029 | 'ekit_heading_sub_title_vertical_alignment', |
| 1030 | [ |
| 1031 | 'label' => esc_html__( 'Vertical Position', 'elementskit-lite' ), |
| 1032 | 'type' => Controls_Manager::SLIDER, |
| 1033 | 'size_units' => [ 'px' ], |
| 1034 | 'range' => [ |
| 1035 | 'px' => [ |
| 1036 | 'min' => -20, |
| 1037 | 'max' => 20, |
| 1038 | 'step' => 1, |
| 1039 | ], |
| 1040 | ], |
| 1041 | 'default' => [ |
| 1042 | 'unit' => 'px', |
| 1043 | 'size' => 3, |
| 1044 | ], |
| 1045 | 'selectors' => [ |
| 1046 | '{{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::before, {{WRAPPER}} .elementskit-section-subtitle.elementskit-style-border::after' => 'transform: translateY({{SIZE}}{{UNIT}}); -webkit-transform: translateY({{SIZE}}{{UNIT}}); -ms-transform: translateY({{SIZE}}{{UNIT}})', |
| 1047 | ], |
| 1048 | 'condition' => [ |
| 1049 | 'ekit_heading_sub_title_border' => 'yes', |
| 1050 | ], |
| 1051 | ] |
| 1052 | ); |
| 1053 | |
| 1054 | $this->add_control( 'subheading_outline_heading', [ |
| 1055 | 'label' => esc_html__( 'Outline', 'elementskit-lite' ), |
| 1056 | 'type' => Controls_Manager::HEADING, |
| 1057 | 'separator' => 'before', |
| 1058 | 'condition' => [ |
| 1059 | 'ekit_heading_sub_title_outline' => 'yes' |
| 1060 | ] |
| 1061 | ]); |
| 1062 | |
| 1063 | $this->add_group_control( |
| 1064 | Group_Control_Border::get_type(), |
| 1065 | [ |
| 1066 | 'name' => 'subheading_outline', |
| 1067 | 'label' => __( 'Outline', 'elementskit-lite' ), |
| 1068 | 'selector' => '{{WRAPPER}} .ekit-heading__subtitle-has-border', |
| 1069 | 'condition' => [ |
| 1070 | 'ekit_heading_sub_title_outline' => 'yes' |
| 1071 | ] |
| 1072 | ] |
| 1073 | ); |
| 1074 | |
| 1075 | $this->add_responsive_control( 'subheading_outline_radius', [ |
| 1076 | 'label' => esc_html__( 'Outline Radius', 'elementskit-lite' ), |
| 1077 | 'type' => Controls_Manager::DIMENSIONS, |
| 1078 | 'size_units' => [ 'px', '%', 'em'], |
| 1079 | 'default' => [ |
| 1080 | 'top' => '2', |
| 1081 | 'right' => '2', |
| 1082 | 'bottom' => '2', |
| 1083 | 'left' => '2', |
| 1084 | 'unit' => 'em', |
| 1085 | 'isLinked' => true |
| 1086 | ], |
| 1087 | 'selectors' => [ |
| 1088 | '{{WRAPPER}} .ekit-heading__subtitle-has-border' => |
| 1089 | 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1090 | ], |
| 1091 | 'condition' => [ |
| 1092 | 'ekit_heading_sub_title_outline' => 'yes' |
| 1093 | ] |
| 1094 | ]); |
| 1095 | |
| 1096 | $this->end_controls_section(); |
| 1097 | |
| 1098 | //Extra Title Style Section |
| 1099 | $this->start_controls_section( |
| 1100 | 'ekit_heading_section_extra_title_style', [ |
| 1101 | 'label' => esc_html__( 'Title Description', 'elementskit-lite' ), |
| 1102 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1103 | 'condition' => [ |
| 1104 | 'ekit_heading_section_extra_title_show' => 'yes', |
| 1105 | 'ekit_heading_extra_title!' => '' |
| 1106 | ] |
| 1107 | ] |
| 1108 | ); |
| 1109 | |
| 1110 | $this->add_responsive_control( |
| 1111 | 'ekit_heading_extra_title_color', [ |
| 1112 | 'label' =>esc_html__( 'Title Description color', 'elementskit-lite' ), |
| 1113 | 'type' => Controls_Manager::COLOR, |
| 1114 | 'selectors' => [ |
| 1115 | '{{WRAPPER}} .elementskit-section-title-wraper p' => 'color: {{VALUE}};', |
| 1116 | ], |
| 1117 | ] |
| 1118 | ); |
| 1119 | $this->add_group_control( |
| 1120 | Group_Control_Typography::get_type(), [ |
| 1121 | 'name' => 'ekit_heading_extra_title_typography', |
| 1122 | 'selector' => '{{WRAPPER}} .elementskit-section-title-wraper p', |
| 1123 | ] |
| 1124 | ); |
| 1125 | |
| 1126 | $this->add_responsive_control( |
| 1127 | 'ekit_heading_extra_title_margin', |
| 1128 | array( |
| 1129 | 'label' => esc_html__( 'Margin', 'elementskit-lite' ), |
| 1130 | 'type' => Controls_Manager::DIMENSIONS, |
| 1131 | 'size_units' => array( 'px', '%' ), |
| 1132 | 'selectors' => array( |
| 1133 | '{{WRAPPER}} .elementskit-section-title-wraper p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1134 | ), |
| 1135 | ) |
| 1136 | ); |
| 1137 | |
| 1138 | $this->end_controls_section(); |
| 1139 | |
| 1140 | //Separator Style Section |
| 1141 | $this->start_controls_section( |
| 1142 | 'ekit_heading_section_seperator_style', [ |
| 1143 | 'label' => esc_html__( 'Separator', 'elementskit-lite' ), |
| 1144 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1145 | 'condition' => [ |
| 1146 | 'ekit_heading_show_seperator' => 'yes' |
| 1147 | ] |
| 1148 | ] |
| 1149 | ); |
| 1150 | $this->add_responsive_control( |
| 1151 | 'ekit_heading_seperator_width', |
| 1152 | [ |
| 1153 | 'label' => esc_html__( 'Width', 'elementskit-lite' ), |
| 1154 | 'type' => Controls_Manager::SLIDER, |
| 1155 | 'range' => [ |
| 1156 | 'px' => [ |
| 1157 | 'min' => 0, |
| 1158 | 'max' => 1000, |
| 1159 | ], |
| 1160 | ], |
| 1161 | 'default' => [ |
| 1162 | 'unit' => 'px', |
| 1163 | 'size' => 100, |
| 1164 | ], |
| 1165 | 'selectors' => [ |
| 1166 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-divider' => 'width: {{SIZE}}{{UNIT}};', |
| 1167 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-divider.elementskit-style-long' => 'width: {{SIZE}}{{UNIT}};', |
| 1168 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-star' => 'width: {{SIZE}}{{UNIT}};', |
| 1169 | ], |
| 1170 | 'condition' => [ |
| 1171 | 'ekit_heading_seperator_style!' => 'ekit_border_custom' |
| 1172 | ] |
| 1173 | ] |
| 1174 | ); |
| 1175 | |
| 1176 | $this->add_responsive_control( |
| 1177 | 'ekit_heading_seperator_height', |
| 1178 | [ |
| 1179 | 'label' => esc_html__( 'Height', 'elementskit-lite' ), |
| 1180 | 'type' => Controls_Manager::SLIDER, |
| 1181 | 'range' => [ |
| 1182 | 'px' => [ |
| 1183 | 'min' => 0, |
| 1184 | 'max' => 1000, |
| 1185 | ], |
| 1186 | ], |
| 1187 | 'default' => [ |
| 1188 | 'unit' => 'px', |
| 1189 | 'size' => 4, |
| 1190 | ], |
| 1191 | 'selectors' => [ |
| 1192 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-divider, {{WRAPPER}} .elementskit-border-divider::before' => 'height: {{SIZE}}{{UNIT}};', |
| 1193 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-divider.elementskit-style-long' => 'height: {{SIZE}}{{UNIT}};', |
| 1194 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-star' => 'height: {{SIZE}}{{UNIT}};', |
| 1195 | |
| 1196 | ], |
| 1197 | 'condition' => [ |
| 1198 | 'ekit_heading_seperator_style!' => 'ekit_border_custom' |
| 1199 | ] |
| 1200 | ] |
| 1201 | ); |
| 1202 | |
| 1203 | $this->add_responsive_control( |
| 1204 | 'ekit_heading_seperator_margin', |
| 1205 | [ |
| 1206 | 'label' => esc_html__( 'Margin', 'elementskit-lite' ), |
| 1207 | 'type' => Controls_Manager::DIMENSIONS, |
| 1208 | 'size_units' => [ 'px', '%' ], |
| 1209 | 'selectors' => [ |
| 1210 | '{{WRAPPER}} .elementskit-section-title-wraper .ekit_heading_separetor_wraper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1211 | ], |
| 1212 | ] |
| 1213 | ); |
| 1214 | |
| 1215 | $this->add_responsive_control( |
| 1216 | 'ekit_heading_seperator_color', [ |
| 1217 | 'label' =>esc_html__( 'Separator color', 'elementskit-lite' ), |
| 1218 | 'type' => Controls_Manager::COLOR, |
| 1219 | 'selectors' => [ |
| 1220 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-divider' => 'background: linear-gradient(90deg, {{VALUE}} 0%, {{VALUE}} 100%);', |
| 1221 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-divider:before' => 'background-color: {{VALUE}}; color: {{VALUE}};', |
| 1222 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-divider.elementskit-style-long' => 'color: {{VALUE}};', |
| 1223 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-star' => 'color: {{VALUE}}', |
| 1224 | '{{WRAPPER}} .elementskit-section-title-wraper .elementskit-border-star:after' => 'background-color: {{VALUE}};', |
| 1225 | ], |
| 1226 | 'condition' => [ |
| 1227 | 'ekit_heading_seperator_style!' => 'ekit_border_custom' |
| 1228 | ] |
| 1229 | ] |
| 1230 | ); |
| 1231 | |
| 1232 | $this->end_controls_section(); |
| 1233 | |
| 1234 | /** Start Heading shadow text style setion */ |
| 1235 | $this->start_controls_section( 'shadow_text_style_section', [ |
| 1236 | 'label' => esc_html__( 'Shadow Text', 'elementskit-lite' ), |
| 1237 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1238 | 'condition' => [ |
| 1239 | 'show_shadow_text' => 'yes' |
| 1240 | ] |
| 1241 | ]); |
| 1242 | |
| 1243 | $this->add_responsive_control( 'shadow_text_position', [ |
| 1244 | 'label' => esc_html__( 'Position', 'elementskit-lite' ), |
| 1245 | 'type' => Controls_Manager::DIMENSIONS, |
| 1246 | 'size_units' => [ 'px', '%', 'em', 'rem', 'vw' ], |
| 1247 | 'allowed_dimensions' => [ 'top', 'left' ], |
| 1248 | 'default' => [ |
| 1249 | 'top' => '-45', |
| 1250 | 'left' => '18', |
| 1251 | 'unit' => '%', |
| 1252 | 'isLinked' => false |
| 1253 | ], |
| 1254 | 'selectors' => [ |
| 1255 | '{{WRAPPER}} .ekit-heading__shadow-text' => |
| 1256 | 'top:{{TOP}}{{UNIT}};left:{{LEFT}}{{UNIT}};', |
| 1257 | ], |
| 1258 | ]); |
| 1259 | |
| 1260 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 1261 | 'name' => 'shadow_text_typography', |
| 1262 | 'selector' => '{{WRAPPER}} .ekit-heading__shadow-text', |
| 1263 | ]); |
| 1264 | |
| 1265 | $this->add_responsive_control( 'shadow_text_color', [ |
| 1266 | 'label' =>esc_html__( 'Text color', 'elementskit-lite' ), |
| 1267 | 'type' => Controls_Manager::COLOR, |
| 1268 | 'selectors' => [ |
| 1269 | '{{WRAPPER}} .ekit-heading__shadow-text' => |
| 1270 | '-webkit-text-fill-color: {{VALUE}};', |
| 1271 | ], |
| 1272 | ]); |
| 1273 | |
| 1274 | $this->add_control( 'shadow_text_border_heading', [ |
| 1275 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 1276 | 'type' => Controls_Manager::HEADING, |
| 1277 | ]); |
| 1278 | |
| 1279 | $this->add_control( 'shadow_text_border_width', [ |
| 1280 | 'label' => __( 'Border Width', 'elementskit-lite' ), |
| 1281 | 'type' => Controls_Manager::SLIDER, |
| 1282 | 'size_units' => [ 'px', 'em' ], |
| 1283 | 'range' => [ |
| 1284 | 'px' => [ |
| 1285 | 'min' => 0, |
| 1286 | 'max' => 64, |
| 1287 | 'step' => 1, |
| 1288 | ] |
| 1289 | ], |
| 1290 | 'default' => [ 'unit' => 'px', 'size' => 1 ], |
| 1291 | 'selectors' => [ |
| 1292 | '{{WRAPPER}} .ekit-heading__shadow-text' => |
| 1293 | '-webkit-text-stroke-width: {{SIZE}}{{UNIT}};' |
| 1294 | ], |
| 1295 | ]); |
| 1296 | |
| 1297 | $this->add_responsive_control( 'shadow_text_border_color', [ |
| 1298 | 'label' =>esc_html__( 'Border Color', 'elementskit-lite' ), |
| 1299 | 'type' => Controls_Manager::COLOR, |
| 1300 | 'selectors' => [ |
| 1301 | '{{WRAPPER}} .ekit-heading__shadow-text' => |
| 1302 | '-webkit-text-stroke-color: {{VALUE}};', |
| 1303 | ], |
| 1304 | ]); |
| 1305 | |
| 1306 | $this->end_controls_section(); |
| 1307 | /** End Heading shadow text style setion */ |
| 1308 | |
| 1309 | $this->insert_pro_message(); |
| 1310 | } |
| 1311 | |
| 1312 | protected function render( ) { |
| 1313 | echo '<div class="ekit-wid-con" >'; |
| 1314 | $this->render_raw(); |
| 1315 | echo '</div>'; |
| 1316 | } |
| 1317 | |
| 1318 | protected function render_raw( ) { |
| 1319 | $settings = $this->get_settings_for_display(); |
| 1320 | extract($settings); |
| 1321 | |
| 1322 | $title_tag = \Elementor\Utils::validate_html_tag($ekit_heading_title_tag); |
| 1323 | $sub_title_tag = \Elementor\Utils::validate_html_tag($ekit_heading_sub_title_tag); |
| 1324 | |
| 1325 | // Image sectionn |
| 1326 | $image_html = ''; |
| 1327 | if (!empty($settings['ekit_heading_seperator_image']['url'])) { |
| 1328 | |
| 1329 | $this->add_render_attribute('image', 'src', $settings['ekit_heading_seperator_image']['url']); |
| 1330 | $this->add_render_attribute('image', 'alt', Control_Media::get_image_alt($settings['ekit_heading_seperator_image'])); |
| 1331 | $this->add_render_attribute('image', 'title', Control_Media::get_image_title($settings['ekit_heading_seperator_image'])); |
| 1332 | |
| 1333 | $image_html = Group_Control_Image_Size::get_attachment_image_html($settings, 'ekit_heading_seperator_image_size', 'ekit_heading_seperator_image'); |
| 1334 | } |
| 1335 | |
| 1336 | $seperator = ''; |
| 1337 | if ($ekit_heading_seperator_style != 'ekit_border_custom') { |
| 1338 | $seperator = ($ekit_heading_show_seperator == 'yes') ? '<div class="ekit_heading_separetor_wraper ekit_heading_'. esc_attr($ekit_heading_seperator_style) .'"><div class="'. esc_attr($ekit_heading_seperator_style) .'"></div></div>' : ''; |
| 1339 | } else { |
| 1340 | $seperator = ($ekit_heading_show_seperator == 'yes') ? '<div class="ekit_heading_separetor_wraper ekit_heading_'. esc_attr($ekit_heading_seperator_style) .'"><div class="'. esc_attr($ekit_heading_seperator_style) .'">'.$image_html.'</div></div>' : ''; |
| 1341 | } |
| 1342 | |
| 1343 | |
| 1344 | $title_text_fill = ($ekit_heading_use_title_text_fill == 'yes') ? 'text_fill' : ''; |
| 1345 | |
| 1346 | $sub_title_text_fill = ($settings['ekit_heading_use_sub_title_text_fill'] == 'yes') ? 'elementskit-gradient-title' : ''; |
| 1347 | |
| 1348 | $sub_title_border = ($settings['ekit_heading_sub_title_border'] == 'yes') ? 'elementskit-style-border' : ''; |
| 1349 | |
| 1350 | $title_border = (isset($show_title_border) && $show_title_border == 'yes') ? ' ekit-heading__title-has-border '. esc_attr($title_border_position) : ''; |
| 1351 | $subheading_outline = (isset($ekit_heading_sub_title_outline) && $ekit_heading_sub_title_outline == 'yes') ? ' ekit-heading__subtitle-has-border' : ''; |
| 1352 | $title_in_left = (isset($title_float_left) && $title_float_left == 'yes' ) ? ' ekit-heading__title-in-left' : ''; |
| 1353 | |
| 1354 | $ekit_heading_align_tablet = isset($settings['ekit_heading_title_align_tablet']) ? $ekit_heading_title_align_tablet : ''; |
| 1355 | $ekit_heading_align_mobile = isset($settings['ekit_heading_title_align_mobile']) ? $ekit_heading_title_align_mobile : ''; |
| 1356 | |
| 1357 | echo '<div class="ekit-heading elementskit-section-title-wraper '.esc_attr($ekit_heading_title_align).' ekit_heading_tablet-'. esc_attr($ekit_heading_align_tablet) .' ekit_heading_mobile-'. esc_attr($ekit_heading_align_mobile) .''.esc_attr($title_in_left).'">'; |
| 1358 | |
| 1359 | if(!empty($shadow_text_content) && $show_shadow_text == 'yes' ): ?> |
| 1360 | <span class='ekit-heading__shadow-text'> |
| 1361 | <?php echo wp_kses(\ElementsKit_Lite\Utils::kspan($shadow_text_content), \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 1362 | </span> |
| 1363 | <?php endif; |
| 1364 | |
| 1365 | if($title_float_left == 'yes'):?> |
| 1366 | <div class='ekit-heading__title-wrapper'> |
| 1367 | <?php endif; |
| 1368 | |
| 1369 | echo (($ekit_heading_seperator_position) == 'top') ? wp_kses($seperator, \ElementsKit_Lite\Utils::get_kses_array()): ''; |
| 1370 | if($ekit_heading_sub_title_position == 'before_title' && $title_float_left != 'yes'){ |
| 1371 | if((!empty($ekit_heading_sub_title) && ($settings['ekit_heading_sub_title_show'] == 'yes'))): |
| 1372 | echo '<'. esc_attr($sub_title_tag).' class="elementskit-section-subtitle '.esc_attr($sub_title_text_fill).' '.esc_attr($sub_title_border).''.esc_attr($subheading_outline).'"> |
| 1373 | '.esc_html( $ekit_heading_sub_title ).' |
| 1374 | </'.esc_attr($sub_title_tag).'>'; |
| 1375 | endif; |
| 1376 | } |
| 1377 | |
| 1378 | $ekit_title = \ElementsKit_Lite\Utils::kspan($ekit_heading_title); |
| 1379 | |
| 1380 | echo (($ekit_heading_seperator_position) == 'before') ? wp_kses($seperator, \ElementsKit_Lite\Utils::get_kses_array()) : ''; |
| 1381 | if(!empty($ekit_heading_title)): |
| 1382 | if ( ! empty( $ekit_heading_link['url'] ) ) { |
| 1383 | $this->add_link_attributes( 'ekit_heading_link', $ekit_heading_link ); |
| 1384 | echo sprintf( |
| 1385 | '<a %1$s><%2$s class="ekit-heading--title elementskit-section-title %3$s">%4$s</%2$s></a>', |
| 1386 | $this->get_render_attribute_string('ekit_heading_link'), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor |
| 1387 | esc_attr($title_tag), |
| 1388 | esc_attr($title_text_fill.''.$title_border), |
| 1389 | wp_kses($ekit_title, \ElementsKit_Lite\Utils::get_kses_array()) |
| 1390 | ); |
| 1391 | } else { |
| 1392 | echo sprintf( |
| 1393 | '<%1$s class="ekit-heading--title elementskit-section-title %2$s">%3$s</%1$s>', |
| 1394 | esc_attr($title_tag), |
| 1395 | esc_attr($title_text_fill.''.$title_border), |
| 1396 | wp_kses($ekit_title, \ElementsKit_Lite\Utils::get_kses_array()) |
| 1397 | ); |
| 1398 | } |
| 1399 | endif; |
| 1400 | |
| 1401 | echo ( |
| 1402 | $ekit_heading_seperator_position == 'after' || ( |
| 1403 | $ekit_heading_seperator_position == 'bottom' && |
| 1404 | $title_float_left == 'yes' |
| 1405 | ) |
| 1406 | ) ? wp_kses($seperator, \ElementsKit_Lite\Utils::get_kses_array()) : ''; |
| 1407 | |
| 1408 | // End Title wrapper |
| 1409 | if($title_float_left == 'yes'): ?> |
| 1410 | </div> |
| 1411 | <div class='ekit-heading__content-wrapper'> |
| 1412 | <?php endif; |
| 1413 | |
| 1414 | if($ekit_heading_sub_title_position == 'after_title' || ($ekit_heading_sub_title_position == 'before_title' && $title_float_left == 'yes')){ |
| 1415 | if(!empty($ekit_heading_sub_title) && ($settings['ekit_heading_sub_title_show'] == 'yes')): |
| 1416 | echo '<'.esc_html($sub_title_tag).' class="ekit-heading--subtitle elementskit-section-subtitle '.esc_attr($sub_title_text_fill).' '.esc_attr($sub_title_border).''.esc_attr($subheading_outline).'"> |
| 1417 | '.esc_html( $ekit_heading_sub_title ).' |
| 1418 | </'.esc_html($sub_title_tag).'>'; |
| 1419 | endif; |
| 1420 | } |
| 1421 | |
| 1422 | if((!empty($ekit_heading_extra_title)) && ($settings['ekit_heading_section_extra_title_show'] == 'yes')): ?> |
| 1423 | <div class='ekit-heading__description'> |
| 1424 | <?php echo wp_kses(wpautop($ekit_heading_extra_title), \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 1425 | </div> |
| 1426 | <?php endif; |
| 1427 | |
| 1428 | if($title_float_left == 'yes'): ?> |
| 1429 | </div> |
| 1430 | <?php endif; |
| 1431 | |
| 1432 | echo ($ekit_heading_seperator_position == 'bottom' && $title_float_left != 'yes') ? wp_kses($seperator, \ElementsKit_Lite\Utils::get_kses_array()) : ''; |
| 1433 | |
| 1434 | echo '</div>'; |
| 1435 | } |
| 1436 | } |
| 1437 |