start_controls_section( 'section_timeline', [ 'label' => __( 'Timeline', 'elementor-extras' ), 'condition' => [ 'source!' => 'posts', ] ] ); $repeater = new Repeater(); $repeater->start_controls_tabs( 'items_repeater' ); $repeater->start_controls_tab( 'tab_content', [ 'label' => __( 'Content', 'elementor-extras' ) ] ); $repeater->add_control( 'date', [ 'label' => __( 'Date', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true ], 'placeholder' => __( '19 January 2000', 'elementor-extras' ), ] ); $repeater->add_control( 'link', [ 'label' => __( 'Link', 'elementor-extras' ), 'description' => __( 'Enable linking the whole card. If you have links inside the content of this card, make sure you have this disabled. Links within links are not allowed.', 'elementor-extras' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true ], 'placeholder' => esc_url( home_url( '/' ) ), 'default' => [ 'url' => '', ], ] ); $default_title = '
' . _x( 'Something really big happened around this period of time. It affected all of humanity. That explains everything.', 'Default title for the content of a hotspot.', 'elementor-extras' ) . '
'; $repeater->add_control( 'content', [ 'label' => '', 'type' => Controls_Manager::WYSIWYG, 'dynamic' => [ 'active' => true ], 'default' => $default_title . $default_paragraph, ] ); $repeater->end_controls_tab(); $repeater->start_controls_tab( 'tab_media', [ 'label' => __( 'Media', 'elementor-extras' ) ] ); $repeater->add_control( 'image', [ 'label' => __( 'Choose Image', 'elementor-extras' ), 'dynamic' => [ 'active' => true ], 'type' => Controls_Manager::MEDIA, ] ); $repeater->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'image', // Actually its `image_size` 'label' => __( 'Image Size', 'elementor-extras' ), 'default' => 'large', ] ); $repeater->end_controls_tab(); $repeater->start_controls_tab( 'tab_style', [ 'label' => __( 'Style', 'elementor-extras' ) ] ); $repeater->add_control( 'custom_style', [ 'label' => __( 'Custom', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'description' => __( 'Set custom styles that will only affect this specific item.', 'elementor-extras' ), ] ); $repeater->add_control( 'point_content_type', [ 'label' => __( 'Type', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'Global', 'elementor-extras' ), 'icons' => __( 'Icon', 'elementor-extras' ), 'numbers' => __( 'Number', 'elementor-extras' ), 'letters' => __( 'Letter', 'elementor-extras' ), ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ] ], ], ] ); $repeater->add_control( 'selected_icon', [ 'label' => __( 'Point Icon', 'elementor-extras' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon', 'default' => [ 'value' => 'fas fa-calendar-alt', 'library' => 'fa-solid', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], [ 'name' => 'point_content_type', 'operator' => '==', 'value' => 'icons', ], ], ], ] ); $repeater->add_control( 'point_content', [ 'label' => __( 'Point Content', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], [ 'name' => 'point_content_type', 'operator' => '!==', 'value' => 'icons', ], [ 'name' => 'point_content_type', 'operator' => '!==', 'value' => '', ], ], ], ] ); $repeater->add_control( 'item_default', [ 'label' => __( 'Default', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'icon_color', [ 'label' => __( 'Point Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}} .timeline-item__point' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'point_background', [ 'label' => __( 'Point Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .ee-timeline {{CURRENT_ITEM}} .timeline-item__point' => 'background-color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'card_foreground', [ 'label' => __( 'Text Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item .timeline-item__content *' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'card_background', [ 'label' => __( 'Card Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item .timeline-item__content-wrapper' => 'background-color: {{VALUE}};', '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item .timeline-item__card__arrow::after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'date_color', [ 'label' => __( 'Date Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item .timeline-item__meta' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'point_size', [ 'label' => __( 'Scale', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0.5, 'max' => 2, 'step' => 0.01 ], ], 'selectors' => [ // Item '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item .timeline-item__point' => 'transform: scale({{SIZE}})', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'item_hover', [ 'label' => __( 'Hover', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'icon_color_hover', [ 'label' => __( 'Hovered Point Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item:hover .timeline-item__point, {{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused:hover .timeline-item__point' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'point_background_hover', [ 'label' => __( 'Hovered Point Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item:hover .timeline-item__point, {{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused:hover .timeline-item__point' => 'background-color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'card_foreground_hover', [ 'label' => __( 'Text Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item:hover .timeline-item__content *' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'card_background_hover', [ 'label' => __( 'Hovered Card Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item:hover .timeline-item__content-wrapper, {{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused:hover .timeline-item__content-wrapper' => 'background-color: {{VALUE}};', '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item:hover .timeline-item__card__arrow::after, {{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused:hover .timeline-item__card__arrow::after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'date_color_hover', [ 'label' => __( 'Hovered Date Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item:hover .timeline-item__meta, {{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused:hover .timeline-item__meta' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'point_size_hover', [ 'label' => __( 'Hovered Point Scale', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0.5, 'max' => 2, 'step' => 0.01 ], ], 'selectors' => [ // Item '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item:hover .timeline-item__point, {{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused:hover .timeline-item__point' => 'transform: scale({{SIZE}})', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'item_focused', [ 'label' => __( 'Focused', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'icon_color_focused', [ 'label' => __( 'Focused Point Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused .timeline-item__point' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'point_background_focused', [ 'label' => __( 'Focused Point Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .ee-timeline {{CURRENT_ITEM}}.timeline-item.is--focused .timeline-item__point' => 'background-color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'card_foreground_focused', [ 'label' => __( 'Text Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused .timeline-item__content *' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'card_background_focused', [ 'label' => __( 'Focused Card Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused .timeline-item__content-wrapper' => 'background-color: {{VALUE}};', '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused .timeline-item__card__arrow::after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'date_color_focused', [ 'label' => __( 'Focused Date Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused .timeline-item__meta' => 'color: {{VALUE}};', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->add_control( 'point_size_focused', [ 'label' => __( 'Focused Point Scale', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0.5, 'max' => 2, 'step' => 0.01 ], ], 'selectors' => [ // Item '{{WRAPPER}} {{CURRENT_ITEM}}.timeline-item.is--focused .timeline-item__point' => 'transform: scale({{SIZE}})', ], 'conditions' => [ 'terms' => [ [ 'name' => 'custom_style', 'operator' => '==', 'value' => 'yes', ], ], ], ] ); $repeater->end_controls_tab(); $repeater->end_controls_tabs(); $this->add_control( 'items', [ 'label' => __( 'Items', 'elementor-extras' ), 'type' => Controls_Manager::REPEATER, 'default' => [ [ 'date' => __( 'February 2, 2014', 'elementor-extras' ) ], [ 'date' => __( 'May 10, 2015', 'elementor-extras' ) ], [ 'date' => __( 'June 21, 2016', 'elementor-extras' ) ], ], 'fields' => $repeater->get_controls(), 'title_field' => '{{{ date }}}', 'condition' => [ 'source' => 'custom' ] ] ); $this->end_controls_section(); } protected function _register_controls() { $posts_control_settings = [ 'label' => __( 'Source', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'custom', 'options' => [ 'custom' => __( 'Custom', 'elementor-extras' ), ], ]; if ( is_elementor_pro_active() ) { $posts_control_settings[ 'options' ][ 'posts' ] = __( 'Posts', 'elementor-extras' ); } $this->start_controls_section( 'section_settings', [ 'label' => __( 'Settings', 'elementor-extras' ), ] ); $this->add_control( 'source', $posts_control_settings ); if ( ! is_elementor_pro_active() ) { $this->add_control( 'posts_go_pro', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => Utils::get_elementor_pro_locked_html(), 'condition' => [ 'source' => 'posts' ] ] ); } else if ( is_elementor_pro_active() ) { $this->add_control( 'post_skin', [ 'label' => __( 'Post Skin', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => __( 'Default', 'elementor-extras' ), 'template' => __( 'Template', 'elementor-extras' ), ], 'condition' => [ 'source' => 'posts', ], ] ); $this->add_control( 'post_skin_template', [ 'label' => __( 'Post Template', 'elementor-extras' ), 'type' => 'ee-query', 'query_type' => 'templates', 'label_block' => false, 'multiple' => false, 'condition' => [ 'post_skin' => 'template', 'source' => 'posts', ], ] ); $this->add_control( 'posts_per_page', [ 'label' => __( 'Posts Per Page', 'elementor-extras' ), 'type' => Controls_Manager::NUMBER, 'default' => 6, 'condition' => [ 'source' => 'posts' ] ] ); } $this->add_control( 'card_links', [ 'label' => __( 'Enable Links', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'description' => __( 'Enable links at card level. If you have links inside the content of a card, make sure you have this disabled. Links within links are not allowed.', 'elementor-extras' ), 'condition' => [ 'source' => 'posts', ] ] ); $this->end_controls_section(); $this->register_items_controls(); if ( is_elementor_pro_active() ) { $this->register_query_content_controls([ 'source' => 'posts', ]); } $this->start_controls_section( 'section_posts', [ 'label' => __( 'Posts', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_CONTENT, 'condition' => [ 'source' => 'posts', ] ] ); $this->add_control( 'date_heading', [ 'label' => __( 'Date', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'condition' => [ 'source' => 'posts', ] ] ); $this->add_control( 'date_source', [ 'label' => __( 'Date Source', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Post Date', 'elementor-extras' ), 'custom' => __( 'Custom', 'elementor-extras' ), ], 'condition' => [ 'source' => 'posts', ], 'default' => '', ] ); $this->add_control( 'date_custom', [ 'label' => __( 'Date', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'label_block' => false, 'dynamic' => [ 'active' => true, 'loop' => true, ], 'condition' => [ 'source' => 'posts', 'date_source' => 'custom', ], ] ); $this->add_control( 'date_format', [ 'label' => __( 'Date Format', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'default' => __( 'Default', 'elementor-extras' ), '' => __( 'None', 'elementor-extras' ), 'F j, Y' => date( 'F j, Y' ), 'Y-m-d' => date( 'Y-m-d' ), 'm/d/Y' => date( 'm/d/Y' ), 'd/m/Y' => date( 'd/m/Y' ), 'custom' => __( 'Custom', 'elementor-extras' ), ], 'condition' => [ 'source' => 'posts', 'date_source' => '', ], 'default' => 'default', ] ); $this->add_control( 'time_format', [ 'label' => __( 'Time Format', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'default' => __( 'Default', 'elementor-extras' ), '' => __( 'None', 'elementor-extras' ), 'g:i a' => date( 'g:i a' ), 'g:i A' => date( 'g:i A' ), 'H:i' => date( 'H:i' ), ], 'default' => 'default', 'condition' => [ 'source' => 'posts', 'date_source' => '', 'date_format!' => 'custom', ], ] ); $this->add_control( 'date_custom_format', [ 'label' => __( 'Custom Format', 'elementor-extras' ), 'default' => get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), 'description' => sprintf( '%s', __( 'Documentation on date and time formatting', 'elementor-extras' ) ), 'condition' => [ 'source' => 'posts', 'date_format' => 'custom', ], ] ); $this->add_control( 'post_title_heading', [ 'label' => __( 'Title', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', ] ] ); $this->add_control( 'post_title', [ 'label' => __( 'Show Title', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', ] ] ); $this->add_control( 'post_title_source', [ 'label' => __( 'Title Source', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Post Title', 'elementor-extras' ), 'custom' => __( 'Custom', 'elementor-extras' ), ], 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', 'post_title!' => '', ], 'default' => '', ] ); $this->add_control( 'post_title_custom', [ 'label' => __( 'Title', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'label_block' => false, 'dynamic' => [ 'active' => true, 'loop' => true, ], 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', 'post_title!' => '', 'post_title_source' => 'custom', ], ] ); $this->add_control( 'post_title_element', [ 'label' => __( 'HTML Element', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => __( 'H1', 'elementor-extras' ), 'h2' => __( 'H2', 'elementor-extras' ), 'h3' => __( 'H3', 'elementor-extras' ), 'h4' => __( 'H4', 'elementor-extras' ), 'h5' => __( 'H5', 'elementor-extras' ), 'h6' => __( 'H6', 'elementor-extras' ), 'div' => __( 'div', 'elementor-extras' ), 'span' => __( 'span', 'elementor-extras' ), ], 'default' => 'h2', 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', 'post_title!' => '', ], ] ); $this->add_control( 'post_excerpt_heading', [ 'label' => __( 'Excerpt', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', ] ] ); $this->add_control( 'post_excerpt', [ 'label' => __( 'Excerpt Source', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Hide', 'elementor-extras' ), 'yes' => __( 'Post Excerpt', 'elementor-extras' ), 'content' => __( 'Post Content', 'elementor-extras' ), 'custom' => __( 'Custom', 'elementor-extras' ), ], 'default' => 'yes', 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', ], ] ); $this->add_control( 'post_excerpt_custom', [ 'label' => __( 'Excerpt', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'label_block' => false, 'dynamic' => [ 'active' => true, 'loop' => true, ], 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', 'post_excerpt' => 'custom', ], ] ); $this->add_control( 'post_excerpt_trim_custom', [ 'label' => __( 'Trim Custom Excerpts', 'elementor-extras' ), 'description' => __( 'Custom excerpts are set manually in the Excerpt field for each post. Enable this if you want to trim those down to the above length as well.' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'return_value' => 'yes', 'condition' => [ 'post_excerpt' => 'yes', 'post_skin' => 'default', ], ] ); $this->add_control( 'post_excerpt_length', [ 'label' => __( 'Excerpt Length', 'elementor-extras' ), 'type' => Controls_Manager::NUMBER, 'default' => apply_filters( 'excerpt_length', 25 ), 'condition' => [ 'post_excerpt' => 'yes', 'post_skin' => 'default', ], ] ); $this->add_control( 'post_excerpt_more', [ 'label' => __( 'Trimmed Suffix', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'default' => '…', 'condition' => [ 'post_excerpt' => 'yes', 'post_skin' => 'default', ], ] ); $this->add_control( 'post_thumbnail_heading', [ 'label' => __( 'Thumbnail', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', ] ] ); $this->add_control( 'post_thumbnail', [ 'label' => __( 'Show Image', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', ] ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'post_thumbnail_size', 'label' => __( 'Image Size', 'elementor-extras' ), 'default' => 'medium', 'prefix_class' => 'elementor-portfolio--thumbnail-size-', 'condition' => [ 'source' => 'posts', 'post_thumbnail' => 'yes', 'post_skin' => 'default', ] ] ); if ( is_woocommerce_active() ) { $this->add_control( 'post_product_heading', [ 'label' => __( 'Products', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'condition' => [ 'source' => 'posts', 'posts_post_type' => 'product', 'post_skin' => 'default', ] ] ); $this->add_control( 'post_buy', [ 'label' => __( 'Buy Button', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'card_links!' => 'yes', 'posts_post_type' => 'product', 'post_skin' => 'default', ] ] ); $this->add_control( 'post_product_attributes', [ 'label' => __( 'Show Attributes', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'source' => 'posts', 'posts_post_type' => 'product', 'post_skin' => 'default', ] ] ); $this->add_control( 'post_product_attributes_exclude', [ 'label' => __( 'Exclude attributes', 'elementor-extras' ), 'description' => __( 'Enter attribute slugs, names or ids, separated by commas', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'source' => 'posts', 'posts_post_type' => 'product', 'post_skin' => 'default', ] ] ); } $this->end_controls_section(); $this->start_controls_section( 'section_layout', [ 'label' => __( 'Layout', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Horizontal Align', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'label_block' => true, 'default' => 'center', 'tablet_default'=> 'left', 'mobile_default'=> 'left', 'options' => [ 'left' => __( 'Left', 'elementor-extras' ), 'center' => __( 'Center', 'elementor-extras' ), 'overlay' => __( 'Overlay', 'elementor-extras' ), 'right' => __( 'Right', 'elementor-extras' ), ], 'prefix_class' => 'ee-timeline-align%s--', ] ); $this->add_control( 'reverse', [ 'label' => __( 'Reverse Cards Positions', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'align' => [ 'center' ], ], ] ); $this->add_responsive_control( 'cards_align', [ 'label' => __( 'Vertical Align', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'label_block' => true, 'default' => 'top', 'tablet_default'=> 'top', 'mobile_default'=> 'top', 'options' => [ 'top' => __( 'Top', 'elementor-extras' ), 'middle' => __( 'Middle', 'elementor-extras' ), 'bottom' => __( 'Bottom', 'elementor-extras' ), ], 'prefix_class' => 'ee-timeline-cards-align%s--', ] ); $this->add_responsive_control( 'horizontal_spacing', [ 'label' => __( 'Horizontal Spacing', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item .timeline-item__point' => 'margin-left: {{SIZE}}px; margin-right: {{SIZE}}px;', ], ] ); $this->add_responsive_control( 'vertical_spacing', [ 'label' => __( 'Vertical Spacing', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .ee-timeline__item, {{WRAPPER}}.ee-timeline-align--overlay .timeline-item__point' => 'margin-bottom: {{SIZE}}px;', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_images', [ 'label' => __( 'Images', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'post_skin' => 'default', ], ] ); $this->add_control( 'cards_images_align', [ 'label' => __( 'Alignment', 'elementor-extras' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'left', 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor-extras' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor-extras' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor-extras' ), 'icon' => 'eicon-h-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item .timeline-item__img' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'cards_images_spacing', [ 'label' => __( 'Spacing', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item .timeline-item__img' => 'margin-bottom: {{SIZE}}px;', ], ] ); $this->add_control( 'images_border_radius', [ 'label' => __( 'Border Radius', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_posts_style', [ 'label' => __( 'Posts', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'source' => 'posts', 'post_skin' => 'default', ] ] ); $this->add_control( 'titles_heading', [ 'label' => __( 'Title', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'condition' => [ 'source' => 'posts', 'post_title!' => '', ] ] ); $this->add_control( 'title_color', [ 'label' => __( 'Title Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__title a' => 'color: {{VALUE}};', ], 'condition' => [ 'source' => 'posts', 'post_title!' => '', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'titles_typography', 'selector' => '{{WRAPPER}} .ee-timeline .timeline-item__title', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_SECONDARY, ], 'condition' => [ 'source' => 'posts', 'post_title!' => '', ], ] ); $this->add_control( 'titles_spacing', [ 'label' => __( 'Spacing', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__title' => 'margin-bottom: {{SIZE}}px;', ], 'condition' => [ 'source' => 'posts', 'post_title!' => '', ], ] ); $this->add_control( 'excerpt_heading', [ 'label' => __( 'Excerpt', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'condition' => [ 'source' => 'posts', 'post_excerpt!' => '', ] ] ); $this->add_control( 'excerpt_color', [ 'label' => __( 'Excerpt Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__excerpt' => 'color: {{VALUE}};', ], 'condition' => [ 'source' => 'posts', 'post_excerpt!' => '', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'excerpt_typography', 'selector' => '{{WRAPPER}} .ee-timeline .timeline-item__excerpt', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_TEXT, ], 'condition' => [ 'source' => 'posts', 'post_excerpt!' => '', ] ] ); $this->add_responsive_control( 'excerpt_padding', [ 'label' => __( 'Padding', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__excerpt' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'source' => 'posts', 'post_excerpt!' => '', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_cards', [ 'label' => __( 'Cards', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'cards_padding', [ 'label' => __( 'Card Padding', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'cards_margin', [ 'label' => __( 'Card Margin', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__card' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'cards_content_padding', [ 'label' => __( 'Content Padding', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'cards_border_radius', [ 'label' => __( 'Border Radius', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__content-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'animate_in', [ 'label' => __( 'Animate Cards', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'animate', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'animate', 'prefix_class' => 'ee-timeline%s-' ] ); $this->add_group_control( Group_Control_Transition::get_type(), [ 'name' => 'cards', 'selector' => '{{WRAPPER}} .timeline-item__content-wrapper, {{WRAPPER}} .timeline-item__content__wysiwyg *, {{WRAPPER}} .timeline-item__title, {{WRAPPER}} .timeline-item__meta, {{WRAPPER}} .timeline-item__excerpt, {{WRAPPER}} .timeline-item__card__arrow::after', 'separator' => '', ] ); $this->start_controls_tabs( 'tabs_cards' ); $this->start_controls_tab( 'tab_cards_default', [ 'label' => __( 'Default', 'elementor-extras' ) ] ); $this->add_responsive_control( 'cards_color', [ 'label' => __( 'Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .timeline-item__content-wrapper, {{WRAPPER}} .timeline-item__content-wrapper *' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'cards_background_color', [ 'label' => __( 'Background Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .timeline-item__content-wrapper' => 'background-color: {{VALUE}};', '{{WRAPPER}} .timeline-item__card .timeline-item__card__arrow::after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'cards_box_shadow', 'selector' => '{{WRAPPER}} .timeline-item__content-wrapper', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_cards_hover', [ 'label' => __( 'Hover', 'elementor-extras' ) ] ); $this->add_responsive_control( 'cards_color_hover', [ 'label' => __( 'Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .timeline-item:hover .timeline-item__content-wrapper, {{WRAPPER}} .timeline-item:hover .timeline-item__content-wrapper *' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'cards_background_color_hover', [ 'label' => __( 'Background Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__content-wrapper' => 'background-color: {{VALUE}};', '{{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__card .timeline-item__card__arrow::after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'cards_box_shadow_hover', 'selector' => '{{WRAPPER}} .timeline-item:hover .timeline-item__content-wrapper', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_cards_focused', [ 'label' => __( 'Focused', 'elementor-extras' ) ] ); $this->add_responsive_control( 'cards_color_focused', [ 'label' => __( 'Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .timeline-item.is--focused .timeline-item__content-wrapper, {{WRAPPER}} .timeline-item.is--focused .timeline-item__content-wrapper *' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'cards_background_color_focused', [ 'label' => __( 'Background Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .timeline-item.is--focused .timeline-item__content-wrapper' => 'background-color: {{VALUE}};', '{{WRAPPER}} .timeline-item.is--focused .timeline-item__card__arrow::after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'cards_box_shadow_focused', 'selector' => '{{WRAPPER}} .timeline-item.is--focused .timeline-item__content-wrapper', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'cards_text_shadow', 'selector' => '{{WRAPPER}} .ee-timeline .timeline-item__content-wrapper', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'cards_typography', 'selector' => '{{WRAPPER}} .ee-timeline .timeline-item__content-wrapper', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_TEXT, ], 'condition' => [ 'post_skin' => 'default', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_dates', [ 'label' => __( 'Dates', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'dates_padding', [ 'label' => __( 'Padding', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__meta' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'dates_margin', [ 'label' => __( 'Margin', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__meta' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'dates_text_shadow', 'selector' => '{{WRAPPER}} .ee-timeline .timeline-item__meta', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'dates_typography', 'selector' => '{{WRAPPER}} .ee-timeline .timeline-item__meta', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_ACCENT, ], ] ); $this->start_controls_tabs( 'tabs_dates_style' ); $this->start_controls_tab( 'tab_dates_default', [ 'label' => __( 'Default', 'elementor-extras' ) ] ); $this->add_responsive_control( 'dates_color', [ 'label' => __( 'Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ee-timeline .timeline-item__meta' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_dates_hover', [ 'label' => __( 'Hover', 'elementor-extras' ) ] ); $this->add_responsive_control( 'dates_color_hover', [ 'label' => __( 'Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ee-timeline .ee-timeline__item:hover .timeline-item__meta' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_dates_focused', [ 'label' => __( 'Focused', 'elementor-extras' ) ] ); $this->add_responsive_control( 'dates_color_focused', [ 'label' => __( 'Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ee-timeline .ee-timeline__item.is--focused .timeline-item__meta' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_points', [ 'label' => __( 'Points', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'points_content', [ 'label' => __( 'Type', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'icons', 'options' => [ 'icons' => __( 'Icons', 'elementor-extras' ), 'numbers' => __( 'Numbers', 'elementor-extras' ), 'letters' => __( 'Letters', 'elementor-extras' ), ], ] ); $this->add_control( 'selected_global_icon', [ 'label' => __( 'Icon', 'elementor-extras' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'global_icon', 'default' => [ 'value' => 'fas fa-calendar-alt', 'library' => 'fa-solid', ], 'condition' => [ 'points_content' => 'icons', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'points_typography', 'selector' => '{{WRAPPER}} .ee-timeline .timeline-item__point', 'exclude' => [ 'font_size' ], 'condition' => [ 'points_content!' => 'icons', ], ] ); $this->add_group_control( Group_Control_Transition::get_type(), [ 'name' => 'points', 'selector' => '{{WRAPPER}} .timeline-item__point', 'separator' => '', ] ); $this->start_controls_tabs( 'tabs_points' ); $this->start_controls_tab( 'points_default', [ 'label' => __( 'Default', 'elementor-extras' ) ] ); $this->add_responsive_control( 'points_size', [ 'label' => __( 'Size', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 40, ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 80, ], ], 'selectors' => [ '{{WRAPPER}} .timeline-item__point' => 'width: {{SIZE}}px; height: {{SIZE}}px', '{{WRAPPER}} .timeline-item__card__arrow' => 'height: {{SIZE}}px;', '{{WRAPPER}} .ee-timeline-align--left .ee-timeline__line' => 'margin-left: calc( {{SIZE}}px / 2 );', '{{WRAPPER}} .ee-timeline-align--right .ee-timeline__line' => 'margin-right: calc( {{SIZE}}px / 2 );', '(tablet){{WRAPPER}} .ee-timeline-align--center .ee-timeline__line' => 'margin-left: calc( {{points_size_tablet.SIZE}}px / 2 );', '(mobile){{WRAPPER}} .ee-timeline-align--center .ee-timeline__line' => 'margin-left: calc( {{points_size_mobile.SIZE}}px / 2 );', ], ] ); $this->add_responsive_control( 'icons_size', [ 'label' => __( 'Icon Size', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'step' => 0.1, 'min' => 1, 'max' => 4, ], ], 'selectors' => [ '{{WRAPPER}} .timeline-item__point' => 'font-size: {{SIZE}}em', ], 'condition' => [ 'points_content' => 'icons' ] ] ); $this->add_responsive_control( 'content_size', [ 'label' => __( 'Content Size', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 4, ], ], 'selectors' => [ '{{WRAPPER}} .timeline-item__point__text' => 'font-size: {{SIZE}}em', ], 'condition' => [ 'points_content!' => 'icons' ] ] ); $this->add_control( 'points_background', [ 'label' => __( 'Background Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => Global_Colors::COLOR_SECONDARY, ], 'selectors' => [ '{{WRAPPER}} .timeline-item .timeline-item__point' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'icons_color', [ 'label' => __( 'Points Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .timeline-item .timeline-item__point' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'points_text_shadow', 'selector' => '{{WRAPPER}} .timeline-item .timeline-item__point', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'points_hover', [ 'label' => __( 'Hover', 'elementor-extras' ) ] ); $this->add_control( 'points_size_hover', [ 'label' => __( 'Scale', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'min' => 0.5, 'max' => 2, 'step' => 0.01 ], ], 'selectors' => [ // General '{{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__point, {{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__point' => 'transform: scale({{SIZE}})', ], ] ); $this->add_control( 'points_background_hover', [ 'label' => __( 'Background Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__point, {{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__point' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'icons_color_hover', [ 'label' => __( 'Points Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__point, {{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__point' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'points_text_shadow_hover', 'selector' => '{{WRAPPER}} .timeline-item:not(.is--focused):hover .timeline-item__point, {{WRAPPER}} .timeline-item:hover .timeline-item__point' ] ); $this->end_controls_tab(); $this->start_controls_tab( 'points_focused', [ 'label' => __( 'Focused', 'elementor-extras' ) ] ); $this->add_control( 'points_size_focused', [ 'label' => __( 'Scale', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'min' => 0.5, 'max' => 2, 'step' => 0.01 ], ], 'selectors' => [ '{{WRAPPER}} .timeline-item.is--focused .timeline-item__point' => 'transform: scale({{SIZE}})', ], ] ); $this->add_control( 'points_background_focused', [ 'label' => __( 'Background Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .timeline-item.is--focused .timeline-item__point' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'icons_color_focused', [ 'label' => __( 'Points Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .timeline-item.is--focused .timeline-item__point' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'points_text_shadow_focused', 'selector' => '{{WRAPPER}} .timeline-item.is--focused .timeline-item__point', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_line', [ 'label' => __( 'Line', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'line_background', [ 'label' => __( 'Background Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => Global_Colors::COLOR_SECONDARY, ], 'selectors' => [ '{{WRAPPER}} .ee-timeline__line' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'progress_background', [ 'label' => __( 'Progress Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .ee-timeline__line__inner' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'line_thickness', [ 'label' => __( 'Thickness', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 4, ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 8, ], ], 'selectors' => [ '{{WRAPPER}} .ee-timeline__line' => 'width: {{SIZE}}px;', ], ] ); $this->add_control( 'line_location', [ 'label' => __( 'Location', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 50, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'frontend_available' => true, ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'line_border', 'label' => __( 'Image Border', 'elementor-extras' ), 'selector' => '{{WRAPPER}} .ee-timeline__line', ] ); $this->add_control( 'line_border_radius', [ 'label' => __( 'Border Radius', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .ee-timeline__line' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); } protected function add_global_render_attributes() { $settings = $this->get_settings_for_display(); $this->add_render_attribute( [ 'wrapper' => [ 'class' => [ 'ee-timeline', 'ee-timeline--vertical', ], ], 'item' => [ 'class' => [ 'ee-timeline__item', 'timeline-item', ], ], 'icon-wrapper' => [ 'class' => [ 'ee-icon', 'ee-icon-support--svg', 'ee-timeline__item__icon', ], ], 'line' => [ 'class' => 'ee-timeline__line', ], 'line-inner' => [ 'class' => 'ee-timeline__line__inner', ], 'card-wrapper' => [ 'class' => 'timeline-item__card-wrapper', ], 'point' => [ 'class' => 'timeline-item__point', ], 'meta' => [ 'class' => 'timeline-item__meta', ], 'image' => [ 'class' => [ 'timeline-item__img', 'ee-post__thumbnail', ], ], 'content-wrapper' => [ 'class' => 'timeline-item__content-wrapper', ], 'content' => [ 'class' => 'timeline-item__content', ], 'post-title' => [ 'class' => 'timeline-item__title', ], 'post-excerpt' => [ 'class' => 'timeline-item__excerpt', ], 'arrow' => [ 'class' => 'timeline-item__card__arrow', ], 'meta-wrapper' => [ 'class' => 'timeline-item__meta-wrapper', ], ] ); if ( 'posts' === $settings['source'] && 'content' === $settings['post_excerpt'] ) { $this->add_render_attribute( 'post-excerpt', 'class', 'timeline-item__excerpt--content' ); } } /** * Render * * Render widget contents on frontend * * @since 1.9.0 * @return void */ protected function render() { $settings = $this->get_settings_for_display(); $this->add_global_render_attributes(); ?>' . $label . ' | '; echo '' . apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values ) . ' | '; echo '
---|