get_name(); } public function get_categories(): array { return [ 'addronix-addons-for-elementor' ]; } public function get_keywords(): array { return [ 'milestone', 'glow', 'path', 'scroll', 'cards', 'timeline', 'roadmap', 'process', 'steps' ]; } public function get_style_depends(): array { return [ 'aafe-scroll-cards-style' ]; } public function get_script_depends(): array { return [ 'aafe-scroll-cards-script' ]; } /** * Dynamically calculate curve path and milestone dot coordinates. * * All peaks align in a uniform horizontal line (Y = 140) and * all valleys align in a uniform horizontal line (Y = 235). * * @param int $count Number of milestones. * @return array Array with 'coords' and 'd'. */ protected function get_curve_data( int $count ): array { if ( $count <= 1 ) { return [ 'coords' => [ [ 550, 180 ] ], 'd' => 'M 100 180 L 1000 180', ]; } $width = 1100; $pad_x = 110; $usable_w = $width - ( 2 * $pad_x ); $step_x = $usable_w / ( $count - 1 ); $coords = []; for ( $i = 0; $i < $count; $i++ ) { $x = round( $pad_x + ( $i * $step_x ), 2 ); // Even index = Valley (card below dot), Odd index = Peak (card above dot) // All peaks are on the exact same horizontal line (140), all valleys at (235) $y = ( $i % 2 === 0 ) ? 235 : 140; $coords[] = [ $x, $y ]; } // Smooth cubic bezier spline through coords $d = "M {$coords[0][0]} {$coords[0][1]}"; for ( $i = 0; $i < $count - 1; $i++ ) { $p0 = $coords[ $i ]; $p1 = $coords[ $i + 1 ]; $dx = $p1[0] - $p0[0]; $cp1x = round( $p0[0] + ( $dx * 0.48 ), 2 ); $cp1y = $p0[1]; $cp2x = round( $p1[0] - ( $dx * 0.48 ), 2 ); $cp2y = $p1[1]; $d .= " C {$cp1x} {$cp1y}, {$cp2x} {$cp2y}, {$p1[0]} {$p1[1]}"; } return [ 'coords' => $coords, 'd' => $d, ]; } protected function register_controls(): void { /* ═════════════════════════════════════════════════════════ * TAB: CONTENT * ═════════════════════════════════════════════════════════ */ /* ── Content: Header Content (Subtitle, Heading, Description) ─ */ $this->start_controls_section( 'section_header_content', [ 'label' => esc_html__( 'Header Content', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'show_header', [ 'label' => esc_html__( 'Show Header Content', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'addronix-addons-for-elementor' ), 'label_off' => esc_html__( 'Hide', 'addronix-addons-for-elementor' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'header_subtitle', [ 'label' => esc_html__( 'Subtitle', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true ], 'default' => esc_html__( 'Our Roadmap', 'addronix-addons-for-elementor' ), 'placeholder' => esc_html__( 'e.g. Our Process', 'addronix-addons-for-elementor' ), 'label_block' => true, 'condition' => [ 'show_header' => 'yes', ], ] ); $this->add_control( 'header_subtitle_tag', [ 'label' => esc_html__( 'Subtitle HTML Tag', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'span' => 'span', 'div' => 'div', 'p' => 'p', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', ], 'default' => 'span', 'condition' => [ 'show_header' => 'yes', 'header_subtitle!' => '', ], ] ); $this->add_control( 'header_title', [ 'label' => esc_html__( 'Heading', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true ], 'default' => esc_html__( 'Milestone Glow Path', 'addronix-addons-for-elementor' ), 'placeholder' => esc_html__( 'e.g. Project Milestones & Phases', 'addronix-addons-for-elementor' ), 'rows' => 2, 'condition' => [ 'show_header' => 'yes', ], ] ); $this->add_control( 'header_title_tag', [ 'label' => esc_html__( 'Heading 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' => 'h2', 'condition' => [ 'show_header' => 'yes', 'header_title!' => '', ], ] ); $this->add_control( 'header_description', [ 'label' => esc_html__( 'Description', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true ], 'default' => esc_html__( 'Track each milestone of our project from start to finish and watch every stage illuminate.', 'addronix-addons-for-elementor' ), 'placeholder' => esc_html__( 'Enter your section description here', 'addronix-addons-for-elementor' ), 'rows' => 3, 'condition' => [ 'show_header' => 'yes', ], ] ); $this->end_controls_section(); /* ── Content: Scroll Hint ──────────────────────────────── */ $this->start_controls_section( 'section_hint', [ 'label' => esc_html__( 'Scroll Hint', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'show_hint', [ 'label' => esc_html__( 'Show Hint', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'addronix-addons-for-elementor' ), 'label_off' => esc_html__( 'Hide', 'addronix-addons-for-elementor' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'hint_icon', [ 'label' => esc_html__( 'Icon', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-mouse', 'library' => 'fa-solid', ], 'condition' => [ 'show_hint' => 'yes', ], ] ); $this->add_control( 'hint_text', [ 'label' => esc_html__( 'Hint Text', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Scroll to explore each milestone and watch it glow.', 'addronix-addons-for-elementor' ), 'label_block' => true, 'condition' => [ 'show_hint' => 'yes', ], ] ); $this->end_controls_section(); /* ── Content: Milestones Repeater ──────────────────────── */ $this->start_controls_section( 'section_milestones', [ 'label' => esc_html__( 'Milestones', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $repeater = new Repeater(); $repeater->add_control( 'title', [ 'label' => esc_html__( 'Title', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Milestone', 'addronix-addons-for-elementor' ), 'label_block' => true, ] ); $repeater->add_control( 'description', [ 'label' => esc_html__( 'Description', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::TEXTAREA, 'default' => esc_html__( 'Describe this milestone step.', 'addronix-addons-for-elementor' ), 'rows' => 3, 'label_block' => true, ] ); $repeater->add_control( 'title_tag', [ 'label' => esc_html__( 'Title HTML Tag', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'h3', 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', ], ] ); $repeater->add_control( 'link', [ 'label' => esc_html__( 'Link', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::URL, 'placeholder' => esc_html__( 'https://your-link.com', 'addronix-addons-for-elementor' ), 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'milestones', [ 'label' => esc_html__( 'Milestone Items', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => '{{{ title }}}', 'default' => [ [ 'title' => esc_html__( 'Kickoff', 'addronix-addons-for-elementor' ), 'description' => esc_html__( 'Align the team on goals, scope and what success looks like.', 'addronix-addons-for-elementor' ), 'title_tag' => 'h3', ], [ 'title' => esc_html__( 'Research', 'addronix-addons-for-elementor' ), 'description' => esc_html__( 'Talk to users and study the market to uncover real needs.', 'addronix-addons-for-elementor' ), 'title_tag' => 'h3', ], [ 'title' => esc_html__( 'Prototype', 'addronix-addons-for-elementor' ), 'description' => esc_html__( 'Sketch and test early ideas fast before committing to a direction.', 'addronix-addons-for-elementor' ), 'title_tag' => 'h3', ], [ 'title' => esc_html__( 'Design', 'addronix-addons-for-elementor' ), 'description' => esc_html__( 'Shape the visual language and polish every single interaction.', 'addronix-addons-for-elementor' ), 'title_tag' => 'h3', ], [ 'title' => esc_html__( 'Beta', 'addronix-addons-for-elementor' ), 'description' => esc_html__( 'Invite early users, gather feedback and fix what matters most.', 'addronix-addons-for-elementor' ), 'title_tag' => 'h3', ], [ 'title' => esc_html__( 'Launch', 'addronix-addons-for-elementor' ), 'description' => esc_html__( 'Ship to the world and keep improving with every release.', 'addronix-addons-for-elementor' ), 'title_tag' => 'h3', ], ], ] ); $this->end_controls_section(); /* ── Content: Responsive & Scroll Settings ─────────────── */ $this->start_controls_section( 'section_scroll_settings', [ 'label' => esc_html__( 'Scroll & Responsive Settings', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'timeline_breakpoint', [ 'label' => esc_html__( 'Timeline Breakpoint', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'description' => esc_html__( 'Choose when the widget switches to vertical timeline layout.', 'addronix-addons-for-elementor' ), 'default' => 'mobile', 'options' => [ 'mobile' => esc_html__( 'Mobile Only (< 768px)', 'addronix-addons-for-elementor' ), 'tablet' => esc_html__( 'Tablet & Mobile (< 1025px)', 'addronix-addons-for-elementor' ), 'always' => esc_html__( 'Always Vertical Timeline', 'addronix-addons-for-elementor' ), ], ] ); $this->add_control( 'scroll_hold', [ 'label' => esc_html__( 'Path Scroll Hold', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'description' => esc_html__( 'Portion of total scroll distance over which the curve glow line completes on desktop (e.g. 0.75 completes at 75% scroll).', 'addronix-addons-for-elementor' ), 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0.4, 'max' => 1.0, 'step' => 0.05, ], ], 'default' => [ 'unit' => 'px', 'size' => 0.75, ], ] ); $this->add_control( 'stagger_delay', [ 'label' => esc_html__( 'Word Reveal Delay (ms)', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::NUMBER, 'description' => esc_html__( 'Stagger delay in milliseconds between each animated word.', 'addronix-addons-for-elementor' ), 'min' => 0, 'max' => 150, 'step' => 5, 'default' => 35, ] ); $this->add_control( 'editor_preview_mode', [ 'label' => esc_html__( 'Editor Preview Mode', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'description' => esc_html__( 'Control how the widget behaves inside Elementor editor.', 'addronix-addons-for-elementor' ), 'default' => 'live_scroll', 'options' => [ 'live_scroll' => esc_html__( 'Interactive Live Scroll (Default)', 'addronix-addons-for-elementor' ), 'static_preview' => esc_html__( 'All Visible (Static Editing Mode)', 'addronix-addons-for-elementor' ), ], ] ); $this->end_controls_section(); /* ═════════════════════════════════════════════════════════ * TAB: STYLE * ═════════════════════════════════════════════════════════ */ /* ── Style: Header Content ─────────────────────────────── */ $this->start_controls_section( 'section_style_header', [ 'label' => esc_html__( 'Header Content', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_header' => 'yes', ], ] ); /* ─ Layout & Alignment ─ */ $this->add_control( 'heading_header_layout', [ 'label' => esc_html__( 'Layout & Spacing', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::HEADING, ] ); $this->add_responsive_control( 'header_width', [ 'label' => esc_html__( 'Content Max Width', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'vw' ], 'range' => [ 'px' => [ 'min' => 200, 'max' => 1400, 'step' => 10, ], '%' => [ 'min' => 10, 'max' => 100, ], 'vw' => [ 'min' => 10, 'max' => 100, ], ], 'default' => [ 'unit' => '%', 'size' => 100, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__header' => 'max-width: {{SIZE}}{{UNIT}}; width: 100%;', ], ] ); $this->add_responsive_control( 'header_block_align', [ 'label' => esc_html__( 'Block Alignment', 'addronix-addons-for-elementor' ), 'description' => esc_html__( 'Align the content box when max width is applied.', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'addronix-addons-for-elementor' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'addronix-addons-for-elementor' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'addronix-addons-for-elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'default' => 'center', 'selectors_dictionary' => [ 'left' => 'margin-left: 0 !important; margin-right: auto !important; align-self: flex-start !important;', 'center' => 'margin-left: auto !important; margin-right: auto !important; align-self: center !important;', 'right' => 'margin-left: auto !important; margin-right: 0 !important; align-self: flex-end !important;', ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__header' => '{{VALUE}}', ], ] ); $this->add_responsive_control( 'header_text_align', [ 'label' => esc_html__( 'Text Alignment', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'addronix-addons-for-elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'addronix-addons-for-elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'addronix-addons-for-elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justify', 'addronix-addons-for-elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__header' => 'text-align: {{VALUE}};', ], ] ); $this->add_responsive_control( 'header_bottom_spacing', [ 'label' => esc_html__( 'Spacing Below Header', 'addronix-addons-for-elementor' ), 'description' => esc_html__( 'Spacing between header content and track / milestones.', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => -40, 'max' => 80, ], ], 'default' => [ 'unit' => 'px', 'size' => 8, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__header' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); /* ─ Subtitle Style ─ */ $this->add_control( 'style_heading_subtitle', [ 'label' => esc_html__( 'Subtitle', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'header_subtitle_color', [ 'label' => esc_html__( 'Text Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#FD551D', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__subtitle' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'header_subtitle_typography', 'label' => esc_html__( 'Typography', 'addronix-addons-for-elementor' ), 'selector' => '{{WRAPPER}} .aafe-scroll-cards__subtitle', 'fields_options' => [ 'font_family' => [ 'default' => 'Inter', ], 'font_size' => [ 'default' => [ 'unit' => 'px', 'size' => 14, ], ], 'font_weight' => [ 'default' => '600', ], 'text_transform' => [ 'default' => 'uppercase', ], 'letter_spacing' => [ 'default' => [ 'unit' => 'em', 'size' => 0.08, ], ], ], ] ); $this->add_responsive_control( 'subtitle_spacing', [ 'label' => esc_html__( 'Subtitle Bottom Spacing', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60, ], ], 'default' => [ 'unit' => 'px', 'size' => 6, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'header_subtitle_bg_color', [ 'label' => esc_html__( 'Background Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__subtitle' => 'background-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'header_subtitle_padding', [ 'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__subtitle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'header_subtitle_radius', [ 'label' => esc_html__( 'Border Radius', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__subtitle' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); /* ─ Heading Style ─ */ $this->add_control( 'style_heading_title', [ 'label' => esc_html__( 'Heading', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'header_title_color', [ 'label' => esc_html__( 'Text Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__heading' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'header_title_typography', 'label' => esc_html__( 'Typography', 'addronix-addons-for-elementor' ), 'selector' => '{{WRAPPER}} .aafe-scroll-cards__heading', 'fields_options' => [ 'font_family' => [ 'default' => 'Inter', ], 'font_size' => [ 'default' => [ 'unit' => 'px', 'size' => 32, ], ], 'font_weight' => [ 'default' => '700', ], 'line_height' => [ 'default' => [ 'unit' => 'em', 'size' => 1.2, ], ], 'letter_spacing' => [ 'default' => [ 'unit' => 'em', 'size' => -0.02, ], ], ], ] ); $this->add_responsive_control( 'title_spacing', [ 'label' => esc_html__( 'Heading Bottom Spacing', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60, ], ], 'default' => [ 'unit' => 'px', 'size' => 8, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__heading' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); /* ─ Description Style ─ */ $this->add_control( 'style_heading_desc', [ 'label' => esc_html__( 'Description', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'header_desc_color', [ 'label' => esc_html__( 'Text Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(255, 255, 255, 0.72)', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__desc' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'header_desc_typography', 'label' => esc_html__( 'Typography', 'addronix-addons-for-elementor' ), 'selector' => '{{WRAPPER}} .aafe-scroll-cards__desc', 'fields_options' => [ 'font_family' => [ 'default' => 'Inter', ], 'font_size' => [ 'default' => [ 'unit' => 'px', 'size' => 16, ], ], 'font_weight' => [ 'default' => '400', ], 'line_height' => [ 'default' => [ 'unit' => 'em', 'size' => 1.5, ], ], ], ] ); /* ─ Header Box / Padding ─ */ $this->add_control( 'style_heading_box', [ 'label' => esc_html__( 'Header Box', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_responsive_control( 'header_padding', [ 'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* ── Style: Container / Track ──────────────────────────── */ $this->start_controls_section( 'section_style_container', [ 'label' => esc_html__( 'Container / Track', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'container_background', 'label' => esc_html__( 'Background', 'addronix-addons-for-elementor' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .aafe-scroll-cards', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => '#000000', ], ], ] ); $this->add_responsive_control( 'track_padding', [ 'label' => esc_html__( 'Padding', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__sticky' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => '20', 'right' => '24', 'bottom' => '20', 'left' => '24', 'unit' => 'px', 'isLinked' => false, ], 'tablet_default' => [ 'top' => '40', 'right' => '20', 'bottom' => '40', 'left' => '20', 'unit' => 'px', 'isLinked' => false, ], 'mobile_default' => [ 'top' => '60', 'right' => '20', 'bottom' => '60', 'left' => '30', 'unit' => 'px', 'isLinked' => false, ], ] ); $this->add_responsive_control( 'stage_max_width', [ 'label' => esc_html__( 'Stage Max Width', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 500, 'max' => 1600, 'step' => 10, ], ], 'default' => [ 'unit' => 'px', 'size' => 1050, ], 'tablet_default' => [ 'unit' => 'px', 'size' => 900, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__stage' => 'max-width: {{SIZE}}{{UNIT}} !important;', ], ] ); $this->end_controls_section(); /* ── Style: Scroll Hint ────────────────────────────────── */ $this->start_controls_section( 'section_style_hint', [ 'label' => esc_html__( 'Scroll Hint', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_hint' => 'yes', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'hint_typography', 'selector' => '{{WRAPPER}} .aafe-scroll-cards__hint', 'fields_options' => [ 'font_family' => [ 'default' => 'Inter', ], 'font_size' => [ 'default' => [ 'unit' => 'px', 'size' => 14, ], ], 'font_weight' => [ 'default' => '400', ], ], ] ); $this->add_control( 'hint_text_color', [ 'label' => esc_html__( 'Text Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(255, 255, 255, 0.7)', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__hint' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'hint_icon_color', [ 'label' => esc_html__( 'Icon Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(255, 255, 255, 0.7)', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__hint-icon' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'hint_icon_size', [ 'label' => esc_html__( 'Icon Size', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 48, ], ], 'default' => [ 'unit' => 'px', 'size' => 16, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__hint-icon' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'hint_gap', [ 'label' => esc_html__( 'Icon Spacing', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'default' => [ 'unit' => 'px', 'size' => 10, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__hint' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'hint_margin_bottom', [ 'label' => esc_html__( 'Bottom Margin', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'default' => [ 'unit' => 'px', 'size' => 20, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__hint' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* ── Style: Glow Path & Dots ───────────────────────────── */ $this->start_controls_section( 'section_style_glow_path', [ 'label' => esc_html__( 'Glow Path & Dots (Curve & Timeline)', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'glow_color', [ 'label' => esc_html__( 'Primary Glow Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#FD551D', 'description' => esc_html__( 'Applied to animated curve line, vertical timeline line, and glowing dot halos.', 'addronix-addons-for-elementor' ), 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--ms-c: {{VALUE}}; --mobile-line-c: {{VALUE}}; --mobile-dot-c: {{VALUE}};', ], ] ); $this->add_control( 'dot_center_color', [ 'label' => esc_html__( 'Active Dot Center Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#FEB399', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--ms-dot-center: {{VALUE}};', ], ] ); $this->add_control( 'path_inactive_color', [ 'label' => esc_html__( 'Inactive Path / Line Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(255, 255, 255, 0.12)', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--ms-path-inactive: {{VALUE}};', ], ] ); $this->add_control( 'dot_inactive_color', [ 'label' => esc_html__( 'Inactive Dot Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(255, 255, 255, 0.14)', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--ms-dot-inactive: {{VALUE}};', ], ] ); $this->add_control( 'head_light_color', [ 'label' => esc_html__( 'Moving Head Light Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--ms-head-c: {{VALUE}};', ], ] ); $this->add_control( 'stroke_width_core', [ 'label' => esc_html__( 'Curve Core Line Width', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 10, ], ], 'default' => [ 'unit' => 'px', 'size' => 3, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__glow-core' => 'stroke-width: {{SIZE}} !important;', ], ] ); $this->add_control( 'stroke_width_mid', [ 'label' => esc_html__( 'Curve Mid Glow Width', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 2, 'max' => 20, ], ], 'default' => [ 'unit' => 'px', 'size' => 8, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__glow-mid' => 'stroke-width: {{SIZE}} !important;', ], ] ); $this->add_control( 'stroke_width_outer', [ 'label' => esc_html__( 'Curve Outer Glow Width', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 5, 'max' => 35, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__glow-outer' => 'stroke-width: {{SIZE}} !important;', ], ] ); $this->end_controls_section(); /* ── Style: Milestone Cards ────────────────────────────── */ $this->start_controls_section( 'section_style_cards', [ 'label' => esc_html__( 'Milestone Cards', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'card_width', [ 'label' => esc_html__( 'Card Width', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 120, 'max' => 380, ], ], 'default' => [ 'unit' => 'px', 'size' => 210, ], 'tablet_default' => [ 'unit' => 'px', 'size' => 160, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__stage > .aafe-scroll-cards__item' => 'width: {{SIZE}}{{UNIT}} !important;', ], ] ); $this->add_responsive_control( 'title_desc_gap', [ 'label' => esc_html__( 'Title / Description Gap', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'default' => [ 'unit' => 'px', 'size' => 9, ], 'tablet_default' => [ 'unit' => 'px', 'size' => 7, ], 'mobile_default' => [ 'unit' => 'px', 'size' => 6, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__item-content' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'heading_title_style', [ 'label' => esc_html__( 'Title Typography & Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .aafe-scroll-cards__item-title', 'fields_options' => [ 'font_family' => [ 'default' => 'Inter', ], 'font_size' => [ 'default' => [ 'unit' => 'px', 'size' => 20, ], ], 'font_weight' => [ 'default' => '500', ], 'line_height' => [ 'default' => [ 'unit' => 'em', 'size' => 1.2, ], ], 'letter_spacing' => [ 'default' => [ 'unit' => 'em', 'size' => -0.03, ], ], ], ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Active Title Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#FFFFFF', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__item-title' => 'color: {{VALUE}};', '{{WRAPPER}} .aafe-scroll-cards__item-title a' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'title_inactive_opacity', [ 'label' => esc_html__( 'Inactive Title Opacity', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0.1, 'max' => 1.0, 'step' => 0.05, ], ], 'default' => [ 'unit' => 'px', 'size' => 0.35, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__stage > .aafe-scroll-cards__item:not(.is-on) .aafe-scroll-cards__item-title' => 'opacity: {{SIZE}} !important;', ], ] ); $this->add_control( 'heading_desc_style', [ 'label' => esc_html__( 'Description Typography & Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'desc_typography', 'selector' => '{{WRAPPER}} .aafe-scroll-cards__item-desc, {{WRAPPER}} .aafe-scroll-cards__item-desc *', 'fields_options' => [ 'font_family' => [ 'default' => 'Inter', ], 'font_size' => [ 'default' => [ 'unit' => 'px', 'size' => 14, ], ], 'font_weight' => [ 'default' => '400', ], 'line_height' => [ 'default' => [ 'unit' => 'em', 'size' => 1.2, ], ], 'letter_spacing' => [ 'default' => [ 'unit' => 'em', 'size' => -0.02, ], ], ], ] ); $this->add_control( 'desc_color', [ 'label' => esc_html__( 'Description Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(255, 255, 255, 0.72)', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__item-desc' => 'color: {{VALUE}};', '{{WRAPPER}} .aafe-scroll-cards__item-desc *' => 'color: {{VALUE}};', ], ] ); $this->end_controls_section(); /* ── Style: Mobile Timeline ────────────────────────────── */ $this->start_controls_section( 'section_style_mobile', [ 'label' => esc_html__( 'Vertical Timeline Styling', 'addronix-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'mobile_line_color', [ 'label' => esc_html__( 'Timeline Glowing Line Color', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#FD551D', 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--mobile-line-c: {{VALUE}}; --mobile-dot-c: {{VALUE}};', ], ] ); $this->add_responsive_control( 'mobile_line_width', [ 'label' => esc_html__( 'Timeline Line Width', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 8, ], ], 'default' => [ 'unit' => 'px', 'size' => 2, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--mobile-line-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'mobile_dot_size', [ 'label' => esc_html__( 'Timeline Dot Size', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 8, 'max' => 26, ], ], 'default' => [ 'unit' => 'px', 'size' => 12, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--mobile-dot-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'mobile_gap', [ 'label' => esc_html__( 'Vertical Item Spacing', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'default' => [ 'unit' => 'px', 'size' => 28, ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards' => '--mobile-gap: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'mobile_padding', [ 'label' => esc_html__( 'Card Padding (Timeline)', 'addronix-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .aafe-scroll-cards__item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); } protected function render(): void { $settings = $this->get_settings_for_display(); $milestones = ! empty( $settings['milestones'] ) ? $settings['milestones'] : []; if ( empty( $milestones ) ) { return; } $hold_factor = ! empty( $settings['scroll_hold']['size'] ) ? floatval( $settings['scroll_hold']['size'] ) : 0.75; $stagger_delay = ! empty( $settings['stagger_delay'] ) ? intval( $settings['stagger_delay'] ) : 35; $editor_mode = ! empty( $settings['editor_preview_mode'] ) ? sanitize_html_class( $settings['editor_preview_mode'] ) : 'live_scroll'; $breakpoint = ! empty( $settings['timeline_breakpoint'] ) ? sanitize_html_class( $settings['timeline_breakpoint'] ) : 'mobile'; // Dynamic curve calculation based on milestone count $milestone_count = count( $milestones ); $curve_data = $this->get_curve_data( $milestone_count ); $svg_d = $curve_data['d']; $coords = $curve_data['coords']; $this->add_render_attribute( 'wrapper', [ 'class' => [ 'aafe-scroll-cards', 'ms-track', 'aafe-timeline-bp-' . $breakpoint, ], 'data-scroll-hold' => esc_attr( $hold_factor ), 'data-stagger-delay' => esc_attr( $stagger_delay ), 'data-editor-mode' => esc_attr( $editor_mode ), ] ); ?>