| 1 |
<?php |
| 2 |
|
| 3 |
namespace Amedea\Widgets; |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
use \Elementor\Widget_Base; |
| 8 |
|
| 9 |
use \Elementor\Controls_Manager; |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
/** |
| 14 |
|
| 15 |
* Elementor |
| 16 |
|
| 17 |
* |
| 18 |
|
| 19 |
* Elementor widget |
| 20 |
|
| 21 |
* |
| 22 |
|
| 23 |
* @since 1.0.0 |
| 24 |
|
| 25 |
*/ |
| 26 |
|
| 27 |
class amedea__welcome_project extends Widget_Base { |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
/** |
| 32 |
|
| 33 |
* Retrieve the widget name. |
| 34 |
|
| 35 |
* |
| 36 |
|
| 37 |
* @since 1.0.0 |
| 38 |
|
| 39 |
* |
| 40 |
|
| 41 |
* @access public |
| 42 |
|
| 43 |
* |
| 44 |
|
| 45 |
* @return string Widget name. |
| 46 |
|
| 47 |
*/ |
| 48 |
|
| 49 |
public function get_name() { |
| 50 |
|
| 51 |
return 'welcome_project'; |
| 52 |
|
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
/** |
| 58 |
|
| 59 |
* Retrieve the widget title. |
| 60 |
|
| 61 |
* |
| 62 |
|
| 63 |
* @since 1.0.0 |
| 64 |
|
| 65 |
* |
| 66 |
|
| 67 |
* @access public |
| 68 |
|
| 69 |
* |
| 70 |
|
| 71 |
* @return string Widget title. |
| 72 |
|
| 73 |
*/ |
| 74 |
|
| 75 |
public function get_title() { |
| 76 |
|
| 77 |
return esc_html__( 'Welcome Project', 'amedea' ); |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
/** |
| 84 |
|
| 85 |
* Retrieve the widget icon. |
| 86 |
|
| 87 |
* |
| 88 |
|
| 89 |
* @since 1.0.0 |
| 90 |
|
| 91 |
* |
| 92 |
|
| 93 |
* @access public |
| 94 |
|
| 95 |
* |
| 96 |
|
| 97 |
* @return string Widget icon. |
| 98 |
|
| 99 |
*/ |
| 100 |
|
| 101 |
public function get_icon() { |
| 102 |
|
| 103 |
return 'eicon-featured-image'; |
| 104 |
|
| 105 |
} |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
/** |
| 110 |
|
| 111 |
* Retrieve the list of scripts the widget depended on. |
| 112 |
|
| 113 |
* |
| 114 |
|
| 115 |
* Used to set scripts dependencies required to run the widget. |
| 116 |
|
| 117 |
* |
| 118 |
|
| 119 |
* @since 1.0.0 |
| 120 |
|
| 121 |
* |
| 122 |
|
| 123 |
* @access public |
| 124 |
|
| 125 |
* |
| 126 |
|
| 127 |
* @return array Widget scripts dependencies. |
| 128 |
|
| 129 |
*/ |
| 130 |
|
| 131 |
public function get_script_depends() { |
| 132 |
|
| 133 |
return [ '' ]; |
| 134 |
|
| 135 |
} |
| 136 |
|
| 137 |
/** |
| 138 |
|
| 139 |
* Retrieve the list of categories the widget belongs to. |
| 140 |
|
| 141 |
* |
| 142 |
|
| 143 |
* Used to determine where to display the widget in the editor. |
| 144 |
|
| 145 |
* |
| 146 |
|
| 147 |
* Note that currently Elementor supports only one category. |
| 148 |
|
| 149 |
* When multiple categories passed, Elementor uses the first one. |
| 150 |
|
| 151 |
* |
| 152 |
|
| 153 |
* @since 1.0.0 |
| 154 |
|
| 155 |
* |
| 156 |
|
| 157 |
* @access public |
| 158 |
|
| 159 |
* |
| 160 |
|
| 161 |
* @return array Widget categories. |
| 162 |
|
| 163 |
*/ |
| 164 |
|
| 165 |
public function get_categories() { |
| 166 |
|
| 167 |
return [ 'amedea-category' , 'amedea-theme-widgets-category' ]; |
| 168 |
|
| 169 |
} |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
/** |
| 176 |
|
| 177 |
* Register the widget controls. |
| 178 |
|
| 179 |
* |
| 180 |
|
| 181 |
* Adds different input fields to allow the user to change and customize the widget settings. |
| 182 |
|
| 183 |
* |
| 184 |
|
| 185 |
* @since 1.0.0 |
| 186 |
|
| 187 |
* |
| 188 |
|
| 189 |
* @access protected |
| 190 |
|
| 191 |
*/ |
| 192 |
|
| 193 |
protected function register_controls() { |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
$this->start_controls_section( |
| 200 |
|
| 201 |
'section_content0', |
| 202 |
|
| 203 |
[ |
| 204 |
|
| 205 |
'label' => esc_html__( 'Image', 'amedea' ), |
| 206 |
|
| 207 |
'tab' => \Elementor\Controls_Manager::TAB_CONTENT, |
| 208 |
|
| 209 |
] |
| 210 |
|
| 211 |
); |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
$this->add_control( |
| 216 |
|
| 217 |
'image', |
| 218 |
|
| 219 |
[ |
| 220 |
|
| 221 |
'label' => esc_html__( 'Choose Image', 'amedea' ), |
| 222 |
|
| 223 |
'type' => \Elementor\Controls_Manager::MEDIA, |
| 224 |
|
| 225 |
'default' => [ |
| 226 |
|
| 227 |
'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 228 |
|
| 229 |
], |
| 230 |
|
| 231 |
] |
| 232 |
|
| 233 |
); |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
$this->end_controls_section(); |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
$this->start_controls_section( |
| 242 |
|
| 243 |
'section_content', |
| 244 |
|
| 245 |
[ |
| 246 |
|
| 247 |
'label' => esc_html__( 'Content', 'amedea' ), |
| 248 |
|
| 249 |
'tab' => \Elementor\Controls_Manager::TAB_CONTENT, |
| 250 |
|
| 251 |
] |
| 252 |
|
| 253 |
); |
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
$this->add_control( |
| 258 |
|
| 259 |
'text_area_2', |
| 260 |
|
| 261 |
[ |
| 262 |
|
| 263 |
'label' => esc_html__( 'Heading', 'amedea' ), |
| 264 |
|
| 265 |
'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 266 |
|
| 267 |
'default' => __( 'Are<br/>you<br/>ready?', 'amedea' ), |
| 268 |
|
| 269 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 270 |
|
| 271 |
] |
| 272 |
|
| 273 |
); |
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
$this->add_control( |
| 278 |
|
| 279 |
'text_area_1', |
| 280 |
|
| 281 |
[ |
| 282 |
|
| 283 |
'label' => esc_html__( 'Intro Text', 'amedea' ), |
| 284 |
|
| 285 |
'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 286 |
|
| 287 |
'default' => esc_html__( 'Are you ready?', 'amedea' ), |
| 288 |
|
| 289 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 290 |
|
| 291 |
] |
| 292 |
|
| 293 |
); |
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
$this->end_controls_section(); |
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
$this->start_controls_section( |
| 302 |
|
| 303 |
'section_content1', |
| 304 |
|
| 305 |
[ |
| 306 |
|
| 307 |
'label' => esc_html__( 'Second Content', 'amedea' ), |
| 308 |
|
| 309 |
'tab' => \Elementor\Controls_Manager::TAB_CONTENT, |
| 310 |
|
| 311 |
] |
| 312 |
|
| 313 |
); |
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
$this->add_control( |
| 318 |
|
| 319 |
'text_area_3', |
| 320 |
|
| 321 |
[ |
| 322 |
|
| 323 |
'label' => esc_html__( 'Heading', 'amedea' ), |
| 324 |
|
| 325 |
'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 326 |
|
| 327 |
'default' => esc_html__( 'Are you ready?', 'amedea' ), |
| 328 |
|
| 329 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 330 |
|
| 331 |
] |
| 332 |
|
| 333 |
); |
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
$this->add_control( |
| 338 |
|
| 339 |
'text_area_4', |
| 340 |
|
| 341 |
[ |
| 342 |
|
| 343 |
'label' => esc_html__( 'Heading', 'amedea' ), |
| 344 |
|
| 345 |
'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 346 |
|
| 347 |
'default' => esc_html__( 'Are you ready?', 'amedea' ), |
| 348 |
|
| 349 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 350 |
|
| 351 |
] |
| 352 |
|
| 353 |
); |
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
$this->end_controls_section(); |
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
$this->start_controls_section( |
| 362 |
|
| 363 |
'section_content2', |
| 364 |
|
| 365 |
[ |
| 366 |
|
| 367 |
'label' => esc_html__( 'Third Content', 'amedea' ), |
| 368 |
|
| 369 |
'tab' => \Elementor\Controls_Manager::TAB_CONTENT, |
| 370 |
|
| 371 |
] |
| 372 |
|
| 373 |
); |
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
$this->add_control( |
| 378 |
|
| 379 |
'text_area_5', |
| 380 |
|
| 381 |
[ |
| 382 |
|
| 383 |
'label' => esc_html__( 'Client', 'amedea' ), |
| 384 |
|
| 385 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 386 |
|
| 387 |
'default' => esc_html__( 'Client', 'amedea' ), |
| 388 |
|
| 389 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 390 |
|
| 391 |
] |
| 392 |
|
| 393 |
); |
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
$this->add_control( |
| 398 |
|
| 399 |
'text_area_6', |
| 400 |
|
| 401 |
[ |
| 402 |
|
| 403 |
'label' => esc_html__( 'Client Content', 'amedea' ), |
| 404 |
|
| 405 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 406 |
|
| 407 |
'default' => esc_html__( 'Krasota Iskusstva', 'amedea' ), |
| 408 |
|
| 409 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 410 |
|
| 411 |
] |
| 412 |
|
| 413 |
); |
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
$this->add_control( |
| 418 |
|
| 419 |
'text_area_7', |
| 420 |
|
| 421 |
[ |
| 422 |
|
| 423 |
'label' => esc_html__( 'Service', 'amedea' ), |
| 424 |
|
| 425 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 426 |
|
| 427 |
'default' => esc_html__( 'Service', 'amedea' ), |
| 428 |
|
| 429 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 430 |
|
| 431 |
] |
| 432 |
|
| 433 |
); |
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
$this->add_control( |
| 438 |
|
| 439 |
'text_area_8', |
| 440 |
|
| 441 |
[ |
| 442 |
|
| 443 |
'label' => esc_html__( 'Service Content', 'amedea' ), |
| 444 |
|
| 445 |
'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 446 |
|
| 447 |
'default' => __( 'UI & UX Design</br> UI & UX Design<br/> UI & UX Design', 'amedea' ), |
| 448 |
|
| 449 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 450 |
|
| 451 |
] |
| 452 |
|
| 453 |
); |
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
$this->add_control( |
| 458 |
|
| 459 |
'text_area_9', |
| 460 |
|
| 461 |
[ |
| 462 |
|
| 463 |
'label' => esc_html__( 'Category', 'amedea' ), |
| 464 |
|
| 465 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 466 |
|
| 467 |
'default' => esc_html__( 'Category', 'amedea' ), |
| 468 |
|
| 469 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 470 |
|
| 471 |
] |
| 472 |
|
| 473 |
); |
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
$this->add_control( |
| 478 |
|
| 479 |
'text_area_10', |
| 480 |
|
| 481 |
[ |
| 482 |
|
| 483 |
'label' => esc_html__( 'Category Content', 'amedea' ), |
| 484 |
|
| 485 |
'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 486 |
|
| 487 |
'default' => __( 'Design <br/>Development', 'amedea' ), |
| 488 |
|
| 489 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 490 |
|
| 491 |
] |
| 492 |
|
| 493 |
); |
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
$this->add_control( |
| 498 |
|
| 499 |
'text_area_11', |
| 500 |
|
| 501 |
[ |
| 502 |
|
| 503 |
'label' => esc_html__( 'Date', 'amedea' ), |
| 504 |
|
| 505 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 506 |
|
| 507 |
'default' => esc_html__( 'Date', 'amedea' ), |
| 508 |
|
| 509 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 510 |
|
| 511 |
] |
| 512 |
|
| 513 |
); |
| 514 |
|
| 515 |
|
| 516 |
|
| 517 |
$this->add_control( |
| 518 |
|
| 519 |
'text_area_12', |
| 520 |
|
| 521 |
[ |
| 522 |
|
| 523 |
'label' => esc_html__( 'Date Content', 'amedea' ), |
| 524 |
|
| 525 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 526 |
|
| 527 |
'default' => esc_html__( '2023', 'amedea' ), |
| 528 |
|
| 529 |
'placeholder' => esc_html__( 'Type your content here', 'amedea' ), |
| 530 |
|
| 531 |
] |
| 532 |
|
| 533 |
); |
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
$this->end_controls_section(); |
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
$this->start_controls_section( |
| 542 |
|
| 543 |
'section_content3', |
| 544 |
|
| 545 |
[ |
| 546 |
|
| 547 |
'label' => esc_html__( 'Link', 'amedea' ), |
| 548 |
|
| 549 |
'tab' => \Elementor\Controls_Manager::TAB_CONTENT, |
| 550 |
|
| 551 |
] |
| 552 |
|
| 553 |
); |
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
$this->add_control( |
| 558 |
|
| 559 |
'button_text', |
| 560 |
|
| 561 |
[ |
| 562 |
|
| 563 |
'label' => esc_html__( 'Button Text', 'amedea' ), |
| 564 |
|
| 565 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 566 |
|
| 567 |
'default' => esc_html__( 'Button Text', 'amedea' ), |
| 568 |
|
| 569 |
] |
| 570 |
|
| 571 |
); |
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
$this->add_control( |
| 576 |
|
| 577 |
'button_url', |
| 578 |
|
| 579 |
[ |
| 580 |
|
| 581 |
'label' => esc_html__( 'Button URL', 'amedea' ), |
| 582 |
|
| 583 |
'type' => \Elementor\Controls_Manager::URL, |
| 584 |
|
| 585 |
] |
| 586 |
|
| 587 |
); |
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
|
| 593 |
$this->end_controls_section(); |
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
} |
| 600 |
|
| 601 |
|
| 602 |
|
| 603 |
/** |
| 604 |
|
| 605 |
* Render the widget output on the frontend. |
| 606 |
|
| 607 |
* |
| 608 |
|
| 609 |
* Written in PHP and used to generate the final HTML. |
| 610 |
|
| 611 |
* |
| 612 |
|
| 613 |
* @since 1.0.0 |
| 614 |
|
| 615 |
* |
| 616 |
|
| 617 |
* @access protected |
| 618 |
|
| 619 |
*/ |
| 620 |
|
| 621 |
protected function render() { |
| 622 |
|
| 623 |
$settings = $this->get_settings_for_display(); |
| 624 |
|
| 625 |
$image = $settings['image']; |
| 626 |
|
| 627 |
//$style = $settings['style']; |
| 628 |
|
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
?> |
| 634 |
|
| 635 |
<section class="content__page welcome__page intro__page"> |
| 636 |
|
| 637 |
<div class="content__image" style="background-image:url('<?php echo esc_attr($settings['image']['url']); ?>')"> |
| 638 |
|
| 639 |
<div class="content__inner"> |
| 640 |
|
| 641 |
<div class="content__text"> |
| 642 |
|
| 643 |
<h1 class="text__title"><?php echo esc_html($settings['text_area_2']); ?></h1> |
| 644 |
|
| 645 |
<span class="text__intro__second"><?php echo esc_html($settings['text_area_1']); ?></span> |
| 646 |
|
| 647 |
</div> |
| 648 |
|
| 649 |
|
| 650 |
|
| 651 |
<div class="content__text text__second"> |
| 652 |
|
| 653 |
<div class="grid__left"> |
| 654 |
|
| 655 |
<p class="text__intro"><?php echo esc_html($settings['text_area_3']); ?></p> |
| 656 |
|
| 657 |
<span class="text__link"><?php echo esc_html($settings['text_area_4']); ?></span> |
| 658 |
|
| 659 |
<?php if ( ! empty( $settings['button_url']['url'] ) ) { ?> |
| 660 |
|
| 661 |
<p class="text__link"> |
| 662 |
|
| 663 |
<a href="<?php echo esc_url($settings['button_url']['url']); ?>" target="_blank" class="animsition-link line-link read--more"> |
| 664 |
|
| 665 |
○ <?php echo esc_html($settings['button_text']); ?> |
| 666 |
|
| 667 |
</a> |
| 668 |
|
| 669 |
</p> |
| 670 |
|
| 671 |
<?php } ?> |
| 672 |
|
| 673 |
</div> |
| 674 |
|
| 675 |
</div> |
| 676 |
|
| 677 |
|
| 678 |
|
| 679 |
<div class="content__text content__info"> |
| 680 |
|
| 681 |
<div class="content__client"> |
| 682 |
|
| 683 |
<h4><?php echo esc_attr($settings['text_area_5']); ?></h4> |
| 684 |
|
| 685 |
<span><?php echo esc_attr($settings['text_area_6']); ?></span> |
| 686 |
|
| 687 |
</div> |
| 688 |
|
| 689 |
<div class="content__services"> |
| 690 |
|
| 691 |
<h4><?php echo esc_attr($settings['text_area_7']); ?></h4> |
| 692 |
|
| 693 |
<span><?php echo esc_html($settings['text_area_8']); ?></span> |
| 694 |
|
| 695 |
</div> |
| 696 |
|
| 697 |
<div class="content__category"> |
| 698 |
|
| 699 |
<h4><?php echo esc_attr($settings['text_area_9']); ?></h4> |
| 700 |
|
| 701 |
<span><?php echo esc_html($settings['text_area_10']); ?></span> |
| 702 |
|
| 703 |
</div> |
| 704 |
|
| 705 |
<div class="content__date"> |
| 706 |
|
| 707 |
<h4><?php echo esc_attr($settings['text_area_11']); ?></h4> |
| 708 |
|
| 709 |
<span><?php echo esc_attr($settings['text_area_12']); ?></span> |
| 710 |
|
| 711 |
</div> |
| 712 |
|
| 713 |
</div> |
| 714 |
|
| 715 |
|
| 716 |
|
| 717 |
</div> |
| 718 |
|
| 719 |
</div> |
| 720 |
|
| 721 |
</section> |
| 722 |
|
| 723 |
|
| 724 |
|
| 725 |
<?php |
| 726 |
|
| 727 |
} |
| 728 |
|
| 729 |
|
| 730 |
|
| 731 |
/** |
| 732 |
|
| 733 |
* Render the widget output in the editor. |
| 734 |
|
| 735 |
* |
| 736 |
|
| 737 |
* Written as a Backbone JavaScript template and used to generate the live preview. |
| 738 |
|
| 739 |
* |
| 740 |
|
| 741 |
* @since 1.0.0 |
| 742 |
|
| 743 |
* |
| 744 |
|
| 745 |
* @access protected |
| 746 |
|
| 747 |
*/ |
| 748 |
|
| 749 |
protected function content_template() {} |
| 750 |
|
| 751 |
|
| 752 |
|
| 753 |
} |
| 754 |
|
| 755 |
|