assets
1 week ago
nav-styles
4 years ago
extend-controls-pro.php
3 years ago
extend-controls.php
1 week ago
init.php
2 years ago
extend-controls-pro.php
264 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Elementor; |
| 4 | |
| 5 | use \ElementsKit_Lite\Modules\Onepage_Scroll\Init; |
| 6 | |
| 7 | class ElementsKit_Pro_Extend_Onepage_Scroll { |
| 8 | public function __construct() { |
| 9 | /** |
| 10 | * Pro Page Controls |
| 11 | */ |
| 12 | add_action( 'elementor/element/wp-page/ekit_page_settings/before_section_end', array( $this, 'pro_page_controls' ) ); |
| 13 | |
| 14 | /** |
| 15 | * Pro Section Controls |
| 16 | */ |
| 17 | add_action( 'elementor/element/section/ekit_onepagescroll_section/before_section_end', array( $this, 'pro_section_controls' ) ); |
| 18 | |
| 19 | /** |
| 20 | * Flexbox Container Support |
| 21 | */ |
| 22 | add_action( 'elementor/element/container/ekit_onepagescroll_section/before_section_end', array( $this, 'pro_section_controls' ) ); |
| 23 | } |
| 24 | |
| 25 | |
| 26 | /** |
| 27 | * Pro Page Controls |
| 28 | */ |
| 29 | public function pro_page_controls( Controls_Stack $element ) { |
| 30 | $element->add_control( |
| 31 | 'ekit_onepagescroll_heading', |
| 32 | array( |
| 33 | 'label' => __( 'Onepage Scroll Settings', 'elementskit-lite' ), |
| 34 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 35 | 'separator' => 'before', |
| 36 | 'condition' => array( |
| 37 | 'ekit_onepagescroll' => 'block', |
| 38 | ), |
| 39 | ) |
| 40 | ); |
| 41 | |
| 42 | $element->add_control( |
| 43 | 'ekit_onepagescroll_nav', |
| 44 | array( |
| 45 | 'label' => esc_html__( 'Navigation Style', 'elementskit-lite' ), |
| 46 | 'type' => Controls_Manager::SELECT, |
| 47 | 'default' => '0', |
| 48 | 'groups' => array( |
| 49 | '0' => esc_html__( 'None', 'elementskit-lite' ), |
| 50 | array( |
| 51 | 'label' => esc_html__( 'Circle', 'elementskit-lite' ), |
| 52 | 'options' => array( |
| 53 | 'circle-scale-up' => esc_html__( 'Scale Up', 'elementskit-lite' ), |
| 54 | 'circle-fill-in' => esc_html__( 'Fill In', 'elementskit-lite' ), |
| 55 | 'circle-fill-out' => esc_html__( 'Fill Out', 'elementskit-lite' ), |
| 56 | 'circle-stroke' => esc_html__( 'Stroke', 'elementskit-lite' ), |
| 57 | 'circle-stroke-dot' => esc_html__( 'Stroke Dot', 'elementskit-lite' ), |
| 58 | 'circle-stroke-simple' => esc_html__( 'Stroke Simple', 'elementskit-lite' ), |
| 59 | 'circle-dot-move' => esc_html__( 'Dot Move', 'elementskit-lite' ), |
| 60 | 'circle-timeline' => esc_html__( 'Timeline', 'elementskit-lite' ), |
| 61 | ), |
| 62 | ), |
| 63 | array( |
| 64 | 'label' => esc_html__( 'Square', 'elementskit-lite' ), |
| 65 | 'options' => array( |
| 66 | 'square-scale-up' => esc_html__( 'Scale Up', 'elementskit-lite' ), |
| 67 | ), |
| 68 | ), |
| 69 | array( |
| 70 | 'label' => esc_html__( 'Line', 'elementskit-lite' ), |
| 71 | 'options' => array( |
| 72 | 'line-grow' => esc_html__( 'Line Grow', 'elementskit-lite' ), |
| 73 | 'line-shrink' => esc_html__( 'Line Shrink', 'elementskit-lite' ), |
| 74 | 'line-fill' => esc_html__( 'Line Fill', 'elementskit-lite' ), |
| 75 | 'line-move' => esc_html__( 'Line Move', 'elementskit-lite' ), |
| 76 | ), |
| 77 | ), |
| 78 | 'icon' => esc_html__( 'Custom Icon', 'elementskit-lite' ), |
| 79 | ), |
| 80 | 'frontend_available' => true, |
| 81 | 'condition' => array( |
| 82 | 'ekit_onepagescroll' => 'block', |
| 83 | ), |
| 84 | ) |
| 85 | ); |
| 86 | |
| 87 | $element->add_control( |
| 88 | 'ekit_onepagescroll_nav_icon', |
| 89 | array( |
| 90 | 'label' => esc_html__( 'Navigation Icon', 'elementskit-lite' ), |
| 91 | 'type' => Controls_Manager::ICONS, |
| 92 | 'default' => array( |
| 93 | 'value' => 'fas fa-circle', |
| 94 | 'library' => 'solid', |
| 95 | ), |
| 96 | 'frontend_available' => true, |
| 97 | 'condition' => array( |
| 98 | 'ekit_onepagescroll' => 'block', |
| 99 | 'ekit_onepagescroll_nav' => 'icon', |
| 100 | ), |
| 101 | ) |
| 102 | ); |
| 103 | |
| 104 | $element->add_control( |
| 105 | 'ekit_onepagescroll_nav_pos', |
| 106 | array( |
| 107 | 'label' => esc_html__( 'Navigation Position', 'elementskit-lite' ), |
| 108 | 'type' => Controls_Manager::CHOOSE, |
| 109 | 'default' => 'right', |
| 110 | 'options' => array( |
| 111 | 'top' => array( |
| 112 | 'title' => esc_html__( 'Top', 'elementskit-lite' ), |
| 113 | 'icon' => 'fa fa-angle-up', |
| 114 | ), |
| 115 | 'bottom' => array( |
| 116 | 'title' => esc_html__( 'Bottom', 'elementskit-lite' ), |
| 117 | 'icon' => 'fa fa-angle-down', |
| 118 | ), |
| 119 | 'left' => array( |
| 120 | 'title' => esc_html__( 'Left', 'elementskit-lite' ), |
| 121 | 'icon' => 'fa fa-angle-left', |
| 122 | ), |
| 123 | 'right' => array( |
| 124 | 'title' => esc_html__( 'Right', 'elementskit-lite' ), |
| 125 | 'icon' => 'fa fa-angle-right', |
| 126 | ), |
| 127 | ), |
| 128 | 'toggle' => false, |
| 129 | 'frontend_available' => true, |
| 130 | 'condition' => array( |
| 131 | 'ekit_onepagescroll' => 'block', |
| 132 | 'ekit_onepagescroll_nav!' => '0', |
| 133 | ), |
| 134 | ) |
| 135 | ); |
| 136 | |
| 137 | $element->add_control( |
| 138 | 'ekit_onepagescroll_nav_pos_offset', |
| 139 | array( |
| 140 | 'label' => esc_html__( 'Navigation Position Offset', 'elementskit-lite' ), |
| 141 | 'type' => Controls_Manager::SLIDER, |
| 142 | 'size_units' => array( 'px', '%' ), |
| 143 | 'range' => array( |
| 144 | 'px' => array( |
| 145 | 'min' => 0, |
| 146 | 'max' => 1000, |
| 147 | 'step' => 10, |
| 148 | ), |
| 149 | '%' => array( |
| 150 | 'min' => 0, |
| 151 | 'max' => 100, |
| 152 | ), |
| 153 | ), |
| 154 | 'default' => array( |
| 155 | 'unit' => '%', |
| 156 | 'size' => '50', |
| 157 | ), |
| 158 | 'condition' => array( |
| 159 | 'ekit_onepagescroll' => 'block', |
| 160 | 'ekit_onepagescroll_nav!' => '0', |
| 161 | ), |
| 162 | 'selectors' => array( |
| 163 | '.onepage_scroll_nav.met-top, .onepage_scroll_nav.met-bottom' => 'left: {{SIZE}}{{UNIT}};', |
| 164 | '.onepage_scroll_nav.met-left, .onepage_scroll_nav.met-right' => 'top: {{SIZE}}{{UNIT}};', |
| 165 | ), |
| 166 | ) |
| 167 | ); |
| 168 | |
| 169 | $element->add_control( |
| 170 | 'ekit_onepagescroll_nav_spacing', |
| 171 | array( |
| 172 | 'label' => esc_html__( 'Navigation Spacing', 'elementskit-lite' ), |
| 173 | 'type' => Controls_Manager::SLIDER, |
| 174 | 'size_units' => array( 'px', '%' ), |
| 175 | 'default' => array( |
| 176 | 'unit' => 'px', |
| 177 | 'size' => '20', |
| 178 | ), |
| 179 | 'condition' => array( |
| 180 | 'ekit_onepagescroll' => 'block', |
| 181 | 'ekit_onepagescroll_nav!' => '0', |
| 182 | ), |
| 183 | 'selectors' => array( |
| 184 | '.onepage_scroll_nav:not(.met-top):not(.met-bottom) li:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 185 | '.onepage_scroll_nav:not(.met-left):not(.met-right) li:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 186 | |
| 187 | '.onepage_scroll_nav.nav-style-circle-timeline:not(.met-top):not(.met-bottom) li:before' => 'height: calc({{SIZE}}{{UNIT}} - 1px)', |
| 188 | '.onepage_scroll_nav.nav-style-circle-timeline:not(.met-left):not(.met-right) li:before' => 'width: calc({{SIZE}}{{UNIT}} - 1px)', |
| 189 | ), |
| 190 | ) |
| 191 | ); |
| 192 | |
| 193 | $element->add_control( |
| 194 | 'ekit_onepagescroll_nav_color', |
| 195 | array( |
| 196 | 'label' => esc_html__( 'Navigation Color', 'elementskit-lite' ), |
| 197 | 'type' => Controls_Manager::COLOR, |
| 198 | 'default' => '#111', |
| 199 | 'condition' => array( |
| 200 | 'ekit_onepagescroll' => 'block', |
| 201 | 'ekit_onepagescroll_nav!' => '0', |
| 202 | ), |
| 203 | 'selectors' => array( |
| 204 | /** |
| 205 | * .editor:met_color |
| 206 | */ |
| 207 | '.onepage_scroll_nav .editor\:met_color' => 'color: {{VALUE}};', |
| 208 | |
| 209 | /** |
| 210 | * .editor:met_bgc |
| 211 | * .editor:before:met_bgc |
| 212 | */ |
| 213 | '.onepage_scroll_nav .editor\:met_bgc, .onepage_scroll_nav .editor\:before\:met_bgc:before' => 'background-color: {{VALUE}};', |
| 214 | |
| 215 | /** |
| 216 | * .editor:met_bdc |
| 217 | * .editor:active:met_bdc |
| 218 | */ |
| 219 | '.onepage_scroll_nav .editor\:met_bdc, .onepage_scroll_nav .active > .editor\:active\:met_bdc' => 'border-color: {{VALUE}};', |
| 220 | ), |
| 221 | ) |
| 222 | ); |
| 223 | |
| 224 | $element->add_group_control( |
| 225 | \Elementor\Group_Control_Typography::get_type(), |
| 226 | array( |
| 227 | 'name' => 'ekit_onepagescroll_nav_tooltip_font', |
| 228 | 'label' => esc_html__( 'Tooltip Typography', 'elementskit-lite' ), |
| 229 | 'selector' => '.onepage_scroll_nav .nav_tooltip', |
| 230 | 'condition' => array( |
| 231 | 'ekit_onepagescroll' => 'block', |
| 232 | 'ekit_onepagescroll_nav!' => '0', |
| 233 | ), |
| 234 | ) |
| 235 | ); |
| 236 | } |
| 237 | |
| 238 | |
| 239 | /** |
| 240 | * Pro Section Controls |
| 241 | */ |
| 242 | public function pro_section_controls( $element ) { |
| 243 | $element->add_control( |
| 244 | 'ekit_has_onepagescroll_dot', |
| 245 | array( |
| 246 | 'label' => esc_html__( 'Enable Dot', 'elementskit-lite' ), |
| 247 | 'type' => Controls_Manager::SWITCHER, |
| 248 | 'frontend_available' => true, |
| 249 | 'default' => 'yes', |
| 250 | 'render_type' => 'none', |
| 251 | ) |
| 252 | ); |
| 253 | $element->add_control( |
| 254 | 'ekit_onepagescroll_tooltip_text', |
| 255 | array( |
| 256 | 'label' => esc_html__( 'Tooltip Text', 'elementskit-lite' ), |
| 257 | 'type' => Controls_Manager::TEXT, |
| 258 | 'frontend_available' => true, |
| 259 | 'render_type' => 'none', |
| 260 | ) |
| 261 | ); |
| 262 | } |
| 263 | } |
| 264 |