duration',
[
'label' => esc_html__( 'Transition Duration', 'wpr-addons' ),
'type' => Controls_Manager::NUMBER,
'default' => 0.5,
'min' => 0,
'max' => 5,
'step' => 0.1,
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-page-list-item a' => 'transition-duration: {{VALUE}}s'
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'page_list_item_title_typo',
'selector' => '{{WRAPPER}} .wpr-page-list-item a',
'fields_options' => [
'typography' => [
'default' => 'custom',
],
'font_size' => [
'default' => [
'size' => '14',
'unit' => 'px',
],
],
'line_height' => [
'default' => [
'size' => '0.8',
'unit' => 'em',
]
],
]
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'page_list_item_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_control(
'page_list_item_title_color_hr',
[
'label' => esc_html__( 'Title Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item a:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} li.wpr-page-list-item a:hover' => 'color: {{VALUE}}',
],
]
);
// $this->add_control(
// 'page_list_item_background_color_hr',
// [
// 'label' => esc_html__( 'Background Color', 'wpr-addons' ),
// 'type' => Controls_Manager::COLOR,
// 'default' => '#00000000',
// 'selectors' => [
// '{{WRAPPER}} .wpr-page-list-item:hover' => 'background-color: {{VALUE}}',
// ]
// ]
// );
$this->add_control_title_pointer_color_hr();
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control_title_pointer();
$this->add_control_title_pointer_animation();
$this->add_control_title_pointer_height();
$this->add_responsive_control(
'title_distance',
[
'label' => esc_html__( 'Bottom Distance', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 50,
],
],
'default' => [
'unit' => 'px',
'size' => 8,
],
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item div a' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
'separator' => 'before'
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_style_sub_title',
[
'label' => esc_html__( 'Sub Title', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE
]
);
$this->add_control(
'page_list_item_sub_title_color',
[
'label' => esc_html__( 'Sub Title Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#B6B6B6',
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item p' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'page_list_item_sub_title_typo',
'selector' => '{{WRAPPER}} .wpr-page-list-item p',
'fields_options' => [
'typography' => [
'default' => 'custom',
],
'font_size' => [
'default' => [
'size' => '12',
'unit' => 'px',
],
],
'line_height' => [
'default' => [
'size' => '0.8',
'unit' => 'em',
]
]
]
]
);
$this->end_controls_section();
// Tab: Style ==============
// Section: Content --------
$this->start_controls_section(
'section_style_badge',
[
'label' => esc_html__( 'Badge', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE
]
);
$this->add_control(
'badge_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#FFFFFF',
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item-badge' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'badge_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item-badge' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'badge_vertical_align',
[
'label' => esc_html__( 'Vertical Align', 'wpr-addons' ),
'type' => Controls_Manager::CHOOSE,
'label_block' => false,
'default' => 'center',
'options' => [
'top' => [
'title' => esc_html__( 'Top', 'wpr-addons' ),
'icon' => 'eicon-v-align-top',
],
'center' => [
'title' => esc_html__( 'Middle', 'wpr-addons' ),
'icon' => 'eicon-v-align-middle',
],
'bottom' => [
'title' => esc_html__( 'Bottom', 'wpr-addons' ),
'icon' => 'eicon-v-align-bottom',
]
],
'prefix_class' => 'wpr-pl-badge-',
'render_type' => 'template',
'separator' => 'before'
]
);
$this->add_responsive_control(
'badge_size',
[
'label' => esc_html__( 'Size', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 50,
],
],
'default' => [
'unit' => 'px',
'size' => 12,
],
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item-badge' => 'font-size: {{SIZE}}{{UNIT}};',
],
'separator' => 'before'
]
);
$this->add_responsive_control(
'badge_distance',
[
'label' => esc_html__( 'Distance', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 50,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item-badge' => 'margin-left: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'badge_border_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 2,
'right' => 5,
'bottom' => 2,
'left' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_control(
'badge_border_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-page-list-item-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->end_controls_section();
// Tab: Style ==============
// Section: Content --------
$this->start_controls_section(
'section_style_icon',
[
'label' => esc_html__( 'Icon', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE
]
);
$this->add_control(
'icon_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-page-list i' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-page-list svg' => 'fill: {{VALUE}}'
],
]
);
$this->add_control(
'icon_vertical_align',
[
'label' => esc_html__( 'Vertical Align', 'wpr-addons' ),
'type' => Controls_Manager::CHOOSE,
'label_block' => false,
'default' => 'center',
'options' => [
'top' => [
'title' => esc_html__( 'Top', 'wpr-addons' ),
'icon' => 'eicon-v-align-top',
],
'center' => [
'title' => esc_html__( 'Middle', 'wpr-addons' ),
'icon' => 'eicon-v-align-middle',
],
'bottom' => [
'title' => esc_html__( 'Bottom', 'wpr-addons' ),
'icon' => 'eicon-v-align-bottom',
]
],
'prefix_class' => 'wpr-pl-icon-',
'render_type' => 'template',
'separator' => 'before'
]
);
$this->add_responsive_control(
'icon_size',
[
'label' => esc_html__( 'Size', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 50,
],
],
'default' => [
'unit' => 'px',
'size' => 15,
],
'selectors' => [
'{{WRAPPER}} .wpr-page-list i' => 'font-size: {{SIZE}}{{UNIT}}; max-height: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-page-list svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-page-list i:before' => 'max-height: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-page-list-item-icon' => 'max-height: {{SIZE}}{{UNIT}};',
],
'separator' => 'before'
]
);
$this->add_responsive_control(
'icon_distance',
[
'label' => esc_html__( 'Distance', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 50,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-page-list .wpr-page-list-item-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
],
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$class = '';
// Pointer Class
$page_title_pointer = ! wpr_fs()->can_use_premium_code() ? 'none' : $settings['title_pointer'];
$page_title_pointer_animation = ! wpr_fs()->can_use_premium_code() ? 'fade' : $settings['title_pointer_animation'];
$pointer_item_class = (isset($settings['title_pointer']) && 'none' !== $settings['title_pointer']) ? 'wpr-pointer-item' : 'wpr-no-pointer';
$class .= ' wpr-pointer-'. $page_title_pointer;
$class .= ' wpr-pointer-line-fx wpr-pointer-fx-'. $page_title_pointer_animation;
echo '
';
echo '
';
foreach ( $settings['page_list'] as $key=>$item ) {
if ( 'yes' === $item['open_in_new_page'] ) {
$target = '_blank';
} else {
$target = '_self';
}
if ( 'yes' === $item['show_page_list_item_badge_animation'] ) {
$badge_anim_class = ' wpr-pl-badge-anim-yes';
} else {
$badge_anim_class = '';
}
$this->add_render_attribute( 'page_list_item'. $key, 'class', 'wpr-page-list-item elementor-repeater-item-'. $item['_id']. $class . $badge_anim_class );
if ( isset($item['page_list_item_icon']) && '' !== $item['page_list_item_icon']['value'] ) {
ob_start();
\Elementor\Icons_Manager::render_icon( $item['page_list_item_icon'], [ 'aria-hidden' => 'true' ] );
$icon = ob_get_clean();
}
if ( 'dynamic' === $item['page_list_item_type'] && isset($item['query_page_selection']) ) {
echo '- get_render_attribute_string('page_list_item'. $key) .'>';
echo (isset($item['page_list_item_icon']) && '' !== $item['page_list_item_icon']['value']) ? ''. $icon .'' : '';
echo '';
echo 'yes' === $item['show_page_list_item_badge'] ? ''. $item['page_list_item_badge_text'] .'' : '';
echo '
';
} else if ( 'custom' === $item['page_list_item_type'] && isset($item['page_list_item_title']) ) {
if ( ! empty( $item['page_list_item_title_url']['url'] ) ) {
$this->add_link_attributes( 'title_link_'. $key, $item['page_list_item_title_url'] );
}
echo '- get_render_attribute_string('page_list_item'. $key) .'>';
echo (isset($item['page_list_item_icon']) && '' !== $item['page_list_item_icon']['value']) ? ''. $icon .'' : '';
echo '';
echo 'yes' === $item['show_page_list_item_badge'] ? ''. $item['page_list_item_badge_text'] .'' : '';
echo '
';
}
}
echo '
';
echo '
';
}
}