start_controls_section( 'content_section', [ 'label' => __( 'Timeline', 'be-pack' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'image', [ 'label' => __( 'Choose Image', 'be-pack' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $repeater->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'thumbnail', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`. 'separator' => 'none', ] ); $repeater->add_control( 'list_title', [ 'label' => __( 'Title', 'be-pack' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Timeline' , 'be-pack' ), 'label_block' => true, ] ); $repeater->add_control( 'list_content', [ 'label' => __( 'Timelines', 'be-pack' ), 'type' => \Elementor\Controls_Manager::WYSIWYG, 'default' => __( 'Item content. Click the edit button to change this text.' , 'be-pack' ), 'show_label' => false, ] ); $this->add_control( 'list', [ 'label' => __( 'Repeater Control', '' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => array_values( $repeater->get_controls() ), 'default' => [ [ 'list_title' => __( 'Timeline', 'be-pack' ), 'list_content' => __( 'Item content. Click the edit button to change this text.', 'be-pack' ), ], [ 'list_title' => __( 'Timeline', 'be-pack' ), 'list_content' => __( 'Item content. Click the edit button to change this text.', 'be-pack' ), ], ], 'title_field' => '{{{ list_title }}}', ] ); $this->end_controls_section(); /*------- BoxStyle ------------*/ $this->start_controls_section( 'content_style', [ 'label' => __( 'Content Style', 'be-pack' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __( 'Title Fonts Color', 'be-pack' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_2, ], 'selectors' => [ '{{WRAPPER}} .tl-heading h4' => 'color: {{title_color}}', ], 'default' => '#333333', ] ); $this->add_control( 'content_color', [ 'label' => __( 'Content Fonts Color', 'be-pack' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_2, ], 'selectors' => [ '{{WRAPPER}} .be-pack .timeline-panel, .be-pack .timeline-panel p' => 'color: {{content_color}}', ], 'default' => '#333333', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'label' => 'Title Typography', 'name' => 'tile_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .be-pack .tl-heading h4', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'label' => 'Content Typography', 'name' => 'content_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .be-pack .timeline-panel', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'label' => 'Title Text Shadow', 'name' => 'text_shadow', 'selector' => '{{WRAPPER}} .tl-heading h4', ] ); $this->add_control( 'title_margin', [ 'label' => __( 'Title Margin', 'be-pack' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .be-pack.timeline .be-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); //=======Content style ======= $this->start_controls_section( 'section_title_style', [ 'label' => __( 'Box Style', 'be-pack' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'theme_color', [ 'label' => __( 'Border Color', 'be-pack' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_2, ], 'selectors' => [ '{{WRAPPER}} .timeline li .tl-circ' => 'background: {{theme_color}};border:5px solid #e6e6e6 !important', ' .timeline li .timeline-panel:before' => 'border-left:15px solid {{theme_color}}; border-right:0px solid {{theme_color}};', ' .timeline li .timeline-panel' => 'border:1px solid {{theme_color}};', ' .timeline::before' => 'background-color:{{theme_color}};', ], ] ); $this->add_control( 'bg_color', [ 'label' => __( 'Background Color', 'be-pack' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_2, ], 'selectors' => [ '{{WRAPPER}} .be-pack .timeline-panel' => 'background-color: {{bg_color}}', '.timeline li .timeline-panel:after' =>'border-left: 14px solid {{bg_color}}; border-right: 0 solid {{bg_color}}' ], 'default' => '#fff', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_box_shadow', 'selector' => '{{WRAPPER}} .timeline-panel', ] ); $this->end_controls_section(); $this->start_controls_section( 'image_style', [ 'label' => __( 'Image Style', 'be-pack' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'border_radius', [ 'label' => __( 'Border Radius', 'be-pack' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .be-pack.timeline .timeline_pic img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default'=>[ 'top' =>15, 'right' => 15, 'bottom' => 15, 'left' => 15, 'isLinked' => true, ], ] ); $this->add_control( 'gap', [ 'label' => __( 'Image Padding', 'be-pack' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .be-pack.timeline .timeline_pic' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default'=>[ 'top' =>15, 'right' => 15, 'bottom' => 15, 'left' => 15, 'isLinked' => true, ], ] ); $this->end_controls_section(); } /** * Render widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $data = $settings['list']; $count=0; echo '