| 1 |
<?php |
| 2 |
/** |
| 3 |
* Main ProductDescription class. |
| 4 |
* |
| 5 |
* @package RadiusTheme\SB |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace RadiusTheme\SB\Elementor\Widgets\Controls; |
| 9 |
|
| 10 |
// Do not allow directly accessing this file. |
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit( 'This script cannot be accessed directly.' ); |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Product Description class |
| 17 |
*/ |
| 18 |
class ButtonSettings { |
| 19 |
|
| 20 |
/** |
| 21 |
* Widget Field |
| 22 |
* |
| 23 |
* @return array |
| 24 |
*/ |
| 25 |
public static function style_settings( $widget ) { |
| 26 |
|
| 27 |
$fields = [ |
| 28 |
'button_section_start' => [ |
| 29 |
'mode' => 'section_start', |
| 30 |
'label' => esc_html__( 'Button', 'shopbuilder' ), |
| 31 |
'tab' => 'style', |
| 32 |
], |
| 33 |
'button_typography' => [ |
| 34 |
'mode' => 'group', |
| 35 |
'type' => 'typography', |
| 36 |
'label' => esc_html__( 'Typography', 'shopbuilder' ), |
| 37 |
'selector' => $widget->selectors['button_typography'], |
| 38 |
], |
| 39 |
'button_height' => [ |
| 40 |
'label' => esc_html__( 'Height', 'shopbuilder' ), |
| 41 |
'type' => 'slider', |
| 42 |
'range' => [ |
| 43 |
'px' => [ |
| 44 |
'min' => 10, |
| 45 |
'max' => 200, |
| 46 |
], |
| 47 |
], |
| 48 |
'selectors' => [ |
| 49 |
$widget->selectors['button_height'] => 'height: {{SIZE}}{{UNIT}};', |
| 50 |
], |
| 51 |
], |
| 52 |
|
| 53 |
'button_width' => [ |
| 54 |
'label' => esc_html__( 'Width', 'shopbuilder' ), |
| 55 |
'size_units' => [ 'px', '%' ], |
| 56 |
'mode' => 'responsive', |
| 57 |
'type' => 'slider', |
| 58 |
'range' => [ |
| 59 |
'px' => [ |
| 60 |
'min' => 10, |
| 61 |
'max' => 900, |
| 62 |
], |
| 63 |
'%' => [ |
| 64 |
'min' => 0, |
| 65 |
'max' => 100, |
| 66 |
], |
| 67 |
], |
| 68 |
'selectors' => [ |
| 69 |
$widget->selectors['button_width'] => 'width: {{SIZE}}{{UNIT}};', |
| 70 |
], |
| 71 |
], |
| 72 |
|
| 73 |
'button_tabs_start' => [ |
| 74 |
'mode' => 'tabs_start', |
| 75 |
], |
| 76 |
'button_normal' => [ |
| 77 |
'mode' => 'tab_start', |
| 78 |
'label' => esc_html__( 'Normal', 'shopbuilder' ), |
| 79 |
], |
| 80 |
'button_text_color_normal' => [ |
| 81 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 82 |
'type' => 'color', |
| 83 |
|
| 84 |
'separator' => 'default', |
| 85 |
'selectors' => [ |
| 86 |
$widget->selectors['button_text_color_normal'] => 'color: {{VALUE}}!important;', |
| 87 |
], |
| 88 |
], |
| 89 |
'button_bg_color_normal' => [ |
| 90 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 91 |
'type' => 'color', |
| 92 |
|
| 93 |
'selectors' => [ |
| 94 |
$widget->selectors['button_bg_color_normal'] => 'background-color: {{VALUE}} !important;', |
| 95 |
], |
| 96 |
], |
| 97 |
|
| 98 |
'button_border' => [ |
| 99 |
'mode' => 'group', |
| 100 |
'type' => 'border', |
| 101 |
'selector' => $widget->selectors['button_border'], |
| 102 |
'size_units' => [ 'px' ], |
| 103 |
], |
| 104 |
'button_normal_end' => [ |
| 105 |
'mode' => 'tab_end', |
| 106 |
], |
| 107 |
'button_hover' => [ |
| 108 |
'mode' => 'tab_start', |
| 109 |
'label' => esc_html__( 'Hover', 'shopbuilder' ), |
| 110 |
], |
| 111 |
'button_text_color_hover' => [ |
| 112 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 113 |
'type' => 'color', |
| 114 |
|
| 115 |
'separator' => 'default', |
| 116 |
'selectors' => [ |
| 117 |
$widget->selectors['button_text_color_hover'] => 'color: {{VALUE}}!important;', |
| 118 |
], |
| 119 |
], |
| 120 |
'button_bg_color_hover' => [ |
| 121 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 122 |
'type' => 'color', |
| 123 |
|
| 124 |
'selectors' => [ |
| 125 |
$widget->selectors['button_bg_color_hover'] => 'background-color: {{VALUE}} !important;', |
| 126 |
], |
| 127 |
], |
| 128 |
'button_border_hover_color' => [ |
| 129 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 130 |
'type' => 'color', |
| 131 |
|
| 132 |
'selectors' => [ |
| 133 |
$widget->selectors['button_border_hover_color'] => 'border-color: {{VALUE}};', |
| 134 |
], |
| 135 |
], |
| 136 |
'button_hover_end' => [ |
| 137 |
'mode' => 'tab_end', |
| 138 |
], |
| 139 |
'button_tabs_end' => [ |
| 140 |
'mode' => 'tabs_end', |
| 141 |
], |
| 142 |
'button_border_radius' => [ |
| 143 |
'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ), |
| 144 |
'type' => 'dimensions', |
| 145 |
'default' => [ |
| 146 |
'top' => '5', |
| 147 |
'right' => '5', |
| 148 |
'bottom' => '5', |
| 149 |
'left' => '5', |
| 150 |
'unit' => 'px', |
| 151 |
'isLinked' => true, |
| 152 |
], |
| 153 |
'size_units' => [ 'px' ], |
| 154 |
'separator' => 'before', |
| 155 |
'selectors' => [ |
| 156 |
$widget->selectors['button_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 157 |
], |
| 158 |
], |
| 159 |
'button_padding' => [ |
| 160 |
'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), |
| 161 |
'type' => 'dimensions', |
| 162 |
'mode' => 'responsive', |
| 163 |
'size_units' => [ 'px' ], |
| 164 |
'selectors' => [ |
| 165 |
$widget->selectors['button_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 166 |
], |
| 167 |
'separator' => 'before', |
| 168 |
], |
| 169 |
|
| 170 |
'button_margin' => [ |
| 171 |
'label' => esc_html__( 'Margin (px)', 'shopbuilder' ), |
| 172 |
'type' => 'dimensions', |
| 173 |
'mode' => 'responsive', |
| 174 |
'size_units' => [ 'px' ], |
| 175 |
'selectors' => [ |
| 176 |
$widget->selectors['button_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 177 |
], |
| 178 |
], |
| 179 |
'button_section_end' => [ |
| 180 |
'mode' => 'section_end', |
| 181 |
], |
| 182 |
]; |
| 183 |
return $fields; |
| 184 |
} |
| 185 |
} |
| 186 |
|