templates
1 year ago
Accordion.php
1 year ago
Alerts_Box.php
1 year ago
Before_after.php
1 year ago
Blog_Grid.php
1 year ago
Cheat_Sheet.php
1 year ago
Counter.php
1 year ago
Icon_Box.php
1 year ago
Integrations.php
1 year ago
List_Item.php
1 year ago
Tabs.php
1 year ago
Team_Carousel.php
1 year ago
Testimonial.php
1 year ago
Timeline.php
1 year ago
Video_Playlist.php
1 year ago
Video_Popup.php
1 year ago
Cheat_Sheet.php
1024 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Use namespace to avoid conflict |
| 4 | */ |
| 5 | |
| 6 | namespace SPEL\Widgets; |
| 7 | |
| 8 | use Elementor\Group_Control_Border; |
| 9 | use Elementor\Group_Control_Box_Shadow; |
| 10 | use Elementor\Repeater; |
| 11 | use Elementor\Widget_Base; |
| 12 | use Elementor\Controls_Manager; |
| 13 | use Elementor\Group_Control_Typography; |
| 14 | |
| 15 | // Exit if accessed directly |
| 16 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | exit; |
| 18 | } |
| 19 | |
| 20 | |
| 21 | /** |
| 22 | * Class Alerts_box |
| 23 | * |
| 24 | * @package spider\Widgets |
| 25 | * @since 1.0.0 |
| 26 | */ |
| 27 | class Cheat_Sheet extends Widget_Base { |
| 28 | |
| 29 | public function get_name() { |
| 30 | return 'docly_cheatsheet'; // ID of the widget (Don't change this name) |
| 31 | } |
| 32 | |
| 33 | public function get_title() { |
| 34 | return esc_html__( 'SE Cheat Sheet', 'spider-elements' ); |
| 35 | } |
| 36 | |
| 37 | public function get_icon() { |
| 38 | return 'eicon-apps spel-icon'; |
| 39 | } |
| 40 | |
| 41 | public function get_keywords() { |
| 42 | return [ 'spider', 'spider elements', 'toggle' ]; |
| 43 | } |
| 44 | |
| 45 | public function get_categories() { |
| 46 | return [ 'spider-elements' ]; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Name: get_style_depends() |
| 51 | * Desc: Register the required CSS dependencies for the frontend. |
| 52 | */ |
| 53 | public function get_style_depends() { |
| 54 | return [ 'spel-main' ]; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Name: get_script_depends() |
| 59 | * Desc: Register the required JS dependencies for the frontend. |
| 60 | */ |
| 61 | public function get_script_depends() { |
| 62 | return [ 'spel-el-widgets' ]; |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Name: register_controls() |
| 67 | * Desc: Register controls for these widgets |
| 68 | * Params: no params |
| 69 | * Return: @void |
| 70 | * Since: @1.0.0 |
| 71 | * Package: @spider-elements |
| 72 | * Author: spider-themes |
| 73 | */ |
| 74 | protected function register_controls() { |
| 75 | $this->elementor_content_control(); |
| 76 | $this->elementor_style_control(); |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Name: elementor_content_control() |
| 81 | * Desc: Register the Content Tab output on the Elementor editor. |
| 82 | * Params: no params |
| 83 | * Return: @void |
| 84 | * Since: @1.0.0 |
| 85 | * Package: @spider-elements |
| 86 | * Author: spider-themes |
| 87 | */ |
| 88 | public function elementor_content_control() { |
| 89 | |
| 90 | //==================== Select Preset Skin ====================// |
| 91 | $this->start_controls_section( |
| 92 | 'sheet_counter_preset', [ |
| 93 | 'label' => esc_html__( 'Preset Skin', 'spider-elements' ), |
| 94 | ] |
| 95 | ); |
| 96 | |
| 97 | $this->add_control( |
| 98 | 'style', [ |
| 99 | 'label' => esc_html__( 'Skin', 'spider-elements' ), |
| 100 | 'type' => Controls_Manager::CHOOSE, |
| 101 | 'options' => [ |
| 102 | '1' => [ |
| 103 | 'title' => esc_html__( 'Style 01', 'spider-elements' ), |
| 104 | 'icon' => 'cheat_sheet_1', |
| 105 | ], |
| 106 | '2' => [ |
| 107 | 'title' => esc_html__( 'Style 02', 'spider-elements' ), |
| 108 | 'icon' => 'cheat_sheet_2', |
| 109 | ], |
| 110 | '3' => [ |
| 111 | 'title' => esc_html__( 'Style 03', 'spider-elements' ), |
| 112 | 'icon' => 'cheat_sheet_3', |
| 113 | ], |
| 114 | ], |
| 115 | 'toggle' => false, |
| 116 | 'default' => '1', |
| 117 | ] |
| 118 | ); |
| 119 | |
| 120 | $this->end_controls_section(); // End Preset Skin |
| 121 | |
| 122 | //======================== Cheat Sheet Section =========================// |
| 123 | $this->start_controls_section( |
| 124 | 'cheat_sheet_sec', [ |
| 125 | 'label' => esc_html__( 'Cheat Sheet', 'spider-elements' ), |
| 126 | ] |
| 127 | ); |
| 128 | |
| 129 | $this->add_control( |
| 130 | 'enable_cheat_sheet_title', [ |
| 131 | 'label' => esc_html__( 'Show Accordion', 'spider-elements' ), |
| 132 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 133 | 'label_on' => esc_html__( 'Yes', 'spider-elements' ), |
| 134 | 'label_off' => esc_html__( 'No', 'spider-elements' ), |
| 135 | 'return_value' => 'yes', |
| 136 | 'default' => 'yes', |
| 137 | ] |
| 138 | ); |
| 139 | |
| 140 | $this->add_control( |
| 141 | 'cheat_sheet_title', [ |
| 142 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 143 | 'type' => Controls_Manager::TEXT, |
| 144 | 'label_block' => true, |
| 145 | 'default' => esc_html__( 'Auxiliary', 'spider-elements' ), |
| 146 | 'condition' => [ |
| 147 | 'enable_cheat_sheet_title' => 'yes', |
| 148 | ], |
| 149 | ] |
| 150 | ); |
| 151 | |
| 152 | $repeater = new Repeater(); |
| 153 | |
| 154 | $repeater->add_control( |
| 155 | 'cs_title', [ |
| 156 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 157 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 158 | 'default' => esc_html__( 'be', 'spider-elements' ), |
| 159 | ] |
| 160 | ); |
| 161 | |
| 162 | $repeater->add_control( |
| 163 | 'cs_content', [ |
| 164 | 'label' => esc_html__( 'Content', 'spider-elements' ), |
| 165 | 'type' => Controls_Manager::TEXTAREA, |
| 166 | 'default' => esc_html__( 'Sein', 'spider-elements' ), |
| 167 | ] |
| 168 | ); |
| 169 | |
| 170 | $repeater->add_control( |
| 171 | 'image', [ |
| 172 | 'label' => esc_html__( 'Image', 'spider-elements' ), |
| 173 | 'type' => \Elementor\Controls_Manager::MEDIA, |
| 174 | 'media_types' => ['image', 'svg'], |
| 175 | 'description' => 'Applicable only for Style 3.', |
| 176 | ] |
| 177 | ); |
| 178 | |
| 179 | $repeater->add_control( |
| 180 | 'text_color', [ |
| 181 | 'label' => esc_html__( 'Title Color', 'spider-elements' ), |
| 182 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 183 | 'description' => 'This will only work for Style 2 and 3', |
| 184 | 'selectors' => [ |
| 185 | '{{WRAPPER}} {{CURRENT_ITEM}} .info-box-heading' => 'color: {{VALUE}}', |
| 186 | '{{WRAPPER}} {{CURRENT_ITEM}} .cs-outline3 .cs3-title' => 'color: {{VALUE}}', |
| 187 | ], |
| 188 | 'separator' => 'before', |
| 189 | ] |
| 190 | ); |
| 191 | |
| 192 | $repeater->add_control( |
| 193 | 'number_color1', [ |
| 194 | 'label' => esc_html__( 'Number Color', 'spider-elements' ), |
| 195 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 196 | 'description' => 'This will only work for Style 2 and 3', |
| 197 | 'selectors' => [ |
| 198 | '{{WRAPPER}} {{CURRENT_ITEM}} .number-circle' => 'color: {{VALUE}}', |
| 199 | '{{WRAPPER}} {{CURRENT_ITEM}} .cs-outline3 .serial-number' => 'color: {{VALUE}}', |
| 200 | ], |
| 201 | ] |
| 202 | ); |
| 203 | |
| 204 | $repeater->add_control( |
| 205 | 'num_bg_color', [ |
| 206 | 'label' => esc_html__( 'Number Background', 'spider-elements' ), |
| 207 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 208 | 'description' => 'This will only work for Style 2', |
| 209 | 'selectors' => [ |
| 210 | '{{WRAPPER}} {{CURRENT_ITEM}} .info-box-number' => 'background: {{VALUE}}', |
| 211 | '{{WRAPPER}} {{CURRENT_ITEM}} .outline:before' => 'background: {{VALUE}}', |
| 212 | ], |
| 213 | ] |
| 214 | ); |
| 215 | |
| 216 | $this->add_control( |
| 217 | 'cheat_sheet_contents', [ |
| 218 | 'label' => esc_html__( 'Cheat Sheet List', 'spider-elements' ), |
| 219 | 'type' => Controls_Manager::REPEATER, |
| 220 | 'fields' => $repeater->get_controls(), |
| 221 | 'title_field' => '{{{ cs_title }}}', |
| 222 | 'default' => [ |
| 223 | [ |
| 224 | 'cs_title' => esc_html__( 'be', 'spider-elements' ), |
| 225 | 'cs_content' => esc_html__( 'sein', 'spider-elements' ), |
| 226 | ], |
| 227 | [ |
| 228 | 'cs_title' => esc_html__( 'have', 'spider-elements' ), |
| 229 | 'cs_content' => esc_html__( 'haben', 'spider-elements' ), |
| 230 | ], |
| 231 | [ |
| 232 | 'cs_title' => esc_html__( 'become', 'spider-elements' ), |
| 233 | 'cs_content' => esc_html__( 'werden', 'spider-elements' ), |
| 234 | ], |
| 235 | [ |
| 236 | 'cs_title' => esc_html__( 'can', 'spider-elements' ), |
| 237 | 'cs_content' => esc_html__( 'konnen', 'spider-elements' ), |
| 238 | ], |
| 239 | ], |
| 240 | 'prevent_empty' => false |
| 241 | ] |
| 242 | ); |
| 243 | |
| 244 | $this->add_control( |
| 245 | 'column_grid', [ |
| 246 | 'label' => esc_html__( 'Column', 'spider-elements' ), |
| 247 | 'type' => Controls_Manager::SELECT, |
| 248 | 'options' => [ |
| 249 | '6' => esc_html__( 'Two Column', 'spider-elements' ), |
| 250 | '4' => esc_html__( 'Three Column', 'spider-elements' ), |
| 251 | '3' => esc_html__( 'Four Column', 'spider-elements' ), |
| 252 | '2' => esc_html__( 'Six Column', 'spider-elements' ), |
| 253 | ], |
| 254 | 'default' => '3', |
| 255 | 'condition' => [ |
| 256 | 'style' => '1' |
| 257 | ], |
| 258 | ] |
| 259 | ); |
| 260 | |
| 261 | $this->add_control( |
| 262 | 'column_grid2', [ |
| 263 | 'label' => esc_html__( 'Column', 'spider-elements' ), |
| 264 | 'type' => Controls_Manager::SELECT, |
| 265 | 'options' => [ |
| 266 | '6' => esc_html__( 'Two Column', 'spider-elements' ), |
| 267 | '4' => esc_html__( 'Three Column', 'spider-elements' ), |
| 268 | '3' => esc_html__( 'Four Column', 'spider-elements' ), |
| 269 | '2' => esc_html__( 'Six Column', 'spider-elements' ), |
| 270 | ], |
| 271 | 'default' => '6', |
| 272 | 'condition' => [ |
| 273 | 'style' => '2' |
| 274 | ], |
| 275 | ] |
| 276 | ); |
| 277 | |
| 278 | $this->add_control( |
| 279 | 'column_grid3', [ |
| 280 | 'label' => esc_html__( 'Column', 'spider-elements' ), |
| 281 | 'type' => Controls_Manager::SELECT, |
| 282 | 'options' => [ |
| 283 | '12' => esc_html__( 'One Column', 'spider-elements' ), |
| 284 | '6' => esc_html__( 'Two Column', 'spider-elements' ), |
| 285 | '4' => esc_html__( 'Three Column', 'spider-elements' ), |
| 286 | '3' => esc_html__( 'Four Column', 'spider-elements' ), |
| 287 | '2' => esc_html__( 'Six Column', 'spider-elements' ), |
| 288 | ], |
| 289 | 'default' => '4', |
| 290 | 'condition' => [ |
| 291 | 'style' => '3' |
| 292 | ], |
| 293 | ] |
| 294 | ); |
| 295 | |
| 296 | $this->add_control( |
| 297 | 'collapse_state', [ |
| 298 | 'label' => esc_html__( 'Extended Collapse', 'spider-elements' ), |
| 299 | 'type' => Controls_Manager::SWITCHER, |
| 300 | 'label_on' => esc_html__( 'Yes', 'spider-elements' ), |
| 301 | 'label_off' => esc_html__( 'No', 'spider-elements' ), |
| 302 | 'return_value' => 'yes', |
| 303 | 'default' => 'yes', // Default 'yes' so that it's ON by default |
| 304 | 'separator' => 'before' |
| 305 | ] |
| 306 | ); |
| 307 | |
| 308 | $this->end_controls_section(); // End Cheat Sheet Section |
| 309 | |
| 310 | } |
| 311 | |
| 312 | /** |
| 313 | * Name: elementor_style_control() |
| 314 | * Desc: Register the Style Tab output on the Elementor editor. |
| 315 | * Params: no params |
| 316 | * Return: @void |
| 317 | * Since: @1.0.0 |
| 318 | * Package: @spider-elements |
| 319 | * Author: spider-themes |
| 320 | */ |
| 321 | public function elementor_style_control() { |
| 322 | |
| 323 | //========================= Item Box Background ==========================// |
| 324 | $this->start_controls_section( |
| 325 | 'sec_bg_style', [ |
| 326 | 'label' => esc_html__( 'Sheet Items', 'spider-elements' ), |
| 327 | 'tab' => Controls_Manager::TAB_STYLE, |
| 328 | ] |
| 329 | ); |
| 330 | |
| 331 | $this->start_controls_tabs( |
| 332 | 'sheet_style_tabs' |
| 333 | ); |
| 334 | |
| 335 | $this->start_controls_tab( |
| 336 | 'sheet_normal_tab', |
| 337 | [ |
| 338 | 'label' => esc_html__( 'Normal', 'spider-elements' ), |
| 339 | ] |
| 340 | ); |
| 341 | |
| 342 | $this->add_group_control( |
| 343 | \Elementor\Group_Control_Background::get_type(), |
| 344 | [ |
| 345 | 'name' => 'background', |
| 346 | 'types' => [ 'classic', 'gradient' ], |
| 347 | 'selector' => '{{WRAPPER}} .cheat-info-box, |
| 348 | {{WRAPPER}} .cheatsheet_item, |
| 349 | {{WRAPPER}} .cs-items3', |
| 350 | ] |
| 351 | ); |
| 352 | |
| 353 | $this->add_group_control( |
| 354 | Group_Control_Border::Get_type(), [ |
| 355 | 'name' => 'item_box_border', |
| 356 | 'selector' => '{{WRAPPER}} .cheatsheet_item, |
| 357 | {{WRAPPER}} .cheat-info-box, |
| 358 | {{WRAPPER}} .cs-items3', |
| 359 | ] |
| 360 | ); |
| 361 | |
| 362 | $this->add_responsive_control( |
| 363 | 'border-radius', [ |
| 364 | 'label' => esc_html__( 'Border Radius', 'spider-elements' ), |
| 365 | 'type' => Controls_Manager::DIMENSIONS, |
| 366 | 'size_units' => [ 'px', '%' ], |
| 367 | 'selectors' => [ |
| 368 | '{{WRAPPER}} .cheatsheet_item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 369 | '{{WRAPPER}} .cheat-info-box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 370 | '{{WRAPPER}} .cs-items3' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 371 | ], |
| 372 | ] |
| 373 | ); |
| 374 | |
| 375 | $this->add_group_control( |
| 376 | Group_Control_Box_Shadow::get_type(), [ |
| 377 | 'name' => 'box_shadow', |
| 378 | 'selector' => '{{WRAPPER}} .cheat-info-box, |
| 379 | {{WRAPPER}} .cheatsheet_item, |
| 380 | {{WRAPPER}} .cs-items3', |
| 381 | ] |
| 382 | ); |
| 383 | |
| 384 | $this->end_controls_tab(); |
| 385 | |
| 386 | $this->start_controls_tab( |
| 387 | 'sheet_hover_tab', |
| 388 | [ |
| 389 | 'label' => esc_html__( 'Hover', 'spider-elements' ), |
| 390 | ] |
| 391 | ); |
| 392 | |
| 393 | $this->add_control( |
| 394 | 'title-hover-color', |
| 395 | [ |
| 396 | 'label' => esc_html__( 'Title Color', 'spider-elements' ), |
| 397 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 398 | 'selectors' => [ |
| 399 | '{{WRAPPER}} .cheat-info-box:hover .info-box-heading' => 'color: {{VALUE}}', |
| 400 | '{{WRAPPER}} .cheatsheet_item:hover h5' => 'color: {{VALUE}}', |
| 401 | '{{WRAPPER}} .cs-items3:hover .cs3-title' => 'color: {{VALUE}}', |
| 402 | ], |
| 403 | ] |
| 404 | ); |
| 405 | |
| 406 | $this->add_control( |
| 407 | 'desc-hover-color', |
| 408 | [ |
| 409 | 'label' => esc_html__( 'Description Color', 'spider-elements' ), |
| 410 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 411 | 'selectors' => [ |
| 412 | '{{WRAPPER}} .cheat-info-box:hover .info-box-description' => 'color: {{VALUE}}', |
| 413 | '{{WRAPPER}} .cheatsheet_item:hover p' => 'color: {{VALUE}}', |
| 414 | '{{WRAPPER}} .cs-items3:hover .cs-info-desc' => 'color: {{VALUE}}', |
| 415 | ], |
| 416 | ] |
| 417 | ); |
| 418 | |
| 419 | $this->add_control( |
| 420 | 'number-hover-color', |
| 421 | [ |
| 422 | 'label' => esc_html__( 'Number color', 'spider-elements' ), |
| 423 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 424 | 'selectors' => [ |
| 425 | '{{WRAPPER}} .cheatsheet_item:hover .cheatsheet_num' => 'color: {{VALUE}}', |
| 426 | '{{WRAPPER}} .cs-items3:hover .serial-number' => 'color: {{VALUE}}', |
| 427 | ], |
| 428 | 'condition' => [ |
| 429 | 'style' => ['1', '3'] |
| 430 | ] |
| 431 | ] |
| 432 | ); |
| 433 | |
| 434 | $this->add_control( |
| 435 | 'outline_hover_color', |
| 436 | [ |
| 437 | 'label' => esc_html__( 'Outline Color', 'spider-elements' ), |
| 438 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 439 | 'selectors' => [ |
| 440 | '{{WRAPPER}} .cs-items3:hover .cs-outline3:before' => 'background-color: {{VALUE}}', |
| 441 | ], |
| 442 | ] |
| 443 | ); |
| 444 | |
| 445 | $this->add_control( |
| 446 | 'border-color', |
| 447 | [ |
| 448 | 'label' => esc_html__( 'Border Color', 'spider-elements' ), |
| 449 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 450 | 'selectors' => [ |
| 451 | '{{WRAPPER}} .cheat-info-box:hover' => 'border-color: {{VALUE}}', |
| 452 | '{{WRAPPER}} .cheatsheet_item:hover' => 'border-color: {{VALUE}}', |
| 453 | '{{WRAPPER}} .cs-items3:hover' => 'border-color: {{VALUE}}', |
| 454 | ], |
| 455 | ] |
| 456 | ); |
| 457 | |
| 458 | $this->add_group_control( |
| 459 | \Elementor\Group_Control_Background::get_type(), |
| 460 | [ |
| 461 | 'name' => 'background-hover', |
| 462 | 'types' => [ 'classic', 'gradient' ], |
| 463 | 'selector' => '{{WRAPPER}} .cheat-info-box:hover, |
| 464 | {{WRAPPER}} .cheatsheet_item:hover, |
| 465 | {{WRAPPER}} .cs-items3:hover', |
| 466 | ] |
| 467 | ); |
| 468 | |
| 469 | $this->add_group_control( |
| 470 | Group_Control_Box_Shadow::get_type(), [ |
| 471 | 'name' => 'box_hover_shadow', |
| 472 | 'selector' => '{{WRAPPER}} .cheat-info-box:hover, |
| 473 | {{WRAPPER}} .cheatsheet_item:hover, |
| 474 | {{WRAPPER}} .cs-items3:hover', |
| 475 | ] |
| 476 | ); |
| 477 | |
| 478 | $this->end_controls_tab(); |
| 479 | |
| 480 | $this->end_controls_tabs(); |
| 481 | |
| 482 | $this->add_responsive_control( |
| 483 | 'item_box_padding', [ |
| 484 | 'label' => esc_html__( 'Padding', 'spider-elements' ), |
| 485 | 'type' => Controls_Manager::DIMENSIONS, |
| 486 | 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], |
| 487 | 'selectors' => [ |
| 488 | '{{WRAPPER}} .cheatsheet_item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 489 | '{{WRAPPER}} .cheat-info-box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 490 | '{{WRAPPER}} .cs-items3' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 491 | ], |
| 492 | 'separator' => 'before', |
| 493 | ] |
| 494 | ); |
| 495 | |
| 496 | $this->add_responsive_control( |
| 497 | 'grid_item_gap', |
| 498 | [ |
| 499 | 'label' => esc_html__( 'Grid Gap', 'spider-elements' ), |
| 500 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 501 | 'description' => esc_html__( 'Set the gap between the items.', 'spider-elements' ), |
| 502 | 'separator' => 'before', |
| 503 | 'range' => [ |
| 504 | 'px' => [ |
| 505 | 'min' => 0, |
| 506 | 'max' => 100, |
| 507 | ], |
| 508 | ], |
| 509 | 'default' => [ |
| 510 | 'size' => 20, |
| 511 | ], |
| 512 | 'selectors' => [ |
| 513 | '{{WRAPPER}} .sheet_items_gap' => 'grid-gap: {{SIZE}}{{UNIT}} !important; display: grid;', |
| 514 | '{{WRAPPER}} .cs-items3-gap' => 'grid-gap: {{SIZE}}{{UNIT}} !important; display: grid;', |
| 515 | ], |
| 516 | ] |
| 517 | ); |
| 518 | |
| 519 | $this->add_responsive_control( |
| 520 | 'number-text-gap', |
| 521 | [ |
| 522 | 'label' => esc_html__( 'Number Gap', 'spider-elements' ), |
| 523 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 524 | 'description' => esc_html__( 'Set the gap between the number and the text.', 'spider-elements' ), |
| 525 | 'range' => [ |
| 526 | 'px' => [ |
| 527 | 'min' => 0, |
| 528 | 'max' => 200, |
| 529 | 'step' => 1, |
| 530 | ], |
| 531 | ], |
| 532 | 'selectors' => [ |
| 533 | '{{WRAPPER}} .cheat-info-box' => 'gap: {{SIZE}}{{UNIT}};', |
| 534 | ], |
| 535 | 'condition' => [ |
| 536 | 'style' => '2' |
| 537 | ] |
| 538 | ] |
| 539 | ); |
| 540 | |
| 541 | $this->end_controls_section(); // End Item Box Background |
| 542 | |
| 543 | //================================ Cheat Sheet Item ================================// |
| 544 | $this->start_controls_section( |
| 545 | 'style_cs_item', [ |
| 546 | 'label' => esc_html__( 'Contents', 'spider-elements' ), |
| 547 | 'tab' => Controls_Manager::TAB_STYLE, |
| 548 | 'condition' => [ |
| 549 | 'style' => '1' |
| 550 | ] |
| 551 | ] |
| 552 | ); |
| 553 | |
| 554 | $this->add_control( |
| 555 | 'title_options', [ |
| 556 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 557 | 'type' => Controls_Manager::HEADING, |
| 558 | ] |
| 559 | ); |
| 560 | |
| 561 | //Title options// |
| 562 | $this->add_control( |
| 563 | 'cheat_sheet_title_color', [ |
| 564 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 565 | 'type' => Controls_Manager::COLOR, |
| 566 | 'selectors' => [ |
| 567 | '{{WRAPPER}} .cheatsheet_accordion .card .card-header button' => 'color: {{VALUE}};', |
| 568 | ], |
| 569 | ] |
| 570 | ); |
| 571 | |
| 572 | $this->add_group_control( |
| 573 | Group_Control_Typography::get_type(), [ |
| 574 | 'name' => 'cheat_sheet_title_typo', |
| 575 | 'selector' => '{{WRAPPER}} .cheatsheet_accordion .card .card-header button', |
| 576 | ] |
| 577 | ); |
| 578 | |
| 579 | //=== Number Options |
| 580 | $this->add_control( |
| 581 | 'cs_num_options', [ |
| 582 | 'label' => esc_html__( 'Number', 'spider-elements' ), |
| 583 | 'type' => Controls_Manager::HEADING, |
| 584 | 'separator' => 'before', |
| 585 | ] |
| 586 | ); |
| 587 | |
| 588 | $this->add_control( |
| 589 | 'cs_item_num_color', [ |
| 590 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 591 | 'type' => Controls_Manager::COLOR, |
| 592 | 'selectors' => [ |
| 593 | '{{WRAPPER}} .cheatsheet_item .cheatsheet_num' => 'color: {{VALUE}};', |
| 594 | ], |
| 595 | ] |
| 596 | ); |
| 597 | |
| 598 | $this->add_group_control( |
| 599 | Group_Control_Typography::get_type(), [ |
| 600 | 'name' => 'cs_item_num_typo', |
| 601 | 'selector' => '{{WRAPPER}} .cheatsheet_item .cheatsheet_num', |
| 602 | ] |
| 603 | ); // End Number Options |
| 604 | |
| 605 | |
| 606 | //=== Top Text Options |
| 607 | $this->add_control( |
| 608 | 'cs_top_text_options', [ |
| 609 | 'label' => esc_html__( 'Top Text', 'spider-elements' ), |
| 610 | 'type' => Controls_Manager::HEADING, |
| 611 | 'separator' => 'before', |
| 612 | ] |
| 613 | ); |
| 614 | |
| 615 | $this->add_control( |
| 616 | 'cs_item_top_color', [ |
| 617 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 618 | 'type' => Controls_Manager::COLOR, |
| 619 | 'selectors' => [ |
| 620 | '{{WRAPPER}} .cheatsheet_item p' => 'color: {{VALUE}};', |
| 621 | ], |
| 622 | ] |
| 623 | ); |
| 624 | |
| 625 | $this->add_group_control( |
| 626 | Group_Control_Typography::get_type(), [ |
| 627 | 'name' => 'cs_item_top_typo', |
| 628 | 'selector' => '{{WRAPPER}} .cheatsheet_item p', |
| 629 | ] |
| 630 | ); // End Top Text Options |
| 631 | |
| 632 | |
| 633 | //=== Bottom Text Options |
| 634 | $this->add_control( |
| 635 | 'cs_bottom_text_options', [ |
| 636 | 'label' => esc_html__( 'Bottom Text', 'spider-elements' ), |
| 637 | 'type' => Controls_Manager::HEADING, |
| 638 | 'separator' => 'before', |
| 639 | ] |
| 640 | ); |
| 641 | |
| 642 | $this->add_control( |
| 643 | 'cs_item_bottom_color', [ |
| 644 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 645 | 'type' => Controls_Manager::COLOR, |
| 646 | 'selectors' => [ |
| 647 | '{{WRAPPER}} .cheatsheet_item h5' => 'color: {{VALUE}};', |
| 648 | ], |
| 649 | ] |
| 650 | ); |
| 651 | |
| 652 | $this->add_group_control( |
| 653 | Group_Control_Typography::get_type(), [ |
| 654 | 'name' => 'cs_item_bottom_typo', |
| 655 | 'selector' => '{{WRAPPER}} .cheatsheet_item h5', |
| 656 | ] |
| 657 | ); // End Bottom Text Options |
| 658 | |
| 659 | $this->end_controls_section(); // End Cheat Sheet Item |
| 660 | |
| 661 | |
| 662 | //======================== Cheat Sheet Item 2 =========================// |
| 663 | $this->start_controls_section( |
| 664 | 'style_cs_item2', [ |
| 665 | 'label' => esc_html__( 'Contents', 'spider-elements' ), |
| 666 | 'tab' => Controls_Manager::TAB_STYLE, |
| 667 | 'condition' => [ |
| 668 | 'style' => ['2', '3'] |
| 669 | ] |
| 670 | ] |
| 671 | ); |
| 672 | |
| 673 | $this->add_control( |
| 674 | 'title_options2', [ |
| 675 | 'label' => esc_html__( 'Accordion Title', 'spider-elements' ), |
| 676 | 'type' => Controls_Manager::HEADING, |
| 677 | ] |
| 678 | ); |
| 679 | |
| 680 | //Title options// |
| 681 | $this->add_control( |
| 682 | 'sheet_title_color', [ |
| 683 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 684 | 'type' => Controls_Manager::COLOR, |
| 685 | 'selectors' => [ |
| 686 | '{{WRAPPER}} .cheatsheet_accordion .card .card-header button' => 'color: {{VALUE}};', |
| 687 | ], |
| 688 | ] |
| 689 | ); |
| 690 | |
| 691 | $this->add_group_control( |
| 692 | Group_Control_Typography::get_type(), [ |
| 693 | 'name' => 'sheet_title_typo', |
| 694 | 'selector' => '{{WRAPPER}} .cheatsheet_accordion .card .card-header button', |
| 695 | ] |
| 696 | ); |
| 697 | |
| 698 | $this->add_control( |
| 699 | 'number_options', [ |
| 700 | 'label' => esc_html__( 'Number', 'spider-elements' ), |
| 701 | 'type' => Controls_Manager::HEADING, |
| 702 | 'separator' => 'before', |
| 703 | 'condition' => [ |
| 704 | 'style' => ['3'] |
| 705 | ] |
| 706 | ] |
| 707 | ); |
| 708 | |
| 709 | $this->add_group_control( |
| 710 | Group_Control_Typography::get_type(), |
| 711 | [ |
| 712 | 'name' => 'number_typography', |
| 713 | 'selector' => '{{WRAPPER}} .cs-outline3 .serial-number', |
| 714 | 'condition' => [ |
| 715 | 'style' => '3' |
| 716 | ] |
| 717 | ] |
| 718 | ); |
| 719 | |
| 720 | $this->add_control( |
| 721 | 'number_color3', |
| 722 | [ |
| 723 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 724 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 725 | 'selectors' => [ |
| 726 | '{{WRAPPER}} .cs-outline3 .serial-number' => 'color: {{VALUE}}', |
| 727 | ], |
| 728 | 'condition' => [ |
| 729 | 'style' => '3' |
| 730 | ] |
| 731 | ] |
| 732 | ); |
| 733 | |
| 734 | $this->add_control( |
| 735 | 'title_heading', |
| 736 | [ |
| 737 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 738 | 'type' => Controls_Manager::HEADING, |
| 739 | 'separator' => 'before', |
| 740 | ] |
| 741 | ); |
| 742 | |
| 743 | $this->add_group_control( |
| 744 | Group_Control_Typography::get_type(), |
| 745 | [ |
| 746 | 'name' => 'title_typography', |
| 747 | 'selector' => '{{WRAPPER}} .info-box-heading, |
| 748 | {{WRAPPER}} .cs3-title', |
| 749 | ] |
| 750 | ); |
| 751 | |
| 752 | $this->add_control( |
| 753 | 'heading_color', |
| 754 | [ |
| 755 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 756 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 757 | 'selectors' => [ |
| 758 | '{{WRAPPER}} .info-box-heading' => 'color: {{VALUE}}', |
| 759 | '{{WRAPPER}} .cs3-title' => 'color: {{VALUE}}', |
| 760 | ], |
| 761 | ] |
| 762 | ); |
| 763 | |
| 764 | $this->add_control( |
| 765 | 'gap_title_number', |
| 766 | [ |
| 767 | 'label' => esc_html__( 'Gap', 'spider-elements' ), |
| 768 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 769 | 'description' => esc_html__( 'Gap Between Title and Number.', 'spider-elements' ), |
| 770 | 'range' => [ |
| 771 | 'px' => [ |
| 772 | 'min' => 0, |
| 773 | 'max' => 200, |
| 774 | 'step' => 1, |
| 775 | ], |
| 776 | ], |
| 777 | 'selectors' => [ |
| 778 | '{{WRAPPER}} .cs-outline3' => 'gap: {{SIZE}}{{UNIT}};', |
| 779 | ], |
| 780 | 'condition' => [ |
| 781 | 'style' => '3' |
| 782 | ] |
| 783 | ] |
| 784 | ); |
| 785 | |
| 786 | $this->add_control( |
| 787 | 'description_heading', |
| 788 | [ |
| 789 | 'label' => esc_html__( 'Description', 'spider-elements' ), |
| 790 | 'type' => Controls_Manager::HEADING, |
| 791 | 'separator' => 'before', |
| 792 | ] |
| 793 | ); |
| 794 | |
| 795 | $this->add_group_control( |
| 796 | Group_Control_Typography::get_type(), |
| 797 | [ |
| 798 | 'name' => 'description_typography', |
| 799 | 'selector' => '{{WRAPPER}} .info-box-description, |
| 800 | {{WRAPPER}} .cs-info-desc', |
| 801 | ] |
| 802 | ); |
| 803 | |
| 804 | $this->add_control( |
| 805 | 'description_color', |
| 806 | [ |
| 807 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 808 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 809 | 'selectors' => [ |
| 810 | '{{WRAPPER}} .info-box-description' => 'color: {{VALUE}}', |
| 811 | '{{WRAPPER}} .cs-info-desc' => 'color: {{VALUE}}', |
| 812 | ], |
| 813 | ] |
| 814 | ); |
| 815 | |
| 816 | $this->add_responsive_control( |
| 817 | 'desc_margin', |
| 818 | [ |
| 819 | 'label' => esc_html__( 'Margin', 'spider-elements' ), |
| 820 | 'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 821 | 'size_units' => [ 'px', 'em', '%' ], |
| 822 | 'selectors' => [ |
| 823 | '{{WRAPPER}} .info-box-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 824 | '{{WRAPPER}} .cs-info-desc' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 825 | ], |
| 826 | ] |
| 827 | ); |
| 828 | |
| 829 | $this->add_control( |
| 830 | 'img_heading', |
| 831 | [ |
| 832 | 'label' => esc_html__( 'Image', 'spider-elements' ), |
| 833 | 'type' => Controls_Manager::HEADING, |
| 834 | 'separator' => 'before', |
| 835 | 'condition' => [ |
| 836 | 'style' => '3' |
| 837 | ] |
| 838 | ] |
| 839 | ); |
| 840 | |
| 841 | $this->add_control( |
| 842 | 'img_radius', |
| 843 | [ |
| 844 | 'label' => esc_html__( 'Image Radius', 'spider-elements' ), |
| 845 | 'type' => Controls_Manager::DIMENSIONS, |
| 846 | 'size_units' => [ 'px', '%' ], |
| 847 | 'selectors' => [ |
| 848 | '{{WRAPPER}} .cs-items3 .cs-img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 849 | ], |
| 850 | 'condition' => [ |
| 851 | 'style' => '3' |
| 852 | ] |
| 853 | ] |
| 854 | ); |
| 855 | |
| 856 | $this->end_controls_section(); // End Cheat Sheet Item 2 |
| 857 | |
| 858 | |
| 859 | //start number style |
| 860 | $this->start_controls_section( |
| 861 | 'icon_style', [ |
| 862 | 'label' => esc_html__( 'Number', 'spider-elements' ), |
| 863 | 'tab' => Controls_Manager::TAB_STYLE, |
| 864 | 'condition' => [ |
| 865 | 'style' => '2' |
| 866 | ] |
| 867 | ] |
| 868 | ); |
| 869 | |
| 870 | $this->add_group_control( |
| 871 | Group_Control_Typography::get_type(), |
| 872 | [ |
| 873 | 'name' => 'number1_typography', |
| 874 | 'selector' => '{{WRAPPER}} .info-box-number .number-circle', |
| 875 | ] |
| 876 | ); |
| 877 | |
| 878 | $this->add_control( |
| 879 | 'number_color2', |
| 880 | [ |
| 881 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 882 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 883 | 'selectors' => [ |
| 884 | '{{WRAPPER}} .info-box-number .number-circle' => 'color: {{VALUE}}', |
| 885 | ], |
| 886 | ] |
| 887 | ); |
| 888 | |
| 889 | $this->add_control( |
| 890 | 'number_circle_bg_color', |
| 891 | [ |
| 892 | 'label' => esc_html__( 'Circle Color', 'spider-elements' ), |
| 893 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 894 | 'selectors' => [ |
| 895 | '{{WRAPPER}} .number-circle' => 'background-color: {{VALUE}};', |
| 896 | ], |
| 897 | ] |
| 898 | ); |
| 899 | |
| 900 | $this->add_control( |
| 901 | 'info_box_number_bg_color', |
| 902 | [ |
| 903 | 'label' => esc_html__( 'Background Color', 'spider-elements' ), |
| 904 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 905 | 'selectors' => [ |
| 906 | '{{WRAPPER}} .info-box-number' => 'background-color: {{VALUE}};', |
| 907 | ], |
| 908 | ] |
| 909 | ); |
| 910 | |
| 911 | $this->add_group_control( |
| 912 | Group_Control_Box_Shadow::get_type(), [ |
| 913 | 'name' => 'number_shadow', |
| 914 | 'label' => esc_html__( 'Circle Shadow', 'spider-elements' ), |
| 915 | 'selector' => '{{WRAPPER}} .number-circle', |
| 916 | ] |
| 917 | ); |
| 918 | |
| 919 | $this->add_responsive_control( |
| 920 | 'number-gap', |
| 921 | [ |
| 922 | 'label' => esc_html__( 'Gap', 'spider-elements' ), |
| 923 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 924 | 'description' => esc_html__( 'Set the gap between the number and the text.', 'spider-elements' ), |
| 925 | 'range' => [ |
| 926 | 'px' => [ |
| 927 | 'min' => 0, |
| 928 | 'max' => 200, |
| 929 | 'step' => 1, |
| 930 | ], |
| 931 | ], |
| 932 | 'selectors' => [ |
| 933 | '{{WRAPPER}} .cheat-info-box' => 'gap: {{SIZE}}{{UNIT}};', |
| 934 | ], |
| 935 | 'separator' => 'before', |
| 936 | ] |
| 937 | ); |
| 938 | |
| 939 | $this->end_controls_section(); |
| 940 | //end number style |
| 941 | |
| 942 | //outline style |
| 943 | $this->start_controls_section( |
| 944 | 'outline_style', [ |
| 945 | 'label' => esc_html__( 'Outline', 'spider-elements' ), |
| 946 | 'tab' => Controls_Manager::TAB_STYLE, |
| 947 | 'condition' => [ |
| 948 | 'style' => '3' |
| 949 | ] |
| 950 | ] |
| 951 | ); |
| 952 | |
| 953 | $this->add_control( |
| 954 | 'outline_color', |
| 955 | [ |
| 956 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 957 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 958 | 'selectors' => [ |
| 959 | '{{WRAPPER}} .cs-items3 .cs-outline3:before' => 'background-color: {{VALUE}}', |
| 960 | ], |
| 961 | ] |
| 962 | ); |
| 963 | |
| 964 | $this->add_responsive_control( |
| 965 | 'outline_width', |
| 966 | [ |
| 967 | 'label' => esc_html__( 'Width', 'spider-elements' ), |
| 968 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 969 | 'description' => esc_html__( 'Set the width of the outline.', 'spider-elements' ), |
| 970 | 'range' => [ |
| 971 | 'px' => [ |
| 972 | 'min' => 0, |
| 973 | 'max' => 100, |
| 974 | 'step' => 1, |
| 975 | ], |
| 976 | ], |
| 977 | 'selectors' => [ |
| 978 | '{{WRAPPER}} .cs-items3 .cs-outline3:before' => 'width: {{SIZE}}{{UNIT}};', |
| 979 | ], |
| 980 | 'separator' => 'before', |
| 981 | ] |
| 982 | ); |
| 983 | |
| 984 | $this->add_responsive_control( |
| 985 | 'outline_height', |
| 986 | [ |
| 987 | 'label' => esc_html__( 'Height', 'spider-elements' ), |
| 988 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 989 | 'description' => esc_html__( 'Set the height of the outline.', 'spider-elements' ), |
| 990 | 'range' => [ |
| 991 | 'px' => [ |
| 992 | 'min' => 0, |
| 993 | 'max' => 100, |
| 994 | 'step' => 1, |
| 995 | ], |
| 996 | ], |
| 997 | 'selectors' => [ |
| 998 | '{{WRAPPER}} .cs-items3 .cs-outline3:before' => 'height: {{SIZE}}{{UNIT}};', |
| 999 | ], |
| 1000 | ] |
| 1001 | ); |
| 1002 | |
| 1003 | $this->end_controls_section(); |
| 1004 | |
| 1005 | } |
| 1006 | |
| 1007 | |
| 1008 | /** |
| 1009 | * Name: elementor_render() |
| 1010 | * Desc: Render the widget output on the frontend. |
| 1011 | * Params: no params |
| 1012 | * Return: @void |
| 1013 | * Since: @1.0.0 |
| 1014 | * Package: @spider-elements |
| 1015 | * Author: spider-themes |
| 1016 | */ |
| 1017 | protected function render() { |
| 1018 | $settings = $this->get_settings_for_display(); |
| 1019 | extract( $settings ); // extract all settings array to variables converted to name of key |
| 1020 | |
| 1021 | //================= Template Parts =================// |
| 1022 | include "templates/cheat-sheet/cheat-sheet-{$settings['style']}.php"; |
| 1023 | } |
| 1024 | } |