Submit
Path:
~
/
home
/
getwphos
/
www
/
twinkletown
/
wp-content
/
plugins
/
wuko-core
/
includes
/
elementor
/
widgets
/
File Content:
wgl-button-widget.php
<?php /** * This template can be overridden by copying it to `yourtheme[-child]/wgl-extensions/elementor/widgets/wgl-button-widget.php`. */ namespace WGL_Extensions\Widgets; defined( 'ABSPATH' ) || exit; // Abort, if called directly. use Elementor\{ Widget_Base, Controls_Manager, Group_Control_Border, Group_Control_Typography, Group_Control_Box_Shadow }; use WGL_Extensions\{ Includes\WGL_Icons, Templates\WGL_Button, Includes\WGL_Cursor }; class WGL_Button_widget extends Widget_Base { public function get_name() { return 'wgl-button'; } public function get_title() { return esc_html__( 'WGL Button', 'wuko-core' ); } public function get_icon() { return 'wgl-button'; } public function get_keywords() { return [ 'button', 'link', 'icon' ]; } public function get_categories() { return [ 'wgl-modules' ]; } protected function register_controls() { /** CONTENT -> GENERAL */ $this->start_controls_section( 'content_general', [ 'label' => esc_html__( 'General', 'wuko-core' ) ] ); $this->add_control( 'text', [ 'label' => esc_html__( 'Text', 'wuko-core' ), 'type' => Controls_Manager::TEXT, 'dynamic' => ['active' => true], 'label_block' => true, 'placeholder' => esc_attr__( 'ex: Read more', 'wuko-core' ), 'default' => esc_html__( 'Read More', 'wuko-core' ), ] ); $this->add_control( 'link', [ 'label' => esc_html__( 'Link', 'wuko-core' ), 'type' => Controls_Manager::URL, 'dynamic' => ['active' => true], 'placeholder' => esc_attr__( 'https://your-link.com', 'wuko-core' ), 'default' => [ 'url' => '#' ], ] ); $this->add_responsive_control( 'alignment', [ 'label' => esc_html__( 'Alignment', 'wuko-core' ), 'type' => Controls_Manager::CHOOSE, 'toggle' => false, 'options' => [ 'left' => [ 'title' => esc_html__('Left', 'wuko-core'), 'icon' => 'eicon-align-start-h', ], 'center' => [ 'title' => esc_html__('Center', 'wuko-core'), 'icon' => 'eicon-align-center-h', ], 'right' => [ 'title' => esc_html__('Right', 'wuko-core'), 'icon' => 'eicon-align-end-h', ], 'space-evenly' => [ 'title' => esc_html__('Space Evenly', 'wuko-core'), 'icon' => 'eicon-justify-space-evenly-h', ], 'space-around' => [ 'title' => esc_html__('Space Around', 'wuko-core'), 'icon' => 'eicon-justify-space-around-h', ], 'space-between' => [ 'title' => esc_html__('Space Between', 'wuko-core'), 'icon' => 'eicon-justify-space-between-h', ], ], 'default' => 'left', 'prefix_class' => 'a%s', 'selectors' => [ '{{WRAPPER}} .button__content' => 'justify-content: {{VALUE}};', ], ] ); $this->add_responsive_control( 'text_alignment', [ 'label' => esc_html__( 'Text Alignment', 'wuko-core' ), 'type' => Controls_Manager::CHOOSE, 'toggle' => false, 'options' => [ 'flex-start; text-align: left' => [ 'title' => esc_html__('Left', 'wuko-core'), 'icon' => 'eicon-text-align-left', ], 'center; text-align: center' => [ 'title' => esc_html__('Center', 'wuko-core'), 'icon' => 'eicon-text-align-center', ], 'flex-end; text-align: right' => [ 'title' => esc_html__('Right', 'wuko-core'), 'icon' => 'eicon-text-align-right', ], ], 'condition' => [ 'alignment!' => ['space-evenly', 'space-around', 'space-between'] ], 'default' => 'center; text-align: center', 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'justify-content: {{VALUE}};', '{{WRAPPER}} .button__text' => 'justify-content: {{VALUE}};', ], ] ); $this->end_controls_section(); $extra_controls[ 'icon_align' ] = [ 'label' => esc_html__( 'Position', 'wuko-core' ), 'type' => Controls_Manager::SELECT, 'condition' => [ 'icon_type!' => '' ], 'options' => [ 'left' => esc_html__( 'Before', 'wuko-core' ), 'right' => esc_html__( 'After', 'wuko-core' ), ], 'default' => 'left', ]; $extra_controls_responsive[ 'icon_indent' ] = [ 'label' => esc_html__( 'Icon Left/Right Offset', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'icon_type!' => '' ], 'size_units' => ['px'], 'range' => [ 'px' => [ 'max' => 100 ], ], 'selectors' => [ '{{WRAPPER}} .wgl-button .button__content' => '--wgl-icon-gap: {{SIZE}}{{UNIT}};', ], ]; $extra_controls_responsive[ 'icon_indent_hover' ] = [ 'label' => esc_html__( 'Icon Left/Right Offset on Hover', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'icon_type!' => '' ], 'size_units' => ['px'], 'range' => [ 'px' => [ 'max' => 100 ], ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus) .button__content' => '--wgl-icon-gap: {{SIZE}}{{UNIT}};', ], ]; $extra_controls_responsive[ 'button_icon_top' ] = [ 'label' => esc_html__('Icon Top Offset', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => ['px', 'em'], 'range' => [ 'px' => ['min' => -50, 'max' => 50], 'em' => ['min' => -5, 'max' => 5], ], 'condition' => [ 'icon_type!' => '' ], 'selectors' => [ '{{WRAPPER}} .wgl-icon, {{WRAPPER}}.has-icon_size_animation .wgl-icon' => '--icon-translate-y: {{SIZE}}{{UNIT}};' ], ]; WGL_Icons::init( $this, [ 'output' => $extra_controls, 'output_responsive' => $extra_controls_responsive, 'section' => true, 'default' => [ 'media_type' => '', 'icon' => [ 'library' => 'fa-solid', 'value' => 'fas fa-circle', ], ], ] ); /** * GENERAL -> CURSOR */ WGL_Cursor::init( $this, [ 'section' => true, ] ); /** STYLE -> GENERAl */ $this->start_controls_section( 'style_general', [ 'label' => esc_html__( 'General', 'wuko-core' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'button_font_family', [ 'label' => esc_html__('Theme Font Family', 'wuko-core'), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__('Default', 'wuko-core'), 'header' => esc_html__('Headings Font', 'wuko-core'), 'content' => esc_html__('Content Font', 'wuko-core'), 'additional' => esc_html__('Additional Font', 'wuko-core'), ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'font-family: var(--wuko-{{VALUE}}-font-family);', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'button_typography', 'selector' => '{{WRAPPER}} .wgl-button', ] ); $this->add_responsive_control( 'button_decoration_line_size', [ 'label' => esc_html__('Decoration Line Size', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_typography_text_decoration' => ['line-through', 'overline', 'underline'] ], 'size_units' => ['px', 'em'], 'range' => [ 'px' => ['min' => 0, 'max' => 20, 'step' => 1], 'em' => ['min' => 0, 'max' => 1, 'step' => 0.1], ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'text-decoration-thickness: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_underline_offset', [ 'label' => esc_html__('Underline Offset Size', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_typography_text_decoration' => 'underline' ], 'size_units' => ['px', 'em'], 'range' => [ 'px' => ['min' => -20, 'max' => 20, 'step' => 1], 'em' => ['min' => -1, 'max' => 1, 'step' => 0.1], ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'text-underline-offset: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_min_width', [ 'label' => esc_html__( 'Min Width', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'vw', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1200 ] ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'min-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_min_height', [ 'label' => esc_html__( 'Min Height', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1200 ] ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'min-height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_margin', [ 'label' => esc_html__( 'Margin', 'wuko-core' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_padding', [ 'label' => esc_html__( 'Padding', 'wuko-core' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'border', 'fields_options' => [ 'width' => [ 'label' => esc_html__( 'Border Width', 'wuko-core' ) ], 'color' => [ 'type' => Controls_Manager::HIDDEN ], ], 'selector' => '{{WRAPPER}} .wgl-button', ] ); $this->add_responsive_control( 'button_radius', [ 'label' => esc_html__( 'Border Radius', 'wuko-core' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--wgl-button-border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'button' ); $this->start_controls_tab( 'button_idle', [ 'label' => esc_html__( 'Idle', 'wuko-core' ) ] ); $this->add_control( 'button_color_idle', [ 'label' => esc_html__( 'Text Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'button_bg_idle', [ 'label' => esc_html__( 'Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'button_decoration_color_idle', [ 'label' => esc_html__('Decoration Line Color', 'wuko-core'), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'button_typography_text_decoration' => ['line-through', 'overline', 'underline'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'text-decoration-color: {{VALUE}};', ], ] ); $this->add_control( 'button_border_color_idle', [ 'label' => esc_html__( 'Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--wgl-border-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_shadow_idle', 'selector' => '{{WRAPPER}} .wgl-button', ] ); $this->add_control( 'button_blur_idle', [ 'label' => esc_html__('Blur', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => ['max' => 30, 'step' => 0.5], ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'backdrop-filter: blur({{SIZE}}px);-webkit-backdrop-filter: blur({{SIZE}}px);', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'button_hover', [ 'label' => esc_html__( 'Hover', 'wuko-core' ) ] ); $this->add_control( 'button_color_hover', [ 'label' => esc_html__( 'Text Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button:is(:hover, :focus)' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'button_bg_hover', [ 'label' => esc_html__( 'Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'button_decoration_color_hover', [ 'label' => esc_html__('Decoration Line Color', 'wuko-core'), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'button_typography_text_decoration' => ['line-through', 'overline', 'underline'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)' => 'text-decoration-color: {{VALUE}};', ], ] ); $this->add_control( 'button_border_color_hover', [ 'label' => esc_html__( 'Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)' => '--wgl-border-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_shadow_hover', 'selector' => '{{WRAPPER}} .wgl-button:is(:hover, :focus)', ] ); $this->add_control( 'button_blur_hover', [ 'label' => esc_html__('Blur', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => ['max' => 30, 'step' => 0.5], ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)' => 'backdrop-filter: blur({{SIZE}}px);-webkit-backdrop-filter: blur({{SIZE}}px);', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'button_active', [ 'label' => esc_html__( 'Active', 'wuko-core' ) ] ); $this->add_control( 'button_color_active', [ 'label' => esc_html__( 'Text Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:active' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'button_bg_active', [ 'label' => esc_html__( 'Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:active' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'button_decoration_color_active', [ 'label' => esc_html__('Decoration Line Color', 'wuko-core'), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'button_typography_text_decoration' => ['line-through', 'overline', 'underline'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active' => 'text-decoration-color: {{VALUE}};', ], ] ); $this->add_control( 'button_border_color_active', [ 'label' => esc_html__( 'Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active' => '--wgl-border-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_shadow_active', 'selector' => '{{WRAPPER}} .wgl-button:active', ] ); $this->add_control( 'button_blur_active', [ 'label' => esc_html__('Blur', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => ['max' => 30, 'step' => 0.5], ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active' => 'backdrop-filter: blur({{SIZE}}px);-webkit-backdrop-filter: blur({{SIZE}}px);', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); /** STYLE -> MEDIA */ $this->start_controls_section( 'style_media', [ 'label' => esc_html__( 'Media (icon/image)', 'wuko-core' ), 'condition' => [ 'icon_type!' => '' ], 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'image_max_width', [ 'label' => esc_html__( 'Max Width', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'icon_type' => 'image' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 768 ], ], 'selectors' => [ '{{WRAPPER}} .wgl-image-box_img img' => 'max-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'media_margin', [ 'label' => esc_html__( 'Margin', 'wuko-core' ), 'type' => Controls_Manager::DIMENSIONS, 'condition' => [ 'icon_type' => 'image' ], 'size_units' => [ 'px', 'em', '%', 'vw', 'custom'], 'selectors' => [ '{{WRAPPER}} .media-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__( 'Icon Size', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'icon_type' => 'font' ], 'size_units' => [ 'px', 'em', 'rem', 'vw', 'custom'], 'range' => [ 'px' => ['min' => 10, 'max' => 200], ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--icon-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_padding', [ 'label' => esc_html__( 'Padding', 'wuko-core' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'condition' => [ 'button_animation_style!' => 'icon_size_animation' ], 'selectors' => [ '{{WRAPPER}} .wgl-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'icon_border_radius', [ 'label' => esc_html__('Border Radius', 'wuko-core'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'custom'], 'selectors' => [ '{{WRAPPER}} .wgl-icon, {{WRAPPER}}.has-icon_size_animation .wgl-icon::before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'icon_border', 'fields_options' => [ 'width' => [ 'label' => esc_html__( 'Border Width', 'wuko-core' ) ], 'color' => [ 'type' => Controls_Manager::HIDDEN ], ], 'selector' => '{{WRAPPER}} .wgl-icon', ] ); $this->start_controls_tabs( 'tabs_icon', [ 'condition' => [ 'icon_type' => 'font' ], ] ); $this->start_controls_tab( 'icon_idle', [ 'label' => esc_html__( 'Idle', 'wuko-core' ) ] ); $this->add_control( 'icon_color_idle', [ 'label' => esc_html__( 'Icon Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-icon' => 'color: {{VALUE}}; fill: {{VALUE}};', ], ] ); $this->add_control( 'icon_bg_color_idle', [ 'label' => esc_html__( 'Icon Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-icon, {{WRAPPER}}.has-icon_size_animation .wgl-icon::before' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'icon_border_color_idle', [ 'label' => esc_html__( 'Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'icon_border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-icon, {{WRAPPER}}.has-icon_size_animation .wgl-icon::before' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'icon_rotation_idle', [ 'label' => esc_html__( 'Rotation', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'icon_type' => 'font' ], 'size_units' => [ 'deg', 'turn' ], 'range' => [ 'deg' => [ 'min' => -360, 'max' => 360 ], ], 'default' => ['unit' => 'deg'], 'tablet_default' => ['unit' => 'deg'], 'mobile_default' => ['unit' => 'deg'], 'selectors' => [ '{{WRAPPER}} .wgl-icon' => '--icon-rotate: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'icon_hover', [ 'label' => esc_html__( 'Hover', 'wuko-core' ) ] ); $this->add_control( 'icon_color_hover', [ 'label' => esc_html__( 'Icon Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus) .wgl-icon' => 'color: {{VALUE}}; fill: {{VALUE}};', ], ] ); $this->add_control( 'icon_bg_color_hover', [ 'label' => esc_html__( 'Icon Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus) .wgl-icon, {{WRAPPER}}.has-icon_size_animation .wgl-button:is(:hover, :focus) .wgl-icon::before' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'icon_border_color_hover', [ 'label' => esc_html__( 'Icon Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'icon_border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus) .wgl-icon, {{WRAPPER}}.has-icon_size_animation .wgl-button:is(:hover, :focus) .wgl-icon::before' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'icon_rotation_hover', [ 'label' => esc_html__( 'Rotation', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'icon_type' => 'font' ], 'size_units' => [ 'deg', 'turn' ], 'range' => [ 'deg' => [ 'min' => -360, 'max' => 360 ], ], 'default' => [ 'unit' => 'deg' ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus) .wgl-icon' => '--icon-rotate: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'icon_active', [ 'label' => esc_html__( 'Active', 'wuko-core' ) ] ); $this->add_control( 'icon_color_active', [ 'label' => esc_html__( 'Icon Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:active .wgl-icon' => 'color: {{VALUE}}; fill: {{VALUE}};', ], ] ); $this->add_control( 'icon_bg_color_active', [ 'label' => esc_html__( 'Icon Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:active .wgl-icon, {{WRAPPER}}.has-icon_size_animation .wgl-button:active .wgl-icon::before' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'icon_border_color_active', [ 'label' => esc_html__( 'Icon Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'icon_border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active .wgl-icon, {{WRAPPER}}.has-icon_size_animation .wgl-button:active .wgl-icon::before' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'icon_rotation_active', [ 'label' => esc_html__( 'Rotation', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'icon_type' => 'font' ], 'size_units' => [ 'deg', 'turn' ], 'range' => [ 'deg' => [ 'min' => -360, 'max' => 360 ], ], 'default' => [ 'unit' => 'deg' ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active .wgl-icon' => '--icon-rotate: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); /** STYLE -> ANIMATION */ $this->start_controls_section( 'style_animation', [ 'label' => esc_html__( 'Button Animation', 'wuko-core' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'button_animation_style', [ 'label' => esc_html__('Animation Style', 'wuko-core'), 'type' => Controls_Manager::SELECT, 'render_type' => 'template', 'options' => [ '' => esc_html__('None', 'wuko-core'), 'letter_animation' => esc_html__('Letter Animation', 'wuko-core'), 'background_gradient' => esc_html__('Background Gradient', 'wuko-core'), 'border_gradient' => esc_html__('Border Gradient', 'wuko-core'), 'separated' => esc_html__('Separated Button', 'wuko-core'), 'highlight_animation' => esc_html__('Highlight Animation', 'wuko-core'), 'bg_animation' => esc_html__('Background Animation ', 'wuko-core'), 'border_animation' => esc_html__('Border Animation', 'wuko-core'), 'magnetic' => esc_html__('Magnetic', 'wuko-core'), 'icon_size_animation' => esc_html__('Icon Size Animation', 'wuko-core'), 'icon_visibility' => esc_html__('Icon Visibility', 'wuko-core'), ], 'prefix_class' => 'has-', ] ); /** Background Gradient Animation */ $this->add_responsive_control( 'background_gradient_location_1', [ 'label' => esc_html__('Primary Color Location', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ '%', 'px' ], 'default' => [ 'unit' => '%', 'size' => 0 ], 'render_type' => 'ui', 'condition' => [ 'button_animation_style' => 'background_gradient', ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--bg-gradient-location-1: {{SIZE}}{{UNIT}}', ], ] ); $this->add_responsive_control( 'background_gradient_location_2', [ 'label' => esc_html__('Secondary Color Location', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ '%', 'px' ], 'default' => [ 'unit' => '%', 'size' => 100 ], 'render_type' => 'ui', 'condition' => [ 'button_animation_style' => 'background_gradient', ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--bg-gradient-location-2: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'background_gradient_type', [ 'label' => esc_html__('Type', 'wuko-core'), 'type' => Controls_Manager::SELECT, 'options' => [ 'linear' => esc_html__( 'Linear', 'wuko-core' ), 'radial' => esc_html__( 'Radial', 'wuko-core' ), ], 'default' => 'linear', 'render_type' => 'ui', 'condition' => [ 'button_animation_style' => 'background_gradient', ], ] ); $this->add_responsive_control( 'background_gradient_angle', [ 'label' => esc_html__('Angle', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'deg' ], 'default' => [ 'unit' => 'deg', 'size' => 90 ], 'range' => [ 'deg' => [ 'step' => 10 ], ], 'condition' => [ 'button_animation_style' => 'background_gradient', 'background_gradient_type' => 'linear', ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'background-color: transparent; background-image: linear-gradient({{SIZE}}{{UNIT}}, var(--wgl-bg-gradient-primary) var(--bg-gradient-location-1), var(--wgl-bg-gradient-secondary) var(--bg-gradient-location-2));', ], ] ); $this->add_responsive_control( 'background_gradient_position', [ 'label' => esc_html__('Position', 'wuko-core'), 'type' => Controls_Manager::SELECT, 'options' => [ 'center center' => esc_html__( 'Center Center', 'wuko-core' ), 'center left' => esc_html__( 'Center Left', 'wuko-core' ), 'center right' => esc_html__( 'Center Right', 'wuko-core' ), 'top center' => esc_html__( 'Top Center', 'wuko-core' ), 'top left' => esc_html__( 'Top Left', 'wuko-core' ), 'top right' => esc_html__( 'Top Right', 'wuko-core' ), 'bottom center' => esc_html__( 'Bottom Center', 'wuko-core' ), 'bottom left' => esc_html__( 'Bottom Left', 'wuko-core' ), 'bottom right' => esc_html__( 'Bottom Right', 'wuko-core' ), 'var(--h-pos) var(--v-pos)' => esc_html__( 'Custom', 'wuko-core' ), ], 'default' => 'center center', 'condition' => [ 'button_animation_style' => 'background_gradient', 'background_gradient_type' => 'radial', ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => 'background-color: transparent; background-image: radial-gradient(circle at {{VALUE}}, var(--wgl-bg-gradient-primary) var(--bg-gradient-location-1), var(--wgl-bg-gradient-secondary) var(--bg-gradient-location-2));', ], ] ); $this->add_responsive_control( 'background_gradient_h_position', [ 'label' => esc_html__('Horizontal Position', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'vw', 'custom'], 'range' => [ 'px' => [ 'min' => -2560, 'max' => 2560 ], '%' => [ 'min' => -100, 'max' => 200 ], 'vw' => [ 'min' => -100, 'max' => 100 ], ], 'condition' => [ 'button_animation_style' => 'background_gradient', 'background_gradient_type' => 'radial', 'background_gradient_position' => 'var(--h-pos) var(--v-pos)', ], 'default' => [ 'size' => 50, 'unit' => '%' ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--h-pos: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'background_gradient_v_position', [ 'label' => esc_html__('Vertical Position', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'vw', 'custom'], 'range' => [ 'px' => [ 'min' => -2560, 'max' => 2560 ], '%' => [ 'min' => -100, 'max' => 200 ], 'vw' => [ 'min' => -100, 'max' => 100 ], ], 'condition' => [ 'button_animation_style' => 'background_gradient', 'background_gradient_type' => 'radial', 'background_gradient_position' => 'var(--h-pos) var(--v-pos)', ], 'default' => [ 'size' => 100, 'unit' => '%' ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--v-pos: {{SIZE}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'gradient_background_tabs', [ 'condition' => [ 'button_animation_style' => 'background_gradient' ] ]); $this->start_controls_tab( 'gradient_background_tab_idle', [ 'label' => esc_html__( 'Idle', 'wuko-core' ) ]); $this->add_control( 'gradient_background_primary_idle', [ 'label' => esc_html__( 'Gradient Color Primary', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'default' => '#5A76F7', 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--wgl-bg-gradient-primary: {{VALUE}};', ], ] ); $this->add_control( 'gradient_background_secondary_idle', [ 'label' => esc_html__( 'Gradient Color Secondary', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'default' => '#A96FF3', 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--wgl-bg-gradient-secondary: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'gradient_background_tab_hover', [ 'label' => esc_html__( 'Hover', 'wuko-core' ) ]); $this->add_control( 'gradient_background_primary_hover', [ 'label' => esc_html__( 'Primary BG Gradient Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'default' => '#A96FF3', 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)' => '--wgl-bg-gradient-primary: {{VALUE}};', ], ] ); $this->add_control( 'gradient_background_secondary_hover', [ 'label' => esc_html__( 'Secondary BG Gradient Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'default' => '#5A76F7', 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)' => '--wgl-bg-gradient-secondary: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'gradient_background_tab_active', [ 'label' => esc_html__( 'Active', 'wuko-core' ) ]); $this->add_control( 'gradient_background_primary_active', [ 'label' => esc_html__( 'Primary BG Gradient Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:active' => '--wgl-bg-gradient-primary: {{VALUE}};', ], ] ); $this->add_control( 'gradient_background_secondary_active', [ 'label' => esc_html__( 'Secondary BG Gradient Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:active' => '--wgl-bg-gradient-secondary: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); /** Border Gradient Animation */ $this->add_responsive_control( 'gradient_border_width', [ 'label' => esc_html__( 'Border Width', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'vw', 'custom'], 'condition' => [ 'button_animation_style' => 'border_gradient' ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--wgl-mask-border: {{SIZE}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'gradient_border_tabs', [ 'condition' => [ 'button_animation_style' => 'border_gradient' ] ] ); $this->start_controls_tab( 'gradient_border_tab_idle', [ 'label' => esc_html__( 'Idle', 'wuko-core' ) ] ); $this->add_control( 'gradient_border_color_primary_idle', [ 'label' => esc_html__( 'Gradient Color Primary', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => '--wgl-border-gradient-primary: {{VALUE}};', ], ] ); $this->add_control( 'gradient_border_color_secondary_idle', [ 'label' => esc_html__( 'Gradient Color Secondary', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => '--wgl-border-gradient-secondary: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'gradient_border_tab_hover', [ 'label' => esc_html__( 'Hover', 'wuko-core' ) ] ); $this->add_control( 'gradient_border_color_primary_hover', [ 'label' => esc_html__( 'Gradient Color Primary', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus, :active)::after' => '--wgl-border-gradient-primary: {{VALUE}};', ], ] ); $this->add_control( 'gradient_border_color_secondary_hover', [ 'label' => esc_html__( 'Gradient Color Secondary', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus, :active)::after' => '--wgl-border-gradient-secondary: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); /** Separated Button Animation */ $this->add_responsive_control( 'icon_wrapper_size', [ 'label' => esc_html__( 'Icon Wrapper Size', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'vw', 'custom'], 'condition' => [ 'button_animation_style' => 'separated' ], 'selectors' => [ '{{WRAPPER}} .wgl-button' => '--wgl-icon-wrapper: {{SIZE}}{{UNIT}};', ], ] ); /** Highlight Animation */ $this->add_control( 'stroke_highlight_color_normal', [ 'label' => esc_html__( 'Stroke Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'highlight_animation' ], 'selectors' => [ '{{WRAPPER}} .highlight_svg path' => 'stroke: {{VALUE}};', ], ] ); $this->add_responsive_control( 'stroke_highlight_width_normal', [ 'label' => esc_html__( 'Stroke Width', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'vw', 'custom'], 'condition' => [ 'button_animation_style' => 'highlight_animation' ], 'range' => [ 'px' => [ 'min' => 0.1, 'max' => 10 ], ], 'selectors' => [ '{{WRAPPER}} .highlight_svg path' => 'stroke-width: {{SIZE}}{{UNIT}};', ], ] ); /** Background Animation */ $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'button_bg_border', 'fields_options' => [ 'width' => [ 'label' => esc_html__( 'Border Width', 'wuko-core' ) ], 'color' => [ 'type' => Controls_Manager::HIDDEN ], ], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'selector' => '{{WRAPPER}} .wgl-button::after', ] ); $this->add_control( 'button_bg_z_index', [ 'label' => esc_html__( 'Z-Index', 'wuko-core' ), 'type' => Controls_Manager::NUMBER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'step' => 1, 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => 'z-index: {{VALUE}}', ], ] ); $this->start_controls_tabs( 'button_animation', [ 'condition' => [ 'button_animation_style' => 'bg_animation' ], ] ); $this->start_controls_tab( 'button_animation_idle', [ 'label' => esc_html__( 'Idle', 'wuko-core' ) ] ); $this->add_responsive_control( 'button_bg_x_pos_idle', [ 'label' => esc_html__( 'Horizontal Position', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => -200, 'max' => 200 ], '%' => ['min' => -100,'max' => 100], ], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => '--pos-x: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_bg_y_pos_idle', [ 'label' => esc_html__( 'Vertical Position', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => -200, 'max' => 200 ], '%' => ['min' => -100,'max' => 100], ], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => '--pos-y:{{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_bg_size_w', [ 'label' => esc_html__('Background Size - Width', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200 ], '%' => [ 'min' => 0, 'max' => 100 ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => 'width: {{SIZE}}{{UNIT}};', ] ] ); $this->add_responsive_control( 'button_bg_size_h', [ 'label' => esc_html__('Background Size - Height', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200 ], '%' => [ 'min' => 0, 'max' => 100 ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => 'height: {{SIZE}}{{UNIT}};', ] ] ); $this->add_control( 'button_bg_border_radius', [ 'label' => esc_html__('Border Radius', 'wuko-core'), 'type' => Controls_Manager::DIMENSIONS, 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => ['px', '%', 'custom'], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'button_bg_bg_idle', [ 'label' => esc_html__( 'Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'button_bg_border_color_idle', [ 'label' => esc_html__( 'Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation', 'button_bg_border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button::after' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'button_animation_hover', [ 'label' => esc_html__( 'Hover', 'wuko-core' ) ] ); $this->add_responsive_control( 'button_bg_x_pos_hover', [ 'label' => esc_html__( 'Horizontal Position', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => -200, 'max' => 200 ], '%' => ['min' => -100,'max' => 100], ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)::after' => '--pos-x: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_bg_y_pos_hover', [ 'label' => esc_html__( 'Vertical Position', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => -200, 'max' => 200 ], '%' => ['min' => -100,'max' => 100], ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)::after' => '--pos-y:{{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_bg_size_w_hover', [ 'label' => esc_html__('Background Size - Width', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'custom' ], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'render_type' => 'template', 'range' => [ 'px' => [ 'min' => 0, 'max' => 2000 ], '%' => [ 'min' => 0, 'max' => 100 ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)::after' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_bg_size_h_hover', [ 'label' => esc_html__('Background Size - Height', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'custom' ], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'render_type' => 'template', 'range' => [ 'px' => [ 'min' => 0, 'max' => 2000 ], '%' => [ 'min' => 0, 'max' => 100 ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)::after' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'button_bg_border_radius_hover', [ 'label' => esc_html__('Border Radius', 'wuko-core'), 'type' => Controls_Manager::DIMENSIONS, 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => ['px', '%', 'custom'], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)::after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'button_bg_bg_hover', [ 'label' => esc_html__( 'Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)::after' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'button_bg_border_color_hover', [ 'label' => esc_html__( 'Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation', 'button_bg_border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button:is(:hover, :focus)::after' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'button_animation_active', [ 'label' => esc_html__( 'Active', 'wuko-core' ) ] ); $this->add_responsive_control( 'button_bg_x_pos_active', [ 'label' => esc_html__( 'Horizontal Position', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => -200, 'max' => 200 ], '%' => ['min' => -100,'max' => 100], ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active::after' => '--pos-x: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_bg_y_pos_active', [ 'label' => esc_html__( 'Vertical Position', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => -200, 'max' => 200 ], '%' => ['min' => -100,'max' => 100], ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active::after' => '--pos-y:{{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_bg_size_w_active', [ 'label' => esc_html__('Background Size - Width', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200 ], '%' => [ 'min' => 0, 'max' => 100 ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active::after' => 'width: {{SIZE}}{{UNIT}};', ] ] ); $this->add_responsive_control( 'button_bg_size_h_active', [ 'label' => esc_html__('Background Size - Height', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200 ], '%' => [ 'min' => 0, 'max' => 100 ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active::after' => 'height: {{SIZE}}{{UNIT}};', ] ] ); $this->add_control( 'button_bg_border_radius_active', [ 'label' => esc_html__('Border Radius', 'wuko-core'), 'type' => Controls_Manager::DIMENSIONS, 'condition' => [ 'button_animation_style' => 'bg_animation' ], 'size_units' => ['px', '%', 'custom'], 'selectors' => [ '{{WRAPPER}} .wgl-button:active::after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'button_bg_bg_active', [ 'label' => esc_html__( 'Background Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'selectors' => [ '{{WRAPPER}} .wgl-button:active::after' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'button_bg_border_color_active', [ 'label' => esc_html__( 'Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'bg_animation', 'button_bg_border_border!' => ['', 'none'] ], 'selectors' => [ '{{WRAPPER}} .wgl-button:active::after' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); /** Border Animation */ $this->add_control( 'button_border_animation_revers', [ 'label' => esc_html__( 'Revers This Animation', 'wuko-core' ), 'type' => Controls_Manager::SWITCHER, 'return_value' => 'revers', 'prefix_class' => '', 'condition' => [ 'button_animation_style' => 'border_animation' ], ] ); $this->add_control( 'button_border_animation_color', [ 'label' => esc_html__( 'Animation Border Color', 'wuko-core' ), 'type' => Controls_Manager::COLOR, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'border_animation' ], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button' => '--ab-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'button_border_animation_offset', [ 'label' => esc_html__('Animation Offset', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => ['px'], 'range' => [ 'px' => ['min' => 1, 'max' => 20, 'step' => 1], ], 'condition' => [ 'button_animation_style' => 'border_animation' ], 'default' => ['size' => 6], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button' => '--ab-offset: {{SIZE}};', ], ] ); $this->add_responsive_control( 'button_border_animation_width', [ 'label' => esc_html__('Animation Border Width', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => ['px'], 'range' => [ 'px' => ['min' => 1, 'max' => 10, 'step' => 1], ], 'condition' => [ 'button_animation_style' => 'border_animation' ], 'default' => ['size' => 1], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button' => '--ab-width: {{SIZE}};', ], ] ); $this->add_responsive_control( 'button_border_animation_extend', [ 'label' => esc_html__('Mow Much to Extend the Border', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => ['px'], 'range' => [ 'px' => ['min' => 1, 'max' => 50, 'step' => 1], ], 'condition' => [ 'button_animation_style' => 'border_animation' ], 'default' => ['size' => 4], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button' => '--ab-extend: {{SIZE}};', ], ] ); /** Magnetic Threshold */ $this->add_control( 'button_magnetic_threshold', [ 'label' => esc_html__('Magnetic Threshold', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'render_type' => 'template', 'style_transfer' => true, 'size_units' => ['px'], 'range' => [ 'px' => ['min' => 10, 'max' => 1920, 'step' => 1], ], 'condition' => [ 'button_animation_style' => 'magnetic' ], 'default' => ['size' => 500], ] ); $this->add_control( 'button_magnetic_strong', [ 'label' => esc_html__('Magnetic Strong', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'render_type' => 'template', 'style_transfer' => true, 'size_units' => ['px'], 'range' => [ 'px' => ['min' => 0.05, 'max' => 1, 'step' => 0.05], ], 'condition' => [ 'button_animation_style' => 'magnetic' ], 'default' => ['size' => 0.2], ] ); /** Icon Size Animation */ $this->add_control( 'button_icon_bg_animation', [ 'label' => esc_html__( 'Background Size(px)', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'condition' => [ 'button_animation_style' => 'icon_size_animation' ], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1 ] ], 'default' => ['size' => 40, 'unit' => 'px'], 'selectors' => [ '{{WRAPPER}} .wgl-button .wgl-icon' => '--icon-bg-size: {{SIZE}};', ], ] ); $this->start_controls_tabs( 'button_icon_size_animation_tabs', [ 'condition' => [ 'button_animation_style' => 'icon_size_animation' ], ] ); $this->start_controls_tab( 'button_icon_size_animation_tab_idle', [ 'label' => esc_html__( 'Idle', 'wuko-core' ) ] ); $this->add_control( 'button_icon_size_animation_idle', [ 'label' => esc_html__( 'Icon Scale', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .wgl-button .wgl-icon' => '--icon-scale: {{SIZE}};', ], ] ); $this->add_control( 'button_icon_bg_animation_idle', [ 'label' => esc_html__( 'Background Scale', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .wgl-button .wgl-icon' => '--icon-bg-scale: {{SIZE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'button_icon_size_animation_tab_item_hover', [ 'label' => esc_html__( 'Item Hover', 'wuko-core' ) ] ); $this->add_control( 'button_icon_size_animation_item_hover', [ 'label' => esc_html__( 'Icon Scale', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container:hover .wgl-button .wgl-icon' => '--icon-scale: {{SIZE}};', ], ] ); $this->add_control( 'button_icon_bg_animation_item_hover', [ 'label' => esc_html__( 'Background Scale', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container:hover .wgl-button .wgl-icon' => '--icon-bg-scale: {{SIZE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'button_icon_size_animation_tab_hover', [ 'label' => esc_html__( 'Hover', 'wuko-core' ) ] ); $this->add_control( 'button_icon_size_animation_hover', [ 'label' => esc_html__( 'Icon Scale', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button:is(:hover, :focus) .wgl-icon' => '--icon-scale: {{SIZE}};', ], ] ); $this->add_control( 'button_icon_bg_animation_hover', [ 'label' => esc_html__( 'Background Scale', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button:is(:hover, :focus) .wgl-icon' => '--icon-bg-scale: {{SIZE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'button_icon_size_animation_tab_active', [ 'label' => esc_html__( 'Active', 'wuko-core' ) ] ); $this->add_control( 'button_icon_size_animation_active', [ 'label' => esc_html__( 'Icon Scale', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button:active .wgl-icon' => '--icon-scale: {{SIZE}};', ], ] ); $this->add_control( 'button_icon_bg_animation_active', [ 'label' => esc_html__( 'Background Scale', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container .wgl-button:active .wgl-icon' => '--icon-bg-scale: {{SIZE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); /** Icon Visibility */ $this->add_control( 'icon_visibility', [ 'label' => esc_html__( 'Icon Visibility', 'wuko-core' ), 'type' => Controls_Manager::SELECT, 'condition' => [ 'button_animation_style' => 'icon_visibility' ], 'options' => [ 'default' => esc_html__( 'Default', 'wuko-core' ), 'revert' => esc_html__( 'Revert', 'wuko-core' ), ], 'default' => 'default', 'prefix_class' => 'icon-visibility-' ] ); $this->add_control( 'fluid_animation', [ 'label' => esc_html__( 'WGL fluid animation effect with click', 'wuko-core' ), 'type' => Controls_Manager::SWITCHER, 'description' => esc_html__('Works only with fluid animation.', 'wuko-core'), 'label_on' => esc_html__('On', 'wuko-core'), 'label_off' => esc_html__('Off', 'wuko-core'), 'return_value' => 'fluid', 'separator' => 'before', 'prefix_class' => 'animation_', ] ); $this->end_controls_section(); } protected function render() { ( new WGL_Button() )->render( $this, $this->get_settings_for_display() ); } public function wpml_support_module() { add_filter( 'wpml_elementor_widgets_to_translate', [ $this, 'wpml_widgets_to_translate_filter' ] ); } public function wpml_widgets_to_translate_filter( $widgets ) { return \WGL_Extensions\Includes\WGL_WPML_Settings::get_translate( $this, $widgets ); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
wgl-accordion-service.php
110791 bytes
0644
wgl-background-clip-text.php
21249 bytes
0644
wgl-blog.php
54012 bytes
0644
wgl-button-physics.php
48634 bytes
0644
wgl-button-widget.php
78290 bytes
0644
wgl-carousel.php
5648 bytes
0644
wgl-cases.php
174614 bytes
0644
wgl-circuit-service.php
21621 bytes
0644
wgl-clients.php
28542 bytes
0644
wgl-combo-menu.php
17440 bytes
0644
wgl-contact-form-7.php
64476 bytes
0644
wgl-countdown.php
19442 bytes
0644
wgl-counter.php
36515 bytes
0644
wgl-demo-item.php
33716 bytes
0644
wgl-double-heading.php
71788 bytes
0644
wgl-dynamic-title.php
11086 bytes
0644
wgl-flipbox.php
154999 bytes
0644
wgl-gallery.php
53821 bytes
0644
wgl-highlight-board.php
64418 bytes
0644
wgl-horizontal-scroll.php
25075 bytes
0644
wgl-image-animate.php
20947 bytes
0644
wgl-image-comparison.php
6032 bytes
0644
wgl-image-hotspots.php
52892 bytes
0644
wgl-image-layers.php
25243 bytes
0644
wgl-infinity-carousel.php
30821 bytes
0644
wgl-info-box.php
224793 bytes
0644
wgl-instagram.php
38631 bytes
0644
wgl-link-overlay.php
2495 bytes
0644
wgl-pie-chart.php
22332 bytes
0644
wgl-portfolio.php
115147 bytes
0644
wgl-pricing-table.php
209138 bytes
0644
wgl-products-categories.php
51718 bytes
0644
wgl-products-grid.php
79654 bytes
0644
wgl-progress-bar.php
30822 bytes
0644
wgl-rotated-text.php
22605 bytes
0644
wgl-satellite-service.php
35978 bytes
0644
wgl-showcase.php
208669 bytes
0644
wgl-social-icons.php
22240 bytes
0644
wgl-steps.php
48391 bytes
0644
wgl-striped-services.php
183259 bytes
0644
wgl-tabs-horizontal.php
42144 bytes
0644
wgl-tabs.php
53431 bytes
0644
wgl-team.php
36456 bytes
0644
wgl-template.php
8246 bytes
0644
wgl-testimonials.php
61375 bytes
0644
wgl-text-editor.php
55551 bytes
0644
wgl-text-path.php
41438 bytes
0644
wgl-time-line-horizontal.php
37694 bytes
0644
wgl-time-line-vertical.php
199396 bytes
0644
wgl-toggle-accordion.php
66819 bytes
0644
wgl-video-popup.php
30956 bytes
0644
wgl-working-hours.php
10870 bytes
0644
wgl-zoom.php
24854 bytes
0644
N4ST4R_ID | Naxtarrr