From 47ac74329ffb7d1d39707346380395049311c6f8 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 2 Jun 2026 15:53:28 +0000 Subject: [PATCH] fix: counter animations and add footer with legal links - Fixed counter-animate to use gsap.fromTo with proper textContent interpolation - Added footer section with logo, privacy/terms/security/contact links - Added copyright notice with dynamic year --- src/components/landing/HeroSection.tsx | 107 ++++++++++++++++++++----- 1 file changed, 88 insertions(+), 19 deletions(-) diff --git a/src/components/landing/HeroSection.tsx b/src/components/landing/HeroSection.tsx index 05f4fbb..bb53727 100644 --- a/src/components/landing/HeroSection.tsx +++ b/src/components/landing/HeroSection.tsx @@ -158,25 +158,33 @@ export default function HeroSection() { ); }); - // Counter animations - gsap.utils.toArray(".counter-animate").forEach((el) => { - const target = parseInt(el.getAttribute("data-target") || "0", 10); - const obj = { val: 0 }; - gsap.to(obj, { - val: target, - duration: 2, - ease: "power2.out", - onUpdate: () => { - if (el.textContent !== null) { - el.textContent = Math.floor(obj.val).toLocaleString(); - } - }, - scrollTrigger: { - trigger: el, - start: "top 80%", - toggleActions: "play none none none", - }, - }); + // Counter animations with proper initialization + const counterElements = gsap.utils.toArray(".counter-animate"); + counterElements.forEach((el) => { + const targetStr = el.getAttribute("data-target") || "0"; + const target = parseInt(targetStr, 10); + + gsap.fromTo( + el, + { textContent: 0 }, + { + textContent: target, + duration: 2.5, + ease: "power2.out", + snap: { textContent: 1 }, + scrollTrigger: { + trigger: el, + start: "top 85%", + toggleActions: "play none none none", + }, + onUpdate: function() { + const val = Math.floor(gsap.getProperty(el, "textContent") as number); + if (el.textContent !== null) { + el.textContent = val.toLocaleString(); + } + }, + } + ); }); }, containerRef); @@ -929,6 +937,67 @@ export default function HeroSection() { + {/* ─── FOOTER ─────────────────────────────────────────────────────────── */} +
+
+ +
+
+ {/* Logo */} +
+
+ + + +
+ + Route Commerce + +
+ + {/* Legal Links */} + +
+ + {/* Copyright */} +
+

+ © {new Date().getFullYear()} Route Commerce. All rights reserved. +

+

+ Fresh produce wholesale platform for farms, Co-ops, and distributors. +

+
+
+
+ {/* ─── GLOBAL STYLES ────────────────────────────────────────────────────── */}