PluginProbe
Enter Addons – Ultimate Template Builder for Elementor / trunk
Enter Addons – Ultimate Template Builder for Elementor vtrunk
trunk 2.2.10 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4
enteraddons / widgets / timeline / Timeline.php

Timeline.php in Enter Addons – Ultimate Template Builder for Elementor trunk, at widgets/timeline/Timeline.php

1,101 lines 41.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Enteraddons\Widgets\Timeline;
3
4 use Elementor\Widget_Base;
5 use Elementor\Controls_Manager;
6 use Elementor\Scheme_Color;
7 use Elementor\Scheme_Typography;
8 use Elementor\Group_Control_Typography;
9 use Elementor\Group_Control_Box_Shadow;
10 use Elementor\Group_Control_Background;
11 use Elementor\Group_Control_Border;
12
13 // Exit if accessed directly
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18
19 /**
20 *
21 * Enteraddons elementor timeline widget.
22 *
23 * @since 1.0
24 */
25 class Timeline extends Widget_Base {
26
27 public function get_name() {
28 return 'enteraddons-timeline';
29 }
30
31 public function get_title() {
32 return esc_html__( 'Timeline', 'enteraddons' );
33 }
34
35 public function get_icon() {
36 return 'entera entera-timeline';
37 }
38
39 public function get_categories() {
40 return ['enteraddons-elements-category'];
41 }
42
43 protected function register_controls() {
44
45 $repeater = new \Elementor\Repeater();
46
47 // ---------------------------------------- Timeline content ------------------------------
48 $this->start_controls_section(
49 'enteraddons_timeline_content',
50 [
51 'label' => esc_html__( 'Timeline Content', 'enteraddons' ),
52 ]
53 );
54
55 $this->add_control(
56 'title',
57 [
58 'label' => esc_html__( 'Title', 'enteraddons' ),
59 'type' => \Elementor\Controls_Manager::TEXT,
60 'dynamic' => [
61 'active' => true,
62 ],
63 'label_block' => true,
64 'default' => 'Lorem Ipsum is simply dummy text'
65 ]
66 );
67 $this->add_control(
68 'date',
69 [
70 'label' => esc_html__( 'Date', 'enteraddons' ),
71 'type' => \Elementor\Controls_Manager::TEXT,
72 'dynamic' => [
73 'active' => true,
74 ],
75 'label_block' => true,
76 'default' => '2015 To 2016'
77 ]
78 );
79 $this->add_control(
80 'descriptions',
81 [
82 'label' => esc_html__( 'Descriptions', 'enteraddons' ),
83 'type' => \Elementor\Controls_Manager::TEXTAREA,
84 'dynamic' => [
85 'active' => true,
86 ],
87 'label_block' => true,
88 'default' => 'Lorem ipsum dolor sit amet, consectetur pass- adipisicing elit, sed do eiusmod.'
89 ]
90 );
91 $this->add_control(
92 'icon_type',
93 [
94 'label' => esc_html__( 'Icon Type', 'enteraddons' ),
95 'type' => \Elementor\Controls_Manager::SELECT,
96 'default' => 'icon',
97 'options' => [
98 'icon' => esc_html__( 'Icon', 'enteraddons' ),
99 'img' => esc_html__( 'Image', 'enteraddons' ),
100 ],
101 ]
102 );
103 $this->add_control(
104 'icon',
105 [
106 'label' => esc_html__( 'Icon', 'enteraddons' ),
107 'type' => \Elementor\Controls_Manager::ICONS,
108 'condition' => [ 'icon_type' => 'icon' ],
109 'default' => [
110 'value' => 'fas fa-star',
111 'library' => 'solid',
112 ],
113 ]
114 );
115 $this->add_control(
116 'image',
117 [
118 'label' => esc_html__( 'Image', 'enteraddons' ),
119 'type' => \Elementor\Controls_Manager::MEDIA,
120 'dynamic' => [
121 'active' => true,
122 ],
123 'condition' => [ 'icon_type' => 'img' ],
124 'default' => [
125 'url' => \Elementor\Utils::get_placeholder_image_src(),
126 ],
127 ]
128 );
129
130 $this->end_controls_section(); // End Timeline content
131
132 /**
133 * Style Tab
134 * ------------------------------ Timeline Style area Settings ------------------------------
135 *
136 */
137 $this->start_controls_section(
138 'enteraddons_timeline_content_wrapper_settings', [
139 'label' => esc_html__( 'Content Wrapper Settings', 'enteraddons' ),
140 'tab' => Controls_Manager::TAB_STYLE,
141 ]
142 );
143 $this->add_responsive_control(
144 'content_wrapper_margin',
145 [
146 'label' => esc_html__( 'Margin', 'enteraddons' ),
147 'type' => Controls_Manager::DIMENSIONS,
148 'devices' => [ 'desktop', 'tablet', 'mobile' ],
149 'size_units' => [ 'px', '%', 'em' ],
150 'selectors' => [
151 '{{WRAPPER}} .enteraddons-timeline-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
152 ],
153 ]
154 );
155 $this->add_responsive_control(
156 'content_wrapper_padding',
157 [
158 'label' => esc_html__( 'Padding', 'enteraddons' ),
159 'type' => Controls_Manager::DIMENSIONS,
160 'devices' => [ 'desktop', 'tablet', 'mobile' ],
161 'size_units' => [ 'px', '%', 'em' ],
162 'selectors' => [
163 '{{WRAPPER}} .enteraddons-timeline-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
164 ],
165 ]
166 );
167 $this->add_responsive_control(
168 'content_wrapper_border_radius',
169 [
170 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
171 'type' => Controls_Manager::DIMENSIONS,
172 'devices' => [ 'desktop', 'tablet', 'mobile' ],
173 'size_units' => [ 'px', '%', 'em' ],
174 'selectors' => [
175 '{{WRAPPER}} .enteraddons-timeline-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
176 ],
177 ]
178 );
179 $this->add_group_control(
180 \Elementor\Group_Control_Box_Shadow::get_type(),
181 [
182 'name' => 'content_wrapper_shadow',
183 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
184 'selector' => '{{WRAPPER}} .enteraddons-timeline-wrapper',
185 ]
186 );
187 $this->add_group_control(
188 \Elementor\Group_Control_Background::get_type(),
189 [
190 'name' => 'content_wrapper_background',
191 'label' => esc_html__( 'Background', 'enteraddons' ),
192 'types' => [ 'classic', 'gradient' ],
193 'selector' => '{{WRAPPER}} .enteraddons-timeline-wrapper',
194 ]
195 );
196 $this->end_controls_section();
197
198 /**
199 * Style Tab
200 * ------------------------------ Timeline Item layout Settings ------------------------------
201 *
202 */
203 $this->start_controls_section(
204 'enteraddons_timeline_layout_settings', [
205 'label' => esc_html__( 'Timeline Layout Settings', 'enteraddons' ),
206 'tab' => Controls_Manager::TAB_STYLE,
207 ]
208 );
209 $this->add_control(
210 'line_position',
211 [
212 'label' => esc_html__( 'Line Position', 'enteraddons' ),
213 'type' => \Elementor\Controls_Manager::SELECT,
214 'default' => 'right',
215 'options' => [
216 'left' => esc_html__( 'Left', 'enteraddons' ),
217 'right' => esc_html__( 'Right', 'enteraddons' ),
218 ],
219 ]
220 );
221 // timeline-right
222 $this->start_controls_tabs( 'timeline_item_tab' );
223 $this->start_controls_tab(
224 'timeline_item_style_normal',
225 [
226 'label' => esc_html__( 'Normal', 'enteraddons' ),
227 ]
228 );
229 $this->add_group_control(
230 \Elementor\Group_Control_Border::get_type(),
231 [
232 'name' => 'single_timeline_border',
233 'label' => esc_html__( 'Border', 'enteraddons' ),
234 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .single-timeline-inner',
235 ]
236 );
237 $this->add_responsive_control(
238 'item_border_radius',
239 [
240 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
241 'type' => Controls_Manager::DIMENSIONS,
242 'devices' => [ 'desktop', 'tablet', 'mobile' ],
243 'size_units' => [ 'px', '%', 'em' ],
244 'selectors' => [
245 '{{WRAPPER}} .enteraddons-single-timeline .single-timeline-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
246 ],
247 ]
248 );
249 $this->add_group_control(
250 \Elementor\Group_Control_Box_Shadow::get_type(),
251 [
252 'name' => 'item_area_shadow',
253 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
254 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .single-timeline-inner',
255 ]
256 );
257 $this->add_group_control(
258 \Elementor\Group_Control_Background::get_type(),
259 [
260 'name' => 'item_area_background',
261 'label' => esc_html__( 'Background', 'enteraddons' ),
262 'types' => [ 'classic', 'gradient' ],
263 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .single-timeline-inner',
264 ]
265 );
266
267 $this->end_controls_tab(); // End Controls tab
268
269 // Controls tab For Hover
270 $this->start_controls_tab(
271 'timeline_layout_hover',
272 [
273 'label' => esc_html__( 'Hover', 'enteraddons' ),
274 ]
275 );
276 $this->add_group_control(
277 \Elementor\Group_Control_Border::get_type(),
278 [
279 'name' => 'timeline_item_hover_border',
280 'label' => esc_html__( 'Border', 'enteraddons' ),
281 'selector' => '{{WRAPPER}} .enteraddons-single-timeline:hover .single-timeline-inner',
282 ]
283 );
284 $this->add_responsive_control(
285 'item_hover_border_radius',
286 [
287 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
288 'type' => Controls_Manager::DIMENSIONS,
289 'devices' => [ 'desktop', 'tablet', 'mobile' ],
290 'size_units' => [ 'px', '%', 'em' ],
291 'selectors' => [
292 '{{WRAPPER}} .enteraddons-single-timeline:hover .single-timeline-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
293 ],
294 ]
295 );
296 $this->add_group_control(
297 \Elementor\Group_Control_Box_Shadow::get_type(),
298 [
299 'name' => 'item_hover_area_shadow',
300 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
301 'selector' => '{{WRAPPER}} .enteraddons-single-timeline:hover .single-timeline-inner',
302 ]
303 );
304 $this->add_group_control(
305 \Elementor\Group_Control_Background::get_type(),
306 [
307 'name' => 'item_hover_area_background',
308 'label' => esc_html__( 'Background', 'enteraddons' ),
309 'types' => [ 'classic', 'gradient' ],
310 'selector' => '{{WRAPPER}} .enteraddons-single-timeline:hover .single-timeline-inner',
311 ]
312 );
313 $this->end_controls_tab(); // End Controls tab
314
315 $this->end_controls_tabs(); // end controls tabs section
316
317 $this->end_controls_section();
318
319 /**
320 * Style Tab
321 * ------------------------------ Timeline Line Settings ------------------------------
322 *
323 */
324 $this->start_controls_section(
325 'enteraddons_timeline_settings', [
326 'label' => esc_html__( 'Line Settings', 'enteraddons' ),
327 'tab' => Controls_Manager::TAB_STYLE,
328 ]
329 );
330 $this->add_control(
331 'vertical_line_color_heading',
332 [
333 'label' => esc_html__( 'Vertical Line Color', 'enteraddons' ),
334 'type' => \Elementor\Controls_Manager::HEADING,
335 'separator' => 'before',
336 ]
337 );
338 $this->add_group_control(
339 \Elementor\Group_Control_Background::get_type(),
340 [
341 'name' => 'vertical_line_color',
342 'label' => esc_html__( 'Vertical Line Color', 'enteraddons' ),
343 'show_label' => true,
344 'label_block' => true,
345 'types' => [ 'classic', 'gradient' ],
346 'selector' => '{{WRAPPER}} .enteraddons-timeline-wrapper:after',
347 ]
348 );
349 $this->add_control(
350 'horizontal_line_color_heading',
351 [
352 'label' => esc_html__( 'Horizontal Line Color', 'enteraddons' ),
353 'type' => \Elementor\Controls_Manager::HEADING,
354 'separator' => 'before',
355 ]
356 );
357 $this->add_group_control(
358 \Elementor\Group_Control_Background::get_type(),
359 [
360 'name' => 'horizontal_line_color',
361 'label' => esc_html__( 'Horizontal Line Color', 'enteraddons' ),
362 'show_label' => true,
363 'label_block' => true,
364 'types' => [ 'classic', 'gradient' ],
365 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .single-timeline-inner:after',
366 ]
367 );
368
369 $this->add_control(
370 'line_dot_color_heading',
371 [
372 'label' => esc_html__( 'Line Dot Color', 'enteraddons' ),
373 'type' => \Elementor\Controls_Manager::HEADING,
374 'separator' => 'before',
375 ]
376 );
377 $this->add_group_control(
378 \Elementor\Group_Control_Background::get_type(),
379 [
380 'name' => 'line_dot_color',
381 'label' => esc_html__( 'Dot Color', 'enteraddons' ),
382 'show_label' => true,
383 'label_block' => true,
384 'types' => [ 'classic', 'gradient' ],
385 'selector' => '{{WRAPPER}} .enteraddons-single-timeline:after',
386 ]
387 );
388 $this->add_control(
389 'dot_border_color',
390 [
391 'label' => esc_html__( 'Dot Border Color', 'enteraddons' ),
392 'type' => \Elementor\Controls_Manager::COLOR,
393 'selectors' => [
394 '{{WRAPPER}} .enteraddons-single-timeline:after' => 'border-color: {{VALUE}}',
395 ],
396 ]
397 );
398 $this->add_control(
399 'dot_wrap_bg_color',
400 [
401 'label' => esc_html__( 'Dot Wrapper Background Color', 'enteraddons' ),
402 'type' => \Elementor\Controls_Manager::COLOR,
403 'selectors' => [
404 '{{WRAPPER}} .enteraddons-single-timeline:before' => 'background-color: {{VALUE}}',
405 ],
406 ]
407 );
408 $this->end_controls_section();
409 /**
410 * Style Tab
411 * ------------------------------ Timeline Name Style Settings ------------------------------
412 *
413 */
414 $this->start_controls_section(
415 'enteraddons_timeline_title_settings', [
416 'label' => esc_html__( 'Title', 'enteraddons' ),
417 'tab' => Controls_Manager::TAB_STYLE,
418 ]
419 );
420 $this->start_controls_tabs( 'timeline_title_tab' );
421 $this->start_controls_tab(
422 'title_style_normal',
423 [
424 'label' => esc_html__( 'Normal', 'enteraddons' ),
425 ]
426 );
427 $this->add_control(
428 'title_color',
429 [
430 'label' => esc_html__( 'Title Color', 'enteraddons' ),
431 'type' => \Elementor\Controls_Manager::COLOR,
432 'selectors' => [
433 '{{WRAPPER}} .timeline-text h6' => 'color: {{VALUE}}',
434 ],
435 ]
436 );
437 $this->add_group_control(
438 \Elementor\Group_Control_Typography::get_type(),
439 [
440 'name' => 'title_typography',
441 'label' => esc_html__( 'Typography', 'enteraddons' ),
442 'selector' => '{{WRAPPER}} .timeline-text h6',
443 ]
444 );
445 $this->add_responsive_control(
446 'title_margin',
447 [
448 'label' => esc_html__( 'Margin', 'enteraddons' ),
449 'type' => Controls_Manager::DIMENSIONS,
450 'devices' => [ 'desktop', 'tablet', 'mobile' ],
451 'size_units' => [ 'px', '%', 'em' ],
452 'selectors' => [
453 '{{WRAPPER}} .timeline-text h6' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
454 ],
455 ]
456 );
457 $this->add_responsive_control(
458 'title_padding',
459 [
460 'label' => esc_html__( 'Padding', 'enteraddons' ),
461 'type' => Controls_Manager::DIMENSIONS,
462 'devices' => [ 'desktop', 'tablet', 'mobile' ],
463 'size_units' => [ 'px', '%', 'em' ],
464 'selectors' => [
465 '{{WRAPPER}} .timeline-text h6' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
466 ],
467 ]
468 );
469 $this->end_controls_tab(); // End Controls tab
470
471 // Controls tab For Hover
472 $this->start_controls_tab(
473 'title_hover',
474 [
475 'label' => esc_html__( 'Hover', 'enteraddons' ),
476 ]
477 );
478
479 $this->add_control(
480 'title_hover_color',
481 [
482 'label' => esc_html__( 'Title Hover Color', 'enteraddons' ),
483 'type' => \Elementor\Controls_Manager::COLOR,
484 'selectors' => [
485 '{{WRAPPER}} .enteraddons-single-timeline:hover .timeline-text h6' => 'color: {{VALUE}}',
486 ],
487 ]
488 );
489 $this->end_controls_tab(); // End Controls tab
490
491 $this->end_controls_tabs(); // end controls tabs section
492 $this->end_controls_section();
493
494 /**
495 * Style Tab
496 * ------------------------------ Descriptions Style Settings ------------------------------
497 *
498 */
499 $this->start_controls_section(
500 'enteraddons_timeline_descriptions_settings', [
501 'label' => esc_html__( 'Descriptions', 'enteraddons' ),
502 'tab' => Controls_Manager::TAB_STYLE,
503 ]
504 );
505 $this->start_controls_tabs( 'timeline_descriptions_tab' );
506 $this->start_controls_tab(
507 'descriptions_style_normal',
508 [
509 'label' => esc_html__( 'Normal', 'enteraddons' ),
510 ]
511 );
512 $this->add_control(
513 'descriptions_color',
514 [
515 'label' => esc_html__( 'Descriptions Color', 'enteraddons' ),
516 'type' => \Elementor\Controls_Manager::COLOR,
517 'selectors' => [
518 '{{WRAPPER}} .timeline-text p' => 'color: {{VALUE}}',
519 ],
520 ]
521 );
522 $this->add_group_control(
523 \Elementor\Group_Control_Typography::get_type(),
524 [
525 'name' => 'descriptions_typography',
526 'label' => esc_html__( 'Typography', 'enteraddons' ),
527 'selector' => '{{WRAPPER}} .timeline-text p',
528 ]
529 );
530 $this->add_responsive_control(
531 'descriptions_margin',
532 [
533 'label' => esc_html__( 'Margin', 'enteraddons' ),
534 'type' => Controls_Manager::DIMENSIONS,
535 'devices' => [ 'desktop', 'tablet', 'mobile' ],
536 'size_units' => [ 'px', '%', 'em' ],
537 'selectors' => [
538 '{{WRAPPER}} .timeline-text p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
539 ],
540 ]
541 );
542 $this->add_responsive_control(
543 'descriptions_padding',
544 [
545 'label' => esc_html__( 'Padding', 'enteraddons' ),
546 'type' => Controls_Manager::DIMENSIONS,
547 'devices' => [ 'desktop', 'tablet', 'mobile' ],
548 'size_units' => [ 'px', '%', 'em' ],
549 'selectors' => [
550 '{{WRAPPER}} .timeline-text p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
551 ],
552 ]
553 );
554
555 $this->end_controls_tab(); // End Controls tab
556
557 // Controls tab For Hover
558 $this->start_controls_tab(
559 'descriptions_hover',
560 [
561 'label' => esc_html__( 'Hover', 'enteraddons' ),
562 ]
563 );
564
565 $this->add_control(
566 'descriptions_hover_color',
567 [
568 'label' => esc_html__( 'Descriptions Hover Color', 'enteraddons' ),
569 'type' => \Elementor\Controls_Manager::COLOR,
570 'selectors' => [
571 '{{WRAPPER}} .enteraddons-single-timeline:hover .timeline-text p' => 'color: {{VALUE}}',
572 ],
573 ]
574 );
575 $this->end_controls_tab(); // End Controls tab
576
577 $this->end_controls_tabs(); // end controls tabs section
578
579 $this->end_controls_section();
580
581 /**
582 * Style Tab
583 * ------------------------------ Date Style Settings ------------------------------
584 *
585 */
586 $this->start_controls_section(
587 'enteraddons_date_style_settings', [
588 'label' => esc_html__( 'Date', 'enteraddons' ),
589 'tab' => Controls_Manager::TAB_STYLE,
590 ]
591 );
592 $this->start_controls_tabs( 'timeline_date_tab' );
593 $this->start_controls_tab(
594 'date_style_normal',
595 [
596 'label' => esc_html__( 'Normal', 'enteraddons' ),
597 ]
598 );
599 $this->add_control(
600 'date_color',
601 [
602 'label' => esc_html__( 'Date Color', 'enteraddons' ),
603 'type' => \Elementor\Controls_Manager::COLOR,
604 'selectors' => [
605 '{{WRAPPER}} .timeline-time span' => 'color: {{VALUE}}',
606 ],
607 ]
608 );
609 $this->add_group_control(
610 \Elementor\Group_Control_Typography::get_type(),
611 [
612 'name' => 'date_typography',
613 'label' => esc_html__( 'Typography', 'enteraddons' ),
614 'selector' => '{{WRAPPER}} .timeline-time span',
615 ]
616 );
617 $this->add_responsive_control(
618 'date_margin',
619 [
620 'label' => esc_html__( 'Margin', 'enteraddons' ),
621 'type' => Controls_Manager::DIMENSIONS,
622 'devices' => [ 'desktop', 'tablet', 'mobile' ],
623 'size_units' => [ 'px', '%', 'em' ],
624 'selectors' => [
625 '{{WRAPPER}} .timeline-time span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
626 ],
627 ]
628 );
629 $this->add_responsive_control(
630 'date_padding',
631 [
632 'label' => esc_html__( 'Padding', 'enteraddons' ),
633 'type' => Controls_Manager::DIMENSIONS,
634 'devices' => [ 'desktop', 'tablet', 'mobile' ],
635 'size_units' => [ 'px', '%', 'em' ],
636 'selectors' => [
637 '{{WRAPPER}} .timeline-time span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
638 ],
639 ]
640 );
641
642 $this->end_controls_tab(); // End Controls tab
643
644 // Controls tab For Hover
645 $this->start_controls_tab(
646 'date_hover',
647 [
648 'label' => esc_html__( 'Hover', 'enteraddons' ),
649 ]
650 );
651 $this->add_control(
652 'date_hover_color',
653 [
654 'label' => esc_html__( 'Date Hover Color', 'enteraddons' ),
655 'type' => \Elementor\Controls_Manager::COLOR,
656 'selectors' => [
657 '{{WRAPPER}} .enteraddons-single-timeline:hover .timeline-time span' => 'color: {{VALUE}}',
658 ],
659 ]
660 );
661 $this->end_controls_tab(); // End Controls tab
662
663 $this->end_controls_tabs(); // end controls tabs section
664 $this->end_controls_section();
665
666 /**
667 * Style Tab
668 * ------------------------------ Icon Wrapper Style Settings ------------------------------
669 *
670 */
671 $this->start_controls_section(
672 'enteraddons_timeline_icon_wrapper_settings', [
673 'label' => esc_html__( 'Icon Wrapper', 'enteraddons' ),
674 'tab' => Controls_Manager::TAB_STYLE,
675 ]
676 );
677 $this->start_controls_tabs( 'timeline_icon_wrap_tab' );
678 $this->start_controls_tab(
679 'icon_wrap_normal',
680 [
681 'label' => esc_html__( 'Normal', 'enteraddons' ),
682 ]
683 );
684 $this->add_responsive_control(
685 'icon_wrapper_width',
686 [
687 'label' => esc_html__( 'Image Container Width', 'enteraddons' ),
688 'type' => Controls_Manager::SLIDER,
689 'size_units' => [ 'px', '%' ],
690 'range' => [
691 'px' => [
692 'min' => 0,
693 'max' => 1000,
694 'step' => 1,
695 ],
696 '%' => [
697 'min' => 0,
698 'max' => 100,
699 ],
700 ],
701 'default' => [
702 'unit' => '%',
703 'size' => '',
704 ],
705 'selectors' => [
706 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon' => 'width: {{SIZE}}{{UNIT}};',
707 ],
708 ]
709 );
710 $this->add_responsive_control(
711 'icon_wrapper_height',
712 [
713 'label' => esc_html__( 'Image Container Height', 'enteraddons' ),
714 'type' => Controls_Manager::SLIDER,
715 'size_units' => [ 'px', '%' ],
716 'range' => [
717 'px' => [
718 'min' => 0,
719 'max' => 1000,
720 'step' => 1,
721 ],
722 '%' => [
723 'min' => 0,
724 'max' => 100,
725 ],
726 ],
727 'default' => [
728 'unit' => '%',
729 'size' => '',
730 ],
731 'selectors' => [
732 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon' => 'height: {{SIZE}}{{UNIT}};',
733 ],
734 ]
735 );
736 $this->add_responsive_control(
737 'icon_wrap_align',
738 [
739 'label' => esc_html__( 'Alignment', 'enteraddons' ),
740 'type' => \Elementor\Controls_Manager::CHOOSE,
741 'options' => [
742 'flex-start' => [
743 'title' => esc_html__( 'Left', 'enteraddons' ),
744 'icon' => 'fa fa-align-left',
745 ],
746 'center' => [
747 'title' => esc_html__( 'Center', 'enteraddons' ),
748 'icon' => 'fa fa-align-center',
749 ],
750 'flex-end' => [
751 'title' => esc_html__( 'Right', 'enteraddons' ),
752 'icon' => 'fa fa-align-right',
753 ],
754 ],
755 'default' => 'center',
756 'toggle' => true,
757 'selectors' => [
758 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon' => 'justify-content: {{VALUE}};',
759 ]
760 ]
761 );
762 $this->add_responsive_control(
763 'icon_wrapper_position',
764 [
765 'label' => esc_html__( 'Position', 'enteraddons' ),
766 'type' => Controls_Manager::DIMENSIONS,
767 'devices' => [ 'desktop', 'tablet', 'mobile' ],
768 'size_units' => [ 'px', '%', 'em' ],
769 'allowed_dimensions' => [ 'top', 'bottom' ],
770 'selectors' => [
771 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
772 ],
773 ]
774 );
775 $this->add_responsive_control(
776 'icon_wrapper_margin',
777 [
778 'label' => esc_html__( 'Margin', 'enteraddons' ),
779 'type' => Controls_Manager::DIMENSIONS,
780 'devices' => [ 'desktop', 'tablet', 'mobile' ],
781 'size_units' => [ 'px', '%', 'em' ],
782 'selectors' => [
783 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
784 ],
785 ]
786 );
787 $this->add_responsive_control(
788 'icon_wrapper_padding',
789 [
790 'label' => esc_html__( 'Padding', 'enteraddons' ),
791 'type' => Controls_Manager::DIMENSIONS,
792 'devices' => [ 'desktop', 'tablet', 'mobile' ],
793 'size_units' => [ 'px', '%', 'em' ],
794 'selectors' => [
795 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
796 ],
797 ]
798 );
799 $this->add_group_control(
800 \Elementor\Group_Control_Border::get_type(),
801 [
802 'name' => 'icon_wrapper_border',
803 'label' => esc_html__( 'Border', 'enteraddons' ),
804 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon',
805 ]
806 );
807 $this->add_responsive_control(
808 'icon_wrapper_border_radius',
809 [
810 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
811 'type' => Controls_Manager::DIMENSIONS,
812 'devices' => [ 'desktop', 'tablet', 'mobile' ],
813 'size_units' => [ 'px', '%', 'em' ],
814 'selectors' => [
815 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
816 ],
817 ]
818 );
819 $this->add_group_control(
820 \Elementor\Group_Control_Background::get_type(),
821 [
822 'name' => 'icon_wrapper_box_bg',
823 'label' => esc_html__( 'Background', 'enteraddons' ),
824 'types' => [ 'classic', 'gradient' ],
825 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon',
826 ]
827 );
828 $this->add_group_control(
829 \Elementor\Group_Control_Box_Shadow::get_type(),
830 [
831 'name' => 'icon_wrapper_box_shadow',
832 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
833 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon',
834 ]
835 );
836
837 $this->end_controls_tab(); // End Controls tab
838
839 // Controls tab For Hover
840 $this->start_controls_tab(
841 'icon_wrap_hover',
842 [
843 'label' => esc_html__( 'Hover', 'enteraddons' ),
844 ]
845 );
846 $this->add_group_control(
847 \Elementor\Group_Control_Background::get_type(),
848 [
849 'name' => 'icon_wrapper_hover_box_bg',
850 'label' => esc_html__( 'Background', 'enteraddons' ),
851 'types' => [ 'classic', 'gradient' ],
852 'selector' => '{{WRAPPER}} .enteraddons-single-timeline:hover .timeline-icon',
853 ]
854 );
855 $this->add_group_control(
856 \Elementor\Group_Control_Box_Shadow::get_type(),
857 [
858 'name' => 'icon_wrapper_hover_box_shadow',
859 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
860 'selector' => '{{WRAPPER}} .enteraddons-single-timeline:hover .timeline-icon',
861 ]
862 );
863 $this->end_controls_tab(); // End Controls tab
864
865 $this->end_controls_tabs(); // end controls tabs section
866 $this->end_controls_section();
867
868 /**
869 * Style Tab
870 * ------------------------------ Icon Style Settings ------------------------------
871 *
872 */
873 $this->start_controls_section(
874 'enteraddons_timeline_icon_settings', [
875 'label' => esc_html__( 'Icon', 'enteraddons' ),
876 'condition' => [ 'icon_type' => 'icon' ],
877 'tab' => Controls_Manager::TAB_STYLE,
878 ]
879 );
880 $this->start_controls_tabs( 'tab_timeline_icon' );
881 // Controls tab For Normal
882 $this->start_controls_tab(
883 'icon_normal',
884 [
885 'label' => esc_html__( 'Normal', 'enteraddons' ),
886 ]
887 );
888 $this->add_control(
889 'icon_color',
890 [
891 'label' => esc_html__( 'Icon Color', 'enteraddons' ),
892 'type' => \Elementor\Controls_Manager::COLOR,
893 'selectors' => [
894 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon i' => 'color: {{VALUE}}',
895 ],
896 ]
897 );
898 $this->add_responsive_control(
899 'icon_size',
900 [
901 'label' => esc_html__( 'Icon Size', 'enteraddons' ),
902 'type' => Controls_Manager::SLIDER,
903 'size_units' => [ 'px', '%' ],
904 'range' => [
905 'px' => [
906 'min' => 0,
907 'max' => 1000,
908 'step' => 1,
909 ],
910 '%' => [
911 'min' => 0,
912 'max' => 100,
913 ],
914 ],
915 'default' => [
916 'unit' => '%',
917 'size' => '',
918 ],
919 'selectors' => [
920 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
921 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img' => 'width: {{SIZE}}{{UNIT}};',
922 ],
923 ]
924 );
925
926 $this->end_controls_tab(); // End Controls tab
927
928 // Controls tab For Hover
929 $this->start_controls_tab(
930 'icon_hover',
931 [
932 'label' => esc_html__( 'Hover', 'enteraddons' ),
933 ]
934 );
935 $this->add_control(
936 'icon_hover_color',
937 [
938 'label' => esc_html__( 'Icon Hover Color', 'enteraddons' ),
939 'type' => \Elementor\Controls_Manager::COLOR,
940 'selectors' => [
941 '{{WRAPPER}} .enteraddons-single-timeline:hover .timeline-icon i' => 'color: {{VALUE}}',
942 ],
943 ]
944 );
945
946 $this->end_controls_tab(); // End Controls tab
947 $this->end_controls_tabs(); // end controls tabs section
948 $this->end_controls_section();
949
950 /**
951 * Style Tab
952 * ------------------------------ Icon Image Style Settings ------------------------------
953 *
954 */
955
956 $this->start_controls_section(
957 'enteraddons_timeline_img_icon_settings', [
958 'label' => esc_html__( 'Image Icon', 'enteraddons' ),
959 'condition' => [ 'icon_type' => 'img' ],
960 'tab' => Controls_Manager::TAB_STYLE,
961 ]
962 );
963
964 $this->add_responsive_control(
965 'img_icon_container_width',
966 [
967 'label' => esc_html__( 'Image Container Width', 'enteraddons' ),
968 'type' => Controls_Manager::SLIDER,
969 'size_units' => [ 'px', '%' ],
970 'range' => [
971 'px' => [
972 'min' => 0,
973 'max' => 1000,
974 'step' => 1,
975 ],
976 '%' => [
977 'min' => 0,
978 'max' => 100,
979 ],
980 ],
981 'default' => [
982 'unit' => '%',
983 'size' => '',
984 ],
985 'selectors' => [
986 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img' => 'width: {{SIZE}}{{UNIT}};',
987 ],
988 ]
989 );
990 $this->add_responsive_control(
991 'img_icon_container_height',
992 [
993 'label' => esc_html__( 'Image Container Height', 'enteraddons' ),
994 'type' => Controls_Manager::SLIDER,
995 'size_units' => [ 'px', '%' ],
996 'range' => [
997 'px' => [
998 'min' => 0,
999 'max' => 1000,
1000 'step' => 1,
1001 ],
1002 '%' => [
1003 'min' => 0,
1004 'max' => 100,
1005 ],
1006 ],
1007 'default' => [
1008 'unit' => '%',
1009 'size' => '',
1010 ],
1011 'selectors' => [
1012 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img' => 'height: {{SIZE}}{{UNIT}};',
1013 ],
1014 ]
1015 );
1016
1017 $this->add_responsive_control(
1018 'img_icon_margin',
1019 [
1020 'label' => esc_html__( 'Margin', 'enteraddons' ),
1021 'type' => Controls_Manager::DIMENSIONS,
1022 'devices' => [ 'desktop', 'tablet', 'mobile' ],
1023 'size_units' => [ 'px', '%', 'em' ],
1024 'selectors' => [
1025 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1026 ],
1027 ]
1028 );
1029 $this->add_responsive_control(
1030 'img_icon_padding',
1031 [
1032 'label' => esc_html__( 'Padding', 'enteraddons' ),
1033 'type' => Controls_Manager::DIMENSIONS,
1034 'devices' => [ 'desktop', 'tablet', 'mobile' ],
1035 'size_units' => [ 'px', '%', 'em' ],
1036 'selectors' => [
1037 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1038 ],
1039 ]
1040 );
1041 $this->add_group_control(
1042 \Elementor\Group_Control_Border::get_type(),
1043 [
1044 'name' => 'img_icon_wrapper_border',
1045 'label' => esc_html__( 'Border', 'enteraddons' ),
1046 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img',
1047 ]
1048 );
1049 $this->add_responsive_control(
1050 'img_icon_wrapper_border_radius',
1051 [
1052 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
1053 'type' => Controls_Manager::DIMENSIONS,
1054 'devices' => [ 'desktop', 'tablet', 'mobile' ],
1055 'size_units' => [ 'px', '%', 'em' ],
1056 'selectors' => [
1057 '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1058 ],
1059 ]
1060 );
1061 $this->add_group_control(
1062 \Elementor\Group_Control_Background::get_type(),
1063 [
1064 'name' => 'img_icon_box_bg',
1065 'label' => esc_html__( 'Background', 'enteraddons' ),
1066 'types' => [ 'classic', 'gradient' ],
1067 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img',
1068 ]
1069 );
1070 $this->add_group_control(
1071 \Elementor\Group_Control_Box_Shadow::get_type(),
1072 [
1073 'name' => 'img_icon_box_shadow',
1074 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
1075 'selector' => '{{WRAPPER}} .enteraddons-single-timeline .timeline-icon img',
1076 ]
1077 );
1078
1079 $this->end_controls_section();
1080 }
1081
1082 protected function render() {
1083 // get settings
1084 $settings = $this->get_settings_for_display();
1085 // Testimonial template render
1086 $obj = new Timeline_Template();
1087 $obj::setDisplaySettings( $settings );
1088 $obj->renderTemplate();
1089 }
1090
1091 public function get_script_depends() {
1092 return [ 'enteraddons-main'];
1093 }
1094
1095 public function get_style_depends() {
1096 return [ 'enteraddons-global-style', 'fontawesome' ];
1097 }
1098
1099
1100 }
1101