theme-elements
6 months ago
accordion.php
6 months ago
audio.php
6 months ago
before-after.php
6 months ago
button.php
6 months ago
carousel-navigation.php
6 months ago
circle-chart.php
6 months ago
contact-box.php
6 months ago
contact-form.php
6 months ago
custom-list.php
6 months ago
divider.php
6 months ago
gallery.php
6 months ago
gmap.php
6 months ago
heading-modern.php
6 months ago
icon.php
6 months ago
image.php
6 months ago
mailchimp.php
6 months ago
modern-button.php
6 months ago
products-grid.php
6 months ago
quote.php
6 months ago
recent-comments.php
6 months ago
recent-posts-grid-carousel.php
6 months ago
recent-posts-land-style.php
6 months ago
recent-posts-masonry.php
6 months ago
recent-posts-tiles-carousel.php
6 months ago
recent-posts-tiles.php
6 months ago
recent-posts-timeline.php
6 months ago
recent-products.php
6 months ago
responsive-table.php
6 months ago
search.php
6 months ago
staff.php
6 months ago
svg.php
6 months ago
tabs.php
6 months ago
testimonial.php
6 months ago
text.php
6 months ago
touch-slider.php
6 months ago
video.php
6 months ago
text.php
1705 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Elements; |
| 3 | |
| 4 | use Elementor\Plugin; |
| 5 | use Elementor\Widget_Base; |
| 6 | use Elementor\Controls_Manager; |
| 7 | use Elementor\Group_Control_Image_Size; |
| 8 | use Elementor\Group_Control_Typography; |
| 9 | use Elementor\Group_Control_Text_Stroke; |
| 10 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 11 | use Elementor\Group_Control_Border; |
| 12 | use Elementor\Group_Control_Box_Shadow; |
| 13 | use Elementor\Group_Control_Text_Shadow; |
| 14 | use Elementor\Group_Control_Background; |
| 15 | |
| 16 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | exit; // Exit if accessed directly. |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Elementor 'RecentProducts' widget. |
| 22 | * |
| 23 | * Elementor widget that displays an 'RecentProducts' with lightbox. |
| 24 | * |
| 25 | * @since 1.0.0 |
| 26 | */ |
| 27 | class Text extends Widget_Base { |
| 28 | |
| 29 | /** |
| 30 | * Get widget name. |
| 31 | * |
| 32 | * Retrieve 'RecentProducts' widget name. |
| 33 | * |
| 34 | * @since 1.0.0 |
| 35 | * @access public |
| 36 | * |
| 37 | * @return string Widget name. |
| 38 | */ |
| 39 | public function get_name() { |
| 40 | return 'aux_text'; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Get widget title. |
| 45 | * |
| 46 | * Retrieve 'RecentProducts' widget title. |
| 47 | * |
| 48 | * @since 1.0.0 |
| 49 | * @access public |
| 50 | * |
| 51 | * @return string Widget title. |
| 52 | */ |
| 53 | public function get_title() { |
| 54 | return __('Info Box', 'auxin-elements' ); |
| 55 | } |
| 56 | |
| 57 | public function has_widget_inner_wrapper(): bool { |
| 58 | return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 59 | } |
| 60 | |
| 61 | |
| 62 | /** |
| 63 | * Get widget icon. |
| 64 | * |
| 65 | * Retrieve 'RecentProducts' widget icon. |
| 66 | * |
| 67 | * @since 1.0.0 |
| 68 | * @access public |
| 69 | * |
| 70 | * @return string Widget icon. |
| 71 | */ |
| 72 | public function get_icon() { |
| 73 | return 'eicon-info-box auxin-badge'; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Get widget categories. |
| 78 | * |
| 79 | * Retrieve 'RecentProducts' widget icon. |
| 80 | * |
| 81 | * @since 1.0.0 |
| 82 | * @access public |
| 83 | * |
| 84 | * @return string Widget icon. |
| 85 | */ |
| 86 | public function get_categories() { |
| 87 | return array( 'auxin-core' ); |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Register 'RecentProducts' widget controls. |
| 92 | * |
| 93 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 94 | * |
| 95 | * @since 1.0.0 |
| 96 | * @access protected |
| 97 | */ |
| 98 | protected function register_controls() { |
| 99 | |
| 100 | /*-----------------------------------------------------------------------------------*/ |
| 101 | /* Content TAB |
| 102 | /*-----------------------------------------------------------------------------------*/ |
| 103 | |
| 104 | /* header_section |
| 105 | /*-------------------------------------*/ |
| 106 | |
| 107 | $this->start_controls_section( |
| 108 | 'header_section', |
| 109 | array( |
| 110 | 'label' => __( 'Header', 'auxin-elements' ), |
| 111 | ) |
| 112 | ); |
| 113 | |
| 114 | $this->add_control( |
| 115 | 'icon_or_image', |
| 116 | array( |
| 117 | 'label' => __( 'Type', 'auxin-elements' ), |
| 118 | 'type' => Controls_Manager::SELECT, |
| 119 | 'default' => 'icon', |
| 120 | 'options' => array( |
| 121 | 'none' => __( 'None' , 'auxin-elements' ), |
| 122 | 'icon' => __( 'Icon' , 'auxin-elements' ), |
| 123 | 'image' => __( 'Image' , 'auxin-elements' ), |
| 124 | 'inline-svg' => __( 'Inline SVG' , 'auxin-elements' ) |
| 125 | ) |
| 126 | ) |
| 127 | ); |
| 128 | |
| 129 | $this->add_control( |
| 130 | 'aux_text_icon', |
| 131 | array( |
| 132 | 'label' => __('Icon','auxin-elements' ), |
| 133 | 'label_block' => true, |
| 134 | 'description' => __('Please choose an icon from the list.', 'auxin-elements'), |
| 135 | 'type' => Controls_Manager::ICONS, |
| 136 | 'condition' => array( |
| 137 | 'icon_or_image' => array('icon') |
| 138 | ) |
| 139 | ) |
| 140 | ); |
| 141 | |
| 142 | $this->add_control( |
| 143 | 'image', |
| 144 | array( |
| 145 | 'label' => __('Image','auxin-elements' ), |
| 146 | 'type' => Controls_Manager::MEDIA, |
| 147 | 'condition' => array( |
| 148 | 'icon_or_image' => array('image') |
| 149 | ) |
| 150 | ) |
| 151 | ); |
| 152 | |
| 153 | $this->add_group_control( |
| 154 | Group_Control_Image_Size::get_type(), |
| 155 | array( |
| 156 | 'name' => 'image', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`. |
| 157 | 'separator' => 'none', |
| 158 | 'default' => 'full', |
| 159 | 'condition' => array( |
| 160 | 'icon_or_image' => array('image') |
| 161 | ) |
| 162 | ) |
| 163 | ); |
| 164 | |
| 165 | $this->add_control( |
| 166 | 'preloadable', |
| 167 | array( |
| 168 | 'label' => __('Preload image','auxin-elements' ), |
| 169 | 'type' => Controls_Manager::SWITCHER, |
| 170 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 171 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 172 | 'return_value' => 'yes', |
| 173 | 'default' => 'no', |
| 174 | 'condition' => array( |
| 175 | 'icon_or_image' => array('image') |
| 176 | ) |
| 177 | ) |
| 178 | ); |
| 179 | |
| 180 | $this->add_control( |
| 181 | 'preload_preview', |
| 182 | array( |
| 183 | 'label' => __('While loading image display','auxin-elements' ), |
| 184 | 'label_block' => true, |
| 185 | 'type' => Controls_Manager::SELECT, |
| 186 | 'options' => auxin_get_preloadable_previews(), |
| 187 | 'return_value' => 'yes', |
| 188 | 'default' => 'yes', |
| 189 | 'condition' => array( |
| 190 | 'icon_or_image' => array('image'), |
| 191 | 'preloadable' => 'yes' |
| 192 | ) |
| 193 | ) |
| 194 | ); |
| 195 | |
| 196 | $this->add_control( |
| 197 | 'preload_bgcolor', |
| 198 | array( |
| 199 | 'label' => __( 'Placeholder color while loading image', 'auxin-elements' ), |
| 200 | 'type' => Controls_Manager::COLOR, |
| 201 | 'condition' => array( |
| 202 | 'icon_or_image' => array('image'), |
| 203 | 'preloadable' => 'yes', |
| 204 | 'preload_preview' => array('no', 'simple-spinner', 'simple-spinner-light', 'simple-spinner-dark') |
| 205 | ) |
| 206 | ) |
| 207 | ); |
| 208 | |
| 209 | $this->add_control( |
| 210 | 'svg_inline', |
| 211 | array( |
| 212 | 'label' => '', |
| 213 | 'type' => Controls_Manager::CODE, |
| 214 | 'default' => '', |
| 215 | 'placeholder' => __( 'Enter inline SVG content here', 'auxin-elements' ), |
| 216 | 'show_label' => false, |
| 217 | 'condition' => array( |
| 218 | 'icon_or_image' => 'inline-svg' |
| 219 | ) |
| 220 | ) |
| 221 | ); |
| 222 | |
| 223 | $this->end_controls_section(); |
| 224 | |
| 225 | /* content_section |
| 226 | /*-------------------------------------*/ |
| 227 | |
| 228 | $this->start_controls_section( |
| 229 | 'content_section', |
| 230 | array( |
| 231 | 'label' => __('Content', 'auxin-elements' ), |
| 232 | ) |
| 233 | ); |
| 234 | |
| 235 | $this->add_control( |
| 236 | 'title', |
| 237 | array( |
| 238 | 'label' => __('Title','auxin-elements' ), |
| 239 | 'description' => __('Text title, leave it empty if you don`t need title.', 'auxin-elements'), |
| 240 | 'type' => Controls_Manager::TEXT, |
| 241 | 'default' => 'Great Idea' |
| 242 | ) |
| 243 | ); |
| 244 | |
| 245 | $this->add_control( |
| 246 | 'subtitle', |
| 247 | array( |
| 248 | 'label' => __('Subtitle','auxin-elements' ), |
| 249 | 'type' => Controls_Manager::TEXT |
| 250 | ) |
| 251 | ); |
| 252 | |
| 253 | $this->add_control( |
| 254 | 'title_link', |
| 255 | array( |
| 256 | 'label' => __('Title Link','auxin-elements' ), |
| 257 | 'type' => Controls_Manager::URL, |
| 258 | 'placeholder' => 'http://phlox.pro', |
| 259 | 'show_external' => false, |
| 260 | 'dynamic' => [ |
| 261 | 'active' => true |
| 262 | ] |
| 263 | ) |
| 264 | ); |
| 265 | |
| 266 | $this->add_control( |
| 267 | 'content', |
| 268 | array( |
| 269 | 'label' => __('Content','auxin-elements' ), |
| 270 | 'description' => __('Enter a text as a text content.', 'auxin-elements'), |
| 271 | 'type' => Controls_Manager::WYSIWYG, |
| 272 | 'default' => 'NVestibulum rutum, mi nec elementum vehicula, eros quam gravida nisl, id fringilla neque ante.' |
| 273 | ) |
| 274 | ); |
| 275 | |
| 276 | $this->end_controls_section(); |
| 277 | |
| 278 | /* button_section |
| 279 | /*-------------------------------------*/ |
| 280 | |
| 281 | $this->start_controls_section( |
| 282 | 'button_section', |
| 283 | array( |
| 284 | 'label' => __('Button', 'auxin-elements' ), |
| 285 | ) |
| 286 | ); |
| 287 | |
| 288 | $this->add_control( |
| 289 | 'display_button', |
| 290 | array( |
| 291 | 'label' => __('Display button','auxin-elements' ), |
| 292 | 'description' => __('Display a button in text widget', 'auxin-elements' ), |
| 293 | 'type' => Controls_Manager::SWITCHER, |
| 294 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 295 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 296 | 'return_value' => 'yes', |
| 297 | 'default' => 'yes' |
| 298 | ) |
| 299 | ); |
| 300 | |
| 301 | $this->add_control( |
| 302 | 'btn_label', |
| 303 | array( |
| 304 | 'label' => __('Button label','auxin-elements' ), |
| 305 | 'type' => Controls_Manager::TEXT, |
| 306 | 'default' => __( 'Read More', 'auxin-elements' ), |
| 307 | 'condition' => array( |
| 308 | 'display_button' => 'yes', |
| 309 | ) |
| 310 | ) |
| 311 | ); |
| 312 | |
| 313 | $this->add_control( |
| 314 | 'aux_text_btn_icon', |
| 315 | array( |
| 316 | 'label' => __('Icon for button','auxin-elements' ), |
| 317 | 'type' => Controls_Manager::ICONS, |
| 318 | 'condition' => array( |
| 319 | 'display_button' => 'yes', |
| 320 | ) |
| 321 | ) |
| 322 | ); |
| 323 | |
| 324 | $this->add_control( |
| 325 | 'btn_link', |
| 326 | array( |
| 327 | 'label' => __('Link','auxin-elements' ), |
| 328 | 'description' => __('If you want to link your button.', 'auxin-elements' ), |
| 329 | 'type' => Controls_Manager::URL, |
| 330 | 'placeholder' => 'http://phlox.pro', |
| 331 | 'show_external' => true, |
| 332 | 'condition' => [ |
| 333 | 'display_button' => 'yes', |
| 334 | ], |
| 335 | 'dynamic' => [ |
| 336 | 'active' => true |
| 337 | ] |
| 338 | ) |
| 339 | ); |
| 340 | |
| 341 | $this->end_controls_section(); |
| 342 | |
| 343 | /*-----------------------------------------------------------------------------------*/ |
| 344 | /* Style TAB |
| 345 | /*-----------------------------------------------------------------------------------*/ |
| 346 | |
| 347 | /* header_style_section |
| 348 | /*-------------------------------------*/ |
| 349 | |
| 350 | $this->start_controls_section( |
| 351 | 'header_style_section', |
| 352 | array( |
| 353 | 'label' => __('Header', 'auxin-elements' ), |
| 354 | 'tab' => Controls_Manager::TAB_STYLE, |
| 355 | 'condition' => array( |
| 356 | 'icon_or_image' => array( 'icon', 'image', 'inline-svg' ) |
| 357 | ) |
| 358 | ) |
| 359 | ); |
| 360 | |
| 361 | $this->add_control( |
| 362 | 'image_position', |
| 363 | array( |
| 364 | 'label' => __('Header Position','auxin-elements'), |
| 365 | 'type' => 'aux-visual-select', |
| 366 | 'style_items' => 'max-width:30%;', |
| 367 | 'options' => array( |
| 368 | 'top' => array( |
| 369 | 'label' => __('Top', 'auxin-elements'), |
| 370 | 'image' => AUXIN_URL . 'images/visual-select/column-icon-top.svg' |
| 371 | ), |
| 372 | 'left' => array( |
| 373 | 'label' => __('Left', 'auxin-elements'), |
| 374 | 'image' => AUXIN_URL . 'images/visual-select/column-icon-left.svg' |
| 375 | ), |
| 376 | 'right' => array( |
| 377 | 'label' => __('Right', 'auxin-elements'), |
| 378 | 'image' => AUXIN_URL . 'images/visual-select/column-icon-right.svg' |
| 379 | ) |
| 380 | ), |
| 381 | 'default' => 'top' |
| 382 | ) |
| 383 | ); |
| 384 | |
| 385 | $this->add_group_control( |
| 386 | Group_Control_Background::get_type(), |
| 387 | array( |
| 388 | 'name' => 'header_background', |
| 389 | 'label' => __( 'Background', 'auxin-elements' ), |
| 390 | 'types' => array( 'classic', 'gradient' ), |
| 391 | 'selector' => '{{WRAPPER}} .aux-text-widget-header' |
| 392 | ) |
| 393 | ); |
| 394 | |
| 395 | $this->add_responsive_control( |
| 396 | 'header_padding', |
| 397 | array( |
| 398 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 399 | 'type' => Controls_Manager::DIMENSIONS, |
| 400 | 'size_units' => array( 'px', '%' ), |
| 401 | 'selectors' => array( |
| 402 | '{{WRAPPER}} .aux-widget-text .aux-text-widget-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 403 | ) |
| 404 | ) |
| 405 | ); |
| 406 | |
| 407 | $this->end_controls_section(); |
| 408 | |
| 409 | /* icon_image_style_section |
| 410 | /*-------------------------------------*/ |
| 411 | |
| 412 | $this->start_controls_section( |
| 413 | 'icon_image_style_section', |
| 414 | array( |
| 415 | 'label' => __('Icon/Image', 'auxin-elements' ), |
| 416 | 'tab' => Controls_Manager::TAB_STYLE, |
| 417 | 'condition' => array( |
| 418 | 'icon_or_image' => array( 'icon', 'image', 'inline-svg' ) |
| 419 | ) |
| 420 | ) |
| 421 | ); |
| 422 | |
| 423 | $this->add_group_control( |
| 424 | Group_Control_Border::get_type(), |
| 425 | array( |
| 426 | 'name' => 'icon_border', |
| 427 | 'label' => __( 'Border', 'auxin-elements' ), |
| 428 | 'selector' => '{{WRAPPER}} .aux-ico-box', |
| 429 | ) |
| 430 | ); |
| 431 | |
| 432 | $this->add_responsive_control( |
| 433 | 'icon_size', |
| 434 | array( |
| 435 | 'label' => __( 'Icon Size', 'auxin-elements' ), |
| 436 | 'type' => Controls_Manager::SLIDER, |
| 437 | 'size_units' => array( 'px', '%' ), |
| 438 | 'range' => array( |
| 439 | 'px' => array( |
| 440 | 'min' => 16, |
| 441 | 'max' => 512, |
| 442 | 'step' => 2, |
| 443 | ), |
| 444 | '%' => array( |
| 445 | 'min' => 0, |
| 446 | 'max' => 100, |
| 447 | ), |
| 448 | ), |
| 449 | 'selectors' => array( |
| 450 | '{{WRAPPER}} .aux-ico' => 'font-size: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', |
| 451 | ), |
| 452 | 'condition' => array( |
| 453 | 'icon_or_image' => array('icon') |
| 454 | ) |
| 455 | ) |
| 456 | ); |
| 457 | |
| 458 | $this->add_control( |
| 459 | 'icon_shape', |
| 460 | array( |
| 461 | 'label' => __('Icon background shape','auxin-elements'), |
| 462 | 'style_items' => 'max-width:30%;', |
| 463 | 'type' => 'aux-visual-select', |
| 464 | 'options' => array( |
| 465 | 'circle' => array( |
| 466 | 'label' => __('Circle', 'auxin-elements'), |
| 467 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-circle.svg' |
| 468 | ), |
| 469 | 'semi-circle' => array( |
| 470 | 'label' => __('Semi-circle', 'auxin-elements'), |
| 471 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-semi-circle.svg' |
| 472 | ), |
| 473 | 'round-rect' => array( |
| 474 | 'label' => __('Round Rectangle', 'auxin-elements'), |
| 475 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-round-rectangle.svg' |
| 476 | ), |
| 477 | 'cross-rect' => array( |
| 478 | 'label' => __('Cross Rectangle', 'auxin-elements'), |
| 479 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-cross-rectangle.svg' |
| 480 | ), |
| 481 | 'rect' => array( |
| 482 | 'label' => __('Rectangle', 'auxin-elements'), |
| 483 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-rectangle.svg' |
| 484 | ) |
| 485 | ), |
| 486 | 'default' => 'circle', |
| 487 | 'condition' => array( |
| 488 | 'icon_or_image' => array('icon') |
| 489 | ) |
| 490 | ) |
| 491 | ); |
| 492 | |
| 493 | $this->add_responsive_control( |
| 494 | 'icon_padding', |
| 495 | array( |
| 496 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 497 | 'type' => Controls_Manager::DIMENSIONS, |
| 498 | 'size_units' => array( 'px', '%' ), |
| 499 | 'selectors' => array( |
| 500 | '{{WRAPPER}} .aux-ico-box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 501 | ), |
| 502 | 'condition' => array( |
| 503 | 'icon_or_image' => array('icon') |
| 504 | ) |
| 505 | ) |
| 506 | ); |
| 507 | |
| 508 | $this->start_controls_tabs( 'icon_style_tabs' ); |
| 509 | |
| 510 | $this->start_controls_tab( |
| 511 | 'icon_style_normal', |
| 512 | array( |
| 513 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 514 | ) |
| 515 | ); |
| 516 | |
| 517 | |
| 518 | $this->add_group_control( |
| 519 | Group_Control_Box_Shadow::get_type(), |
| 520 | array( |
| 521 | 'name' => 'header_box_shadow', |
| 522 | 'selector' => '{{WRAPPER}} .aux-ico-box' |
| 523 | ) |
| 524 | ); |
| 525 | |
| 526 | $this->add_control( |
| 527 | 'icon_color', |
| 528 | array( |
| 529 | 'label' => __('Icon color', 'auxin-elements'), |
| 530 | 'type' => Controls_Manager::COLOR, |
| 531 | 'default' => '#ffffff', |
| 532 | 'selectors' => array( |
| 533 | '{{WRAPPER}} .aux-ico-box' => 'color:{{VALUE}};fill: {{VALUE}};', |
| 534 | ), |
| 535 | 'condition' => array( |
| 536 | 'icon_or_image' => array('icon') |
| 537 | ) |
| 538 | ) |
| 539 | ); |
| 540 | |
| 541 | $this->add_control( |
| 542 | 'icon_bg_color', |
| 543 | array( |
| 544 | 'label' => __('Icon background color','auxin-elements' ), |
| 545 | 'type' => Controls_Manager::COLOR, |
| 546 | 'default' => '', |
| 547 | 'selectors' => array( |
| 548 | '{{WRAPPER}} .aux-ico-box' => 'background-color:{{VALUE}};', |
| 549 | ), |
| 550 | 'condition' => array( |
| 551 | 'icon_or_image' => array('icon') |
| 552 | ) |
| 553 | ) |
| 554 | ); |
| 555 | |
| 556 | $this->add_group_control( |
| 557 | Group_Control_Background::get_type(), |
| 558 | array( |
| 559 | 'name' => 'icon_background_normal', |
| 560 | 'label' => __( 'Background', 'auxin-elements' ), |
| 561 | 'types' => array( 'gradient' ), |
| 562 | 'selector' => '{{WRAPPER}} .aux-ico-box' |
| 563 | ) |
| 564 | ); |
| 565 | |
| 566 | |
| 567 | $this->end_controls_tab(); |
| 568 | |
| 569 | $this->start_controls_tab( |
| 570 | 'icon_style_hover', |
| 571 | array( |
| 572 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 573 | ) |
| 574 | ); |
| 575 | |
| 576 | |
| 577 | $this->add_group_control( |
| 578 | Group_Control_Box_Shadow::get_type(), |
| 579 | array( |
| 580 | 'name' => 'header_box_shadow_hover', |
| 581 | 'selector' => '{{WRAPPER}}:hover .aux-ico-box' |
| 582 | ) |
| 583 | ); |
| 584 | |
| 585 | $this->add_control( |
| 586 | 'icon_color_hover', |
| 587 | array( |
| 588 | 'label' => __('Icon color', 'auxin-elements'), |
| 589 | 'type' => Controls_Manager::COLOR, |
| 590 | 'default' => '', |
| 591 | 'selectors' => array( |
| 592 | '{{WRAPPER}}:hover .aux-ico-box' => 'color:{{VALUE}} !important;', |
| 593 | ), |
| 594 | 'condition' => array( |
| 595 | 'icon_or_image' => ['icon'] |
| 596 | ) |
| 597 | ) |
| 598 | ); |
| 599 | |
| 600 | $this->add_control( |
| 601 | 'icon_bg_color_hover', |
| 602 | array( |
| 603 | 'label' => __('Icon background color','auxin-elements' ), |
| 604 | 'type' => Controls_Manager::COLOR, |
| 605 | 'default' => '', |
| 606 | 'selectors' => array( |
| 607 | '{{WRAPPER}}:hover .aux-ico-box' => 'background-color:{{VALUE}} !important;', |
| 608 | ), |
| 609 | 'condition' => array( |
| 610 | 'icon_or_image' => ['icon'] |
| 611 | ) |
| 612 | ) |
| 613 | ); |
| 614 | |
| 615 | $this->add_group_control( |
| 616 | Group_Control_Background::get_type(), |
| 617 | array( |
| 618 | 'name' => 'icon_background_hover', |
| 619 | 'label' => __( 'Background', 'auxin-elements' ), |
| 620 | 'types' => array( 'gradient' ), |
| 621 | 'selector' => '{{WRAPPER}}:hover .aux-ico-box' |
| 622 | ) |
| 623 | ); |
| 624 | |
| 625 | $this->add_control( |
| 626 | 'icon_transition', |
| 627 | array( |
| 628 | 'label' => __( 'Transition duration', 'auxin-elements' ), |
| 629 | 'type' => Controls_Manager::SLIDER, |
| 630 | 'range' => array( |
| 631 | 'px' => array( |
| 632 | 'min' => 0, |
| 633 | 'max' => 2000, |
| 634 | 'step' => 50 |
| 635 | ) |
| 636 | ), |
| 637 | 'selectors' => array( |
| 638 | '{{WRAPPER}} .aux-ico-box' => 'transition:all {{SIZE}}ms ease;' |
| 639 | ), |
| 640 | 'condition' => array( |
| 641 | 'icon_or_image' => ['icon'] |
| 642 | ) |
| 643 | ) |
| 644 | ); |
| 645 | |
| 646 | $this->end_controls_tab(); |
| 647 | |
| 648 | $this->end_controls_tabs(); |
| 649 | |
| 650 | $this->add_control( |
| 651 | 'img_shape', |
| 652 | array( |
| 653 | 'label' => __('Image shape','auxin-elements'), |
| 654 | 'type' => 'aux-visual-select', |
| 655 | 'options' => array( |
| 656 | 'default' => array( |
| 657 | 'label' => __('Default Aspect', 'auxin-elements'), |
| 658 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-rectangle.svg' |
| 659 | ), |
| 660 | 'circle' => array( |
| 661 | 'label' => __('Circle', 'auxin-elements'), |
| 662 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-circle.svg' |
| 663 | ), |
| 664 | 'semi-circle' => array( |
| 665 | 'label' => __('Semi-circle', 'auxin-elements'), |
| 666 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-semi-circle.svg' |
| 667 | ), |
| 668 | 'round-rect' => array( |
| 669 | 'label' => __('Round Rectangle', 'auxin-elements'), |
| 670 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-round-rectangle.svg' |
| 671 | ), |
| 672 | 'rect' => array( |
| 673 | 'label' => __('Rectangle', 'auxin-elements'), |
| 674 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-rectangle.svg' |
| 675 | ), |
| 676 | ), |
| 677 | 'default' => 'default', |
| 678 | 'condition' => array( |
| 679 | 'icon_or_image' => array('image') |
| 680 | ) |
| 681 | ) |
| 682 | ); |
| 683 | |
| 684 | $this->end_controls_section(); |
| 685 | |
| 686 | /* title_style_section |
| 687 | /*-------------------------------------*/ |
| 688 | |
| 689 | $this->start_controls_section( |
| 690 | 'title_style_section', |
| 691 | array( |
| 692 | 'label' => __( 'Title', 'auxin-elements' ), |
| 693 | 'tab' => Controls_Manager::TAB_STYLE, |
| 694 | 'condition' => array( |
| 695 | 'title!' => '' |
| 696 | ) |
| 697 | ) |
| 698 | ); |
| 699 | |
| 700 | $this->start_controls_tabs( 'title_colors' ); |
| 701 | |
| 702 | $this->start_controls_tab( |
| 703 | 'title_color_normal', |
| 704 | array( |
| 705 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 706 | ) |
| 707 | ); |
| 708 | |
| 709 | $this->add_control( |
| 710 | 'title_color', |
| 711 | array( |
| 712 | 'label' => __( 'Color', 'auxin-elements' ), |
| 713 | 'type' => Controls_Manager::COLOR, |
| 714 | 'selectors' => array( |
| 715 | '{{WRAPPER}} .col-title a, {{WRAPPER}} .col-title' => 'color: {{VALUE}} !important;', |
| 716 | ) |
| 717 | ) |
| 718 | ); |
| 719 | |
| 720 | $this->end_controls_tab(); |
| 721 | |
| 722 | $this->start_controls_tab( |
| 723 | 'title_color_hover', |
| 724 | array( |
| 725 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 726 | ) |
| 727 | ); |
| 728 | |
| 729 | $this->add_control( |
| 730 | 'title_hover_color', |
| 731 | array( |
| 732 | 'label' => __( 'Color', 'auxin-elements' ), |
| 733 | 'type' => Controls_Manager::COLOR, |
| 734 | 'selectors' => array( |
| 735 | '{{WRAPPER}}:hover .col-title a, {{WRAPPER}}:hover .col-title' => 'color: {{VALUE}} !important;' |
| 736 | ) |
| 737 | ) |
| 738 | ); |
| 739 | |
| 740 | $this->end_controls_tab(); |
| 741 | |
| 742 | $this->end_controls_tabs(); |
| 743 | |
| 744 | if ( class_exists( 'Elementor\Group_Control_Text_Stroke' ) ) { |
| 745 | $this->add_group_control( |
| 746 | Group_Control_Text_Stroke::get_type(), |
| 747 | [ |
| 748 | 'name' => 'title_stroke', |
| 749 | 'selector' => '{{WRAPPER}} .col-title a, {{WRAPPER}} .col-title' |
| 750 | ] |
| 751 | ); |
| 752 | } |
| 753 | |
| 754 | $this->add_group_control( |
| 755 | Group_Control_Typography::get_type(), |
| 756 | array( |
| 757 | 'name' => 'title_typography', |
| 758 | 'global' => [ |
| 759 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 760 | ], |
| 761 | 'selector' => '{{WRAPPER}} .col-title, {{WRAPPER}} .col-title a' |
| 762 | ) |
| 763 | ); |
| 764 | |
| 765 | $this->add_group_control( |
| 766 | Group_Control_Text_Shadow::get_type(), |
| 767 | array( |
| 768 | 'name' => 'title_shadow', |
| 769 | 'label' => __( 'Text Shadow', 'auxin-elements' ), |
| 770 | 'selector' => '{{WRAPPER}} .col-title' |
| 771 | ) |
| 772 | ); |
| 773 | |
| 774 | $this->add_responsive_control( |
| 775 | 'title_margin_bottom', |
| 776 | array( |
| 777 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 778 | 'type' => Controls_Manager::SLIDER, |
| 779 | 'range' => array( |
| 780 | 'px' => array( |
| 781 | 'min' => -200, |
| 782 | 'max' => 200 |
| 783 | ) |
| 784 | ), |
| 785 | 'selectors' => array( |
| 786 | '{{WRAPPER}} .col-title' => 'margin-bottom: {{SIZE}}{{UNIT}};' |
| 787 | ) |
| 788 | ) |
| 789 | ); |
| 790 | |
| 791 | $this->end_controls_section(); |
| 792 | |
| 793 | /* subtitle_style_section |
| 794 | /*-------------------------------------*/ |
| 795 | |
| 796 | $this->start_controls_section( |
| 797 | 'subtitle_style_section', |
| 798 | array( |
| 799 | 'label' => __( 'Subtitle', 'auxin-elements' ), |
| 800 | 'tab' => Controls_Manager::TAB_STYLE, |
| 801 | 'condition' => array( |
| 802 | 'subtitle!' => '' |
| 803 | ) |
| 804 | ) |
| 805 | ); |
| 806 | |
| 807 | $this->start_controls_tabs( 'subtitle_colors' ); |
| 808 | |
| 809 | $this->start_controls_tab( |
| 810 | 'subtitle_color_normal', |
| 811 | array( |
| 812 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 813 | ) |
| 814 | ); |
| 815 | |
| 816 | $this->add_control( |
| 817 | 'subtitle_color', |
| 818 | array( |
| 819 | 'label' => __( 'Color', 'auxin-elements' ), |
| 820 | 'type' => Controls_Manager::COLOR, |
| 821 | 'selectors' => array( |
| 822 | '{{WRAPPER}} .col-subtitle' => 'color: {{VALUE}} !important;', |
| 823 | ) |
| 824 | ) |
| 825 | ); |
| 826 | |
| 827 | $this->end_controls_tab(); |
| 828 | |
| 829 | $this->start_controls_tab( |
| 830 | 'subtitle_color_hover', |
| 831 | array( |
| 832 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 833 | ) |
| 834 | ); |
| 835 | |
| 836 | $this->add_control( |
| 837 | 'subtitle_hover_color', |
| 838 | array( |
| 839 | 'label' => __( 'Color', 'auxin-elements' ), |
| 840 | 'type' => Controls_Manager::COLOR, |
| 841 | 'selectors' => array( |
| 842 | '{{WRAPPER}}:hover .col-subtitle' => 'color: {{VALUE}} !important;' |
| 843 | ) |
| 844 | ) |
| 845 | ); |
| 846 | |
| 847 | $this->end_controls_tab(); |
| 848 | |
| 849 | $this->end_controls_tabs(); |
| 850 | |
| 851 | |
| 852 | $this->add_group_control( |
| 853 | Group_Control_Typography::get_type(), |
| 854 | array( |
| 855 | 'name' => 'subtitle_typography', |
| 856 | 'global' => [ |
| 857 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 858 | ], |
| 859 | 'selector' => '{{WRAPPER}} .col-subtitle' |
| 860 | ) |
| 861 | ); |
| 862 | |
| 863 | $this->add_group_control( |
| 864 | Group_Control_Text_Shadow::get_type(), |
| 865 | array( |
| 866 | 'name' => 'subtitle_shadow', |
| 867 | 'label' => __( 'Text Shadow', 'auxin-elements' ), |
| 868 | 'selector' => '{{WRAPPER}} .col-subtitle' |
| 869 | ) |
| 870 | ); |
| 871 | |
| 872 | $this->add_responsive_control( |
| 873 | 'subtitle_margin_top', |
| 874 | array( |
| 875 | 'label' => __( 'Top space', 'auxin-elements' ), |
| 876 | 'type' => Controls_Manager::SLIDER, |
| 877 | 'range' => array( |
| 878 | 'px' => array( |
| 879 | 'min' => -200, |
| 880 | 'max' => 200 |
| 881 | ) |
| 882 | ), |
| 883 | 'selectors' => array( |
| 884 | '{{WRAPPER}} .col-subtitle' => 'margin-top: {{SIZE}}{{UNIT}};' |
| 885 | ) |
| 886 | ) |
| 887 | ); |
| 888 | |
| 889 | $this->add_responsive_control( |
| 890 | 'subtitle_margin_bottom', |
| 891 | array( |
| 892 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 893 | 'type' => Controls_Manager::SLIDER, |
| 894 | 'range' => array( |
| 895 | 'px' => array( |
| 896 | 'min' => -200, |
| 897 | 'max' => 200 |
| 898 | ) |
| 899 | ), |
| 900 | 'selectors' => array( |
| 901 | '{{WRAPPER}} .col-subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}};' |
| 902 | ) |
| 903 | ) |
| 904 | ); |
| 905 | |
| 906 | $this->end_controls_section(); |
| 907 | |
| 908 | /* content_style_section |
| 909 | /*-------------------------------------*/ |
| 910 | |
| 911 | $this->start_controls_section( |
| 912 | 'content_style_section', |
| 913 | array( |
| 914 | 'label' => __( 'Content', 'auxin-elements' ), |
| 915 | 'tab' => Controls_Manager::TAB_STYLE |
| 916 | ) |
| 917 | ); |
| 918 | |
| 919 | |
| 920 | $this->start_controls_tabs( 'content_colors' ); |
| 921 | |
| 922 | $this->start_controls_tab( |
| 923 | 'content_color_normal', |
| 924 | array( |
| 925 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 926 | ) |
| 927 | ); |
| 928 | |
| 929 | $this->add_control( |
| 930 | 'content_color', |
| 931 | array( |
| 932 | 'label' => __( 'Color', 'auxin-elements' ), |
| 933 | 'type' => Controls_Manager::COLOR, |
| 934 | 'selectors' => array( |
| 935 | '{{WRAPPER}} .widget-content' => 'color:{{VALUE}} !important;', |
| 936 | ) |
| 937 | ) |
| 938 | ); |
| 939 | |
| 940 | $this->end_controls_tab(); |
| 941 | |
| 942 | $this->start_controls_tab( |
| 943 | 'content_color_hover', |
| 944 | array( |
| 945 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 946 | ) |
| 947 | ); |
| 948 | |
| 949 | $this->add_control( |
| 950 | 'content_hover_color', |
| 951 | array( |
| 952 | 'label' => __( 'Color', 'auxin-elements' ), |
| 953 | 'type' => Controls_Manager::COLOR, |
| 954 | 'selectors' => array( |
| 955 | '{{WRAPPER}}:hover .widget-content' => 'color:{{VALUE}} !important;' |
| 956 | ) |
| 957 | ) |
| 958 | ); |
| 959 | |
| 960 | $this->end_controls_tab(); |
| 961 | |
| 962 | $this->end_controls_tabs(); |
| 963 | |
| 964 | |
| 965 | $this->add_group_control( |
| 966 | Group_Control_Typography::get_type(), |
| 967 | array( |
| 968 | 'name' => 'content_typography', |
| 969 | 'global' => [ |
| 970 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 971 | ], |
| 972 | 'selector' => '{{WRAPPER}} .widget-content' |
| 973 | ) |
| 974 | ); |
| 975 | |
| 976 | $this->add_group_control( |
| 977 | Group_Control_Text_Shadow::get_type(), |
| 978 | array( |
| 979 | 'name' => 'content_shadow', |
| 980 | 'label' => __( 'Text Shadow', 'auxin-elements' ), |
| 981 | 'selector' => '{{WRAPPER}} .widget-content' |
| 982 | ) |
| 983 | ); |
| 984 | |
| 985 | $this->add_responsive_control( |
| 986 | 'content_padding', |
| 987 | array( |
| 988 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 989 | 'type' => Controls_Manager::DIMENSIONS, |
| 990 | 'size_units' => array( 'px', '%' ), |
| 991 | 'selectors' => array( |
| 992 | '{{WRAPPER}} .aux-widget-text .aux-text-widget-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 993 | ) |
| 994 | ) |
| 995 | ); |
| 996 | |
| 997 | $this->add_responsive_control( |
| 998 | 'content_margin_top', |
| 999 | array( |
| 1000 | 'label' => __( 'Top space', 'auxin-elements' ), |
| 1001 | 'type' => Controls_Manager::SLIDER, |
| 1002 | 'range' => array( |
| 1003 | 'px' => array( |
| 1004 | 'min' => -200, |
| 1005 | 'max' => 200 |
| 1006 | ) |
| 1007 | ), |
| 1008 | 'selectors' => array( |
| 1009 | '{{WRAPPER}} .widget-content' => 'margin-top: {{SIZE}}{{UNIT}};' |
| 1010 | ) |
| 1011 | ) |
| 1012 | ); |
| 1013 | |
| 1014 | $this->add_responsive_control( |
| 1015 | 'content_margin_bottom', |
| 1016 | array( |
| 1017 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 1018 | 'type' => Controls_Manager::SLIDER, |
| 1019 | 'range' => array( |
| 1020 | 'px' => array( |
| 1021 | 'min' => -200, |
| 1022 | 'max' => 200 |
| 1023 | ) |
| 1024 | ), |
| 1025 | 'selectors' => array( |
| 1026 | '{{WRAPPER}} .widget-content' => 'margin-bottom: {{SIZE}}{{UNIT}};' |
| 1027 | ) |
| 1028 | ) |
| 1029 | ); |
| 1030 | |
| 1031 | $this->end_controls_section(); |
| 1032 | |
| 1033 | /* button_style_section |
| 1034 | /*-------------------------------------*/ |
| 1035 | |
| 1036 | $this->start_controls_section( |
| 1037 | 'button_style_section', |
| 1038 | array( |
| 1039 | 'label' => __('Button', 'auxin-elements' ), |
| 1040 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1041 | 'condition' => array( |
| 1042 | 'display_button' => 'yes', |
| 1043 | ) |
| 1044 | ) |
| 1045 | ); |
| 1046 | |
| 1047 | $this->add_control( |
| 1048 | 'btn_size', |
| 1049 | array( |
| 1050 | 'label' => __('Size', 'auxin-elements'), |
| 1051 | 'type' => Controls_Manager::SELECT, |
| 1052 | 'default' => 'medium', |
| 1053 | 'options' => array( |
| 1054 | 'exlarge' => __('Exlarge', 'auxin-elements' ), |
| 1055 | 'large' => __('Large' , 'auxin-elements' ), |
| 1056 | 'medium' => __('Medium' , 'auxin-elements' ), |
| 1057 | 'small' => __('Small' , 'auxin-elements' ), |
| 1058 | 'tiny' => __('Tiny' , 'auxin-elements' ) |
| 1059 | ) |
| 1060 | ) |
| 1061 | ); |
| 1062 | |
| 1063 | $this->add_control( |
| 1064 | 'button_skin_heading', |
| 1065 | array( |
| 1066 | 'label' => __( 'Button Skin', 'auxin-elements' ), |
| 1067 | 'type' => Controls_Manager::HEADING, |
| 1068 | 'separator' => 'before', |
| 1069 | ) |
| 1070 | ); |
| 1071 | |
| 1072 | $this->add_control( |
| 1073 | 'btn_color_name', |
| 1074 | array( |
| 1075 | 'label' => __('Skin', 'auxin-elements'), |
| 1076 | 'type' => 'aux-visual-select', |
| 1077 | 'default' => 'black', |
| 1078 | 'options' => auxin_get_famous_colors_list() |
| 1079 | ) |
| 1080 | ); |
| 1081 | |
| 1082 | $this->start_controls_tabs( 'button_background_tab' ); |
| 1083 | |
| 1084 | $this->start_controls_tab( |
| 1085 | 'button_bg_normal', |
| 1086 | array( |
| 1087 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 1088 | ) |
| 1089 | ); |
| 1090 | |
| 1091 | $this->add_group_control( |
| 1092 | Group_Control_Background::get_type(), |
| 1093 | array( |
| 1094 | 'name' => 'button_background', |
| 1095 | 'label' => __( 'Background', 'auxin-elements' ), |
| 1096 | 'types' => array( 'classic', 'gradient' ), |
| 1097 | 'selector' => '{{WRAPPER}} .aux-button' |
| 1098 | ) |
| 1099 | ); |
| 1100 | |
| 1101 | $this->add_group_control( |
| 1102 | Group_Control_Box_Shadow::get_type(), |
| 1103 | array( |
| 1104 | 'name' => 'button_box_shadow', |
| 1105 | 'selector' => '{{WRAPPER}} .aux-button' |
| 1106 | ) |
| 1107 | ); |
| 1108 | |
| 1109 | $this->end_controls_tab(); |
| 1110 | |
| 1111 | $this->start_controls_tab( |
| 1112 | 'button_bg_hover', |
| 1113 | array( |
| 1114 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 1115 | ) |
| 1116 | ); |
| 1117 | |
| 1118 | $this->add_group_control( |
| 1119 | Group_Control_Background::get_type(), |
| 1120 | array( |
| 1121 | 'name' => 'hover_button_background', |
| 1122 | 'label' => __( 'Background', 'auxin-elements' ), |
| 1123 | 'types' => array( 'classic', 'gradient' ), |
| 1124 | 'selector' => '{{WRAPPER}} .aux-button .aux-overlay::after' |
| 1125 | ) |
| 1126 | ); |
| 1127 | |
| 1128 | $this->add_group_control( |
| 1129 | Group_Control_Box_Shadow::get_type(), |
| 1130 | array( |
| 1131 | 'name' => 'hover_button_box_shadow', |
| 1132 | 'selector' => '{{WRAPPER}} .aux-button:hover' |
| 1133 | ) |
| 1134 | ); |
| 1135 | |
| 1136 | $this->end_controls_tab(); |
| 1137 | |
| 1138 | $this->end_controls_tabs(); |
| 1139 | |
| 1140 | $this->add_control( |
| 1141 | 'button_icon_heading', |
| 1142 | array( |
| 1143 | 'label' => __( 'Button Icon', 'auxin-elements' ), |
| 1144 | 'type' => Controls_Manager::HEADING, |
| 1145 | 'separator' => 'before', |
| 1146 | // @TODO: un comment after some release |
| 1147 | // 'condition' => array( |
| 1148 | // 'aux_text_btn_icon!' => '', |
| 1149 | // ) |
| 1150 | ) |
| 1151 | ); |
| 1152 | |
| 1153 | $this->add_control( |
| 1154 | 'btn_icon_align', |
| 1155 | array( |
| 1156 | 'label' => __('Icon alignment', 'auxin-elements'), |
| 1157 | 'type' => Controls_Manager::SELECT, |
| 1158 | 'default' => 'default', |
| 1159 | 'options' => array( |
| 1160 | 'default' => __('Default' , 'auxin-elements' ), |
| 1161 | 'left' => __('Left' , 'auxin-elements' ), |
| 1162 | 'right' => __('Right' , 'auxin-elements' ), |
| 1163 | 'over' => __('Over' , 'auxin-elements' ), |
| 1164 | 'left-animate' => __('Animate from Left' , 'auxin-elements' ), |
| 1165 | 'right-animate' => __('Animate from Right' , 'auxin-elements' ) |
| 1166 | ), |
| 1167 | // @TODO: un comment after some release |
| 1168 | // 'condition' => array( |
| 1169 | // 'aux_text_btn_icon!' => '', |
| 1170 | // ) |
| 1171 | ) |
| 1172 | ); |
| 1173 | |
| 1174 | $this->add_responsive_control( |
| 1175 | 'btn_icon_size', |
| 1176 | array( |
| 1177 | 'label' => __( 'Icon Size', 'auxin-elements' ), |
| 1178 | 'type' => Controls_Manager::SLIDER, |
| 1179 | 'size_units' => array( 'px', '%' ), |
| 1180 | 'range' => array( |
| 1181 | 'px' => array( |
| 1182 | 'min' => 10, |
| 1183 | 'max' => 512, |
| 1184 | 'step' => 2, |
| 1185 | ), |
| 1186 | '%' => array( |
| 1187 | 'min' => 0, |
| 1188 | 'max' => 100, |
| 1189 | ), |
| 1190 | ), |
| 1191 | 'selectors' => array( |
| 1192 | '{{WRAPPER}} .aux-icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1193 | ), |
| 1194 | // @TODO: un comment after some release |
| 1195 | // 'condition' => array( |
| 1196 | // 'aux_text_btn_icon!' => '' |
| 1197 | // ) |
| 1198 | ) |
| 1199 | ); |
| 1200 | |
| 1201 | $this->start_controls_tabs( |
| 1202 | 'btn_icon_color', |
| 1203 | array( |
| 1204 | // @TODO: un comment after some release |
| 1205 | // 'condition' => array( |
| 1206 | // 'aux_text_btn_icon!' => '', |
| 1207 | // ) |
| 1208 | ) |
| 1209 | ); |
| 1210 | |
| 1211 | $this->start_controls_tab( |
| 1212 | 'icon_color_normal', |
| 1213 | array( |
| 1214 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 1215 | ) |
| 1216 | ); |
| 1217 | |
| 1218 | $this->add_control( |
| 1219 | 'button_icon_color', |
| 1220 | array( |
| 1221 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1222 | 'type' => Controls_Manager::COLOR, |
| 1223 | 'selectors' => array( |
| 1224 | '{{WRAPPER}} .aux-icon' => 'color: {{VALUE}};', |
| 1225 | ) |
| 1226 | ) |
| 1227 | ); |
| 1228 | |
| 1229 | $this->end_controls_tab(); |
| 1230 | |
| 1231 | $this->start_controls_tab( |
| 1232 | 'btn_icon_color_hover', |
| 1233 | array( |
| 1234 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 1235 | ) |
| 1236 | ); |
| 1237 | |
| 1238 | $this->add_control( |
| 1239 | 'hover_button_icon_color', |
| 1240 | array( |
| 1241 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1242 | 'type' => Controls_Manager::COLOR, |
| 1243 | 'selectors' => array( |
| 1244 | '{{WRAPPER}} .aux-button:hover .aux-icon' => 'color: {{VALUE}};', |
| 1245 | ) |
| 1246 | ) |
| 1247 | ); |
| 1248 | |
| 1249 | $this->end_controls_tab(); |
| 1250 | |
| 1251 | $this->end_controls_tabs(); |
| 1252 | |
| 1253 | $this->add_control( |
| 1254 | 'button_text_heading', |
| 1255 | array( |
| 1256 | 'label' => __( 'Button Text', 'auxin-elements' ), |
| 1257 | 'type' => Controls_Manager::HEADING, |
| 1258 | 'separator' => 'before', |
| 1259 | // @TODO: un comment after some release |
| 1260 | // 'condition' => array( |
| 1261 | // 'aux_text_btn_icon!' => '', |
| 1262 | // ) |
| 1263 | ) |
| 1264 | ); |
| 1265 | |
| 1266 | $this->start_controls_tabs( 'button_text' ); |
| 1267 | |
| 1268 | $this->start_controls_tab( |
| 1269 | 'button_text_normal', |
| 1270 | array( |
| 1271 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 1272 | ) |
| 1273 | ); |
| 1274 | |
| 1275 | $this->add_control( |
| 1276 | 'btn_text_color', |
| 1277 | array( |
| 1278 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1279 | 'type' => Controls_Manager::COLOR, |
| 1280 | 'selectors' => array( |
| 1281 | '{{WRAPPER}} .aux-text' => 'color: {{VALUE}};', |
| 1282 | ) |
| 1283 | ) |
| 1284 | ); |
| 1285 | |
| 1286 | $this->add_group_control( |
| 1287 | Group_Control_Text_Shadow::get_type(), |
| 1288 | array( |
| 1289 | 'name' => 'btn_text_shadow', |
| 1290 | 'label' => __( 'Text Shadow', 'auxin-elements' ), |
| 1291 | 'selector' => '{{WRAPPER}} .aux-button', |
| 1292 | ) |
| 1293 | ); |
| 1294 | |
| 1295 | $this->add_group_control( |
| 1296 | Group_Control_Typography::get_type(), |
| 1297 | array( |
| 1298 | 'name' => 'button_typography', |
| 1299 | 'global' => [ |
| 1300 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1301 | ], |
| 1302 | 'selector' => '{{WRAPPER}} .aux-text' |
| 1303 | ) |
| 1304 | ); |
| 1305 | |
| 1306 | $this->end_controls_tab(); |
| 1307 | |
| 1308 | $this->start_controls_tab( |
| 1309 | 'button_text_hover', |
| 1310 | array( |
| 1311 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 1312 | ) |
| 1313 | ); |
| 1314 | |
| 1315 | $this->add_control( |
| 1316 | 'hover_btn_text_color', |
| 1317 | array( |
| 1318 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1319 | 'type' => Controls_Manager::COLOR, |
| 1320 | 'selectors' => array( |
| 1321 | '{{WRAPPER}} .aux-button:hover .aux-text' => 'color: {{VALUE}};', |
| 1322 | ) |
| 1323 | ) |
| 1324 | ); |
| 1325 | |
| 1326 | $this->add_group_control( |
| 1327 | Group_Control_Text_Shadow::get_type(), |
| 1328 | array( |
| 1329 | 'name' => 'hover_btn_text_shadow', |
| 1330 | 'label' => __( 'Text Shadow', 'auxin-elements' ), |
| 1331 | 'selector' => '{{WRAPPER}} .aux-button:hover', |
| 1332 | ) |
| 1333 | ); |
| 1334 | |
| 1335 | $this->add_group_control( |
| 1336 | Group_Control_Typography::get_type(), |
| 1337 | array( |
| 1338 | 'name' => 'hover_button_typography', |
| 1339 | 'global' => [ |
| 1340 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1341 | ], |
| 1342 | 'selector' => '{{WRAPPER}} .aux-text' |
| 1343 | ) |
| 1344 | ); |
| 1345 | |
| 1346 | $this->end_controls_tab(); |
| 1347 | |
| 1348 | $this->end_controls_tabs(); |
| 1349 | |
| 1350 | $this->add_control( |
| 1351 | 'button_wrapper_heading', |
| 1352 | array( |
| 1353 | 'label' => __( 'Button Wrapper', 'auxin-elements' ), |
| 1354 | 'type' => Controls_Manager::HEADING, |
| 1355 | 'separator' => 'before', |
| 1356 | // @TODO: un comment after some release |
| 1357 | // 'condition' => array( |
| 1358 | // 'aux_text_btn_icon!' => '', |
| 1359 | // ) |
| 1360 | ) |
| 1361 | ); |
| 1362 | |
| 1363 | $this->add_responsive_control( |
| 1364 | 'btn_icon_margin', |
| 1365 | array( |
| 1366 | 'label' => __( 'Icon Margin', 'auxin-elements' ), |
| 1367 | 'type' => Controls_Manager::DIMENSIONS, |
| 1368 | 'size_units' => array( 'px', '%' ), |
| 1369 | 'selectors' => array( |
| 1370 | '{{WRAPPER}} .aux-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1371 | ) |
| 1372 | ) |
| 1373 | ); |
| 1374 | |
| 1375 | $this->add_control( |
| 1376 | 'btn_border', |
| 1377 | array( |
| 1378 | 'label' => __('Shape Style','auxin-elements' ), |
| 1379 | 'type' => 'aux-visual-select', |
| 1380 | 'style_items' => 'max-width:30%;', |
| 1381 | 'options' => array( |
| 1382 | 'none' => array( |
| 1383 | 'label' => __('Box', 'auxin-elements' ), |
| 1384 | 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg' |
| 1385 | ), |
| 1386 | 'round' => array( |
| 1387 | 'label' => __('Round', 'auxin-elements' ), |
| 1388 | 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg' |
| 1389 | ), |
| 1390 | 'curve' => array( |
| 1391 | 'label' => __('Curve', 'auxin-elements' ), |
| 1392 | 'image' => AUXIN_URL . 'images/visual-select/button-rounded.svg' |
| 1393 | ) |
| 1394 | ), |
| 1395 | 'default' => 'round' |
| 1396 | ) |
| 1397 | ); |
| 1398 | |
| 1399 | $this->add_control( |
| 1400 | 'btn_style', |
| 1401 | array( |
| 1402 | 'label' => __('Button Style','auxin-elements' ), |
| 1403 | 'type' => 'aux-visual-select', |
| 1404 | 'style_items' => 'max-width:30%;', |
| 1405 | 'options' => array( |
| 1406 | 'none' => array( |
| 1407 | 'label' => __('Normal', 'auxin-elements' ), |
| 1408 | 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg' |
| 1409 | ), |
| 1410 | '3d' => array( |
| 1411 | 'label' => __('3D', 'auxin-elements' ), |
| 1412 | 'image' => AUXIN_URL . 'images/visual-select/button-3d.svg' |
| 1413 | ), |
| 1414 | 'outline' => array( |
| 1415 | 'label' => __('Outline', 'auxin-elements' ), |
| 1416 | 'image' => AUXIN_URL . 'images/visual-select/button-outline.svg' |
| 1417 | ) |
| 1418 | ), |
| 1419 | 'default' => 'outline' |
| 1420 | ) |
| 1421 | ); |
| 1422 | |
| 1423 | $this->add_responsive_control( |
| 1424 | 'button_padding', |
| 1425 | array( |
| 1426 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 1427 | 'type' => Controls_Manager::DIMENSIONS, |
| 1428 | 'size_units' => array( 'px', '%' ), |
| 1429 | 'selectors' => array( |
| 1430 | '{{WRAPPER}} .aux-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1431 | ) |
| 1432 | ) |
| 1433 | ); |
| 1434 | |
| 1435 | $this->end_controls_section(); |
| 1436 | |
| 1437 | |
| 1438 | /* wrapper_style_section |
| 1439 | /*-------------------------------------*/ |
| 1440 | |
| 1441 | $this->start_controls_section( |
| 1442 | 'wrapper_style_section', |
| 1443 | array( |
| 1444 | 'label' => __( 'Wrapper', 'auxin-elements' ), |
| 1445 | 'tab' => Controls_Manager::TAB_STYLE |
| 1446 | ) |
| 1447 | ); |
| 1448 | |
| 1449 | $this->add_control( |
| 1450 | 'overlay_color', |
| 1451 | array( |
| 1452 | 'label' => __('Overlay', 'auxin-elements'), |
| 1453 | 'type' => Controls_Manager::COLOR |
| 1454 | ) |
| 1455 | ); |
| 1456 | |
| 1457 | $this->add_responsive_control( |
| 1458 | 'text_align', |
| 1459 | array( |
| 1460 | 'label' => __('Text Align','auxin-elements'), |
| 1461 | 'type' => Controls_Manager::CHOOSE, |
| 1462 | 'options' => array( |
| 1463 | 'left' => array( |
| 1464 | 'title' => __( 'Left', 'auxin-elements' ), |
| 1465 | 'icon' => 'eicon-text-align-left', |
| 1466 | ), |
| 1467 | 'center' => array( |
| 1468 | 'title' => __( 'Center', 'auxin-elements' ), |
| 1469 | 'icon' => 'eicon-text-align-center', |
| 1470 | ), |
| 1471 | 'right' => array( |
| 1472 | 'title' => __( 'Right', 'auxin-elements' ), |
| 1473 | 'icon' => 'eicon-text-align-right', |
| 1474 | ), |
| 1475 | ), |
| 1476 | 'default' => 'center', |
| 1477 | 'toggle' => true, |
| 1478 | 'selectors' => array( |
| 1479 | '{{WRAPPER}} .aux-widget-advanced-text' => 'text-align: {{VALUE}} !important;' |
| 1480 | ) |
| 1481 | ) |
| 1482 | ); |
| 1483 | |
| 1484 | $this->add_responsive_control( |
| 1485 | 'wrapper_content_padding', |
| 1486 | array( |
| 1487 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 1488 | 'type' => Controls_Manager::DIMENSIONS, |
| 1489 | 'size_units' => array( 'px', '%' ), |
| 1490 | 'selectors' => array( |
| 1491 | '{{WRAPPER}} .aux-widget-advanced-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1492 | ) |
| 1493 | ) |
| 1494 | ); |
| 1495 | |
| 1496 | $this->add_responsive_control( |
| 1497 | 'wrapper_content_border_radius', |
| 1498 | array( |
| 1499 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 1500 | 'type' => Controls_Manager::DIMENSIONS, |
| 1501 | 'size_units' => array( 'px', 'em', '%' ), |
| 1502 | 'selectors' => array( |
| 1503 | '{{WRAPPER}} .aux-text-widget-overlay, {{WRAPPER}} .aux-widget-advanced-text' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1504 | ), |
| 1505 | 'allowed_dimensions' => 'all', |
| 1506 | 'separator' => 'after' |
| 1507 | ) |
| 1508 | ); |
| 1509 | |
| 1510 | $this->start_controls_tabs( 'wrapper_content_status' ); |
| 1511 | |
| 1512 | $this->start_controls_tab( |
| 1513 | 'wrapper_content_status_normal', |
| 1514 | array( |
| 1515 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 1516 | ) |
| 1517 | ); |
| 1518 | |
| 1519 | $this->add_group_control( |
| 1520 | Group_Control_Border::get_type(), |
| 1521 | array( |
| 1522 | 'name' => 'wrapper_content_border_normal', |
| 1523 | 'selector' => '{{WRAPPER}} .aux-widget-advanced-text', |
| 1524 | 'separator' => 'none' |
| 1525 | ) |
| 1526 | ); |
| 1527 | |
| 1528 | $this->add_group_control( |
| 1529 | Group_Control_Background::get_type(), |
| 1530 | array( |
| 1531 | 'name' => 'wrapper_content_background_normal', |
| 1532 | 'selector' => '{{WRAPPER}} .aux-widget-advanced-text', |
| 1533 | 'separator' => 'none' |
| 1534 | ) |
| 1535 | ); |
| 1536 | |
| 1537 | $this->end_controls_tab(); |
| 1538 | |
| 1539 | |
| 1540 | $this->start_controls_tab( |
| 1541 | 'wrapper_content_status_hover', |
| 1542 | array( |
| 1543 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 1544 | ) |
| 1545 | ); |
| 1546 | |
| 1547 | $this->add_group_control( |
| 1548 | Group_Control_Border::get_type(), |
| 1549 | array( |
| 1550 | 'name' => 'wrapper_content_border_hover', |
| 1551 | 'selector' => '{{WRAPPER}} .aux-widget-advanced-text:hover', |
| 1552 | 'separator' => 'none' |
| 1553 | ) |
| 1554 | ); |
| 1555 | |
| 1556 | $this->add_group_control( |
| 1557 | Group_Control_Background::get_type(), |
| 1558 | array( |
| 1559 | 'name' => 'wrapper_content_background_hover', |
| 1560 | 'selector' => '{{WRAPPER}} .aux-widget-advanced-text:hover', |
| 1561 | 'separator' => 'none' |
| 1562 | ) |
| 1563 | ); |
| 1564 | |
| 1565 | $this->add_control( |
| 1566 | 'wrapper_content_transition', |
| 1567 | array( |
| 1568 | 'label' => __( 'Transition duration', 'auxin-elements' ), |
| 1569 | 'type' => Controls_Manager::SLIDER, |
| 1570 | 'range' => array( |
| 1571 | 'px' => array( |
| 1572 | 'min' => 0, |
| 1573 | 'max' => 2000, |
| 1574 | 'step' => 50 |
| 1575 | ) |
| 1576 | ), |
| 1577 | 'selectors' => array( |
| 1578 | '{{WRAPPER}} .aux-widget-advanced-text' => 'transition-duration:{{SIZE}}ms;' |
| 1579 | ) |
| 1580 | ) |
| 1581 | ); |
| 1582 | |
| 1583 | $this->end_controls_tab(); |
| 1584 | |
| 1585 | $this->end_controls_tabs(); |
| 1586 | |
| 1587 | $this->end_controls_section(); |
| 1588 | |
| 1589 | /* footer_section |
| 1590 | /*-------------------------------------*/ |
| 1591 | |
| 1592 | $this->start_controls_section( |
| 1593 | 'footer_section', |
| 1594 | array( |
| 1595 | 'label' => __('Footer', 'auxin-elements' ), |
| 1596 | 'tab' => Controls_Manager::TAB_STYLE |
| 1597 | ) |
| 1598 | ); |
| 1599 | |
| 1600 | $this->add_control( |
| 1601 | 'footer_shape', |
| 1602 | array( |
| 1603 | 'label' => __('Footer Shape','auxin-elements'), |
| 1604 | 'type' => 'aux-visual-select', |
| 1605 | 'style_items' => 'max-width:30%;', |
| 1606 | 'options' => array( |
| 1607 | 'none' => array( |
| 1608 | 'label' => __('None', 'auxin-elements'), |
| 1609 | 'image' => AUXIN_URL . 'images/visual-select/text-normal.svg' |
| 1610 | ), |
| 1611 | 'wave' => array( |
| 1612 | 'label' => __('Wave', 'auxin-elements'), |
| 1613 | 'image' => AUXIN_URL . 'images/visual-select/text-outline.svg' |
| 1614 | ), |
| 1615 | 'tail' => array( |
| 1616 | 'label' => __('Tail', 'auxin-elements'), |
| 1617 | 'image' => AUXIN_URL . 'images/visual-select/text-boxed.svg' |
| 1618 | ) |
| 1619 | ), |
| 1620 | 'default' => 'none' |
| 1621 | ) |
| 1622 | ); |
| 1623 | |
| 1624 | $this->add_control( |
| 1625 | 'footer_shape_color', |
| 1626 | array( |
| 1627 | 'label' => __('Color of button', 'auxin-elements'), |
| 1628 | 'type' => Controls_Manager::COLOR, |
| 1629 | 'condition' => array( |
| 1630 | 'footer_shape' => array('tail', 'wave') |
| 1631 | ) |
| 1632 | ) |
| 1633 | ); |
| 1634 | |
| 1635 | $this->end_controls_section(); |
| 1636 | } |
| 1637 | |
| 1638 | /** |
| 1639 | * Render image box widget output on the frontend. |
| 1640 | * |
| 1641 | * Written in PHP and used to generate the final HTML. |
| 1642 | * |
| 1643 | * @since 1.0.0 |
| 1644 | * @access protected |
| 1645 | */ |
| 1646 | protected function render() { |
| 1647 | |
| 1648 | $settings = $this->get_settings_for_display(); |
| 1649 | $main_icon = ''; |
| 1650 | |
| 1651 | if( 'icon' == $settings['icon_or_image'] ){ |
| 1652 | $main_icon = ! empty( $settings['aux_text_icon']['value'] ) ? $settings['aux_text_icon'] : ( ! empty( $settings['icon'] ) ? $settings['icon'] : '' ) ; |
| 1653 | } |
| 1654 | |
| 1655 | $btn_icon_value = ! empty( $settings['aux_text_btn_icon']['value'] ) ? $settings['aux_text_btn_icon'] : ( ! empty( $settings['btn_icon'] ) ? $settings['btn_icon'] : '' ) ; |
| 1656 | |
| 1657 | $args = array( |
| 1658 | 'title' => $settings['title'], |
| 1659 | 'subtitle' => $settings['subtitle'], |
| 1660 | 'title_link' => auxin_get_array_value( $settings['title_link'], 'url' ), |
| 1661 | 'content' => $settings['content'], |
| 1662 | |
| 1663 | 'display_button' => $settings['display_button'], |
| 1664 | 'btn_label' => $settings['btn_label'], |
| 1665 | 'btn_size' => $settings['btn_size'], |
| 1666 | 'btn_border' => $settings['btn_border'], |
| 1667 | 'btn_style' => $settings['btn_style'], |
| 1668 | 'btn_icon' => $btn_icon_value, |
| 1669 | 'btn_icon_align' => $settings['btn_icon_align'], |
| 1670 | 'btn_color_name' => $settings['btn_color_name'], |
| 1671 | 'btn_link' => auxin_get_array_value( $settings['btn_link'], 'url' ), |
| 1672 | 'btn_nofollow' => auxin_get_array_value( $settings['btn_link'], 'nofollow' ), |
| 1673 | 'btn_target' => auxin_get_array_value( $settings['btn_link'], 'is_external', false ) ? '_blank' : '_self', |
| 1674 | |
| 1675 | 'icon_or_image' => $settings['icon_or_image'], |
| 1676 | 'icon' => $main_icon, |
| 1677 | 'icon_color' => $settings['icon_color'] ?? '#ffffff', |
| 1678 | 'icon_bg_color' => $settings['icon_bg_color'] ?? '', |
| 1679 | 'icon_shape' => $settings['icon_shape'], |
| 1680 | 'image' => auxin_get_array_value( $settings['image'], 'id' ), |
| 1681 | 'size' => $settings['image_size'], |
| 1682 | 'width' => auxin_get_array_value( $settings['image_custom_dimension'], 'width' ), |
| 1683 | 'height' => auxin_get_array_value( $settings['image_custom_dimension'], 'height' ), |
| 1684 | 'preloadable' => $settings['preloadable'], |
| 1685 | 'preload_preview' => $settings['preload_preview'], |
| 1686 | 'preload_bgcolor' => $settings['preload_bgcolor'], |
| 1687 | 'image_size' => $settings['image_size'], |
| 1688 | 'img_shape' => $settings['img_shape'], |
| 1689 | 'image_position' => $settings['image_position'], |
| 1690 | 'icon_svg_inline' => $settings['svg_inline'], |
| 1691 | |
| 1692 | 'text_align' => $settings['text_align'] ?? 'center', |
| 1693 | 'text_align_resp' => empty( $settings['text_align_mobile'] ) ? '' : $settings['text_align_mobile'], |
| 1694 | 'overlay_color' => $settings['overlay_color'], |
| 1695 | |
| 1696 | 'footer_shape' => $settings['footer_shape'], |
| 1697 | 'footer_shape_color' => $settings['footer_shape_color'] |
| 1698 | ); |
| 1699 | |
| 1700 | // get the shortcode base blog page |
| 1701 | echo auxin_widget_column_callback( $args ); |
| 1702 | } |
| 1703 | |
| 1704 | } |
| 1705 |