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