'',
'url' => \Elementor\Utils::get_placeholder_image_src(),
];
}
return $items;
}
public function get_name() {
return 'aafe_headline_gallery';
}
public function get_title() {
return esc_html__( 'AAFE Headline Gallery', 'addronix-addons-for-elementor' );
}
public function get_icon() {
return 'eicon-gallery-grid';
}
public function get_categories() {
return [ 'addronix-addons-for-elementor' ];
}
public function get_keywords() {
return [ 'headline', 'gallery', 'images', 'marquee', 'text', 'masonry', 'button', 'spacing' ];
}
public function get_style_depends() {
return [ 'aafe-headline-gallery-style' ];
}
public function get_script_depends() {
return [ 'aafe-headline-gallery-script' ];
}
protected function register_controls() {
/* ── CONTENT ── */
$this->start_controls_section( 'section_content', [
'label' => esc_html__( 'Content', 'addronix-addons-for-elementor' ),
] );
$this->add_control( 'title_text', [
'label' => esc_html__( 'Headline', 'addronix-addons-for-elementor' ),
'description' => esc_html__( 'Use [image_1], [image_2] to place images inline within the text.', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::TEXTAREA,
'default' => "WE CREATE [image_1]\nBEAUTIFUL [image_2]\nWEBSITES",
'dynamic' => [ 'active' => true, 'categories' => [ DynamicTagsModule::TEXT_CATEGORY ] ],
] );
$this->add_control( 'title_tag', [
'label' => esc_html__( 'HTML Tag', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => [
'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p',
],
'default' => 'h1',
] );
$this->add_control( 'subtitle_text', [
'label' => esc_html__( 'Subtitle', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::TEXT,
'default' => 'Addronix Agency',
'dynamic' => [ 'active' => true, 'categories' => [ DynamicTagsModule::TEXT_CATEGORY ] ],
] );
$this->add_control( 'description_text', [
'label' => esc_html__( 'Description', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::TEXTAREA,
'default' => 'We are a creative agency specialized in building interactive web experiences.',
'dynamic' => [ 'active' => true, 'categories' => [ DynamicTagsModule::TEXT_CATEGORY ] ],
] );
$this->add_control( 'button_text', [
'label' => esc_html__( 'Button Text', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::TEXT,
'default' => 'Discover More',
'dynamic' => [ 'active' => true, 'categories' => [ DynamicTagsModule::TEXT_CATEGORY ] ],
] );
$this->add_control( 'button_link', [
'label' => esc_html__( 'Button Link', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::URL,
'dynamic' => [ 'active' => true ],
'placeholder' => esc_html__( 'https://your-link.com', 'addronix-addons-for-elementor' ),
] );
$this->add_control( 'button_icon', [
'label' => esc_html__( 'Button Icon', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::ICONS,
] );
$this->add_control( 'button_icon_align', [
'label' => esc_html__( 'Icon Position', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'left',
'options' => [
'left' => esc_html__( 'Before', 'addronix-addons-for-elementor' ),
'right' => esc_html__( 'After', 'addronix-addons-for-elementor' ),
],
'condition' => [ 'button_icon[value]!' => '' ],
] );
$this->add_responsive_control( 'button_icon_spacing', [
'label' => esc_html__( 'Icon Spacing', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'max' => 50 ] ],
'selectors' => [
'{{WRAPPER}} .aafe-btn-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .aafe-btn-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};',
],
'condition' => [ 'button_icon[value]!' => '' ],
] );
$this->add_control( 'gallery_images', [
'label' => esc_html__( 'Gallery Images', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::GALLERY,
'default' => [],
'dynamic' => [ 'active' => true ],
] );
$this->add_group_control(
Group_Control_Image_Size::get_type(),
[
'name' => 'image',
'default' => 'large',
]
);
$this->add_control( 'link_to', [
'label' => esc_html__( 'Gallery Link', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => [
'none' => esc_html__( 'None', 'addronix-addons-for-elementor' ),
'file' => esc_html__( 'Media File', 'addronix-addons-for-elementor' ),
'custom' => esc_html__( 'Custom URL', 'addronix-addons-for-elementor' ),
],
] );
$this->add_control( 'link', [
'label' => esc_html__( 'Custom URL', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::URL,
'dynamic' => [ 'active' => true ],
'condition' => [ 'link_to' => 'custom' ],
] );
$this->add_control( 'open_lightbox', [
'label' => esc_html__( 'Lightbox', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'condition' => [ 'link_to' => 'file' ],
] );
$this->end_controls_section();
/* ── LAYOUT ── */
$this->start_controls_section( 'section_layout', [
'label' => esc_html__( 'Layout', 'addronix-addons-for-elementor' ),
] );
$this->add_control( 'layout_type', [
'label' => esc_html__( 'Gallery Layout', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => [
'grid' => 'Grid',
'masonry' => 'Masonry',
],
'default' => 'grid',
] );
$this->end_controls_section();
/* ── STYLE: Wrapper ── */
$this->start_controls_section( 'style_wrapper', [
'label' => esc_html__( 'Wrapper', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_responsive_control( 'wrapper_margin', [
'label' => esc_html__( 'Margin', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'wrapper_padding', [
'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_group_control( Group_Control_Background::get_type(), [
'name' => 'wrapper_bg',
'selector' => '{{WRAPPER}} .aafe-headline-gallery-wrapper',
] );
$this->add_group_control( Group_Control_Border::get_type(), [
'name' => 'wrapper_border',
'selector' => '{{WRAPPER}} .aafe-headline-gallery-wrapper',
] );
$this->add_group_control( Group_Control_Box_Shadow::get_type(), [
'name' => 'wrapper_shadow',
'selector' => '{{WRAPPER}} .aafe-headline-gallery-wrapper',
] );
$this->end_controls_section();
/* ── STYLE: Content Box ── */
$this->start_controls_section( 'style_content_box', [
'label' => esc_html__( 'Content Box', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_responsive_control( 'content_width', [
'label' => esc_html__( 'Content Max Width', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', '%', 'vw' ],
'range' => [
'px' => [ 'min' => 0, 'max' => 1200 ],
'%' => [ 'min' => 0, 'max' => 100 ],
],
'selectors' => [
'{{WRAPPER}} .aafe-headline-gallery-content' => 'max-width: {{SIZE}}{{UNIT}}; width: 100%; margin-left: auto; margin-right: auto;',
],
] );
$this->add_responsive_control( 'content_align', [
'label' => esc_html__( 'Alignment', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [ 'title' => 'Left', 'icon' => 'eicon-text-align-left' ],
'center' => [ 'title' => 'Center', 'icon' => 'eicon-text-align-center' ],
'right' => [ 'title' => 'Right', 'icon' => 'eicon-text-align-right' ],
],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-content' => 'text-align: {{VALUE}};' ],
] );
$this->add_responsive_control( 'content_margin', [
'label' => esc_html__( 'Margin', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'content_padding', [
'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->end_controls_section();
/* ── STYLE: Headline ── */
$this->start_controls_section( 'style_headline', [
'label' => esc_html__( 'Headline', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_group_control( Group_Control_Typography::get_type(), [
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__title',
] );
$this->add_control( 'title_color', [
'label' => esc_html__( 'Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__title' => 'color: {{VALUE}};' ],
] );
$this->add_control( 'text_stroke', [
'label' => esc_html__( 'Text Stroke Width', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 0, 'max' => 10, 'step' => 1 ] ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__title' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}};' ],
] );
$this->add_control( 'text_stroke_color', [
'label' => esc_html__( 'Text Stroke Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__title' => '-webkit-text-stroke-color: {{VALUE}};' ],
'condition' => [ 'text_stroke[size]!' => '' ],
] );
$this->add_control( 'blend_mode', [
'label' => esc_html__( 'Mix Blend Mode', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => [
'normal' => 'Normal',
'multiply' => 'Multiply',
'screen' => 'Screen',
'overlay' => 'Overlay',
'difference' => 'Difference',
'exclusion' => 'Exclusion',
'color-dodge' => 'Color Dodge',
'color-burn' => 'Color Burn',
],
'default' => 'normal',
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__title' => 'mix-blend-mode: {{VALUE}};' ],
] );
$this->add_responsive_control( 'title_margin', [
'label' => esc_html__( 'Margin', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'title_padding', [
'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'inline_img_height', [
'label' => esc_html__( 'Inline Image Height', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'em', 'px' ],
'range' => [ 'em' => [ 'min' => 0.5, 'max' => 3, 'step' => 0.1 ] ],
'default' => [ 'size' => 1, 'unit' => 'em' ],
'selectors' => [ '{{WRAPPER}} .aafe-inline-img' => 'height: {{SIZE}}{{UNIT}}; vertical-align: middle; border-radius: 0.2em; margin: 0 0.1em;' ],
] );
$this->end_controls_section();
/* ── STYLE: Subtitle ── */
$this->start_controls_section( 'style_subtitle', [
'label' => esc_html__( 'Subtitle', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_group_control( Group_Control_Typography::get_type(), [
'name' => 'subtitle_typography',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__subtitle',
] );
$this->add_control( 'subtitle_color', [
'label' => esc_html__( 'Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__subtitle' => 'color: {{VALUE}};' ],
] );
$this->add_responsive_control( 'subtitle_margin', [
'label' => esc_html__( 'Margin', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__subtitle' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'subtitle_padding', [
'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__subtitle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->end_controls_section();
/* ── STYLE: Description ── */
$this->start_controls_section( 'style_description', [
'label' => esc_html__( 'Description', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_group_control( Group_Control_Typography::get_type(), [
'name' => 'desc_typography',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__desc',
] );
$this->add_control( 'desc_color', [
'label' => esc_html__( 'Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__desc' => 'color: {{VALUE}};' ],
] );
$this->add_responsive_control( 'desc_margin', [
'label' => esc_html__( 'Margin', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__desc' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'desc_padding', [
'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__desc' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->end_controls_section();
/* ── STYLE: Button ── */
$this->start_controls_section( 'style_button', [
'label' => esc_html__( 'Button', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_group_control( Group_Control_Typography::get_type(), [
'name' => 'btn_typography',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__btn',
] );
$this->add_responsive_control( 'btn_margin', [
'label' => esc_html__( 'Margin', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
] );
$this->add_responsive_control( 'btn_padding', [
'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
] );
$this->start_controls_tabs( 'tabs_button_style' );
$this->start_controls_tab( 'tab_button_normal', [
'label' => esc_html__( 'Normal', 'addronix-addons-for-elementor' ),
] );
$this->add_control( 'btn_text_color', [
'label' => esc_html__( 'Text Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__btn' => 'color: {{VALUE}};' ],
] );
$this->add_control( 'btn_bg_color', [
'label' => esc_html__( 'Background Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__btn' => 'background-color: {{VALUE}};' ],
] );
$this->add_group_control( Group_Control_Border::get_type(), [
'name' => 'btn_border',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__btn',
] );
$this->add_control( 'btn_border_radius', [
'label' => esc_html__( 'Border Radius', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
] );
$this->add_group_control( Group_Control_Box_Shadow::get_type(), [
'name' => 'btn_shadow',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__btn',
] );
$this->end_controls_tab();
$this->start_controls_tab( 'tab_button_hover', [
'label' => esc_html__( 'Hover', 'addronix-addons-for-elementor' ),
] );
$this->add_control( 'btn_hover_text_color', [
'label' => esc_html__( 'Text Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__btn:hover' => 'color: {{VALUE}};' ],
] );
$this->add_control( 'btn_hover_bg_color', [
'label' => esc_html__( 'Background Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__btn:hover' => 'background-color: {{VALUE}};' ],
] );
$this->add_group_control( Group_Control_Border::get_type(), [
'name' => 'btn_hover_border',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__btn:hover',
] );
$this->add_control( 'btn_hover_border_radius', [
'label' => esc_html__( 'Border Radius', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__btn:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
] );
$this->add_group_control( Group_Control_Box_Shadow::get_type(), [
'name' => 'btn_hover_shadow',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__btn:hover',
] );
$this->add_control( 'btn_hover_animation', [
'label' => esc_html__( 'Hover Animation', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::HOVER_ANIMATION,
] );
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
/* ── STYLE: Gallery ── */
$this->start_controls_section( 'style_gallery', [
'label' => esc_html__( 'Gallery Images', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_responsive_control( 'gallery_margin', [
'label' => esc_html__( 'Margin', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__grid' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'gallery_padding', [
'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__grid' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'gallery_columns', [
'label' => esc_html__( 'Columns', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 10,
'default' => 5,
'tablet_default' => 3,
'mobile_default' => 2,
'selectors' => [
'{{WRAPPER}} .aafe-headline-gallery__grid[data-layout="grid"]' => 'grid-template-columns: repeat({{VALUE}}, 1fr);',
'{{WRAPPER}} .aafe-headline-gallery__grid[data-layout="masonry"]' => 'column-count: {{VALUE}};',
],
] );
$this->add_responsive_control( 'gallery_gap', [
'label' => esc_html__( 'Gap', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', 'em', 'vw' ],
'range' => [ 'px' => [ 'min' => 0, 'max' => 100 ] ],
'default' => [ 'size' => 15, 'unit' => 'px' ],
'selectors' => [
'{{WRAPPER}} .aafe-headline-gallery__grid[data-layout="grid"]' => 'gap: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .aafe-headline-gallery__grid[data-layout="masonry"]' => 'column-gap: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .aafe-headline-gallery__grid[data-layout="masonry"] .aafe-headline-gallery__item' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
] );
$this->add_responsive_control( 'gallery_height', [
'label' => esc_html__( 'Image Height (Grid only)', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', 'vh', 'rem', 'vw' ],
'range' => [ 'px' => [ 'min' => 0, 'max' => 1000 ] ],
'default' => [ 'size' => 250, 'unit' => 'px' ],
'condition' => [ 'layout_type' => 'grid' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__grid[data-layout="grid"] .aafe-headline-gallery__img' => 'height: {{SIZE}}{{UNIT}};' ],
] );
$this->add_control( 'mask_shape', [
'label' => esc_html__( 'Image Mask Shape', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => [
'none' => 'None',
'circle' => 'Circle',
'ellipse' => 'Ellipse',
'blob' => 'Blob',
'hexagon' => 'Hexagon',
'arch' => 'Arch',
],
'default' => 'none',
] );
$this->add_control( 'gallery_radius', [
'label' => esc_html__( 'Border Radius', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery__item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
'condition' => [ 'mask_shape' => 'none' ],
] );
$this->add_group_control( Group_Control_Border::get_type(), [
'name' => 'gallery_border',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__item',
] );
$this->add_group_control( Group_Control_Box_Shadow::get_type(), [
'name' => 'gallery_shadow',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__item',
] );
$this->add_group_control( Group_Control_Css_Filter::get_type(), [
'name' => 'image_filters',
'selector' => '{{WRAPPER}} .aafe-headline-gallery__img',
] );
$this->add_group_control( Group_Control_Css_Filter::get_type(), [
'name' => 'image_filters_hover',
'label' => esc_html__( 'Hover CSS Filters', 'addronix-addons-for-elementor' ),
'selector' => '{{WRAPPER}} .aafe-headline-gallery__item:hover .aafe-headline-gallery__img',
] );
$this->end_controls_section();
/* ── HOVER EFFECTS ── */
$this->start_controls_section( 'style_hover', [
'label' => esc_html__( 'Hover Effects', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_control( 'hover_effect_type', [
'label' => esc_html__( 'Hover Effect Type', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => [
'none' => 'None',
'lift' => 'Lift',
'glow' => 'Glow',
'scale' => 'Scale',
'border-pop' => 'Border Pop',
'shine' => 'Shine',
'overlay' => 'Overlay',
],
'default' => 'scale',
] );
$this->add_control( 'hover_duration', [
'label' => esc_html__( 'Transition Duration (ms)', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 100, 'max' => 800, 'step' => 50 ] ],
'default' => [ 'size' => 300, 'unit' => 'px' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-transition: {{SIZE}}ms;' ],
] );
$this->add_control( 'hover_scale', [
'label' => esc_html__( 'Scale Amount', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 1.0, 'max' => 1.2, 'step' => 0.01 ] ],
'default' => [ 'size' => 1.05, 'unit' => 'px' ],
'condition' => [ 'hover_effect_type' => [ 'scale' ] ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-hover-scale: {{SIZE}};' ],
] );
// LIFT CONTROLS
$this->add_control( 'lift_amount', [
'label' => esc_html__( 'Lift Amount (Y Offset)', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => -30, 'max' => 0, 'step' => 1 ] ],
'default' => [ 'size' => -6, 'unit' => 'px' ],
'condition' => [ 'hover_effect_type' => 'lift' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-lift-y: {{SIZE}}{{UNIT}};' ],
] );
$this->add_control( 'lift_shadow_color', [
'label' => esc_html__( 'Shadow Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'default' => 'rgba(0,0,0,0.15)',
'condition' => [ 'hover_effect_type' => 'lift' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-lift-shadow: {{VALUE}};' ],
] );
// GLOW CONTROLS
$this->add_control( 'glow_color', [
'label' => esc_html__( 'Glow Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [ 'hover_effect_type' => 'glow' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-glow-color: {{VALUE}};' ],
] );
$this->add_control( 'glow_blur', [
'label' => esc_html__( 'Glow Blur/Spread', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1 ] ],
'default' => [ 'size' => 30, 'unit' => 'px' ],
'condition' => [ 'hover_effect_type' => 'glow' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-glow-blur: {{SIZE}}{{UNIT}};' ],
] );
// BORDER POP CONTROLS
$this->add_control( 'border_pop_color', [
'label' => esc_html__( 'Border Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [ 'hover_effect_type' => 'border-pop' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-border-pop-color: {{VALUE}};' ],
] );
$this->add_control( 'border_pop_width', [
'label' => esc_html__( 'Border Width', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 1, 'max' => 10, 'step' => 1 ] ],
'default' => [ 'size' => 2, 'unit' => 'px' ],
'condition' => [ 'hover_effect_type' => 'border-pop' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-border-pop-width: {{SIZE}}{{UNIT}};' ],
] );
// SHINE CONTROLS
$this->add_control( 'shine_opacity', [
'label' => esc_html__( 'Shine Opacity', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 0, 'max' => 1, 'step' => 0.05 ] ],
'default' => [ 'size' => 0.3, 'unit' => 'px' ],
'condition' => [ 'hover_effect_type' => 'shine' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-shine-opacity: {{SIZE}};' ],
] );
// OVERLAY CONTROLS
$this->add_control( 'overlay_color', [
'label' => esc_html__( 'Overlay Color', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::COLOR,
'default' => 'rgba(0,0,0,0.5)',
'condition' => [ 'hover_effect_type' => 'overlay' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-overlay-color: {{VALUE}};' ],
] );
$this->end_controls_section();
/* ── INTERACTIVE EFFECTS ── */
$this->start_controls_section( 'style_interaction', [
'label' => esc_html__( 'Interactive Effects', 'addronix-addons-for-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_control( 'interaction_type', [
'label' => esc_html__( 'Effect Type', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => [
'none' => 'None',
'marquee' => 'Infinite Marquee Scroll',
'tilt' => '3D Tilt',
'reveal' => 'Staggered Scroll Reveal',
],
'default' => 'reveal',
] );
$this->add_control( 'marquee_speed', [
'label' => esc_html__( 'Scroll Speed', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 10, 'max' => 200, 'step' => 1 ] ],
'default' => [ 'size' => 40, 'unit' => 'px' ],
'condition' => [ 'interaction_type' => 'marquee' ],
] );
$this->add_control( 'marquee_direction', [
'label' => esc_html__( 'Direction', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'normal' => [ 'title' => 'Left', 'icon' => 'eicon-arrow-left' ],
'reverse' => [ 'title' => 'Right', 'icon' => 'eicon-arrow-right' ],
],
'default' => 'normal',
'condition' => [ 'interaction_type' => 'marquee' ],
] );
$this->add_control( 'marquee_pause', [
'label' => esc_html__( 'Pause on Hover', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'condition' => [ 'interaction_type' => 'marquee' ],
] );
$this->add_responsive_control( 'marquee_item_width', [
'label' => esc_html__( 'Marquee Image Width', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', '%', 'vw' ],
'range' => [ 'px' => [ 'min' => 50, 'max' => 800 ] ],
'default' => [ 'size' => 250, 'unit' => 'px' ],
'condition' => [ 'interaction_type' => 'marquee' ],
'selectors' => [
'{{WRAPPER}} .aafe-headline-gallery-wrapper[data-interaction="marquee"] .aafe-headline-gallery__item' => 'width: {{SIZE}}{{UNIT}};',
],
] );
$this->add_control( 'tilt_max', [
'label' => esc_html__( 'Max Tilt Angle', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 5, 'max' => 60, 'step' => 1 ] ],
'default' => [ 'size' => 20, 'unit' => 'px' ],
'condition' => [ 'interaction_type' => 'tilt' ],
] );
$this->add_control( 'tilt_speed', [
'label' => esc_html__( 'Tilt Return Speed (ms)', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 100, 'max' => 1000, 'step' => 50 ] ],
'default' => [ 'size' => 500, 'unit' => 'px' ],
'condition' => [ 'interaction_type' => 'tilt' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-tilt-speed: {{SIZE}}; /* no units needed for js */' ],
] );
$this->add_control( 'reveal_style', [
'label' => esc_html__( 'Reveal Animation', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => [
'fade' => 'Fade In',
'up' => 'Slide Up',
'zoom' => 'Zoom In',
],
'default' => 'up',
'condition' => [ 'interaction_type' => 'reveal' ],
] );
$this->add_control( 'reveal_delay', [
'label' => esc_html__( 'Stagger Delay (ms)', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 0, 'max' => 500, 'step' => 10 ] ],
'default' => [ 'size' => 100, 'unit' => 'px' ],
'condition' => [ 'interaction_type' => 'reveal' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-stagger-delay: {{SIZE}}; /* unitless for JS */' ],
] );
$this->add_control( 'reveal_duration', [
'label' => esc_html__( 'Animation Duration (ms)', 'addronix-addons-for-elementor' ),
'type' => Controls_Manager::SLIDER,
'range' => [ 'px' => [ 'min' => 100, 'max' => 2000, 'step' => 50 ] ],
'default' => [ 'size' => 600, 'unit' => 'px' ],
'condition' => [ 'interaction_type' => 'reveal' ],
'selectors' => [ '{{WRAPPER}} .aafe-headline-gallery-wrapper' => '--aafe-reveal-duration: {{SIZE}}; /* unitless for JS */' ],
] );
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$hover_type = $settings['hover_effect_type'] ? $settings['hover_effect_type'] : 'none';
$interaction_type = $settings['interaction_type'] ?? 'none';
$marquee_speed = $settings['marquee_speed']['size'] ?? '40';
$marquee_dir = $settings['marquee_direction'] ?? 'normal';
$marquee_pause = ( $settings['marquee_pause'] === 'yes' ) ? 'true' : 'false';
$tilt_max = $settings['tilt_max']['size'] ?? '20';
$reveal_style = $settings['reveal_style'] ?? 'up';
$layout_type = $settings['layout_type'] ?? 'grid';
$mask_shape = $settings['mask_shape'] ?? 'none';
$this->add_render_attribute( 'wrapper', [
'class' => 'aafe-headline-gallery-wrapper',
'data-hover' => $hover_type,
'data-interaction' => $interaction_type,
'data-marquee-speed'=> $marquee_speed,
'data-marquee-dir' => $marquee_dir,
'data-marquee-pause'=> $marquee_pause,
'data-tilt-max' => $tilt_max,
'data-reveal-style' => $reveal_style,
] );
$title_tag = $settings['title_tag'] ?? 'h1';
$images = ! empty( $settings['gallery_images'] ) ? $settings['gallery_images'] : self::aafe_placeholder_gallery( 4 ); // AAFE FIX: placeholders while empty.
// Process inline images in Title
$title_text = $settings['title_text'];
if ( !empty($title_text) ) {
$title_text = preg_replace_callback('/\[image_(\d+)\]/', function($matches) use ($images, $settings) {
$index = intval($matches[1]) - 1;
if ( isset($images[$index]) ) {
$img_url = Group_Control_Image_Size::get_attachment_image_src( $images[$index]['id'], 'image', $settings );
if (!$img_url) $img_url = $images[$index]['url'];
$alt = get_post_meta( $images[$index]['id'], '_wp_attachment_image_alt', true ) ?: 'inline image';
return '';
}
return '';
}, $title_text);
}
// Render dynamic mask CSS to bypass any cache
if ( $mask_shape !== 'none' ) {
echo '';
}
$has_content = !empty($settings['title_text']) || !empty($settings['subtitle_text']) || !empty($settings['description_text']) || !empty($settings['button_text']);
?>