| @@ -1,1286 +1,1289 @@ | ||
| 1 | -<?php | |
| 2 | -namespace Easyel\EasyElements\Widgets; | |
| 3 | -use Elementor\Controls_Manager; | |
| 4 | -use Elementor\Group_Control_Typography; | |
| 5 | -use Elementor\Widget_Base; | |
| 6 | -use Elementor\Group_Control_Background; | |
| 7 | - | |
| 8 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | - exit; | |
| 10 | -} | |
| 11 | - | |
| 12 | -class Easyel_Heading_Widget extends \Elementor\Widget_Base { | |
| 13 | - | |
| 14 | - public function get_name() { | |
| 15 | - return 'eel-heading'; | |
| 16 | - } | |
| 17 | - | |
| 18 | - public function get_title() { | |
| 19 | - return __( 'Heading', 'easy-elements' ); | |
| 20 | - } | |
| 21 | - | |
| 22 | - public function get_icon() { | |
| 23 | - return 'easyicon easyelIcon-heading'; | |
| 24 | - } | |
| 25 | - | |
| 26 | - public function get_categories() { | |
| 27 | - return [ 'easyelements_category' ]; | |
| 28 | - } | |
| 29 | - public function get_keywords() { | |
| 30 | - return [ 'heading', 'title', 'link', 'click', 'text' ]; | |
| 31 | - } | |
| 32 | - | |
| 33 | - public function get_style_depends() { | |
| 34 | - return [ | |
| 35 | - 'eel-heading', | |
| 36 | - ]; | |
| 37 | - } | |
| 38 | - | |
| 39 | - | |
| 40 | - protected function register_controls() { | |
| 41 | - $this->start_controls_section( | |
| 42 | - 'content_section', | |
| 43 | - [ | |
| 44 | - 'label' => esc_html__('Heading Settings', 'easy-elements'), | |
| 45 | - 'tab' => Controls_Manager::TAB_CONTENT, | |
| 46 | - ] | |
| 47 | - ); | |
| 48 | - | |
| 49 | - $this->add_control( | |
| 50 | - 'title', | |
| 51 | - [ | |
| 52 | - 'label' => esc_html__('Heading Text', 'easy-elements'), | |
| 53 | - 'type' => Controls_Manager::TEXTAREA, | |
| 54 | - 'default' => esc_html__('Heading Here', 'easy-elements'), | |
| 55 | - 'label_block' => true, | |
| 56 | - 'description' => esc_html__('You can highlight part of the text using double curly brackets. Example: Heading {{Here}} will highlight "Here".', 'easy-elements'), | |
| 57 | - ] | |
| 58 | - ); | |
| 59 | - | |
| 60 | - $this->add_control( | |
| 61 | - 'show_border_title', | |
| 62 | - [ | |
| 63 | - 'label' => esc_html__( 'Show Border', 'easy-elements' ), | |
| 64 | - 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 65 | - 'label_on' => esc_html__( 'Show', 'easy-elements' ), | |
| 66 | - 'label_off' => esc_html__( 'Hide', 'easy-elements' ), | |
| 67 | - 'return_value' => 'yes', | |
| 68 | - 'default' => '', | |
| 69 | - ] | |
| 70 | - ); | |
| 71 | - | |
| 72 | - $this->add_control( | |
| 73 | - 'show_gradient_title', | |
| 74 | - [ | |
| 75 | - 'label' => esc_html__( 'Gradient Text', 'easy-elements' ), | |
| 76 | - 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 77 | - 'label_on' => esc_html__( 'Show', 'easy-elements' ), | |
| 78 | - 'label_off' => esc_html__( 'Hide', 'easy-elements' ), | |
| 79 | - 'return_value' => 'yes', | |
| 80 | - 'default' => '', | |
| 81 | - ] | |
| 82 | - ); | |
| 83 | - | |
| 84 | - $this->add_control( | |
| 85 | - 'border_position', | |
| 86 | - [ | |
| 87 | - 'label' => esc_html__( 'Border Position', 'easy-elements' ), | |
| 88 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 89 | - 'default' => 'eel_title_start', | |
| 90 | - 'options' => [ | |
| 91 | - 'eel_title_start' => esc_html__( 'Only Start Title', 'easy-elements' ), | |
| 92 | - 'eel_title_end' => esc_html__( 'Only Title End', 'easy-elements' ), | |
| 93 | - 'eel_full_title_start' => esc_html__( 'Full Title Part Start', 'easy-elements' ), | |
| 94 | - 'eel_full_title_end' => esc_html__( 'Full Title Part End', 'easy-elements' ), | |
| 95 | - ], | |
| 96 | - 'condition' => [ | |
| 97 | - 'show_border_title' => 'yes', | |
| 98 | - ], | |
| 99 | - ] | |
| 100 | - ); | |
| 101 | - | |
| 102 | - | |
| 103 | - $this->add_control( | |
| 104 | - 'border_color', | |
| 105 | - [ | |
| 106 | - 'label' => esc_html__('Border Color', 'easy-elements'), | |
| 107 | - 'type' => Controls_Manager::COLOR, | |
| 108 | - 'selectors' => [ | |
| 109 | - '{{WRAPPER}} .eel_full_title_end, {{WRAPPER}} .eel_title_end .e-e-title, {{WRAPPER}} .eel_full_title_start, {{WRAPPER}} .eel_title_start .e-e-title' => 'border-color: {{VALUE}};', | |
| 110 | - ], | |
| 111 | - 'condition' => [ | |
| 112 | - 'show_border_title' => 'yes', | |
| 113 | - ], | |
| 114 | - ] | |
| 115 | - ); | |
| 116 | - | |
| 117 | - $this->add_responsive_control( | |
| 118 | - 'title_border_padding', | |
| 119 | - [ | |
| 120 | - 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 121 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 122 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 123 | - 'selectors' => [ | |
| 124 | - '{{WRAPPER}} .eel_full_title_end, {{WRAPPER}} .eel_title_end .e-e-title, {{WRAPPER}} .eel_full_title_start, {{WRAPPER}} .eel_title_start .e-e-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 125 | - ], | |
| 126 | - 'condition' => [ | |
| 127 | - 'show_border_title' => 'yes', | |
| 128 | - ], | |
| 129 | - ] | |
| 130 | - ); | |
| 131 | - | |
| 132 | - | |
| 133 | - $this->add_control( | |
| 134 | - 'link', | |
| 135 | - [ | |
| 136 | - 'label' => __( 'Link', 'easy-elements' ), | |
| 137 | - 'type' => \Elementor\Controls_Manager::URL, | |
| 138 | - 'placeholder' => 'https://your-link.com', | |
| 139 | - 'default' => [ | |
| 140 | - 'url' => '', | |
| 141 | - 'is_external' => false, | |
| 142 | - 'nofollow' => false, | |
| 143 | - ], | |
| 144 | - 'show_external' => true, | |
| 145 | - 'description' => esc_html__( 'Set a URL to make the heading clickable. Supports opening in a new tab and nofollow attribute.', 'easy-elements' ), | |
| 146 | - ] | |
| 147 | - ); | |
| 148 | - | |
| 149 | - $this->add_control( | |
| 150 | - 'title_tag', | |
| 151 | - [ | |
| 152 | - 'label' => esc_html__('Select Tag', 'easy-elements'), | |
| 153 | - 'type' => Controls_Manager::SELECT, | |
| 154 | - 'default' => 'h2', | |
| 155 | - 'options' => [ | |
| 156 | - 'h1' => 'H1', | |
| 157 | - 'h2' => 'H2', | |
| 158 | - 'h3' => 'H3', | |
| 159 | - 'h4' => 'H4', | |
| 160 | - 'h5' => 'H5', | |
| 161 | - 'h6' => 'H6', | |
| 162 | - 'div' => 'div', | |
| 163 | - ], | |
| 164 | - ] | |
| 165 | - ); | |
| 166 | - | |
| 167 | - $this->add_control( | |
| 168 | - 'description', | |
| 169 | - [ | |
| 170 | - 'label' => esc_html__('Description', 'easy-elements'), | |
| 171 | - 'type' => Controls_Manager::TEXTAREA, | |
| 172 | - 'label_block' => true, | |
| 173 | - ] | |
| 174 | - ); | |
| 175 | - | |
| 176 | - | |
| 177 | - $this->add_responsive_control( | |
| 178 | - 'align', | |
| 179 | - [ | |
| 180 | - 'label' => esc_html__('Alignment', 'easy-elements'), | |
| 181 | - 'type' => Controls_Manager::CHOOSE, | |
| 182 | - 'options' => [ | |
| 183 | - 'left' => [ | |
| 184 | - 'title' => esc_html__('Left', 'easy-elements'), | |
| 185 | - 'icon' => 'eicon-text-align-left', | |
| 186 | - ], | |
| 187 | - 'center' => [ | |
| 188 | - 'title' => esc_html__('Center', 'easy-elements'), | |
| 189 | - 'icon' => 'eicon-text-align-center', | |
| 190 | - ], | |
| 191 | - 'right' => [ | |
| 192 | - 'title' => esc_html__('Right', 'easy-elements'), | |
| 193 | - 'icon' => 'eicon-text-align-right', | |
| 194 | - ], | |
| 195 | - 'justify' => [ | |
| 196 | - 'title' => esc_html__('Justify', 'easy-elements'), | |
| 197 | - 'icon' => 'eicon-text-align-justify', | |
| 198 | - ], | |
| 199 | - ], | |
| 200 | - 'toggle' => true, | |
| 201 | - 'selectors' => [ | |
| 202 | - '{{WRAPPER}} .e-e-heading' => 'text-align: {{VALUE}}', | |
| 203 | - '{{WRAPPER}} .image-heading' => 'justify-content: {{VALUE}}', | |
| 204 | - ], | |
| 205 | - ] | |
| 206 | - ); | |
| 207 | - | |
| 208 | - $this->end_controls_section(); | |
| 209 | - | |
| 210 | - $this->start_controls_section( | |
| 211 | - 'sub_heading_section', | |
| 212 | - [ | |
| 213 | - 'label' => esc_html__('Sub Heading Settings', 'easy-elements'), | |
| 214 | - 'tab' => Controls_Manager::TAB_CONTENT, | |
| 215 | - ] | |
| 216 | - ); | |
| 217 | - | |
| 218 | - $this->add_control( | |
| 219 | - 'sub_title', | |
| 220 | - [ | |
| 221 | - 'label' => esc_html__( 'Sub Heading', 'easy-elements' ), | |
| 222 | - 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 223 | - 'label_block' => true, | |
| 224 | - ] | |
| 225 | - ); | |
| 226 | - | |
| 227 | - $this->add_control( | |
| 228 | - 'show_gradient_border', | |
| 229 | - [ | |
| 230 | - 'label' => esc_html__( 'Show Gradient Border', 'easy-elements' ), | |
| 231 | - 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 232 | - 'label_on' => esc_html__( 'Show', 'easy-elements' ), | |
| 233 | - 'label_off' => esc_html__( 'Hide', 'easy-elements' ), | |
| 234 | - 'return_value' => 'yes', | |
| 235 | - 'default' => '', | |
| 236 | - ] | |
| 237 | - ); | |
| 238 | - | |
| 239 | - $this->add_control( | |
| 240 | - 'gradient_color_1', | |
| 241 | - [ | |
| 242 | - 'label' => esc_html__( 'Gradient Color 1', 'easy-elements' ), | |
| 243 | - 'type' => \Elementor\Controls_Manager::COLOR, | |
| 244 | - 'default' => 'rgba(0, 0, 0, 0.15)', | |
| 245 | - 'selectors' => [ | |
| 246 | - '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-1: {{VALUE}};', | |
| 247 | - ], | |
| 248 | - 'condition' => [ | |
| 249 | - 'show_gradient_border' => 'yes', | |
| 250 | - ], | |
| 251 | - ] | |
| 252 | - ); | |
| 253 | - | |
| 254 | - $this->add_control( | |
| 255 | - 'gradient_color_2', | |
| 256 | - [ | |
| 257 | - 'label' => esc_html__( 'Gradient Color 2', 'easy-elements' ), | |
| 258 | - 'type' => \Elementor\Controls_Manager::COLOR, | |
| 259 | - 'default' => 'rgba(0, 0, 0, 0.30)', | |
| 260 | - 'selectors' => [ | |
| 261 | - '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-2: {{VALUE}};', | |
| 262 | - ], | |
| 263 | - 'condition' => [ | |
| 264 | - 'show_gradient_border' => 'yes', | |
| 265 | - ], | |
| 266 | - ] | |
| 267 | - ); | |
| 268 | - | |
| 269 | - $this->add_control( | |
| 270 | - 'gradient_color_3', | |
| 271 | - [ | |
| 272 | - 'label' => esc_html__( 'Gradient Color 3', 'easy-elements' ), | |
| 273 | - 'type' => \Elementor\Controls_Manager::COLOR, | |
| 274 | - 'default' => 'rgba(0, 0, 0, 0.50)', | |
| 275 | - 'selectors' => [ | |
| 276 | - '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-3: {{VALUE}};', | |
| 277 | - ], | |
| 278 | - 'condition' => [ | |
| 279 | - 'show_gradient_border' => 'yes', | |
| 280 | - ], | |
| 281 | - ] | |
| 282 | - ); | |
| 283 | - | |
| 284 | - | |
| 285 | - $this->add_responsive_control( | |
| 286 | - 'sub_gradient_border_padding', | |
| 287 | - [ | |
| 288 | - 'label' => __('Gradient Border Padding', 'easy-elements'), | |
| 289 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 290 | - 'size_units' => ['px', '%', 'em'], | |
| 291 | - 'selectors' => [ | |
| 292 | - '{{WRAPPER}} .easy_gradiant_border' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 293 | - ], | |
| 294 | - 'condition' => [ | |
| 295 | - 'show_gradient_border' => 'yes', | |
| 296 | - ], | |
| 297 | - ] | |
| 298 | - ); | |
| 299 | - | |
| 300 | - $this->add_responsive_control( | |
| 301 | - 'gradient_border_radius', | |
| 302 | - [ | |
| 303 | - 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 304 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 305 | - 'size_units' => [ 'px', '%' ], | |
| 306 | - 'range' => [ | |
| 307 | - 'px' => [ | |
| 308 | - 'min' => 0, | |
| 309 | - 'max' => 200, | |
| 310 | - ], | |
| 311 | - '%' => [ | |
| 312 | - 'min' => 0, | |
| 313 | - 'max' => 100, | |
| 314 | - ], | |
| 315 | - ], | |
| 316 | - 'default' => [ | |
| 317 | - 'unit' => 'px', | |
| 318 | - 'size' => 40, | |
| 319 | - ], | |
| 320 | - 'selectors' => [ | |
| 321 | - '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-border-radius: {{SIZE}}{{UNIT}};', | |
| 322 | - ], | |
| 323 | - ] | |
| 324 | - ); | |
| 325 | - | |
| 326 | - | |
| 327 | - $this->add_control( | |
| 328 | - 'sub_heading_type', | |
| 329 | - [ | |
| 330 | - 'label' => esc_html__( 'Sub Heading Type', 'easy-elements' ), | |
| 331 | - 'type' => \Elementor\Controls_Manager::CHOOSE, | |
| 332 | - 'options' => [ | |
| 333 | - 'none' => [ | |
| 334 | - 'title' => esc_html__( 'None', 'easy-elements' ), | |
| 335 | - 'icon' => 'eicon-ban', | |
| 336 | - ], | |
| 337 | - 'icon' => [ | |
| 338 | - 'title' => esc_html__( 'Icon', 'easy-elements' ), | |
| 339 | - 'icon' => 'eicon-star', | |
| 340 | - ], | |
| 341 | - 'image' => [ | |
| 342 | - 'title' => esc_html__( 'Image', 'easy-elements' ), | |
| 343 | - 'icon' => 'eicon-image-bold', | |
| 344 | - ], | |
| 345 | - ], | |
| 346 | - 'default' => 'none', | |
| 347 | - 'toggle' => false, | |
| 348 | - ] | |
| 349 | - ); | |
| 350 | - | |
| 351 | - $this->add_control( | |
| 352 | - 'sub_heading_icon', | |
| 353 | - [ | |
| 354 | - 'label' => esc_html__( 'Select Icon', 'easy-elements' ), | |
| 355 | - 'type' => \Elementor\Controls_Manager::ICONS, | |
| 356 | - 'default' => [ | |
| 357 | - 'value' => 'fas fa-heart', | |
| 358 | - 'library' => 'fa-solid', | |
| 359 | - ], | |
| 360 | - 'condition' => [ | |
| 361 | - 'sub_heading_type' => 'icon', | |
| 362 | - ], | |
| 363 | - ] | |
| 364 | - ); | |
| 365 | - | |
| 366 | - $this->add_control( | |
| 367 | - 'sub_heading_image', | |
| 368 | - [ | |
| 369 | - 'label' => esc_html__( 'Upload Image', 'easy-elements' ), | |
| 370 | - 'type' => \Elementor\Controls_Manager::MEDIA, | |
| 371 | - 'default' => [ | |
| 372 | - 'url' => \Elementor\Utils::get_placeholder_image_src(), | |
| 373 | - ], | |
| 374 | - 'condition' => [ | |
| 375 | - 'sub_heading_type' => 'image', | |
| 376 | - ], | |
| 377 | - ] | |
| 378 | - ); | |
| 379 | - | |
| 380 | - $this->add_control( | |
| 381 | - 'icon_color', | |
| 382 | - [ | |
| 383 | - 'label' => esc_html__('Color', 'easy-elements'), | |
| 384 | - 'type' => Controls_Manager::COLOR, | |
| 385 | - 'selectors' => [ | |
| 386 | - '{{WRAPPER}} .eel-sub-heading i, {{WRAPPER}} .eel-sub-heading svg' => 'color: {{VALUE}}; fill: {{VALUE}};', | |
| 387 | - ], | |
| 388 | - 'condition' => [ | |
| 389 | - 'sub_heading_type' => ['icon'], | |
| 390 | - ], | |
| 391 | - ] | |
| 392 | - ); | |
| 393 | - | |
| 394 | - $this->add_responsive_control( | |
| 395 | - 'sub_heading_icon_margin', | |
| 396 | - [ | |
| 397 | - 'label' => esc_html__( 'Icon Spacing', 'easy-elements' ), | |
| 398 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 399 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 400 | - 'selectors' => [ | |
| 401 | - '{{WRAPPER}} .eel-sub-heading span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 402 | - ], | |
| 403 | - 'condition' => [ | |
| 404 | - 'sub_heading_type' => ['image', 'icon'], | |
| 405 | - ], | |
| 406 | - ] | |
| 407 | - ); | |
| 408 | - | |
| 409 | - $this->add_control( | |
| 410 | - 'icon_direction', | |
| 411 | - [ | |
| 412 | - 'label' => esc_html__( 'Direction', 'easy-elements' ), | |
| 413 | - 'type' => \Elementor\Controls_Manager::CHOOSE, | |
| 414 | - 'default' => 'top', | |
| 415 | - 'options' => [ | |
| 416 | - 'left' => [ | |
| 417 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 418 | - 'icon' => 'eicon-h-align-left', | |
| 419 | - ], | |
| 420 | - 'top' => [ | |
| 421 | - 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 422 | - 'icon' => 'eicon-v-align-top', | |
| 423 | - ], | |
| 424 | - 'right' => [ | |
| 425 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 426 | - 'icon' => 'eicon-h-align-right', | |
| 427 | - ], | |
| 428 | - ], | |
| 429 | - 'toggle' => false, | |
| 430 | - ] | |
| 431 | - ); | |
| 432 | - $this->end_controls_section(); | |
| 433 | - | |
| 434 | - $this->start_controls_section( | |
| 435 | - 'separator_section', | |
| 436 | - [ | |
| 437 | - 'label' => esc_html__('Separator Settings', 'easy-elements'), | |
| 438 | - 'tab' => Controls_Manager::TAB_CONTENT, | |
| 439 | - ] | |
| 440 | - ); | |
| 441 | - | |
| 442 | - $this->add_control( | |
| 443 | - 'separator_', | |
| 444 | - [ | |
| 445 | - 'label' => __( 'Choose Option', 'easy-elements' ), | |
| 446 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 447 | - 'options' => [ | |
| 448 | - 'none' => __( 'None', 'easy-elements' ), | |
| 449 | - 'dotted' => __( 'Dotted', 'easy-elements' ), | |
| 450 | - 'solid' => __( 'Solid', 'easy-elements' ), | |
| 451 | - 'icon' => __( 'Icon', 'easy-elements' ), | |
| 452 | - 'image' => __( 'Image', 'easy-elements' ), | |
| 453 | - ], | |
| 454 | - 'default' => 'none', | |
| 455 | - ] | |
| 456 | - ); | |
| 457 | - | |
| 458 | - $this->add_control( | |
| 459 | - 'solid_color', | |
| 460 | - [ | |
| 461 | - 'label' => esc_html__('Separator Color', 'easy-elements'), | |
| 462 | - 'type' => \Elementor\Controls_Manager::COLOR, | |
| 463 | - 'selectors' => [ | |
| 464 | - '{{WRAPPER}} .eel--separator-icon.dotted::before, {{WRAPPER}} .eel--separator-icon' => 'color: {{VALUE}}; background-color: {{VALUE}};', | |
| 465 | - ], | |
| 466 | - 'condition' => [ | |
| 467 | - 'separator_' => ['solid', 'dotted'], | |
| 468 | - ], | |
| 469 | - ] | |
| 470 | - ); | |
| 471 | - | |
| 472 | - $this->add_control( | |
| 473 | - 'select_icon_', | |
| 474 | - [ | |
| 475 | - 'label' => esc_html__( 'Select/Upload Icon', 'easy-elements' ), | |
| 476 | - 'type' => \Elementor\Controls_Manager::ICONS, | |
| 477 | - 'default' => [ | |
| 478 | - 'value' => 'fas fa-heart', | |
| 479 | - 'library' => 'fa-solid', | |
| 480 | - ], | |
| 481 | - 'description' => esc_html__( 'You can upload an SVG image or choose a font icon.', 'easy-elements' ), | |
| 482 | - 'condition' => [ | |
| 483 | - 'separator_' => ['icon'], | |
| 484 | - ], | |
| 485 | - ] | |
| 486 | - ); | |
| 487 | - | |
| 488 | - $this->add_control( | |
| 489 | - 'sep_image', | |
| 490 | - [ | |
| 491 | - 'label' => esc_html__( 'Upload Image', 'easy-elements' ), | |
| 492 | - 'type' => \Elementor\Controls_Manager::MEDIA, | |
| 493 | - 'default' => [ | |
| 494 | - 'url' => \Elementor\Utils::get_placeholder_image_src(), | |
| 495 | - ], | |
| 496 | - 'condition' => [ | |
| 497 | - 'separator_' => 'image', | |
| 498 | - ], | |
| 499 | - ] | |
| 500 | - ); | |
| 501 | - | |
| 502 | - $this->add_control( | |
| 503 | - 'separator_position', | |
| 504 | - [ | |
| 505 | - 'label' => esc_html__( 'Position', 'easy-elements' ), | |
| 506 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 507 | - 'default' => 'below', | |
| 508 | - 'options' => [ | |
| 509 | - 'top' => esc_html__( 'Top', 'easy-elements' ), | |
| 510 | - 'above' => esc_html__( 'Above Title', 'easy-elements' ), | |
| 511 | - 'below' => esc_html__( 'Title Below', 'easy-elements' ), | |
| 512 | - 'bottom' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 513 | - ], | |
| 514 | - ] | |
| 515 | - ); | |
| 516 | - | |
| 517 | - $this->add_control( | |
| 518 | - 'separator_margin', | |
| 519 | - [ | |
| 520 | - 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 521 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 522 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 523 | - 'selectors' => [ | |
| 524 | - '{{WRAPPER}} .eel--separator-icon, {{WRAPPER}} .eel--separator-icon-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 525 | - ], | |
| 526 | - ] | |
| 527 | - ); | |
| 528 | - | |
| 529 | - $this->end_controls_section(); | |
| 530 | - | |
| 531 | - | |
| 532 | - $this->start_controls_section( | |
| 533 | - 'water_mark_section', | |
| 534 | - [ | |
| 535 | - 'label' => esc_html__('WaterMark Settings', 'easy-elements'), | |
| 536 | - 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, | |
| 537 | - ] | |
| 538 | - ); | |
| 539 | - | |
| 540 | - $this->add_control( | |
| 541 | - 'water_mark', | |
| 542 | - [ | |
| 543 | - 'label' => esc_html__('WaterMark Text', 'easy-elements'), | |
| 544 | - 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 545 | - 'label_block' => 'true', | |
| 546 | - ] | |
| 547 | - ); | |
| 548 | - | |
| 549 | - $this->add_control( | |
| 550 | - 'water_mark_font_size', | |
| 551 | - [ | |
| 552 | - 'label' => esc_html__('Font Size', 'easy-elements'), | |
| 553 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 554 | - 'size_units' => ['px', 'em', 'rem', '%'], | |
| 555 | - 'range' => [ | |
| 556 | - 'px' => ['min' => 10, 'max' => 300], | |
| 557 | - 'em' => ['min' => 0.5, 'max' => 20], | |
| 558 | - 'rem' => ['min' => 0.5, 'max' => 20], | |
| 559 | - '%' => ['min' => 10, 'max' => 500], | |
| 560 | - ], | |
| 561 | - 'default' => [ | |
| 562 | - 'size' => '', | |
| 563 | - 'unit' => 'px', | |
| 564 | - ], | |
| 565 | - 'selectors' => [ | |
| 566 | - '{{WRAPPER}} .eel-watermark' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 567 | - ], | |
| 568 | - ] | |
| 569 | - ); | |
| 570 | - | |
| 571 | - $this->add_control( | |
| 572 | - '_mark_color', | |
| 573 | - [ | |
| 574 | - 'label' => esc_html__('Color', 'easy-elements'), | |
| 575 | - 'type' => \Elementor\Controls_Manager::COLOR, | |
| 576 | - 'default' => '', | |
| 577 | - 'selectors' => [ | |
| 578 | - '{{WRAPPER}} .eel-watermark' => 'color: {{VALUE}};', | |
| 579 | - ], | |
| 580 | - ] | |
| 581 | - ); | |
| 582 | - | |
| 583 | - $this->add_control( | |
| 584 | - 'water_mark_color', | |
| 585 | - [ | |
| 586 | - 'label' => esc_html__('Stroke Color', 'easy-elements'), | |
| 587 | - 'type' => \Elementor\Controls_Manager::COLOR, | |
| 588 | - 'default' => 'rgba(0, 0, 0, 0.3)', | |
| 589 | - 'selectors' => [ | |
| 590 | - '{{WRAPPER}} .eel-watermark' => '-webkit-text-stroke-color: {{VALUE}}; text-stroke-color: {{VALUE}};', | |
| 591 | - ], | |
| 592 | - ] | |
| 593 | - ); | |
| 594 | - | |
| 595 | - $this->add_control( | |
| 596 | - 'water_mark_stroke_width', | |
| 597 | - [ | |
| 598 | - 'label' => esc_html__('Stroke Width (px)', 'easy-elements'), | |
| 599 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 600 | - 'default' => [ | |
| 601 | - 'size' => 1, | |
| 602 | - 'unit' => 'px', | |
| 603 | - ], | |
| 604 | - 'range' => [ | |
| 605 | - 'px' => [ | |
| 606 | - 'min' => 0, | |
| 607 | - 'max' => 10, | |
| 608 | - ], | |
| 609 | - ], | |
| 610 | - 'selectors' => [ | |
| 611 | - '{{WRAPPER}} .eel-watermark' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}}; text-stroke-width: {{SIZE}}{{UNIT}};', | |
| 612 | - ], | |
| 613 | - ] | |
| 614 | - ); | |
| 615 | - | |
| 616 | - $this->add_responsive_control( | |
| 617 | - 'water_mark_top', | |
| 618 | - [ | |
| 619 | - 'label' => esc_html__('Top / Bottom', 'easy-elements'), | |
| 620 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 621 | - 'size_units' => ['px', '%', 'em'], | |
| 622 | - 'range' => [ | |
| 623 | - 'px' => ['min' => -500, 'max' => 500], | |
| 624 | - '%' => ['min' => -100, 'max' => 100], | |
| 625 | - 'em' => ['min' => -50, 'max' => 50], | |
| 626 | - ], | |
| 627 | - 'selectors' => [ | |
| 628 | - '{{WRAPPER}} .eel-watermark' => 'top: {{SIZE}}{{UNIT}};', | |
| 629 | - ], | |
| 630 | - ] | |
| 631 | - ); | |
| 632 | - | |
| 633 | - $this->add_responsive_control( | |
| 634 | - 'water_mark_left', | |
| 635 | - [ | |
| 636 | - 'label' => esc_html__('Left / Right', 'easy-elements'), | |
| 637 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 638 | - 'size_units' => ['px', '%', 'em'], | |
| 639 | - 'range' => [ | |
| 640 | - 'px' => ['min' => -500, 'max' => 500], | |
| 641 | - '%' => ['min' => 0, 'max' => 100], | |
| 642 | - 'em' => ['min' => 0, 'max' => 50], | |
| 643 | - ], | |
| 644 | - 'selectors' => [ | |
| 645 | - '{{WRAPPER}} .eel-watermark' => 'left: {{SIZE}}{{UNIT}};', | |
| 646 | - ], | |
| 647 | - ] | |
| 648 | - ); | |
| 649 | - | |
| 650 | - $this->add_responsive_control( | |
| 651 | - 'water_mark_z_index', | |
| 652 | - [ | |
| 653 | - 'label' => esc_html__('Z-Index', 'easy-elements'), | |
| 654 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 655 | - 'default' => [ | |
| 656 | - 'size' => -1, | |
| 657 | - ], | |
| 658 | - 'range' => [ | |
| 659 | - 'px' => [ | |
| 660 | - 'min' => 0, | |
| 661 | - 'max' => 9999, | |
| 662 | - ], | |
| 663 | - ], | |
| 664 | - 'selectors' => [ | |
| 665 | - '{{WRAPPER}} .eel-watermark' => 'z-index: {{SIZE}};', | |
| 666 | - ], | |
| 667 | - ] | |
| 668 | - ); | |
| 669 | - | |
| 670 | - | |
| 671 | - $this->end_controls_section(); | |
| 672 | - | |
| 673 | - | |
| 674 | - | |
| 675 | - // Heading | |
| 676 | - $this->start_controls_section( | |
| 677 | - 'section_heading_style', | |
| 678 | - [ | |
| 679 | - 'label' => esc_html__('Heading', 'easy-elements'), | |
| 680 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 681 | - ] | |
| 682 | - ); | |
| 683 | - | |
| 684 | - $this->add_control( | |
| 685 | - 'title_color', | |
| 686 | - [ | |
| 687 | - 'label' => esc_html__('Color', 'easy-elements'), | |
| 688 | - 'type' => Controls_Manager::COLOR, | |
| 689 | - 'selectors' => [ | |
| 690 | - '{{WRAPPER}} .e-e-heading .e-e-title' => 'color: {{VALUE}};', | |
| 691 | - ], | |
| 692 | - 'condition' => [ | |
| 693 | - 'show_gradient_title' => '', | |
| 694 | - ], | |
| 695 | - ] | |
| 696 | - ); | |
| 697 | - | |
| 698 | - $this->add_control( | |
| 699 | - 'title_color_gradient_heading', | |
| 700 | - [ | |
| 701 | - 'label' => esc_html__('Text Gradient Color', 'easy-elements'), | |
| 702 | - 'type' => Controls_Manager::HEADING, | |
| 703 | - 'separator' => 'before', | |
| 704 | - 'condition' => [ | |
| 705 | - 'show_gradient_title' => 'yes', | |
| 706 | - ] | |
| 707 | - ] | |
| 708 | - ); | |
| 709 | - | |
| 710 | - $this->add_group_control( | |
| 711 | - Group_Control_Background::get_type(), | |
| 712 | - [ | |
| 713 | - 'name' => 'title_gradient_color', | |
| 714 | - 'label' => __( 'Title Color', 'easy-elements' ), | |
| 715 | - 'types' => [ 'classic', 'gradient' ], | |
| 716 | - 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title.e-e-gradient-title', | |
| 717 | - 'condition' => [ | |
| 718 | - 'show_gradient_title' => 'yes', | |
| 719 | - ], | |
| 720 | - ] | |
| 721 | - ); | |
| 722 | - | |
| 723 | - | |
| 724 | - $this->add_group_control( | |
| 725 | - Group_Control_Typography::get_type(), | |
| 726 | - [ | |
| 727 | - 'name' => 'title_typography', | |
| 728 | - 'label' => esc_html__('Typography', 'easy-elements'), | |
| 729 | - 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title', | |
| 730 | - ] | |
| 731 | - ); | |
| 732 | - $this->add_control( | |
| 733 | - 'title_opacity', | |
| 734 | - [ | |
| 735 | - 'label' => esc_html__('Opacity', 'easy-elements'), | |
| 736 | - 'type' => Controls_Manager::SLIDER, | |
| 737 | - 'selectors' => [ | |
| 738 | - '{{WRAPPER}} .e-e-heading .e-e-title' => 'opacity: {{SIZE}};', | |
| 739 | - ], | |
| 740 | - 'default' => [ | |
| 741 | - 'size' => 1, | |
| 742 | - 'unit' => 'px', | |
| 743 | - ], | |
| 744 | - ] | |
| 745 | - ); | |
| 746 | - | |
| 747 | - $this->add_control( | |
| 748 | - 'title_text_stroke', | |
| 749 | - [ | |
| 750 | - 'label' => esc_html__('Stroke Width', 'easy-elements'), | |
| 751 | - 'type' => Controls_Manager::SLIDER, | |
| 752 | - 'selectors' => [ | |
| 753 | - '{{WRAPPER}} .e-e-heading .e-e-title' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}};', | |
| 754 | - ], | |
| 755 | - 'default' => [ | |
| 756 | - 'size' => 0, | |
| 757 | - 'unit' => 'px', | |
| 758 | - ], | |
| 759 | - ] | |
| 760 | - ); | |
| 761 | - $this->add_control( | |
| 762 | - 'title_text_stroke_color', | |
| 763 | - [ | |
| 764 | - 'label' => esc_html__('Stroke Color', 'easy-elements'), | |
| 765 | - 'type' => Controls_Manager::COLOR, | |
| 766 | - 'selectors' => [ | |
| 767 | - '{{WRAPPER}} .e-e-heading .e-e-title' => '-webkit-text-stroke-color: {{VALUE}};', | |
| 768 | - ], | |
| 769 | - 'condition' => [ | |
| 770 | - 'title_text_stroke[size]!' => '', | |
| 771 | - ], | |
| 772 | - ] | |
| 773 | - ); | |
| 774 | - // Text Shadow | |
| 775 | - $this->add_group_control( | |
| 776 | - \Elementor\Group_Control_Text_Shadow::get_type(), | |
| 777 | - [ | |
| 778 | - 'name' => 'title_text_shadow', | |
| 779 | - 'label' => esc_html__('Text Shadow', 'easy-elements'), | |
| 780 | - 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title', | |
| 781 | - ] | |
| 782 | - ); | |
| 783 | - // Mix Blend Mode | |
| 784 | - $this->add_control( | |
| 785 | - 'title_blend_mode', | |
| 786 | - [ | |
| 787 | - 'label' => esc_html__('Blend Mode', 'easy-elements'), | |
| 788 | - 'type' => Controls_Manager::SELECT, | |
| 789 | - 'options' => [ | |
| 790 | - '' => esc_html__('Default', 'easy-elements'), | |
| 791 | - 'normal' => 'Normal', | |
| 792 | - 'multiply' => 'Multiply', | |
| 793 | - 'screen' => 'Screen', | |
| 794 | - 'overlay' => 'Overlay', | |
| 795 | - 'darken' => 'Darken', | |
| 796 | - 'lighten' => 'Lighten', | |
| 797 | - 'color-dodge' => 'Color Dodge', | |
| 798 | - 'color-burn' => 'Color Burn', | |
| 799 | - 'hard-light' => 'Hard Light', | |
| 800 | - 'soft-light' => 'Soft Light', | |
| 801 | - 'difference' => 'Difference', | |
| 802 | - 'exclusion' => 'Exclusion', | |
| 803 | - 'hue' => 'Hue', | |
| 804 | - 'saturation' => 'Saturation', | |
| 805 | - 'color' => 'Color', | |
| 806 | - 'luminosity' => 'Luminosity', | |
| 807 | - ], | |
| 808 | - 'selectors' => [ | |
| 809 | - '{{WRAPPER}} .e-e-heading .e-e-title' => 'mix-blend-mode: {{VALUE}};', | |
| 810 | - ], | |
| 811 | - ] | |
| 812 | - ); | |
| 813 | - $this->add_responsive_control( | |
| 814 | - 'title_margin', | |
| 815 | - [ | |
| 816 | - 'label' => esc_html__('Margin', 'easy-elements'), | |
| 817 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 818 | - 'size_units' => ['px', 'em', '%'], | |
| 819 | - 'selectors' => [ | |
| 820 | - '{{WRAPPER}} .e-e-heading .e-e-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 821 | - ], | |
| 822 | - ] | |
| 823 | - ); | |
| 824 | - | |
| 825 | - $this->add_responsive_control( | |
| 826 | - 'title_padding', | |
| 827 | - [ | |
| 828 | - 'label' => esc_html__('Padding', 'easy-elements'), | |
| 829 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 830 | - 'size_units' => ['px', 'em', '%'], | |
| 831 | - 'selectors' => [ | |
| 832 | - '{{WRAPPER}} .e-e-heading .e-e-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 833 | - ], | |
| 834 | - ] | |
| 835 | - ); | |
| 836 | - | |
| 837 | - | |
| 838 | - $this->add_control( | |
| 839 | - 'title_image_fill_heading', | |
| 840 | - [ | |
| 841 | - 'label' => esc_html__('Image Fill (Text Mask)', 'easy-elements'), | |
| 842 | - 'type' => Controls_Manager::HEADING, | |
| 843 | - 'separator' => 'before', | |
| 844 | - ] | |
| 845 | - ); | |
| 846 | - | |
| 847 | - $this->add_control( | |
| 848 | - 'enable_title_image_fill', | |
| 849 | - [ | |
| 850 | - 'label' => esc_html__('Enable Image Fill', 'easy-elements'), | |
| 851 | - 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 852 | - 'label_on' => esc_html__('Yes', 'easy-elements'), | |
| 853 | - 'label_off' => esc_html__('No', 'easy-elements'), | |
| 854 | - 'return_value' => 'yes', | |
| 855 | - 'default' => '', | |
| 856 | - ] | |
| 857 | - ); | |
| 858 | - | |
| 859 | - $this->add_group_control( | |
| 860 | - Group_Control_Background::get_type(), | |
| 861 | - [ | |
| 862 | - 'name' => 'title_image_fill_bg', | |
| 863 | - 'label' => esc_html__('Image Fill', 'easy-elements'), | |
| 864 | - 'types' => [ 'classic' ], | |
| 865 | - 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title.e-e-image-fill, {{WRAPPER}} .e-e-heading .e-e-title.e-e-image-fill div', | |
| 866 | - 'fields_options' => [ | |
| 867 | - 'background' => [ | |
| 868 | - 'default' => 'classic', | |
| 869 | - ], | |
| 870 | - 'classic' => [ | |
| 871 | - 'types' => [ 'image' ], | |
| 872 | - ], | |
| 873 | - ], | |
| 874 | - 'condition' => [ | |
| 875 | - 'enable_title_image_fill' => 'yes', | |
| 876 | - ], | |
| 877 | - ] | |
| 878 | - ); | |
| 879 | - | |
| 880 | - $this->add_control( | |
| 881 | - 'title_image_fill_note', | |
| 882 | - [ | |
| 883 | - 'type' => Controls_Manager::RAW_HTML, | |
| 884 | - 'raw' => __('Tip: Apply this only when you want the text to be filled with an image (the image will appear inside the text).', 'easy-elements'), | |
| 885 | - 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', | |
| 886 | - ] | |
| 887 | - ); | |
| 888 | - | |
| 889 | - $this->end_controls_section(); | |
| 890 | - | |
| 891 | - //Sub Heading | |
| 892 | - $this->start_controls_section( | |
| 893 | - 'section_sub_heading_style', | |
| 894 | - [ | |
| 895 | - 'label' => esc_html__('Sub Heading', 'easy-elements'), | |
| 896 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 897 | - ] | |
| 898 | - ); | |
| 899 | - | |
| 900 | - $this->add_control( | |
| 901 | - 'sub_heading_color', | |
| 902 | - [ | |
| 903 | - 'label' => esc_html__('Color', 'easy-elements'), | |
| 904 | - 'type' => Controls_Manager::COLOR, | |
| 905 | - 'selectors' => [ | |
| 906 | - '{{WRAPPER}} .e-e-heading .eel-sub-heading span' => 'color: {{VALUE}};', | |
| 907 | - ], | |
| 908 | - ] | |
| 909 | - ); | |
| 910 | - | |
| 911 | - $this->add_group_control( | |
| 912 | - \Elementor\Group_Control_Background::get_type(), | |
| 913 | - [ | |
| 914 | - 'name' => 'background_subtext', | |
| 915 | - 'types' => [ 'classic', 'gradient' ], | |
| 916 | - 'selector' => '{{WRAPPER}} .eel-sub-heading.top', | |
| 917 | - 'condition' => [ | |
| 918 | - 'icon_direction' => 'top', | |
| 919 | - ], | |
| 920 | - ] | |
| 921 | - ); | |
| 922 | - | |
| 923 | - $this->add_group_control( | |
| 924 | - \Elementor\Group_Control_Background::get_type(), | |
| 925 | - [ | |
| 926 | - 'name' => 'background_subtext_top', | |
| 927 | - 'types' => [ 'classic', 'gradient' ], | |
| 928 | - 'selector' => '{{WRAPPER}} .eel-sub-heading', | |
| 929 | - 'condition' => [ | |
| 930 | - 'icon_direction' => ['left', 'right'], | |
| 931 | - ], | |
| 932 | - ] | |
| 933 | - ); | |
| 934 | - | |
| 935 | - $this->add_group_control( | |
| 936 | - Group_Control_Typography::get_type(), | |
| 937 | - [ | |
| 938 | - 'name' => 'sub_heading_typography', | |
| 939 | - 'label' => esc_html__('Typography', 'easy-elements'), | |
| 940 | - 'selector' => '{{WRAPPER}} .e-e-heading .eel-sub-heading span', | |
| 941 | - ] | |
| 942 | - ); | |
| 943 | - | |
| 944 | - $this->add_group_control( | |
| 945 | - \Elementor\Group_Control_Border::get_type(), | |
| 946 | - [ | |
| 947 | - 'name' => 'subtext_border', | |
| 948 | - 'label' => esc_html__( 'Border', 'easy-elements' ), | |
| 949 | - 'selector' => '{{WRAPPER}} .eel-sub-heading', | |
| 950 | - ] | |
| 951 | - ); | |
| 952 | - | |
| 953 | - $this->add_control( | |
| 954 | - 'subtext_icon_size', | |
| 955 | - [ | |
| 956 | - 'label' => esc_html__( 'Icon Size', 'easy-elements' ), | |
| 957 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 958 | - 'range' => [ | |
| 959 | - 'px' => [ | |
| 960 | - 'min' => 6, | |
| 961 | - 'max' => 100, | |
| 962 | - ], | |
| 963 | - ], | |
| 964 | - 'selectors' => [ | |
| 965 | - '{{WRAPPER}} .eel-sub-heading i, {{WRAPPER}} .eel-sub-heading svg' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 966 | - ], | |
| 967 | - 'description' => esc_html__( 'Adjust the icon size in pixels for the subheading icon.', 'easy-elements' ), | |
| 968 | - 'condition' => [ | |
| 969 | - 'sub_heading_type' => 'icon', | |
| 970 | - ], | |
| 971 | - ] | |
| 972 | - ); | |
| 973 | - | |
| 974 | - $this->add_responsive_control( | |
| 975 | - 'subtext_border_radius', | |
| 976 | - [ | |
| 977 | - 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 978 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 979 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 980 | - 'selectors' => [ | |
| 981 | - '{{WRAPPER}} .eel-sub-heading' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 982 | - ], | |
| 983 | - ] | |
| 984 | - ); | |
| 985 | - | |
| 986 | - $this->add_responsive_control( | |
| 987 | - 'subtext_padding', | |
| 988 | - [ | |
| 989 | - 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 990 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 991 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 992 | - 'selectors' => [ | |
| 993 | - '{{WRAPPER}} .eel-sub-heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 994 | - ], | |
| 995 | - ] | |
| 996 | - ); | |
| 997 | - | |
| 998 | - $this->add_control( | |
| 999 | - 'sub_heading_margin', | |
| 1000 | - [ | |
| 1001 | - 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 1002 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 1003 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1004 | - 'selectors' => [ | |
| 1005 | - '{{WRAPPER}} .eel-sub-heading' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1006 | - ], | |
| 1007 | - ] | |
| 1008 | - ); | |
| 1009 | - | |
| 1010 | - $this->end_controls_section(); | |
| 1011 | - | |
| 1012 | - | |
| 1013 | - // Highlight | |
| 1014 | - $this->start_controls_section( | |
| 1015 | - 'section_highlight_style', | |
| 1016 | - [ | |
| 1017 | - 'label' => esc_html__('Highlight', 'easy-elements'), | |
| 1018 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 1019 | - ] | |
| 1020 | - ); | |
| 1021 | - $this->add_control( | |
| 1022 | - 'highlight_color', | |
| 1023 | - [ | |
| 1024 | - 'label' => esc_html__('Color', 'easy-elements'), | |
| 1025 | - 'type' => Controls_Manager::COLOR, | |
| 1026 | - 'selectors' => [ | |
| 1027 | - '{{WRAPPER}} .e-e-heading .e-e-title span' => 'color: {{VALUE}};', | |
| 1028 | - ], | |
| 1029 | - ] | |
| 1030 | - ); | |
| 1031 | - | |
| 1032 | - $this->add_group_control( | |
| 1033 | - \Elementor\Group_Control_Background::get_type(), | |
| 1034 | - [ | |
| 1035 | - 'name' => 'background_highlight', | |
| 1036 | - 'types' => [ 'classic', 'gradient' ], | |
| 1037 | - 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title span', | |
| 1038 | - ] | |
| 1039 | - ); | |
| 1040 | - | |
| 1041 | - $this->add_group_control( | |
| 1042 | - Group_Control_Typography::get_type(), | |
| 1043 | - [ | |
| 1044 | - 'name' => 'highlight_typography', | |
| 1045 | - 'label' => esc_html__('Highlight Typography', 'easy-elements'), | |
| 1046 | - 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title span', | |
| 1047 | - ] | |
| 1048 | - ); | |
| 1049 | - | |
| 1050 | - $this->add_responsive_control( | |
| 1051 | - 'highlight_padding', | |
| 1052 | - [ | |
| 1053 | - 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 1054 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 1055 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1056 | - 'selectors' => [ | |
| 1057 | - '{{WRAPPER}} .e-e-heading .e-e-title span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1058 | - ], | |
| 1059 | - ] | |
| 1060 | - ); | |
| 1061 | - | |
| 1062 | - $this->add_control( | |
| 1063 | - 'highlight_margin', | |
| 1064 | - [ | |
| 1065 | - 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 1066 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 1067 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1068 | - 'selectors' => [ | |
| 1069 | - '{{WRAPPER}} .e-e-heading .e-e-title span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1070 | - ], | |
| 1071 | - ] | |
| 1072 | - ); | |
| 1073 | - | |
| 1074 | - $this->add_responsive_control( | |
| 1075 | - 'hithlight_border_radius', | |
| 1076 | - [ | |
| 1077 | - 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1078 | - 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 1079 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1080 | - 'selectors' => [ | |
| 1081 | - '{{WRAPPER}} .e-e-heading .e-e-title span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1082 | - ], | |
| 1083 | - ] | |
| 1084 | - ); | |
| 1085 | - | |
| 1086 | - $this->end_controls_section(); | |
| 1087 | - | |
| 1088 | - // Description | |
| 1089 | - $this->start_controls_section( | |
| 1090 | - 'section_description_style', | |
| 1091 | - [ | |
| 1092 | - 'label' => esc_html__('Description', 'easy-elements'), | |
| 1093 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 1094 | - ] | |
| 1095 | - ); | |
| 1096 | - $this->add_control( | |
| 1097 | - 'description_color', | |
| 1098 | - [ | |
| 1099 | - 'label' => esc_html__('Color', 'easy-elements'), | |
| 1100 | - 'type' => Controls_Manager::COLOR, | |
| 1101 | - 'selectors' => [ | |
| 1102 | - '{{WRAPPER}} .e-e-heading .e-e-description' => 'color: {{VALUE}};', | |
| 1103 | - ], | |
| 1104 | - ] | |
| 1105 | - ); | |
| 1106 | - $this->add_group_control( | |
| 1107 | - Group_Control_Typography::get_type(), | |
| 1108 | - [ | |
| 1109 | - 'name' => 'description_typography', | |
| 1110 | - 'label' => esc_html__('Title Typography', 'easy-elements'), | |
| 1111 | - 'selector' => '{{WRAPPER}} .e-e-heading .e-e-description', | |
| 1112 | - ] | |
| 1113 | - ); | |
| 1114 | - $this->add_responsive_control( | |
| 1115 | - 'description_margin', | |
| 1116 | - [ | |
| 1117 | - 'label' => esc_html__('Margin', 'easy-elements'), | |
| 1118 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1119 | - 'size_units' => ['px', 'em', '%'], | |
| 1120 | - 'selectors' => [ | |
| 1121 | - '{{WRAPPER}} .e-e-heading .e-e-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1122 | - ], | |
| 1123 | - ] | |
| 1124 | - ); | |
| 1125 | - $this->add_responsive_control( | |
| 1126 | - 'description_padding', | |
| 1127 | - [ | |
| 1128 | - 'label' => esc_html__('Padding', 'easy-elements'), | |
| 1129 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1130 | - 'size_units' => ['px', 'em', '%'], | |
| 1131 | - 'selectors' => [ | |
| 1132 | - '{{WRAPPER}} .e-e-heading .e-e-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1133 | - ], | |
| 1134 | - ] | |
| 1135 | - ); | |
| 1136 | - $this->end_controls_section(); | |
| 1137 | - } | |
| 1138 | - | |
| 1139 | - protected function render_separator( $settings ) { | |
| 1140 | - if ( ! empty( $settings['separator_'] ) && in_array( $settings['separator_'], ['dotted', 'solid'], true ) ) { | |
| 1141 | - echo '<div class="eel--separator-icon ' . esc_attr( $settings['separator_'] ) . '"></div>'; | |
| 1142 | - } | |
| 1143 | - | |
| 1144 | - if ( 'icon' === $settings['separator_'] && ! empty( $settings['select_icon_']['value'] ) ) { | |
| 1145 | - echo '<div class="eel--separator-icon-wrap">'; | |
| 1146 | - \Elementor\Icons_Manager::render_icon( $settings['select_icon_'], [ 'aria-hidden' => 'true' ] ); | |
| 1147 | - echo '</div>'; | |
| 1148 | - } | |
| 1149 | - if ( isset( $settings['separator_'] ) && 'image' === $settings['separator_'] && ! empty( $settings['sep_image']['url'] ) ) { | |
| 1150 | - echo '<div class="eel--separator-icon-wrap">'; | |
| 1151 | - printf( | |
| 1152 | - '<img src="%s" alt="%s" title="%s" class="eel-separator-img" loading="lazy" decoding="async" />', | |
| 1153 | - esc_url( $settings['sep_image']['url'] ), | |
| 1154 | - esc_attr__( 'Separator Image', 'easy-elements' ), | |
| 1155 | - esc_attr__( 'Separator Image', 'easy-elements' ) | |
| 1156 | - ); | |
| 1157 | - | |
| 1158 | - echo '</div>'; | |
| 1159 | - } | |
| 1160 | - } | |
| 1161 | - | |
| 1162 | - protected function render() { | |
| 1163 | - $settings = $this->get_settings_for_display(); | |
| 1164 | - | |
| 1165 | - $tag = isset($settings['title_tag']) ? $settings['title_tag'] : 'h2'; | |
| 1166 | - $title = preg_replace_callback( '/\{\{(.*?)\}\}/', function( $matches ) { | |
| 1167 | - return '<span>' . esc_html( trim( $matches[1] ) ) . '</span>'; | |
| 1168 | - }, $settings['title'] ); | |
| 1169 | - | |
| 1170 | - if ( ! empty( $settings['link']['url'] ) ) { | |
| 1171 | - $this->add_link_attributes( 'title_link', $settings['link'] ); | |
| 1172 | - $title = sprintf( | |
| 1173 | - '<a %s>%s</a>', | |
| 1174 | - $this->get_render_attribute_string( 'title_link' ), | |
| 1175 | - $title | |
| 1176 | - ); | |
| 1177 | - } | |
| 1178 | - | |
| 1179 | - $border_position = $settings['border_position'] ?? ''; | |
| 1180 | - $unique_id = 'eel-heading-' . $this->get_id(); | |
| 1181 | - $animation = isset( $settings['animation_type'] ) && ! empty($settings['animation_type']) ? $settings['animation_type'] : ''; | |
| 1182 | - ?> | |
| 1183 | - <div class="e-e-heading <?php echo esc_attr($border_position); ?>" <?php if(!empty($animation)) : ?> | |
| 1184 | - data-eel-animation="<?php echo esc_attr($animation); ?>" | |
| 1185 | - <?php endif; ?>> | |
| 1186 | - <?php | |
| 1187 | - $icon_direction = $settings['icon_direction'] ?? '' ; | |
| 1188 | - $separator_position = ! empty( $settings['separator_position'] ) ? $settings['separator_position'] : 'default'; | |
| 1189 | - | |
| 1190 | - if ( in_array( $separator_position, ['top'], true ) ) { | |
| 1191 | - if ( ! empty( $settings['separator_'] ) ) { | |
| 1192 | - $this->render_separator( $settings ); | |
| 1193 | - } | |
| 1194 | - } | |
| 1195 | - | |
| 1196 | - if ( ! empty( $settings['sub_title'] ) ) : ?> | |
| 1197 | - <div class="eel-sub-heading <?php echo esc_attr($icon_direction); ?> <?php echo esc_attr($settings['show_gradient_border'] == 'yes' ? 'easy_gradiant_border' : ''); ?>"> | |
| 1198 | - <?php | |
| 1199 | - $this->add_inline_editing_attributes( 'sub_title' ); | |
| 1200 | - if ( 'icon' === $settings['sub_heading_type'] && ! empty( $settings['sub_heading_icon']['value'] ) ) { | |
| 1201 | - \Elementor\Icons_Manager::render_icon( $settings['sub_heading_icon'], [ 'aria-hidden' => 'true' ] ); | |
| 1202 | - } elseif ( 'image' === $settings['sub_heading_type'] && ! empty( $settings['sub_heading_image']['url'] ) ) { | |
| 1203 | - if ( ! empty( $settings['sub_heading_image']['id'] ) ) { | |
| 1204 | - echo wp_get_attachment_image( | |
| 1205 | - $settings['sub_heading_image']['id'], | |
| 1206 | - 'full', | |
| 1207 | - false, | |
| 1208 | - ['alt' => $settings['sub_heading_image']['alt'] ?? ''] | |
| 1209 | - ); | |
| 1210 | - } elseif ( ! empty( $settings['sub_heading_image']['url'] ) ) { | |
| 1211 | - echo '<img src="' . esc_url( $settings['sub_heading_image']['url'] ) . '" alt="">'; | |
| 1212 | - } | |
| 1213 | - } | |
| 1214 | - | |
| 1215 | - ?> | |
| 1216 | - <span class="elementor-inline-editing" <?php | |
| 1217 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1218 | - echo $this->get_render_attribute_string( 'sub_title' ); ?>> | |
| 1219 | - <?php | |
| 1220 | - echo wp_kses_post( $settings['sub_title'] ); | |
| 1221 | - ?> | |
| 1222 | - </span> | |
| 1223 | - </div> | |
| 1224 | - <?php endif; | |
| 1225 | - | |
| 1226 | - if ( in_array( $separator_position, ['above'], true ) ) { | |
| 1227 | - if ( ! empty( $settings['separator_'] ) ) { | |
| 1228 | - $this->render_separator( $settings ); | |
| 1229 | - } | |
| 1230 | - } | |
| 1231 | - | |
| 1232 | - $allowed_tags = ['h1','h2','h3','h4','h5','h6','div','span']; | |
| 1233 | - $tag = in_array(strtolower($tag), $allowed_tags, true) ? strtolower($tag) : 'div'; | |
| 1234 | - | |
| 1235 | - | |
| 1236 | - if ( ! empty( $title ) ) { | |
| 1237 | - $gradient_class = ! empty( $settings['show_gradient_title'] ) ? ' e-e-gradient-title' : ''; | |
| 1238 | - $image_fill_class = ( ! empty( $settings['enable_title_image_fill'] ) ) ? ' e-e-image-fill' : ''; | |
| 1239 | - $tag_class = 'e-e-title elementor-inline-editing' . $gradient_class . $image_fill_class; | |
| 1240 | - | |
| 1241 | - // Inline editing attribute add | |
| 1242 | - $this->add_inline_editing_attributes( 'title' ); | |
| 1243 | - | |
| 1244 | - printf( | |
| 1245 | - '<%1$s class="%2$s" %3$s>%4$s</%1$s>', | |
| 1246 | - esc_html( $tag ), | |
| 1247 | - esc_attr( $tag_class ), | |
| 1248 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1249 | - $this->get_render_attribute_string( 'title' ), | |
| 1250 | - wp_kses_post( $title ) | |
| 1251 | - ); | |
| 1252 | - } | |
| 1253 | - | |
| 1254 | - | |
| 1255 | - | |
| 1256 | - if ( in_array( $separator_position, ['below'], true ) ) { | |
| 1257 | - if ( ! empty( $settings['separator_'] ) ) { | |
| 1258 | - $this->render_separator( $settings ); | |
| 1259 | - } | |
| 1260 | - } | |
| 1261 | - | |
| 1262 | - if ( ! empty( $settings['description'] ) ) { | |
| 1263 | - $this->add_inline_editing_attributes( 'description' ); | |
| 1264 | - ?> | |
| 1265 | - <div class="e-e-description elementor-inline-editing" <?php | |
| 1266 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1267 | - echo $this->get_render_attribute_string( 'description' ); ?>> | |
| 1268 | - <?php echo wp_kses_post( $settings['description'] ); ?> | |
| 1269 | - </div> | |
| 1270 | - <?php } | |
| 1271 | - if ( in_array( $separator_position, ['bottom'], true ) ) { | |
| 1272 | - if ( ! empty( $settings['separator_'] ) ) { | |
| 1273 | - $this->render_separator( $settings ); | |
| 1274 | - } | |
| 1275 | - } | |
| 1276 | - | |
| 1277 | - if ( ! empty( $settings['water_mark'] ) ) { | |
| 1278 | - echo '<div class="eel-watermark">'; | |
| 1279 | - echo esc_html( $settings['water_mark'] ); | |
| 1280 | - echo '</div>'; | |
| 1281 | - } | |
| 1282 | - | |
| 1283 | - ?> | |
| 1284 | - </div> | |
| 1285 | - <?php } | |
| 1286 | -} | |
| 1 | +<?php | |
| 2 | +use Elementor\Controls_Manager; | |
| 3 | +use Elementor\Group_Control_Typography; | |
| 4 | +use Elementor\Widget_Base; | |
| 5 | +use Elementor\Group_Control_Background; | |
| 6 | + | |
| 7 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 8 | + exit; | |
| 9 | +} | |
| 10 | + | |
| 11 | +class Easyel_Heading_Widget extends \Elementor\Widget_Base { | |
| 12 | + | |
| 13 | + public function get_style_depends() { | |
| 14 | + $handle = 'eel-heading-style'; | |
| 15 | + $css_path = plugin_dir_path( __FILE__ ) . 'css/heading.min.css'; | |
| 16 | + | |
| 17 | + if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) { | |
| 18 | + wp_register_style( $handle, plugins_url( 'css/heading.min.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : '1.0.0' ); | |
| 19 | + } | |
| 20 | + return [ $handle ]; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public function get_name() { | |
| 24 | + return 'eel-heading'; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public function get_title() { | |
| 28 | + return __( 'Heading', 'easy-elements' ); | |
| 29 | + } | |
| 30 | + | |
| 31 | + public function get_icon() { | |
| 32 | + return 'easyicon easyelIcon-heading'; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public function get_categories() { | |
| 36 | + return [ 'easyelements_category' ]; | |
| 37 | + } | |
| 38 | + public function get_keywords() { | |
| 39 | + return [ 'heading', 'title', 'link', 'click', 'text' ]; | |
| 40 | + } | |
| 41 | + | |
| 42 | + protected function register_controls() { | |
| 43 | + $this->start_controls_section( | |
| 44 | + 'content_section', | |
| 45 | + [ | |
| 46 | + 'label' => esc_html__('Heading Settings', 'easy-elements'), | |
| 47 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 48 | + ] | |
| 49 | + ); | |
| 50 | + | |
| 51 | + $this->add_control( | |
| 52 | + 'title', | |
| 53 | + [ | |
| 54 | + 'label' => esc_html__('Heading Text', 'easy-elements'), | |
| 55 | + 'type' => Controls_Manager::TEXTAREA, | |
| 56 | + 'default' => esc_html__('Heading Here', 'easy-elements'), | |
| 57 | + 'label_block' => true, | |
| 58 | + 'description' => esc_html__('You can highlight part of the text using double curly brackets. Example: Heading {{Here}} will highlight "Here".', 'easy-elements'), | |
| 59 | + ] | |
| 60 | + ); | |
| 61 | + | |
| 62 | + $this->add_control( | |
| 63 | + 'show_border_title', | |
| 64 | + [ | |
| 65 | + 'label' => esc_html__( 'Show Border', 'easy-elements' ), | |
| 66 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 67 | + 'label_on' => esc_html__( 'Show', 'easy-elements' ), | |
| 68 | + 'label_off' => esc_html__( 'Hide', 'easy-elements' ), | |
| 69 | + 'return_value' => 'yes', | |
| 70 | + 'default' => '', | |
| 71 | + ] | |
| 72 | + ); | |
| 73 | + | |
| 74 | + $this->add_control( | |
| 75 | + 'show_gradient_title', | |
| 76 | + [ | |
| 77 | + 'label' => esc_html__( 'Gradient Text', 'easy-elements' ), | |
| 78 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 79 | + 'label_on' => esc_html__( 'Show', 'easy-elements' ), | |
| 80 | + 'label_off' => esc_html__( 'Hide', 'easy-elements' ), | |
| 81 | + 'return_value' => 'yes', | |
| 82 | + 'default' => '', | |
| 83 | + ] | |
| 84 | + ); | |
| 85 | + | |
| 86 | + $this->add_control( | |
| 87 | + 'border_position', | |
| 88 | + [ | |
| 89 | + 'label' => esc_html__( 'Border Position', 'easy-elements' ), | |
| 90 | + 'type' => \Elementor\Controls_Manager::SELECT, | |
| 91 | + 'default' => 'eel_title_start', | |
| 92 | + 'options' => [ | |
| 93 | + 'eel_title_start' => esc_html__( 'Only Start Title', 'easy-elements' ), | |
| 94 | + 'eel_title_end' => esc_html__( 'Only Title End', 'easy-elements' ), | |
| 95 | + 'eel_full_title_start' => esc_html__( 'Full Title Part Start', 'easy-elements' ), | |
| 96 | + 'eel_full_title_end' => esc_html__( 'Full Title Part End', 'easy-elements' ), | |
| 97 | + ], | |
| 98 | + 'condition' => [ | |
| 99 | + 'show_border_title' => 'yes', | |
| 100 | + ], | |
| 101 | + ] | |
| 102 | + ); | |
| 103 | + | |
| 104 | + | |
| 105 | + $this->add_control( | |
| 106 | + 'border_color', | |
| 107 | + [ | |
| 108 | + 'label' => esc_html__('Border Color', 'easy-elements'), | |
| 109 | + 'type' => Controls_Manager::COLOR, | |
| 110 | + 'selectors' => [ | |
| 111 | + '{{WRAPPER}} .eel_full_title_end, {{WRAPPER}} .eel_title_end .e-e-title, {{WRAPPER}} .eel_full_title_start, {{WRAPPER}} .eel_title_start .e-e-title' => 'border-color: {{VALUE}};', | |
| 112 | + ], | |
| 113 | + 'condition' => [ | |
| 114 | + 'show_border_title' => 'yes', | |
| 115 | + ], | |
| 116 | + ] | |
| 117 | + ); | |
| 118 | + | |
| 119 | + $this->add_responsive_control( | |
| 120 | + 'title_border_padding', | |
| 121 | + [ | |
| 122 | + 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 123 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 124 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 125 | + 'selectors' => [ | |
| 126 | + '{{WRAPPER}} .eel_full_title_end, {{WRAPPER}} .eel_title_end .e-e-title, {{WRAPPER}} .eel_full_title_start, {{WRAPPER}} .eel_title_start .e-e-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 127 | + ], | |
| 128 | + 'condition' => [ | |
| 129 | + 'show_border_title' => 'yes', | |
| 130 | + ], | |
| 131 | + ] | |
| 132 | + ); | |
| 133 | + | |
| 134 | + | |
| 135 | + $this->add_control( | |
| 136 | + 'link', | |
| 137 | + [ | |
| 138 | + 'label' => __( 'Link', 'easy-elements' ), | |
| 139 | + 'type' => \Elementor\Controls_Manager::URL, | |
| 140 | + 'placeholder' => 'https://your-link.com', | |
| 141 | + 'default' => [ | |
| 142 | + 'url' => '', | |
| 143 | + 'is_external' => false, | |
| 144 | + 'nofollow' => false, | |
| 145 | + ], | |
| 146 | + 'show_external' => true, | |
| 147 | + 'description' => esc_html__( 'Set a URL to make the heading clickable. Supports opening in a new tab and nofollow attribute.', 'easy-elements' ), | |
| 148 | + ] | |
| 149 | + ); | |
| 150 | + | |
| 151 | + $this->add_control( | |
| 152 | + 'title_tag', | |
| 153 | + [ | |
| 154 | + 'label' => esc_html__('Select Tag', 'easy-elements'), | |
| 155 | + 'type' => Controls_Manager::SELECT, | |
| 156 | + 'default' => 'h2', | |
| 157 | + 'options' => [ | |
| 158 | + 'h1' => 'H1', | |
| 159 | + 'h2' => 'H2', | |
| 160 | + 'h3' => 'H3', | |
| 161 | + 'h4' => 'H4', | |
| 162 | + 'h5' => 'H5', | |
| 163 | + 'h6' => 'H6', | |
| 164 | + 'div' => 'div', | |
| 165 | + ], | |
| 166 | + ] | |
| 167 | + ); | |
| 168 | + | |
| 169 | + $this->add_control( | |
| 170 | + 'description', | |
| 171 | + [ | |
| 172 | + 'label' => esc_html__('Description', 'easy-elements'), | |
| 173 | + 'type' => Controls_Manager::TEXTAREA, | |
| 174 | + 'label_block' => true, | |
| 175 | + ] | |
| 176 | + ); | |
| 177 | + | |
| 178 | + | |
| 179 | + $this->add_responsive_control( | |
| 180 | + 'align', | |
| 181 | + [ | |
| 182 | + 'label' => esc_html__('Alignment', 'easy-elements'), | |
| 183 | + 'type' => Controls_Manager::CHOOSE, | |
| 184 | + 'options' => [ | |
| 185 | + 'left' => [ | |
| 186 | + 'title' => esc_html__('Left', 'easy-elements'), | |
| 187 | + 'icon' => 'eicon-text-align-left', | |
| 188 | + ], | |
| 189 | + 'center' => [ | |
| 190 | + 'title' => esc_html__('Center', 'easy-elements'), | |
| 191 | + 'icon' => 'eicon-text-align-center', | |
| 192 | + ], | |
| 193 | + 'right' => [ | |
| 194 | + 'title' => esc_html__('Right', 'easy-elements'), | |
| 195 | + 'icon' => 'eicon-text-align-right', | |
| 196 | + ], | |
| 197 | + 'justify' => [ | |
| 198 | + 'title' => esc_html__('Justify', 'easy-elements'), | |
| 199 | + 'icon' => 'eicon-text-align-justify', | |
| 200 | + ], | |
| 201 | + ], | |
| 202 | + 'toggle' => true, | |
| 203 | + 'selectors' => [ | |
| 204 | + '{{WRAPPER}} .e-e-heading' => 'text-align: {{VALUE}}', | |
| 205 | + '{{WRAPPER}} .image-heading' => 'justify-content: {{VALUE}}', | |
| 206 | + ], | |
| 207 | + ] | |
| 208 | + ); | |
| 209 | + | |
| 210 | + $this->end_controls_section(); | |
| 211 | + | |
| 212 | + $this->start_controls_section( | |
| 213 | + 'sub_heading_section', | |
| 214 | + [ | |
| 215 | + 'label' => esc_html__('Sub Heading Settings', 'easy-elements'), | |
| 216 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 217 | + ] | |
| 218 | + ); | |
| 219 | + | |
| 220 | + $this->add_control( | |
| 221 | + 'sub_title', | |
| 222 | + [ | |
| 223 | + 'label' => esc_html__( 'Sub Heading', 'easy-elements' ), | |
| 224 | + 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 225 | + 'label_block' => true, | |
| 226 | + ] | |
| 227 | + ); | |
| 228 | + | |
| 229 | + $this->add_control( | |
| 230 | + 'show_gradient_border', | |
| 231 | + [ | |
| 232 | + 'label' => esc_html__( 'Show Gradient Border', 'easy-elements' ), | |
| 233 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 234 | + 'label_on' => esc_html__( 'Show', 'easy-elements' ), | |
| 235 | + 'label_off' => esc_html__( 'Hide', 'easy-elements' ), | |
| 236 | + 'return_value' => 'yes', | |
| 237 | + 'default' => '', | |
| 238 | + ] | |
| 239 | + ); | |
| 240 | + | |
| 241 | + $this->add_control( | |
| 242 | + 'gradient_color_1', | |
| 243 | + [ | |
| 244 | + 'label' => esc_html__( 'Gradient Color 1', 'easy-elements' ), | |
| 245 | + 'type' => \Elementor\Controls_Manager::COLOR, | |
| 246 | + 'default' => 'rgba(0, 0, 0, 0.15)', | |
| 247 | + 'selectors' => [ | |
| 248 | + '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-1: {{VALUE}};', | |
| 249 | + ], | |
| 250 | + 'condition' => [ | |
| 251 | + 'show_gradient_border' => 'yes', | |
| 252 | + ], | |
| 253 | + ] | |
| 254 | + ); | |
| 255 | + | |
| 256 | + $this->add_control( | |
| 257 | + 'gradient_color_2', | |
| 258 | + [ | |
| 259 | + 'label' => esc_html__( 'Gradient Color 2', 'easy-elements' ), | |
| 260 | + 'type' => \Elementor\Controls_Manager::COLOR, | |
| 261 | + 'default' => 'rgba(0, 0, 0, 0.30)', | |
| 262 | + 'selectors' => [ | |
| 263 | + '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-2: {{VALUE}};', | |
| 264 | + ], | |
| 265 | + 'condition' => [ | |
| 266 | + 'show_gradient_border' => 'yes', | |
| 267 | + ], | |
| 268 | + ] | |
| 269 | + ); | |
| 270 | + | |
| 271 | + $this->add_control( | |
| 272 | + 'gradient_color_3', | |
| 273 | + [ | |
| 274 | + 'label' => esc_html__( 'Gradient Color 3', 'easy-elements' ), | |
| 275 | + 'type' => \Elementor\Controls_Manager::COLOR, | |
| 276 | + 'default' => 'rgba(0, 0, 0, 0.50)', | |
| 277 | + 'selectors' => [ | |
| 278 | + '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-3: {{VALUE}};', | |
| 279 | + ], | |
| 280 | + 'condition' => [ | |
| 281 | + 'show_gradient_border' => 'yes', | |
| 282 | + ], | |
| 283 | + ] | |
| 284 | + ); | |
| 285 | + | |
| 286 | + | |
| 287 | + $this->add_responsive_control( | |
| 288 | + 'sub_gradient_border_padding', | |
| 289 | + [ | |
| 290 | + 'label' => __('Gradient Border Padding', 'easy-elements'), | |
| 291 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 292 | + 'size_units' => ['px', '%', 'em'], | |
| 293 | + 'selectors' => [ | |
| 294 | + '{{WRAPPER}} .easy_gradiant_border' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 295 | + ], | |
| 296 | + 'condition' => [ | |
| 297 | + 'show_gradient_border' => 'yes', | |
| 298 | + ], | |
| 299 | + ] | |
| 300 | + ); | |
| 301 | + | |
| 302 | + $this->add_responsive_control( | |
| 303 | + 'gradient_border_radius', | |
| 304 | + [ | |
| 305 | + 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 306 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 307 | + 'size_units' => [ 'px', '%' ], | |
| 308 | + 'range' => [ | |
| 309 | + 'px' => [ | |
| 310 | + 'min' => 0, | |
| 311 | + 'max' => 200, | |
| 312 | + ], | |
| 313 | + '%' => [ | |
| 314 | + 'min' => 0, | |
| 315 | + 'max' => 100, | |
| 316 | + ], | |
| 317 | + ], | |
| 318 | + 'default' => [ | |
| 319 | + 'unit' => 'px', | |
| 320 | + 'size' => 40, | |
| 321 | + ], | |
| 322 | + 'selectors' => [ | |
| 323 | + '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-border-radius: {{SIZE}}{{UNIT}};', | |
| 324 | + ], | |
| 325 | + ] | |
| 326 | + ); | |
| 327 | + | |
| 328 | + | |
| 329 | + $this->add_control( | |
| 330 | + 'sub_heading_type', | |
| 331 | + [ | |
| 332 | + 'label' => esc_html__( 'Sub Heading Type', 'easy-elements' ), | |
| 333 | + 'type' => \Elementor\Controls_Manager::CHOOSE, | |
| 334 | + 'options' => [ | |
| 335 | + 'none' => [ | |
| 336 | + 'title' => esc_html__( 'None', 'easy-elements' ), | |
| 337 | + 'icon' => 'eicon-ban', | |
| 338 | + ], | |
| 339 | + 'icon' => [ | |
| 340 | + 'title' => esc_html__( 'Icon', 'easy-elements' ), | |
| 341 | + 'icon' => 'eicon-star', | |
| 342 | + ], | |
| 343 | + 'image' => [ | |
| 344 | + 'title' => esc_html__( 'Image', 'easy-elements' ), | |
| 345 | + 'icon' => 'eicon-image-bold', | |
| 346 | + ], | |
| 347 | + ], | |
| 348 | + 'default' => 'none', | |
| 349 | + 'toggle' => false, | |
| 350 | + ] | |
| 351 | + ); | |
| 352 | + | |
| 353 | + $this->add_control( | |
| 354 | + 'sub_heading_icon', | |
| 355 | + [ | |
| 356 | + 'label' => esc_html__( 'Select Icon', 'easy-elements' ), | |
| 357 | + 'type' => \Elementor\Controls_Manager::ICONS, | |
| 358 | + 'default' => [ | |
| 359 | + 'value' => 'fas fa-heart', | |
| 360 | + 'library' => 'fa-solid', | |
| 361 | + ], | |
| 362 | + 'condition' => [ | |
| 363 | + 'sub_heading_type' => 'icon', | |
| 364 | + ], | |
| 365 | + ] | |
| 366 | + ); | |
| 367 | + | |
| 368 | + $this->add_control( | |
| 369 | + 'sub_heading_image', | |
| 370 | + [ | |
| 371 | + 'label' => esc_html__( 'Upload Image', 'easy-elements' ), | |
| 372 | + 'type' => \Elementor\Controls_Manager::MEDIA, | |
| 373 | + 'default' => [ | |
| 374 | + 'url' => \Elementor\Utils::get_placeholder_image_src(), | |
| 375 | + ], | |
| 376 | + 'condition' => [ | |
| 377 | + 'sub_heading_type' => 'image', | |
| 378 | + ], | |
| 379 | + ] | |
| 380 | + ); | |
| 381 | + | |
| 382 | + $this->add_control( | |
| 383 | + 'icon_color', | |
| 384 | + [ | |
| 385 | + 'label' => esc_html__('Color', 'easy-elements'), | |
| 386 | + 'type' => Controls_Manager::COLOR, | |
| 387 | + 'selectors' => [ | |
| 388 | + '{{WRAPPER}} .eel-sub-heading i, {{WRAPPER}} .eel-sub-heading svg' => 'color: {{VALUE}}; fill: {{VALUE}};', | |
| 389 | + ], | |
| 390 | + 'condition' => [ | |
| 391 | + 'sub_heading_type' => ['icon'], | |
| 392 | + ], | |
| 393 | + ] | |
| 394 | + ); | |
| 395 | + | |
| 396 | + $this->add_responsive_control( | |
| 397 | + 'sub_heading_icon_margin', | |
| 398 | + [ | |
| 399 | + 'label' => esc_html__( 'Icon Spacing', 'easy-elements' ), | |
| 400 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 401 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 402 | + 'selectors' => [ | |
| 403 | + '{{WRAPPER}} .eel-sub-heading span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 404 | + ], | |
| 405 | + 'condition' => [ | |
| 406 | + 'sub_heading_type' => ['image', 'icon'], | |
| 407 | + ], | |
| 408 | + ] | |
| 409 | + ); | |
| 410 | + | |
| 411 | + $this->add_control( | |
| 412 | + 'icon_direction', | |
| 413 | + [ | |
| 414 | + 'label' => esc_html__( 'Direction', 'easy-elements' ), | |
| 415 | + 'type' => \Elementor\Controls_Manager::CHOOSE, | |
| 416 | + 'default' => 'top', | |
| 417 | + 'options' => [ | |
| 418 | + 'left' => [ | |
| 419 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 420 | + 'icon' => 'eicon-h-align-left', | |
| 421 | + ], | |
| 422 | + 'top' => [ | |
| 423 | + 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 424 | + 'icon' => 'eicon-v-align-top', | |
| 425 | + ], | |
| 426 | + 'right' => [ | |
| 427 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 428 | + 'icon' => 'eicon-h-align-right', | |
| 429 | + ], | |
| 430 | + ], | |
| 431 | + 'toggle' => false, | |
| 432 | + ] | |
| 433 | + ); | |
| 434 | + $this->end_controls_section(); | |
| 435 | + | |
| 436 | + $this->start_controls_section( | |
| 437 | + 'separator_section', | |
| 438 | + [ | |
| 439 | + 'label' => esc_html__('Separator Settings', 'easy-elements'), | |
| 440 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 441 | + ] | |
| 442 | + ); | |
| 443 | + | |
| 444 | + $this->add_control( | |
| 445 | + 'separator_', | |
| 446 | + [ | |
| 447 | + 'label' => __( 'Choose Option', 'easy-elements' ), | |
| 448 | + 'type' => \Elementor\Controls_Manager::SELECT, | |
| 449 | + 'options' => [ | |
| 450 | + 'none' => __( 'None', 'easy-elements' ), | |
| 451 | + 'dotted' => __( 'Dotted', 'easy-elements' ), | |
| 452 | + 'solid' => __( 'Solid', 'easy-elements' ), | |
| 453 | + 'icon' => __( 'Icon', 'easy-elements' ), | |
| 454 | + 'image' => __( 'Image', 'easy-elements' ), | |
| 455 | + ], | |
| 456 | + 'default' => 'none', | |
| 457 | + ] | |
| 458 | + ); | |
| 459 | + | |
| 460 | + $this->add_control( | |
| 461 | + 'solid_color', | |
| 462 | + [ | |
| 463 | + 'label' => esc_html__('Separator Color', 'easy-elements'), | |
| 464 | + 'type' => \Elementor\Controls_Manager::COLOR, | |
| 465 | + 'selectors' => [ | |
| 466 | + '{{WRAPPER}} .eel--separator-icon.dotted::before, {{WRAPPER}} .eel--separator-icon' => 'color: {{VALUE}}; background-color: {{VALUE}};', | |
| 467 | + ], | |
| 468 | + 'condition' => [ | |
| 469 | + 'separator_' => ['solid', 'dotted'], | |
| 470 | + ], | |
| 471 | + ] | |
| 472 | + ); | |
| 473 | + | |
| 474 | + $this->add_control( | |
| 475 | + 'select_icon_', | |
| 476 | + [ | |
| 477 | + 'label' => esc_html__( 'Select/Upload Icon', 'easy-elements' ), | |
| 478 | + 'type' => \Elementor\Controls_Manager::ICONS, | |
| 479 | + 'default' => [ | |
| 480 | + 'value' => 'fas fa-heart', | |
| 481 | + 'library' => 'fa-solid', | |
| 482 | + ], | |
| 483 | + 'description' => esc_html__( 'You can upload an SVG image or choose a font icon.', 'easy-elements' ), | |
| 484 | + 'condition' => [ | |
| 485 | + 'separator_' => ['icon'], | |
| 486 | + ], | |
| 487 | + ] | |
| 488 | + ); | |
| 489 | + | |
| 490 | + $this->add_control( | |
| 491 | + 'sep_image', | |
| 492 | + [ | |
| 493 | + 'label' => esc_html__( 'Upload Image', 'easy-elements' ), | |
| 494 | + 'type' => \Elementor\Controls_Manager::MEDIA, | |
| 495 | + 'default' => [ | |
| 496 | + 'url' => \Elementor\Utils::get_placeholder_image_src(), | |
| 497 | + ], | |
| 498 | + 'condition' => [ | |
| 499 | + 'separator_' => 'image', | |
| 500 | + ], | |
| 501 | + ] | |
| 502 | + ); | |
| 503 | + | |
| 504 | + $this->add_control( | |
| 505 | + 'separator_position', | |
| 506 | + [ | |
| 507 | + 'label' => esc_html__( 'Position', 'easy-elements' ), | |
| 508 | + 'type' => \Elementor\Controls_Manager::SELECT, | |
| 509 | + 'default' => 'below', | |
| 510 | + 'options' => [ | |
| 511 | + 'top' => esc_html__( 'Top', 'easy-elements' ), | |
| 512 | + 'above' => esc_html__( 'Above Title', 'easy-elements' ), | |
| 513 | + 'below' => esc_html__( 'Title Below', 'easy-elements' ), | |
| 514 | + 'bottom' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 515 | + ], | |
| 516 | + ] | |
| 517 | + ); | |
| 518 | + | |
| 519 | + $this->add_control( | |
| 520 | + 'separator_margin', | |
| 521 | + [ | |
| 522 | + 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 523 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 524 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 525 | + 'selectors' => [ | |
| 526 | + '{{WRAPPER}} .eel--separator-icon, {{WRAPPER}} .eel--separator-icon-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 527 | + ], | |
| 528 | + ] | |
| 529 | + ); | |
| 530 | + | |
| 531 | + $this->end_controls_section(); | |
| 532 | + | |
| 533 | + | |
| 534 | + $this->start_controls_section( | |
| 535 | + 'water_mark_section', | |
| 536 | + [ | |
| 537 | + 'label' => esc_html__('WaterMark Settings', 'easy-elements'), | |
| 538 | + 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, | |
| 539 | + ] | |
| 540 | + ); | |
| 541 | + | |
| 542 | + $this->add_control( | |
| 543 | + 'water_mark', | |
| 544 | + [ | |
| 545 | + 'label' => esc_html__('WaterMark Text', 'easy-elements'), | |
| 546 | + 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 547 | + 'label_block' => 'true', | |
| 548 | + ] | |
| 549 | + ); | |
| 550 | + | |
| 551 | + $this->add_control( | |
| 552 | + 'water_mark_font_size', | |
| 553 | + [ | |
| 554 | + 'label' => esc_html__('Font Size', 'easy-elements'), | |
| 555 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 556 | + 'size_units' => ['px', 'em', 'rem', '%'], | |
| 557 | + 'range' => [ | |
| 558 | + 'px' => ['min' => 10, 'max' => 300], | |
| 559 | + 'em' => ['min' => 0.5, 'max' => 20], | |
| 560 | + 'rem' => ['min' => 0.5, 'max' => 20], | |
| 561 | + '%' => ['min' => 10, 'max' => 500], | |
| 562 | + ], | |
| 563 | + 'default' => [ | |
| 564 | + 'size' => '', | |
| 565 | + 'unit' => 'px', | |
| 566 | + ], | |
| 567 | + 'selectors' => [ | |
| 568 | + '{{WRAPPER}} .eel-watermark' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 569 | + ], | |
| 570 | + ] | |
| 571 | + ); | |
| 572 | + | |
| 573 | + $this->add_control( | |
| 574 | + '_mark_color', | |
| 575 | + [ | |
| 576 | + 'label' => esc_html__('Color', 'easy-elements'), | |
| 577 | + 'type' => \Elementor\Controls_Manager::COLOR, | |
| 578 | + 'default' => '', | |
| 579 | + 'selectors' => [ | |
| 580 | + '{{WRAPPER}} .eel-watermark' => 'color: {{VALUE}};', | |
| 581 | + ], | |
| 582 | + ] | |
| 583 | + ); | |
| 584 | + | |
| 585 | + $this->add_control( | |
| 586 | + 'water_mark_color', | |
| 587 | + [ | |
| 588 | + 'label' => esc_html__('Stroke Color', 'easy-elements'), | |
| 589 | + 'type' => \Elementor\Controls_Manager::COLOR, | |
| 590 | + 'default' => 'rgba(0, 0, 0, 0.3)', | |
| 591 | + 'selectors' => [ | |
| 592 | + '{{WRAPPER}} .eel-watermark' => '-webkit-text-stroke-color: {{VALUE}}; text-stroke-color: {{VALUE}};', | |
| 593 | + ], | |
| 594 | + ] | |
| 595 | + ); | |
| 596 | + | |
| 597 | + $this->add_control( | |
| 598 | + 'water_mark_stroke_width', | |
| 599 | + [ | |
| 600 | + 'label' => esc_html__('Stroke Width (px)', 'easy-elements'), | |
| 601 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 602 | + 'default' => [ | |
| 603 | + 'size' => 1, | |
| 604 | + 'unit' => 'px', | |
| 605 | + ], | |
| 606 | + 'range' => [ | |
| 607 | + 'px' => [ | |
| 608 | + 'min' => 0, | |
| 609 | + 'max' => 10, | |
| 610 | + ], | |
| 611 | + ], | |
| 612 | + 'selectors' => [ | |
| 613 | + '{{WRAPPER}} .eel-watermark' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}}; text-stroke-width: {{SIZE}}{{UNIT}};', | |
| 614 | + ], | |
| 615 | + ] | |
| 616 | + ); | |
| 617 | + | |
| 618 | + $this->add_responsive_control( | |
| 619 | + 'water_mark_top', | |
| 620 | + [ | |
| 621 | + 'label' => esc_html__('Top / Bottom', 'easy-elements'), | |
| 622 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 623 | + 'size_units' => ['px', '%', 'em'], | |
| 624 | + 'range' => [ | |
| 625 | + 'px' => ['min' => -500, 'max' => 500], | |
| 626 | + '%' => ['min' => -100, 'max' => 100], | |
| 627 | + 'em' => ['min' => -50, 'max' => 50], | |
| 628 | + ], | |
| 629 | + 'selectors' => [ | |
| 630 | + '{{WRAPPER}} .eel-watermark' => 'top: {{SIZE}}{{UNIT}};', | |
| 631 | + ], | |
| 632 | + ] | |
| 633 | + ); | |
| 634 | + | |
| 635 | + $this->add_responsive_control( | |
| 636 | + 'water_mark_left', | |
| 637 | + [ | |
| 638 | + 'label' => esc_html__('Left / Right', 'easy-elements'), | |
| 639 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 640 | + 'size_units' => ['px', '%', 'em'], | |
| 641 | + 'range' => [ | |
| 642 | + 'px' => ['min' => -500, 'max' => 500], | |
| 643 | + '%' => ['min' => 0, 'max' => 100], | |
| 644 | + 'em' => ['min' => 0, 'max' => 50], | |
| 645 | + ], | |
| 646 | + 'selectors' => [ | |
| 647 | + '{{WRAPPER}} .eel-watermark' => 'left: {{SIZE}}{{UNIT}};', | |
| 648 | + ], | |
| 649 | + ] | |
| 650 | + ); | |
| 651 | + | |
| 652 | + $this->add_responsive_control( | |
| 653 | + 'water_mark_z_index', | |
| 654 | + [ | |
| 655 | + 'label' => esc_html__('Z-Index', 'easy-elements'), | |
| 656 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 657 | + 'default' => [ | |
| 658 | + 'size' => -1, | |
| 659 | + ], | |
| 660 | + 'range' => [ | |
| 661 | + 'px' => [ | |
| 662 | + 'min' => 0, | |
| 663 | + 'max' => 9999, | |
| 664 | + ], | |
| 665 | + ], | |
| 666 | + 'selectors' => [ | |
| 667 | + '{{WRAPPER}} .eel-watermark' => 'z-index: {{SIZE}};', | |
| 668 | + ], | |
| 669 | + ] | |
| 670 | + ); | |
| 671 | + | |
| 672 | + | |
| 673 | + $this->end_controls_section(); | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + // Heading | |
| 678 | + $this->start_controls_section( | |
| 679 | + 'section_heading_style', | |
| 680 | + [ | |
| 681 | + 'label' => esc_html__('Heading', 'easy-elements'), | |
| 682 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 683 | + ] | |
| 684 | + ); | |
| 685 | + | |
| 686 | + $this->add_control( | |
| 687 | + 'title_color', | |
| 688 | + [ | |
| 689 | + 'label' => esc_html__('Color', 'easy-elements'), | |
| 690 | + 'type' => Controls_Manager::COLOR, | |
| 691 | + 'selectors' => [ | |
| 692 | + '{{WRAPPER}} .e-e-heading .e-e-title' => 'color: {{VALUE}};', | |
| 693 | + ], | |
| 694 | + 'condition' => [ | |
| 695 | + 'show_gradient_title' => '', | |
| 696 | + ], | |
| 697 | + ] | |
| 698 | + ); | |
| 699 | + | |
| 700 | + $this->add_control( | |
| 701 | + 'title_color_gradient_heading', | |
| 702 | + [ | |
| 703 | + 'label' => esc_html__('Text Gradient Color', 'easy-elements'), | |
| 704 | + 'type' => Controls_Manager::HEADING, | |
| 705 | + 'separator' => 'before', | |
| 706 | + 'condition' => [ | |
| 707 | + 'show_gradient_title' => 'yes', | |
| 708 | + ] | |
| 709 | + ] | |
| 710 | + ); | |
| 711 | + | |
| 712 | + $this->add_group_control( | |
| 713 | + Group_Control_Background::get_type(), | |
| 714 | + [ | |
| 715 | + 'name' => 'title_gradient_color', | |
| 716 | + 'label' => __( 'Title Color', 'easy-elements' ), | |
| 717 | + 'types' => [ 'classic', 'gradient' ], | |
| 718 | + 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title.e-e-gradient-title', | |
| 719 | + 'condition' => [ | |
| 720 | + 'show_gradient_title' => 'yes', | |
| 721 | + ], | |
| 722 | + ] | |
| 723 | + ); | |
| 724 | + | |
| 725 | + | |
| 726 | + $this->add_group_control( | |
| 727 | + Group_Control_Typography::get_type(), | |
| 728 | + [ | |
| 729 | + 'name' => 'title_typography', | |
| 730 | + 'label' => esc_html__('Typography', 'easy-elements'), | |
| 731 | + 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title', | |
| 732 | + ] | |
| 733 | + ); | |
| 734 | + $this->add_control( | |
| 735 | + 'title_opacity', | |
| 736 | + [ | |
| 737 | + 'label' => esc_html__('Opacity', 'easy-elements'), | |
| 738 | + 'type' => Controls_Manager::SLIDER, | |
| 739 | + 'selectors' => [ | |
| 740 | + '{{WRAPPER}} .e-e-heading .e-e-title' => 'opacity: {{SIZE}};', | |
| 741 | + ], | |
| 742 | + 'default' => [ | |
| 743 | + 'size' => 1, | |
| 744 | + 'unit' => 'px', | |
| 745 | + ], | |
| 746 | + ] | |
| 747 | + ); | |
| 748 | + | |
| 749 | + $this->add_control( | |
| 750 | + 'title_text_stroke', | |
| 751 | + [ | |
| 752 | + 'label' => esc_html__('Stroke Width', 'easy-elements'), | |
| 753 | + 'type' => Controls_Manager::SLIDER, | |
| 754 | + 'selectors' => [ | |
| 755 | + '{{WRAPPER}} .e-e-heading .e-e-title' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}};', | |
| 756 | + ], | |
| 757 | + 'default' => [ | |
| 758 | + 'size' => 0, | |
| 759 | + 'unit' => 'px', | |
| 760 | + ], | |
| 761 | + ] | |
| 762 | + ); | |
| 763 | + $this->add_control( | |
| 764 | + 'title_text_stroke_color', | |
| 765 | + [ | |
| 766 | + 'label' => esc_html__('Stroke Color', 'easy-elements'), | |
| 767 | + 'type' => Controls_Manager::COLOR, | |
| 768 | + 'selectors' => [ | |
| 769 | + '{{WRAPPER}} .e-e-heading .e-e-title' => '-webkit-text-stroke-color: {{VALUE}};', | |
| 770 | + ], | |
| 771 | + 'condition' => [ | |
| 772 | + 'title_text_stroke[size]!' => '', | |
| 773 | + ], | |
| 774 | + ] | |
| 775 | + ); | |
| 776 | + // Text Shadow | |
| 777 | + $this->add_group_control( | |
| 778 | + \Elementor\Group_Control_Text_Shadow::get_type(), | |
| 779 | + [ | |
| 780 | + 'name' => 'title_text_shadow', | |
| 781 | + 'label' => esc_html__('Text Shadow', 'easy-elements'), | |
| 782 | + 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title', | |
| 783 | + ] | |
| 784 | + ); | |
| 785 | + // Mix Blend Mode | |
| 786 | + $this->add_control( | |
| 787 | + 'title_blend_mode', | |
| 788 | + [ | |
| 789 | + 'label' => esc_html__('Blend Mode', 'easy-elements'), | |
| 790 | + 'type' => Controls_Manager::SELECT, | |
| 791 | + 'options' => [ | |
| 792 | + '' => esc_html__('Default', 'easy-elements'), | |
| 793 | + 'normal' => 'Normal', | |
| 794 | + 'multiply' => 'Multiply', | |
| 795 | + 'screen' => 'Screen', | |
| 796 | + 'overlay' => 'Overlay', | |
| 797 | + 'darken' => 'Darken', | |
| 798 | + 'lighten' => 'Lighten', | |
| 799 | + 'color-dodge' => 'Color Dodge', | |
| 800 | + 'color-burn' => 'Color Burn', | |
| 801 | + 'hard-light' => 'Hard Light', | |
| 802 | + 'soft-light' => 'Soft Light', | |
| 803 | + 'difference' => 'Difference', | |
| 804 | + 'exclusion' => 'Exclusion', | |
| 805 | + 'hue' => 'Hue', | |
| 806 | + 'saturation' => 'Saturation', | |
| 807 | + 'color' => 'Color', | |
| 808 | + 'luminosity' => 'Luminosity', | |
| 809 | + ], | |
| 810 | + 'selectors' => [ | |
| 811 | + '{{WRAPPER}} .e-e-heading .e-e-title' => 'mix-blend-mode: {{VALUE}};', | |
| 812 | + ], | |
| 813 | + ] | |
| 814 | + ); | |
| 815 | + $this->add_responsive_control( | |
| 816 | + 'title_margin', | |
| 817 | + [ | |
| 818 | + 'label' => esc_html__('Margin', 'easy-elements'), | |
| 819 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 820 | + 'size_units' => ['px', 'em', '%'], | |
| 821 | + 'selectors' => [ | |
| 822 | + '{{WRAPPER}} .e-e-heading .e-e-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 823 | + ], | |
| 824 | + ] | |
| 825 | + ); | |
| 826 | + | |
| 827 | + $this->add_responsive_control( | |
| 828 | + 'title_padding', | |
| 829 | + [ | |
| 830 | + 'label' => esc_html__('Padding', 'easy-elements'), | |
| 831 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 832 | + 'size_units' => ['px', 'em', '%'], | |
| 833 | + 'selectors' => [ | |
| 834 | + '{{WRAPPER}} .e-e-heading .e-e-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 835 | + ], | |
| 836 | + ] | |
| 837 | + ); | |
| 838 | + | |
| 839 | + | |
| 840 | + $this->add_control( | |
| 841 | + 'title_image_fill_heading', | |
| 842 | + [ | |
| 843 | + 'label' => esc_html__('Image Fill (Text Mask)', 'easy-elements'), | |
| 844 | + 'type' => Controls_Manager::HEADING, | |
| 845 | + 'separator' => 'before', | |
| 846 | + ] | |
| 847 | + ); | |
| 848 | + | |
| 849 | + $this->add_control( | |
| 850 | + 'enable_title_image_fill', | |
| 851 | + [ | |
| 852 | + 'label' => esc_html__('Enable Image Fill', 'easy-elements'), | |
| 853 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 854 | + 'label_on' => esc_html__('Yes', 'easy-elements'), | |
| 855 | + 'label_off' => esc_html__('No', 'easy-elements'), | |
| 856 | + 'return_value' => 'yes', | |
| 857 | + 'default' => '', | |
| 858 | + ] | |
| 859 | + ); | |
| 860 | + | |
| 861 | + $this->add_group_control( | |
| 862 | + Group_Control_Background::get_type(), | |
| 863 | + [ | |
| 864 | + 'name' => 'title_image_fill_bg', | |
| 865 | + 'label' => esc_html__('Image Fill', 'easy-elements'), | |
| 866 | + 'types' => [ 'classic' ], | |
| 867 | + 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title.e-e-image-fill, {{WRAPPER}} .e-e-heading .e-e-title.e-e-image-fill div', | |
| 868 | + 'fields_options' => [ | |
| 869 | + 'background' => [ | |
| 870 | + 'default' => 'classic', | |
| 871 | + ], | |
| 872 | + 'classic' => [ | |
| 873 | + 'types' => [ 'image' ], | |
| 874 | + ], | |
| 875 | + ], | |
| 876 | + 'condition' => [ | |
| 877 | + 'enable_title_image_fill' => 'yes', | |
| 878 | + ], | |
| 879 | + ] | |
| 880 | + ); | |
| 881 | + | |
| 882 | + $this->add_control( | |
| 883 | + 'title_image_fill_note', | |
| 884 | + [ | |
| 885 | + 'type' => Controls_Manager::RAW_HTML, | |
| 886 | + 'raw' => __('Tip: Apply this only when you want the text to be filled with an image (the image will appear inside the text).', 'easy-elements'), | |
| 887 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', | |
| 888 | + ] | |
| 889 | + ); | |
| 890 | + | |
| 891 | + $this->end_controls_section(); | |
| 892 | + | |
| 893 | + //Sub Heading | |
| 894 | + $this->start_controls_section( | |
| 895 | + 'section_sub_heading_style', | |
| 896 | + [ | |
| 897 | + 'label' => esc_html__('Sub Heading', 'easy-elements'), | |
| 898 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 899 | + ] | |
| 900 | + ); | |
| 901 | + | |
| 902 | + $this->add_control( | |
| 903 | + 'sub_heading_color', | |
| 904 | + [ | |
| 905 | + 'label' => esc_html__('Color', 'easy-elements'), | |
| 906 | + 'type' => Controls_Manager::COLOR, | |
| 907 | + 'selectors' => [ | |
| 908 | + '{{WRAPPER}} .e-e-heading .eel-sub-heading span' => 'color: {{VALUE}};', | |
| 909 | + ], | |
| 910 | + ] | |
| 911 | + ); | |
| 912 | + | |
| 913 | + $this->add_group_control( | |
| 914 | + \Elementor\Group_Control_Background::get_type(), | |
| 915 | + [ | |
| 916 | + 'name' => 'background_subtext', | |
| 917 | + 'types' => [ 'classic', 'gradient' ], | |
| 918 | + 'selector' => '{{WRAPPER}} .eel-sub-heading.top', | |
| 919 | + 'condition' => [ | |
| 920 | + 'icon_direction' => 'top', | |
| 921 | + ], | |
| 922 | + ] | |
| 923 | + ); | |
| 924 | + | |
| 925 | + $this->add_group_control( | |
| 926 | + \Elementor\Group_Control_Background::get_type(), | |
| 927 | + [ | |
| 928 | + 'name' => 'background_subtext_top', | |
| 929 | + 'types' => [ 'classic', 'gradient' ], | |
| 930 | + 'selector' => '{{WRAPPER}} .eel-sub-heading', | |
| 931 | + 'condition' => [ | |
| 932 | + 'icon_direction' => ['left', 'right'], | |
| 933 | + ], | |
| 934 | + ] | |
| 935 | + ); | |
| 936 | + | |
| 937 | + $this->add_group_control( | |
| 938 | + Group_Control_Typography::get_type(), | |
| 939 | + [ | |
| 940 | + 'name' => 'sub_heading_typography', | |
| 941 | + 'label' => esc_html__('Typography', 'easy-elements'), | |
| 942 | + 'selector' => '{{WRAPPER}} .e-e-heading .eel-sub-heading span', | |
| 943 | + ] | |
| 944 | + ); | |
| 945 | + | |
| 946 | + $this->add_group_control( | |
| 947 | + \Elementor\Group_Control_Border::get_type(), | |
| 948 | + [ | |
| 949 | + 'name' => 'subtext_border', | |
| 950 | + 'label' => esc_html__( 'Border', 'easy-elements' ), | |
| 951 | + 'selector' => '{{WRAPPER}} .eel-sub-heading', | |
| 952 | + ] | |
| 953 | + ); | |
| 954 | + | |
| 955 | + $this->add_control( | |
| 956 | + 'subtext_icon_size', | |
| 957 | + [ | |
| 958 | + 'label' => esc_html__( 'Icon Size', 'easy-elements' ), | |
| 959 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 960 | + 'range' => [ | |
| 961 | + 'px' => [ | |
| 962 | + 'min' => 6, | |
| 963 | + 'max' => 100, | |
| 964 | + ], | |
| 965 | + ], | |
| 966 | + 'selectors' => [ | |
| 967 | + '{{WRAPPER}} .eel-sub-heading i, {{WRAPPER}} .eel-sub-heading svg' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 968 | + ], | |
| 969 | + 'description' => esc_html__( 'Adjust the icon size in pixels for the subheading icon.', 'easy-elements' ), | |
| 970 | + 'condition' => [ | |
| 971 | + 'sub_heading_type' => 'icon', | |
| 972 | + ], | |
| 973 | + ] | |
| 974 | + ); | |
| 975 | + | |
| 976 | + $this->add_responsive_control( | |
| 977 | + 'subtext_border_radius', | |
| 978 | + [ | |
| 979 | + 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 980 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 981 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 982 | + 'selectors' => [ | |
| 983 | + '{{WRAPPER}} .eel-sub-heading' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 984 | + ], | |
| 985 | + ] | |
| 986 | + ); | |
| 987 | + | |
| 988 | + $this->add_responsive_control( | |
| 989 | + 'subtext_padding', | |
| 990 | + [ | |
| 991 | + 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 992 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 993 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 994 | + 'selectors' => [ | |
| 995 | + '{{WRAPPER}} .eel-sub-heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 996 | + ], | |
| 997 | + ] | |
| 998 | + ); | |
| 999 | + | |
| 1000 | + $this->add_control( | |
| 1001 | + 'sub_heading_margin', | |
| 1002 | + [ | |
| 1003 | + 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 1004 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 1005 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1006 | + 'selectors' => [ | |
| 1007 | + '{{WRAPPER}} .eel-sub-heading' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1008 | + ], | |
| 1009 | + ] | |
| 1010 | + ); | |
| 1011 | + | |
| 1012 | + $this->end_controls_section(); | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + // Highlight | |
| 1016 | + $this->start_controls_section( | |
| 1017 | + 'section_highlight_style', | |
| 1018 | + [ | |
| 1019 | + 'label' => esc_html__('Highlight', 'easy-elements'), | |
| 1020 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 1021 | + ] | |
| 1022 | + ); | |
| 1023 | + $this->add_control( | |
| 1024 | + 'highlight_color', | |
| 1025 | + [ | |
| 1026 | + 'label' => esc_html__('Color', 'easy-elements'), | |
| 1027 | + 'type' => Controls_Manager::COLOR, | |
| 1028 | + 'selectors' => [ | |
| 1029 | + '{{WRAPPER}} .e-e-heading .e-e-title span' => 'color: {{VALUE}};', | |
| 1030 | + ], | |
| 1031 | + ] | |
| 1032 | + ); | |
| 1033 | + | |
| 1034 | + $this->add_group_control( | |
| 1035 | + \Elementor\Group_Control_Background::get_type(), | |
| 1036 | + [ | |
| 1037 | + 'name' => 'background_highlight', | |
| 1038 | + 'types' => [ 'classic', 'gradient' ], | |
| 1039 | + 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title span', | |
| 1040 | + ] | |
| 1041 | + ); | |
| 1042 | + | |
| 1043 | + $this->add_group_control( | |
| 1044 | + Group_Control_Typography::get_type(), | |
| 1045 | + [ | |
| 1046 | + 'name' => 'highlight_typography', | |
| 1047 | + 'label' => esc_html__('Highlight Typography', 'easy-elements'), | |
| 1048 | + 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title span', | |
| 1049 | + ] | |
| 1050 | + ); | |
| 1051 | + | |
| 1052 | + $this->add_responsive_control( | |
| 1053 | + 'highlight_padding', | |
| 1054 | + [ | |
| 1055 | + 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 1056 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 1057 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1058 | + 'selectors' => [ | |
| 1059 | + '{{WRAPPER}} .e-e-heading .e-e-title span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1060 | + ], | |
| 1061 | + ] | |
| 1062 | + ); | |
| 1063 | + | |
| 1064 | + $this->add_control( | |
| 1065 | + 'highlight_margin', | |
| 1066 | + [ | |
| 1067 | + 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 1068 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 1069 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1070 | + 'selectors' => [ | |
| 1071 | + '{{WRAPPER}} .e-e-heading .e-e-title span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1072 | + ], | |
| 1073 | + ] | |
| 1074 | + ); | |
| 1075 | + | |
| 1076 | + $this->add_responsive_control( | |
| 1077 | + 'hithlight_border_radius', | |
| 1078 | + [ | |
| 1079 | + 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1080 | + 'type' => \Elementor\Controls_Manager::DIMENSIONS, | |
| 1081 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1082 | + 'selectors' => [ | |
| 1083 | + '{{WRAPPER}} .e-e-heading .e-e-title span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1084 | + ], | |
| 1085 | + ] | |
| 1086 | + ); | |
| 1087 | + | |
| 1088 | + $this->end_controls_section(); | |
| 1089 | + | |
| 1090 | + // Description | |
| 1091 | + $this->start_controls_section( | |
| 1092 | + 'section_description_style', | |
| 1093 | + [ | |
| 1094 | + 'label' => esc_html__('Description', 'easy-elements'), | |
| 1095 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 1096 | + ] | |
| 1097 | + ); | |
| 1098 | + $this->add_control( | |
| 1099 | + 'description_color', | |
| 1100 | + [ | |
| 1101 | + 'label' => esc_html__('Color', 'easy-elements'), | |
| 1102 | + 'type' => Controls_Manager::COLOR, | |
| 1103 | + 'selectors' => [ | |
| 1104 | + '{{WRAPPER}} .e-e-heading .e-e-description' => 'color: {{VALUE}};', | |
| 1105 | + ], | |
| 1106 | + ] | |
| 1107 | + ); | |
| 1108 | + $this->add_group_control( | |
| 1109 | + Group_Control_Typography::get_type(), | |
| 1110 | + [ | |
| 1111 | + 'name' => 'description_typography', | |
| 1112 | + 'label' => esc_html__('Title Typography', 'easy-elements'), | |
| 1113 | + 'selector' => '{{WRAPPER}} .e-e-heading .e-e-description', | |
| 1114 | + ] | |
| 1115 | + ); | |
| 1116 | + $this->add_responsive_control( | |
| 1117 | + 'description_margin', | |
| 1118 | + [ | |
| 1119 | + 'label' => esc_html__('Margin', 'easy-elements'), | |
| 1120 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1121 | + 'size_units' => ['px', 'em', '%'], | |
| 1122 | + 'selectors' => [ | |
| 1123 | + '{{WRAPPER}} .e-e-heading .e-e-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1124 | + ], | |
| 1125 | + ] | |
| 1126 | + ); | |
| 1127 | + $this->add_responsive_control( | |
| 1128 | + 'description_padding', | |
| 1129 | + [ | |
| 1130 | + 'label' => esc_html__('Padding', 'easy-elements'), | |
| 1131 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1132 | + 'size_units' => ['px', 'em', '%'], | |
| 1133 | + 'selectors' => [ | |
| 1134 | + '{{WRAPPER}} .e-e-heading .e-e-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1135 | + ], | |
| 1136 | + ] | |
| 1137 | + ); | |
| 1138 | + $this->end_controls_section(); | |
| 1139 | + } | |
| 1140 | + | |
| 1141 | + protected function render_separator( $settings ) { | |
| 1142 | + if ( ! empty( $settings['separator_'] ) && in_array( $settings['separator_'], ['dotted', 'solid'], true ) ) { | |
| 1143 | + echo '<div class="eel--separator-icon ' . esc_attr( $settings['separator_'] ) . '"></div>'; | |
| 1144 | + } | |
| 1145 | + | |
| 1146 | + if ( 'icon' === $settings['separator_'] && ! empty( $settings['select_icon_']['value'] ) ) { | |
| 1147 | + echo '<div class="eel--separator-icon-wrap">'; | |
| 1148 | + \Elementor\Icons_Manager::render_icon( $settings['select_icon_'], [ 'aria-hidden' => 'true' ] ); | |
| 1149 | + echo '</div>'; | |
| 1150 | + } | |
| 1151 | + if ( isset( $settings['separator_'] ) && 'image' === $settings['separator_'] && ! empty( $settings['sep_image']['url'] ) ) { | |
| 1152 | + echo '<div class="eel--separator-icon-wrap">'; | |
| 1153 | + printf( | |
| 1154 | + '<img src="%s" alt="%s" title="%s" class="eel-separator-img" loading="lazy" decoding="async" />', | |
| 1155 | + esc_url( $settings['sep_image']['url'] ), | |
| 1156 | + esc_attr__( 'Separator Image', 'easy-elements' ), | |
| 1157 | + esc_attr__( 'Separator Image', 'easy-elements' ) | |
| 1158 | + ); | |
| 1159 | + | |
| 1160 | + echo '</div>'; | |
| 1161 | + } | |
| 1162 | + } | |
| 1163 | + | |
| 1164 | + protected function render() { | |
| 1165 | + $settings = $this->get_settings_for_display(); | |
| 1166 | + | |
| 1167 | + $tag = isset($settings['title_tag']) ? $settings['title_tag'] : 'h2'; | |
| 1168 | + $title = preg_replace_callback( '/\{\{(.*?)\}\}/', function( $matches ) { | |
| 1169 | + return '<span>' . esc_html( trim( $matches[1] ) ) . '</span>'; | |
| 1170 | + }, $settings['title'] ); | |
| 1171 | + | |
| 1172 | + if ( ! empty( $settings['link']['url'] ) ) { | |
| 1173 | + $this->add_link_attributes( 'title_link', $settings['link'] ); | |
| 1174 | + $title = sprintf( | |
| 1175 | + '<a %s>%s</a>', | |
| 1176 | + $this->get_render_attribute_string( 'title_link' ), | |
| 1177 | + $title | |
| 1178 | + ); | |
| 1179 | + } | |
| 1180 | + | |
| 1181 | + $border_position = $settings['border_position'] ?? ''; | |
| 1182 | + $unique_id = 'eel-heading-' . $this->get_id(); | |
| 1183 | + $animation = isset( $settings['animation_type'] ) && ! empty($settings['animation_type']) ? $settings['animation_type'] : ''; | |
| 1184 | + ?> | |
| 1185 | + <div class="e-e-heading <?php echo esc_attr($border_position); ?>" <?php if(!empty($animation)) : ?> | |
| 1186 | + data-eel-animation="<?php echo esc_attr($animation); ?>" | |
| 1187 | + <?php endif; ?>> | |
| 1188 | + <?php | |
| 1189 | + $icon_direction = $settings['icon_direction'] ?? '' ; | |
| 1190 | + $separator_position = ! empty( $settings['separator_position'] ) ? $settings['separator_position'] : 'default'; | |
| 1191 | + | |
| 1192 | + if ( in_array( $separator_position, ['top'], true ) ) { | |
| 1193 | + if ( ! empty( $settings['separator_'] ) ) { | |
| 1194 | + $this->render_separator( $settings ); | |
| 1195 | + } | |
| 1196 | + } | |
| 1197 | + | |
| 1198 | + if ( ! empty( $settings['sub_title'] ) ) : ?> | |
| 1199 | + <div class="eel-sub-heading <?php echo esc_attr($icon_direction); ?> <?php echo esc_attr($settings['show_gradient_border'] == 'yes' ? 'easy_gradiant_border' : ''); ?>"> | |
| 1200 | + <?php | |
| 1201 | + $this->add_inline_editing_attributes( 'sub_title' ); | |
| 1202 | + if ( 'icon' === $settings['sub_heading_type'] && ! empty( $settings['sub_heading_icon']['value'] ) ) { | |
| 1203 | + \Elementor\Icons_Manager::render_icon( $settings['sub_heading_icon'], [ 'aria-hidden' => 'true' ] ); | |
| 1204 | + } elseif ( 'image' === $settings['sub_heading_type'] && ! empty( $settings['sub_heading_image']['url'] ) ) { | |
| 1205 | + if ( ! empty( $settings['sub_heading_image']['id'] ) ) { | |
| 1206 | + echo wp_get_attachment_image( | |
| 1207 | + $settings['sub_heading_image']['id'], | |
| 1208 | + 'full', | |
| 1209 | + false, | |
| 1210 | + ['alt' => $settings['sub_heading_image']['alt'] ?? ''] | |
| 1211 | + ); | |
| 1212 | + } elseif ( ! empty( $settings['sub_heading_image']['url'] ) ) { | |
| 1213 | + echo '<img src="' . esc_url( $settings['sub_heading_image']['url'] ) . '" alt="">'; | |
| 1214 | + } | |
| 1215 | + } | |
| 1216 | + | |
| 1217 | + ?> | |
| 1218 | + <span class="elementor-inline-editing" <?php | |
| 1219 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1220 | + echo $this->get_render_attribute_string( 'sub_title' ); ?>> | |
| 1221 | + <?php | |
| 1222 | + echo wp_kses_post( $settings['sub_title'] ); | |
| 1223 | + ?> | |
| 1224 | + </span> | |
| 1225 | + </div> | |
| 1226 | + <?php endif; | |
| 1227 | + | |
| 1228 | + if ( in_array( $separator_position, ['above'], true ) ) { | |
| 1229 | + if ( ! empty( $settings['separator_'] ) ) { | |
| 1230 | + $this->render_separator( $settings ); | |
| 1231 | + } | |
| 1232 | + } | |
| 1233 | + | |
| 1234 | + $allowed_tags = ['h1','h2','h3','h4','h5','h6','div','span']; | |
| 1235 | + $tag = in_array(strtolower($tag), $allowed_tags, true) ? strtolower($tag) : 'div'; | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + if ( ! empty( $title ) ) { | |
| 1239 | + $gradient_class = ! empty( $settings['show_gradient_title'] ) ? ' e-e-gradient-title' : ''; | |
| 1240 | + $image_fill_class = ( ! empty( $settings['enable_title_image_fill'] ) ) ? ' e-e-image-fill' : ''; | |
| 1241 | + $tag_class = 'e-e-title elementor-inline-editing' . $gradient_class . $image_fill_class; | |
| 1242 | + | |
| 1243 | + // Inline editing attribute add | |
| 1244 | + $this->add_inline_editing_attributes( 'title' ); | |
| 1245 | + | |
| 1246 | + printf( | |
| 1247 | + '<%1$s class="%2$s" %3$s>%4$s</%1$s>', | |
| 1248 | + esc_html( $tag ), | |
| 1249 | + esc_attr( $tag_class ), | |
| 1250 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1251 | + $this->get_render_attribute_string( 'title' ), | |
| 1252 | + wp_kses_post( $title ) | |
| 1253 | + ); | |
| 1254 | + } | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + if ( in_array( $separator_position, ['below'], true ) ) { | |
| 1259 | + if ( ! empty( $settings['separator_'] ) ) { | |
| 1260 | + $this->render_separator( $settings ); | |
| 1261 | + } | |
| 1262 | + } | |
| 1263 | + | |
| 1264 | + if ( ! empty( $settings['description'] ) ) { | |
| 1265 | + $this->add_inline_editing_attributes( 'description' ); | |
| 1266 | + ?> | |
| 1267 | + <div class="e-e-description elementor-inline-editing" <?php | |
| 1268 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1269 | + echo $this->get_render_attribute_string( 'description' ); ?>> | |
| 1270 | + <?php echo wp_kses_post( $settings['description'] ); ?> | |
| 1271 | + </div> | |
| 1272 | + <?php } | |
| 1273 | + if ( in_array( $separator_position, ['bottom'], true ) ) { | |
| 1274 | + if ( ! empty( $settings['separator_'] ) ) { | |
| 1275 | + $this->render_separator( $settings ); | |
| 1276 | + } | |
| 1277 | + } | |
| 1278 | + | |
| 1279 | + if ( ! empty( $settings['water_mark'] ) ) { | |
| 1280 | + echo '<div class="eel-watermark">'; | |
| 1281 | + echo esc_html( $settings['water_mark'] ); | |
| 1282 | + echo '</div>'; | |
| 1283 | + } | |
| 1284 | + | |
| 1285 | + ?> | |
| 1286 | + </div> | |
| 1287 | + <?php } | |
| 1288 | +} | |
| 1289 | +?> | |