Adv_Accordion.php
1 year ago
Adv_Tabs.php
1 year ago
Advanced_Data_Table.php
1 year ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
1 year ago
Betterdocs_Category_Grid.php
1 year ago
Betterdocs_Search_Form.php
1 year ago
Business_Reviews.php
1 year ago
Caldera_Forms.php
1 year ago
Career_Page.php
4 years ago
Contact_Form_7.php
1 year ago
Content_Ticker.php
1 year ago
Countdown.php
1 year ago
Creative_Button.php
1 year ago
Cta_Box.php
1 year ago
Data_Table.php
1 year ago
Dual_Color_Header.php
1 year ago
EmbedPress.php
4 years ago
Event_Calendar.php
1 year ago
Facebook_Feed.php
1 year ago
Fancy_Text.php
1 year ago
Feature_List.php
1 year ago
Filterable_Gallery.php
1 year ago
Flip_Box.php
1 year ago
FluentForm.php
1 year ago
Formstack.php
1 year ago
GravityForms.php
1 year ago
Image_Accordion.php
1 year ago
Info_Box.php
1 year ago
Interactive_Circle.php
1 year ago
Login_Register.php
1 year ago
NFT_Gallery.php
1 year ago
NinjaForms.php
1 year ago
Post_Grid.php
1 year ago
Post_Timeline.php
1 year ago
Pricing_Table.php
1 year ago
Product_Grid.php
1 year ago
Progress_Bar.php
1 year ago
SVG_Draw.php
1 year ago
Simple_Menu.php
1 year ago
Sticky_Video.php
1 year ago
Team_Member.php
1 year ago
Testimonial.php
1 year ago
Tooltip.php
1 year ago
Twitter_Feed.php
1 year ago
TypeForm.php
1 year ago
WeForms.php
2 years ago
Woo_Cart.php
1 year ago
Woo_Checkout.php
1 year ago
Woo_Product_Carousel.php
1 year ago
Woo_Product_Compare.php
2 years ago
Woo_Product_Gallery.php
1 year ago
Woo_Product_List.php
1 year ago
WpForms.php
1 year ago
index.php
3 years ago
Creative_Button.php
635 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | // If this file is called directly, abort. |
| 6 | if (!defined('ABSPATH')) { |
| 7 | exit; |
| 8 | } |
| 9 | |
| 10 | use \Elementor\Controls_Manager; |
| 11 | use \Elementor\Group_Control_Background; |
| 12 | use \Elementor\Group_Control_Border; |
| 13 | use \Elementor\Group_Control_Box_Shadow; |
| 14 | use \Elementor\Group_Control_Typography; |
| 15 | use Elementor\Icons_Manager; |
| 16 | use Elementor\Modules\DynamicTags\Module as TagsModule; |
| 17 | use \Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 18 | use \Elementor\Widget_Base; |
| 19 | use Essential_Addons_Elementor\Classes\Helper; |
| 20 | |
| 21 | |
| 22 | class Creative_Button extends Widget_Base |
| 23 | { |
| 24 | |
| 25 | public function get_name() |
| 26 | { |
| 27 | return 'eael-creative-button'; |
| 28 | } |
| 29 | |
| 30 | public function get_title() |
| 31 | { |
| 32 | return esc_html__('Creative Button', 'essential-addons-for-elementor-lite'); |
| 33 | } |
| 34 | |
| 35 | public function get_icon() |
| 36 | { |
| 37 | return 'eaicon-creative-button'; |
| 38 | } |
| 39 | |
| 40 | public function get_categories() |
| 41 | { |
| 42 | return ['essential-addons-elementor']; |
| 43 | } |
| 44 | |
| 45 | public function get_keywords() |
| 46 | { |
| 47 | return [ |
| 48 | 'button', |
| 49 | 'ea button', |
| 50 | 'creative button', |
| 51 | 'ea creative button', |
| 52 | 'cta', |
| 53 | 'call to action', |
| 54 | 'ea', |
| 55 | 'marketing button', |
| 56 | 'essential addons', |
| 57 | ]; |
| 58 | } |
| 59 | |
| 60 | protected function is_dynamic_content():bool { |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | public function get_custom_help_url() |
| 65 | { |
| 66 | return 'https://essential-addons.com/elementor/docs/creative-buttons/'; |
| 67 | } |
| 68 | |
| 69 | protected function register_controls() |
| 70 | { |
| 71 | |
| 72 | if ( !apply_filters( 'eael/pro_enabled', false ) ) { |
| 73 | // Content Controls |
| 74 | $this->start_controls_section( |
| 75 | 'eael_section_creative_button_content', |
| 76 | [ |
| 77 | 'label' => esc_html__('Button Content', 'essential-addons-for-elementor-lite'), |
| 78 | ] |
| 79 | ); |
| 80 | |
| 81 | $this->add_control( |
| 82 | 'creative_button_text', |
| 83 | [ |
| 84 | 'label' => __('Button Text', 'essential-addons-for-elementor-lite'), |
| 85 | 'type' => Controls_Manager::TEXT, |
| 86 | 'dynamic' => [ |
| 87 | 'active' => true, |
| 88 | ], |
| 89 | 'label_block' => true, |
| 90 | 'default' => 'Click Me!', |
| 91 | 'placeholder' => __('Enter button text', 'essential-addons-for-elementor-lite'), |
| 92 | 'title' => __('Enter button text here', 'essential-addons-for-elementor-lite'), |
| 93 | 'ai' => [ |
| 94 | 'active' => false, |
| 95 | ], |
| 96 | ] |
| 97 | ); |
| 98 | |
| 99 | $this->add_control( |
| 100 | 'creative_button_secondary_text', |
| 101 | [ |
| 102 | 'label' => __('Button Secondary Text', 'essential-addons-for-elementor-lite'), |
| 103 | 'type' => Controls_Manager::TEXT, |
| 104 | 'dynamic' => [ |
| 105 | 'active' => true, |
| 106 | ], |
| 107 | 'label_block' => true, |
| 108 | 'default' => 'Go!', |
| 109 | 'placeholder' => __('Enter button secondary text', 'essential-addons-for-elementor-lite'), |
| 110 | 'title' => __('Enter button secondary text here', 'essential-addons-for-elementor-lite'), |
| 111 | 'ai' => [ |
| 112 | 'active' => false, |
| 113 | ], |
| 114 | ] |
| 115 | ); |
| 116 | |
| 117 | $this->add_control( |
| 118 | 'creative_button_link_url', |
| 119 | [ |
| 120 | 'label' => esc_html__('Link URL', 'essential-addons-for-elementor-lite'), |
| 121 | 'type' => Controls_Manager::URL, |
| 122 | 'dynamic' => [ |
| 123 | 'active' => true, |
| 124 | 'categories' => [ |
| 125 | TagsModule::POST_META_CATEGORY, |
| 126 | TagsModule::URL_CATEGORY, |
| 127 | ], |
| 128 | ], |
| 129 | 'label_block' => true, |
| 130 | 'default' => [ |
| 131 | 'url' => '#', |
| 132 | 'is_external' => '', |
| 133 | ], |
| 134 | 'show_external' => true, |
| 135 | ] |
| 136 | ); |
| 137 | |
| 138 | $this->add_control( |
| 139 | 'eael_creative_button_icon_new', |
| 140 | [ |
| 141 | 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'), |
| 142 | 'type' => Controls_Manager::ICONS, |
| 143 | 'fa4compatibility' => 'eael_creative_button_icon', |
| 144 | 'condition' => [ |
| 145 | 'creative_button_effect!' => ['eael-creative-button--tamaya'], |
| 146 | ], |
| 147 | ] |
| 148 | ); |
| 149 | |
| 150 | $this->add_control( |
| 151 | 'eael_creative_button_icon_alignment', |
| 152 | [ |
| 153 | 'label' => esc_html__('Icon Position', 'essential-addons-for-elementor-lite'), |
| 154 | 'type' => Controls_Manager::SELECT, |
| 155 | 'default' => 'left', |
| 156 | 'options' => [ |
| 157 | 'left' => esc_html__('Before', 'essential-addons-for-elementor-lite'), |
| 158 | 'right' => esc_html__('After', 'essential-addons-for-elementor-lite'), |
| 159 | ], |
| 160 | 'condition' => [ |
| 161 | 'eael_creative_button_icon_new!' => '', |
| 162 | 'creative_button_effect!' => ['eael-creative-button--tamaya'], |
| 163 | ], |
| 164 | ] |
| 165 | ); |
| 166 | |
| 167 | $this->add_responsive_control( |
| 168 | 'eael_creative_button_icon_indent', |
| 169 | [ |
| 170 | 'label' => esc_html__('Icon Spacing', 'essential-addons-for-elementor-lite'), |
| 171 | 'type' => Controls_Manager::SLIDER, |
| 172 | 'range' => [ |
| 173 | 'px' => [ |
| 174 | 'max' => 60, |
| 175 | ], |
| 176 | ], |
| 177 | 'condition' => [ |
| 178 | 'eael_creative_button_icon_new!' => '', |
| 179 | 'creative_button_effect!' => ['eael-creative-button--tamaya'], |
| 180 | ], |
| 181 | 'selectors' => [ |
| 182 | '{{WRAPPER}} .eael-creative-button-icon-right' => 'margin-left: {{SIZE}}px;', |
| 183 | '{{WRAPPER}} .eael-creative-button-icon-left' => 'margin-right: {{SIZE}}px;', |
| 184 | '{{WRAPPER}} .eael-creative-button--shikoba i' => 'left: {{SIZE}}%;', |
| 185 | ], |
| 186 | ] |
| 187 | ); |
| 188 | |
| 189 | $this->end_controls_section(); |
| 190 | } else { |
| 191 | do_action('eael_creative_button_pro_controls', $this); |
| 192 | } |
| 193 | |
| 194 | if ( !apply_filters( 'eael/pro_enabled', false ) ) { |
| 195 | $this->start_controls_section( |
| 196 | 'eael_section_pro', |
| 197 | [ |
| 198 | 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'), |
| 199 | ] |
| 200 | ); |
| 201 | |
| 202 | $this->add_control( |
| 203 | 'eael_control_get_pro', |
| 204 | [ |
| 205 | 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'), |
| 206 | 'type' => Controls_Manager::CHOOSE, |
| 207 | 'options' => [ |
| 208 | '1' => [ |
| 209 | 'title' => '', |
| 210 | 'icon' => 'fa fa-unlock-alt', |
| 211 | ], |
| 212 | ], |
| 213 | 'default' => '1', |
| 214 | 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>', |
| 215 | ] |
| 216 | ); |
| 217 | |
| 218 | $this->end_controls_section(); |
| 219 | } |
| 220 | |
| 221 | // Style Controls |
| 222 | $this->start_controls_section( |
| 223 | 'eael_section_creative_button_settings', |
| 224 | [ |
| 225 | 'label' => esc_html__('Button Effects & Styles', 'essential-addons-for-elementor-lite'), |
| 226 | 'tab' => Controls_Manager::TAB_STYLE, |
| 227 | ] |
| 228 | ); |
| 229 | if (!apply_filters('eael/pro_enabled', false)) { |
| 230 | $this->add_control( |
| 231 | 'creative_button_effect', |
| 232 | [ |
| 233 | 'label' => esc_html__('Set Button Effect', 'essential-addons-for-elementor-lite'), |
| 234 | 'type' => Controls_Manager::SELECT, |
| 235 | 'default' => 'eael-creative-button--default', |
| 236 | 'options' => [ |
| 237 | 'eael-creative-button--default' => esc_html__('Default', 'essential-addons-for-elementor-lite'), |
| 238 | 'eael-creative-button--winona' => esc_html__('Winona', 'essential-addons-for-elementor-lite'), |
| 239 | 'eael-creative-button--ujarak' => esc_html__('Ujarak', 'essential-addons-for-elementor-lite'), |
| 240 | 'eael-creative-button--wayra' => esc_html__('Wayra', 'essential-addons-for-elementor-lite'), |
| 241 | 'eael-creative-button--tamaya' => esc_html__('Tamaya', 'essential-addons-for-elementor-lite'), |
| 242 | 'eael-creative-button--rayen' => esc_html__('Rayen', 'essential-addons-for-elementor-lite'), |
| 243 | 'eael-creative-button--pipaluk' => esc_html__('Pipaluk (Pro)', 'essential-addons-for-elementor-lite'), |
| 244 | 'eael-creative-button--moema' => esc_html__('Moema (Pro)', 'essential-addons-for-elementor-lite'), |
| 245 | 'eael-creative-button--wave' => esc_html__('Wave (Pro)', 'essential-addons-for-elementor-lite'), |
| 246 | 'eael-creative-button--aylen' => esc_html__('Aylen (Pro)', 'essential-addons-for-elementor-lite'), |
| 247 | 'eael-creative-button--saqui' => esc_html__('Saqui (Pro)', 'essential-addons-for-elementor-lite'), |
| 248 | 'eael-creative-button--wapasha' => esc_html__('Wapasha (Pro)', 'essential-addons-for-elementor-lite'), |
| 249 | 'eael-creative-button--nuka' => esc_html__('Nuka (Pro)', 'essential-addons-for-elementor-lite'), |
| 250 | 'eael-creative-button--antiman' => esc_html__('Antiman (Pro)', 'essential-addons-for-elementor-lite'), |
| 251 | 'eael-creative-button--quidel' => esc_html__('Quidel (Pro)', 'essential-addons-for-elementor-lite'), |
| 252 | 'eael-creative-button--shikoba' => esc_html__('Shikoba (Pro)', 'essential-addons-for-elementor-lite'), |
| 253 | ], |
| 254 | 'description' => '10 more effects on <a href="https://wpdeveloper.com/in/upgrade-essential-addons-elementor">Pro version</a>', |
| 255 | ] |
| 256 | ); |
| 257 | $this->add_control( |
| 258 | 'use_gradient_background', |
| 259 | [ |
| 260 | 'label' => __('Use Gradient Background', 'essential-addons-for-elementor-lite'), |
| 261 | 'type' => Controls_Manager::SWITCHER, |
| 262 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 263 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 264 | 'return_value' => 'yes', |
| 265 | 'default' => '', |
| 266 | ] |
| 267 | ); |
| 268 | $this->start_controls_tabs('eael_creative_button_tabs'); |
| 269 | |
| 270 | $this->start_controls_tab('normal', ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]); |
| 271 | |
| 272 | $this->add_control('eael_creative_button_icon_color', |
| 273 | [ |
| 274 | 'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'), |
| 275 | 'type' => Controls_Manager::COLOR, |
| 276 | 'default' => '#ffffff', |
| 277 | 'selectors' => [ |
| 278 | '{{WRAPPER}} .eael-creative-button i' => 'color: {{VALUE}};', |
| 279 | '{{WRAPPER}} .eael-creative-button .creative-button-inner svg' => 'fill: {{VALUE}};', |
| 280 | ], |
| 281 | ] |
| 282 | ); |
| 283 | |
| 284 | $this->add_control( |
| 285 | 'eael_creative_button_text_color', |
| 286 | [ |
| 287 | 'label' => esc_html__( 'Text Color', 'essential-addons-for-elementor-lite' ), |
| 288 | 'type' => Controls_Manager::COLOR, |
| 289 | 'default' => '#ffffff', |
| 290 | 'selectors' => [ |
| 291 | '{{WRAPPER}} .eael-creative-button' => 'color: {{VALUE}};', |
| 292 | '{{WRAPPER}} .eael-creative-button svg' => 'fill: {{VALUE}};', |
| 293 | '{{WRAPPER}} .eael-creative-button .eael-creative-button--tamaya-secondary' => 'color: {{VALUE}};', |
| 294 | ], |
| 295 | ] |
| 296 | ); |
| 297 | $this->add_control( |
| 298 | 'eael_creative_button_background_color', |
| 299 | [ |
| 300 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 301 | 'type' => Controls_Manager::COLOR, |
| 302 | 'default' => '#f54', |
| 303 | 'selectors' => [ |
| 304 | '{{WRAPPER}} .eael-creative-button' => 'background-color: {{VALUE}};', |
| 305 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak:hover' => 'background-color: {{VALUE}};', |
| 306 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover' => 'background-color: {{VALUE}};', |
| 307 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before' => 'background-color: {{VALUE}};', |
| 308 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::after' => 'background-color: {{VALUE}};', |
| 309 | ], |
| 310 | 'condition' => [ |
| 311 | 'use_gradient_background' => '', |
| 312 | ], |
| 313 | ] |
| 314 | ); |
| 315 | |
| 316 | $this->add_group_control( |
| 317 | Group_Control_Background::get_type(), |
| 318 | [ |
| 319 | 'name' => 'eael_creative_button_gradient_background', |
| 320 | 'types' => ['gradient', 'classic'], |
| 321 | 'selector' => ' |
| 322 | {{WRAPPER}} .eael-creative-button, |
| 323 | {{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak:hover, |
| 324 | {{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover, |
| 325 | {{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before, |
| 326 | {{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::after |
| 327 | ', |
| 328 | 'condition' => [ |
| 329 | 'use_gradient_background' => 'yes', |
| 330 | ], |
| 331 | ] |
| 332 | ); |
| 333 | |
| 334 | $this->add_group_control( |
| 335 | Group_Control_Border::get_type(), |
| 336 | [ |
| 337 | 'name' => 'eael_creative_button_border', |
| 338 | 'selector' => '{{WRAPPER}} .eael-creative-button', |
| 339 | ] |
| 340 | ); |
| 341 | |
| 342 | $this->add_control( |
| 343 | 'eael_creative_button_border_radius', |
| 344 | [ |
| 345 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 346 | 'type' => Controls_Manager::SLIDER, |
| 347 | 'range' => [ |
| 348 | 'px' => [ |
| 349 | 'max' => 100, |
| 350 | ], |
| 351 | ], |
| 352 | 'selectors' => [ |
| 353 | '{{WRAPPER}} .eael-creative-button' => 'border-radius: {{SIZE}}px;', |
| 354 | '{{WRAPPER}} .eael-creative-button::before' => 'border-radius: {{SIZE}}px;', |
| 355 | '{{WRAPPER}} .eael-creative-button::after' => 'border-radius: {{SIZE}}px;', |
| 356 | ], |
| 357 | ] |
| 358 | ); |
| 359 | |
| 360 | $this->end_controls_tab(); |
| 361 | |
| 362 | $this->start_controls_tab('eael_creative_button_hover', ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]); |
| 363 | |
| 364 | $this->add_control('eael_creative_button_hover_icon_color', |
| 365 | [ |
| 366 | 'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'), |
| 367 | 'type' => Controls_Manager::COLOR, |
| 368 | 'default' => '#ffffff', |
| 369 | 'selectors' => [ |
| 370 | '{{WRAPPER}} .eael-creative-button:hover i' => 'color: {{VALUE}};', |
| 371 | '{{WRAPPER}} .eael-creative-button:hover .creative-button-inner svg' => 'fill: {{VALUE}};', |
| 372 | ], |
| 373 | ] |
| 374 | ); |
| 375 | |
| 376 | $this->add_control( |
| 377 | 'eael_creative_button_hover_text_color', |
| 378 | [ |
| 379 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 380 | 'type' => Controls_Manager::COLOR, |
| 381 | 'default' => '#ffffff', |
| 382 | 'selectors' => [ |
| 383 | '{{WRAPPER}} .eael-creative-button:hover .cretive-button-text' => 'color: {{VALUE}};', |
| 384 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--winona::after' => 'color: {{VALUE}};', |
| 385 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before' => 'color: {{VALUE}};', |
| 386 | ], |
| 387 | ] |
| 388 | ); |
| 389 | |
| 390 | $this->add_control( |
| 391 | 'eael_creative_button_hover_background_color', |
| 392 | [ |
| 393 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 394 | 'type' => Controls_Manager::COLOR, |
| 395 | 'default' => '#f54', |
| 396 | 'selectors' => [ |
| 397 | '{{WRAPPER}} .eael-creative-button:hover' => 'background-color: {{VALUE}};', |
| 398 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak::before' => 'background-color: {{VALUE}};', |
| 399 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover::before' => 'background-color: {{VALUE}};', |
| 400 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya:hover' => 'background-color: {{VALUE}};', |
| 401 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before' => 'background-color: {{VALUE}};', |
| 402 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before' => 'background-color: {{VALUE}};', |
| 403 | ], |
| 404 | 'condition' => [ |
| 405 | 'use_gradient_background' => '', |
| 406 | ], |
| 407 | ] |
| 408 | ); |
| 409 | |
| 410 | $this->add_group_control( |
| 411 | Group_Control_Background::get_type(), |
| 412 | [ |
| 413 | 'name' => 'eael_creative_button_hover_gradient_background', |
| 414 | 'types' => ['gradient', 'classic'], |
| 415 | 'selector' => ' |
| 416 | {{WRAPPER}} .eael-creative-button:hover, |
| 417 | {{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak::before, |
| 418 | {{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover::before, |
| 419 | {{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya:hover, |
| 420 | {{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before, |
| 421 | {{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before |
| 422 | ', |
| 423 | 'condition' => [ |
| 424 | 'use_gradient_background' => 'yes', |
| 425 | ], |
| 426 | ] |
| 427 | ); |
| 428 | |
| 429 | $this->add_control( |
| 430 | 'eael_creative_button_hover_border_color', |
| 431 | [ |
| 432 | 'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'), |
| 433 | 'type' => Controls_Manager::COLOR, |
| 434 | 'default' => '', |
| 435 | 'selectors' => [ |
| 436 | '{{WRAPPER}} .eael-creative-button:hover' => 'border-color: {{VALUE}};', |
| 437 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--wapasha::before' => 'border-color: {{VALUE}};', |
| 438 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--antiman::before' => 'border-color: {{VALUE}};', |
| 439 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--pipaluk::before' => 'border-color: {{VALUE}};', |
| 440 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--quidel::before' => 'background-color: {{VALUE}};', |
| 441 | ], |
| 442 | ] |
| 443 | ); |
| 444 | |
| 445 | $this->end_controls_tab(); |
| 446 | |
| 447 | $this->end_controls_tabs(); |
| 448 | |
| 449 | $this->add_responsive_control( |
| 450 | 'eael_creative_button_alignment', |
| 451 | [ |
| 452 | 'label' => esc_html__('Button Alignment', 'essential-addons-for-elementor-lite'), |
| 453 | 'type' => Controls_Manager::CHOOSE, |
| 454 | 'label_block' => true, |
| 455 | 'options' => [ |
| 456 | 'flex-start' => [ |
| 457 | 'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'), |
| 458 | 'icon' => 'eicon-text-align-left', |
| 459 | ], |
| 460 | 'center' => [ |
| 461 | 'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'), |
| 462 | 'icon' => 'eicon-text-align-center', |
| 463 | ], |
| 464 | 'flex-end' => [ |
| 465 | 'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'), |
| 466 | 'icon' => 'eicon-text-align-right', |
| 467 | ], |
| 468 | ], |
| 469 | 'default' => '', |
| 470 | 'selectors' => [ |
| 471 | '{{WRAPPER}} .eael-creative-button-wrapper' => 'justify-content: {{VALUE}};', |
| 472 | ], |
| 473 | ] |
| 474 | ); |
| 475 | |
| 476 | $this->add_responsive_control( |
| 477 | 'eael_creative_button_width', |
| 478 | [ |
| 479 | 'label' => esc_html__('Width', 'essential-addons-for-elementor-lite'), |
| 480 | 'type' => Controls_Manager::SLIDER, |
| 481 | 'size_units' => ['px', '%'], |
| 482 | 'range' => [ |
| 483 | 'px' => [ |
| 484 | 'min' => 0, |
| 485 | 'max' => 500, |
| 486 | 'step' => 1, |
| 487 | ], |
| 488 | '%' => [ |
| 489 | 'min' => 0, |
| 490 | 'max' => 100, |
| 491 | ], |
| 492 | ], |
| 493 | 'selectors' => [ |
| 494 | '{{WRAPPER}} .eael-creative-button' => 'width: {{SIZE}}{{UNIT}};', |
| 495 | ], |
| 496 | ] |
| 497 | ); |
| 498 | |
| 499 | $this->add_group_control( |
| 500 | Group_Control_Typography::get_type(), |
| 501 | [ |
| 502 | 'name' => 'eael_creative_button_typography', |
| 503 | 'global' => [ |
| 504 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 505 | ], |
| 506 | 'selector' => '{{WRAPPER}} .eael-creative-button .cretive-button-text, {{WRAPPER}} .eael-creative-button--winona::after, {{WRAPPER}} .eael-creative-button--rayen::before, {{WRAPPER}} .eael-creative-button--tamaya::after, {{WRAPPER}} .eael-creative-button--tamaya::before', |
| 507 | ] |
| 508 | ); |
| 509 | |
| 510 | $this->add_responsive_control( |
| 511 | 'eael_creative_button_icon_size', |
| 512 | [ |
| 513 | 'label' => esc_html__('Icon Size', 'essential-addons-for-elementor-lite'), |
| 514 | 'type' => Controls_Manager::SLIDER, |
| 515 | 'size_units' => ['px', '%'], |
| 516 | 'default' => [ |
| 517 | 'size' => 30, |
| 518 | 'unit' => 'px', |
| 519 | ], |
| 520 | 'range' => [ |
| 521 | 'px' => [ |
| 522 | 'min' => 0, |
| 523 | 'max' => 500, |
| 524 | 'step' => 1, |
| 525 | ], |
| 526 | '%' => [ |
| 527 | 'min' => 0, |
| 528 | 'max' => 100, |
| 529 | ], |
| 530 | ], |
| 531 | 'selectors' => [ |
| 532 | '{{WRAPPER}} .eael-creative-button i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 533 | '{{WRAPPER}} .eael-creative-button svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 534 | ], |
| 535 | ] |
| 536 | ); |
| 537 | |
| 538 | $this->add_responsive_control( |
| 539 | 'eael_creative_button_padding', |
| 540 | [ |
| 541 | 'label' => esc_html__('Button Padding', 'essential-addons-for-elementor-lite'), |
| 542 | 'type' => Controls_Manager::DIMENSIONS, |
| 543 | 'size_units' => ['px', 'em', '%'], |
| 544 | 'selectors' => [ |
| 545 | '{{WRAPPER}} .eael-creative-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 546 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--winona::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 547 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--winona > .creative-button-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 548 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 549 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 550 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen > .creative-button-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 551 | '{{WRAPPER}} .eael-creative-button.eael-creative-button--saqui::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 552 | ], |
| 553 | ] |
| 554 | ); |
| 555 | } else { |
| 556 | do_action('eael_creative_button_style_pro_controls', $this); |
| 557 | } |
| 558 | |
| 559 | $this->add_group_control( |
| 560 | Group_Control_Box_Shadow::get_type(), |
| 561 | [ |
| 562 | 'name' => 'button_box_shadow', |
| 563 | 'selector' => '{{WRAPPER}} .eael-creative-button', |
| 564 | ] |
| 565 | ); |
| 566 | |
| 567 | $this->end_controls_section(); |
| 568 | } |
| 569 | |
| 570 | protected function render() |
| 571 | { |
| 572 | $settings = $this->get_settings_for_display(); |
| 573 | $icon_migrated = isset($settings['__fa4_migrated']['eael_creative_button_icon_new']); |
| 574 | $icon_is_new = empty($settings['eael_creative_button_icon']); |
| 575 | |
| 576 | $this->add_render_attribute('eael_creative_button', [ |
| 577 | 'class' => ['eael-creative-button', esc_attr($settings['creative_button_effect'])], |
| 578 | ]); |
| 579 | |
| 580 | if ( ! empty( $settings['creative_button_link_url']['url'] ) ) { |
| 581 | $this->add_link_attributes( 'eael_creative_button', $settings['creative_button_link_url'] ); |
| 582 | } |
| 583 | |
| 584 | if ($settings['creative_button_link_url']['is_external']) { |
| 585 | $this->add_render_attribute('eael_creative_button', 'target'); |
| 586 | } |
| 587 | |
| 588 | if ($settings['creative_button_link_url']['nofollow']) { |
| 589 | $this->add_render_attribute('eael_creative_button', 'rel', 'nofollow'); |
| 590 | } |
| 591 | |
| 592 | $this->add_render_attribute('eael_creative_button', 'data-text', esc_attr($settings['creative_button_secondary_text'])); |
| 593 | ?> |
| 594 | <div class="eael-creative-button-wrapper"> |
| 595 | |
| 596 | <a <?php $this->print_render_attribute_string('eael_creative_button'); ?>> |
| 597 | |
| 598 | <?php if ($settings['creative_button_effect'] === 'eael-creative-button--tamaya' ) : ?> |
| 599 | <div class="eael-creative-button--tamaya-secondary eael-creative-button--tamaya-before"><span><?php echo wp_kses( $settings['creative_button_secondary_text'], Helper::eael_allowed_tags() ); ?></span></div> |
| 600 | <?php endif; ?> |
| 601 | |
| 602 | <div class="creative-button-inner"> |
| 603 | |
| 604 | <?php if ($settings['creative_button_effect'] !== 'eael-creative-button--tamaya' && $settings['eael_creative_button_icon_alignment'] == 'left') : ?> |
| 605 | <?php if ($icon_migrated || $icon_is_new) { |
| 606 | echo '<span class="eael-creative-button-icon-left">'; |
| 607 | Icons_Manager::render_icon( $settings['eael_creative_button_icon_new'], [ 'aria-hidden' => 'true' ] ); |
| 608 | echo '</span>'; |
| 609 | } else { ?> |
| 610 | <i class="<?php echo esc_attr($settings['eael_creative_button_icon']); ?> eael-creative-button-icon-left" aria-hidden="true"></i> |
| 611 | <?php } ?> |
| 612 | <?php endif; ?> |
| 613 | |
| 614 | <span class="cretive-button-text"><?php echo wp_kses( $settings['creative_button_text'], Helper::eael_allowed_tags() ); ?></span> |
| 615 | |
| 616 | <?php if ($settings['creative_button_effect'] !== 'eael-creative-button--tamaya' && $settings['eael_creative_button_icon_alignment'] == 'right') : ?> |
| 617 | <?php if ($icon_migrated || $icon_is_new) { |
| 618 | echo '<span class="eael-creative-button-icon-right">'; |
| 619 | Icons_Manager::render_icon( $settings['eael_creative_button_icon_new'], [ 'aria-hidden' => 'true' ] ); |
| 620 | echo '</span>'; |
| 621 | } else { ?> |
| 622 | <i class="<?php echo esc_attr($settings['eael_creative_button_icon']); ?> eael-creative-button-icon-right" aria-hidden="true"></i> |
| 623 | <?php } ?> |
| 624 | <?php endif; ?> |
| 625 | </div> |
| 626 | <?php if ($settings['creative_button_effect'] === 'eael-creative-button--tamaya' ) : ?> |
| 627 | <div class="eael-creative-button--tamaya-secondary eael-creative-button--tamaya-after"><span><?php echo wp_kses( $settings['creative_button_secondary_text'], Helper::eael_allowed_tags() ); ?></span></div> |
| 628 | <?php endif; ?> |
| 629 | </a> |
| 630 | </div> |
| 631 | <?php |
| 632 | |
| 633 | } |
| 634 | } |
| 635 |