diff --git a/src/App.jsx b/src/App.jsx
index 34c287e..bdfbcea 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -34,19 +34,19 @@ function Reveal({ children, delay = 0, style }) {
);
}
-import {
- ArrowRight,
- Sparkles,
- Database,
- Cpu,
- LineChart,
- Layers,
- Activity,
- Settings,
- Shield,
- TrendingUp,
- Globe,
- ChevronRight,
+import {
+ ArrowRight,
+ Sparkles,
+ Database,
+ Cpu,
+ LineChart,
+ Layers,
+ Activity,
+ Settings,
+ Shield,
+ TrendingUp,
+ Globe,
+ ChevronRight,
ChevronLeft,
Mail,
CheckCircle,
@@ -83,24 +83,24 @@ const iconMap = {
// Reusable Orbital Logo Component for animated paths around header text
const OrbitalLogo = ({ src, alt, radiusX, radiusY, startAngle, duration, clockwise = true, size = 120 }) => {
const [position, setPosition] = useState({ x: 0, y: 0 });
-
+
useEffect(() => {
const speed = (2 * Math.PI) / (duration * 1000); // radians per millisecond
const direction = clockwise ? 1 : -1;
const startRad = (startAngle * Math.PI) / 180;
-
+
let animFrame;
const update = () => {
const elapsed = performance.now();
const angle = startRad + direction * speed * elapsed;
-
+
const x = radiusX * Math.cos(angle);
const y = radiusY * Math.sin(angle);
-
+
setPosition({ x, y });
animFrame = requestAnimationFrame(update);
};
-
+
animFrame = requestAnimationFrame(update);
return () => cancelAnimationFrame(animFrame);
}, [radiusX, radiusY, startAngle, duration, clockwise]);
@@ -150,11 +150,11 @@ function ServiceCard({ service, isMobile, index = 0 }) {
];
const formatTitle = (title) => {
- if (title.includes('AI & Data')) return <>AI & Data
Services>;
- if (title.includes('Enterprise')) return <>Enterprise
Software>;
- if (title.includes('SAP')) return <>SAP Managed
Services>;
- if (title.includes('Smart')) return <>Smart
Factory>;
- if (title.includes('AR/VR')) return <>AR/VR &
Immersive
Technologies>;
+ if (title.includes('AI & Data')) return <>AI & Data
Services>;
+ if (title.includes('Enterprise')) return <>Enterprise
Software>;
+ if (title.includes('SAP')) return <>SAP Managed
Services>;
+ if (title.includes('Smart')) return <>Smart
Factory>;
+ if (title.includes('AR/VR')) return <>AR/VR &
Immersive
Technologies>;
return title;
};
@@ -234,8 +234,8 @@ function ServiceCard({ service, isMobile, index = 0 }) {
right: '-15px',
pointerEvents: 'none',
}}>
- {
- const hash = typeof window !== 'undefined' ? window.location.hash : '';
- if (hash === '#contact' || hash === '#contactus') return 'contact';
- if (hash === '#about' || hash === '#aboutus') return 'about';
- return 'home';
- });
+ const [currentPage, setCurrentPage] = useState('home');
useEffect(() => {
const syncPageFromHash = () => {
@@ -453,7 +448,7 @@ export default function App({ previewMode = false }) {
const logoNumbers = [27, 28, 30, 31, 32, 33, 34, 35, 36];
const randomNum = logoNumbers[Math.floor(Math.random() * logoNumbers.length)];
setFlippingLogo(randomNum);
-
+
// Clear flip after animation completes
setTimeout(() => {
setFlippingLogo(null);
@@ -550,23 +545,15 @@ export default function App({ previewMode = false }) {
const NAV_OFFSET = isMobile ? 72 : 88;
const scrollToSection = (sectionId) => {
- if (sectionId === 'contactus') {
- const footer = document.getElementById('contactus');
- if (footer) {
- const top = footer.getBoundingClientRect().top + window.scrollY - NAV_OFFSET;
- window.scrollTo({ top: Math.max(0, top), behavior: 'smooth' });
- } else {
- window.scrollTo({ top: document.documentElement.scrollHeight, behavior: 'smooth' });
- }
- setActiveSection('contactus');
- return;
- }
-
const el = document.getElementById(sectionId);
- if (!el) return;
- const top = el.getBoundingClientRect().top + window.scrollY - NAV_OFFSET;
- window.scrollTo({ top: Math.max(0, top), behavior: 'smooth' });
- setActiveSection(sectionId);
+ if (el) {
+ const top = el.getBoundingClientRect().top + window.scrollY - NAV_OFFSET;
+ window.scrollTo({ top, behavior: 'smooth' });
+ setActiveSection(sectionId);
+ } else if (sectionId === 'contactus') {
+ window.scrollTo({ top: document.documentElement.scrollHeight, behavior: 'smooth' });
+ setActiveSection('contactus');
+ }
};
const handleNavClick = (item) => {
@@ -594,28 +581,33 @@ export default function App({ previewMode = false }) {
const sectionMap = {
Home: 'home',
- 'About Us': 'aboutus',
Products: 'products',
};
const id = sectionMap[item];
+ const doScroll = (sectionId) => {
+ if (!sectionId || sectionId === 'home') {
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ return;
+ }
+ requestAnimationFrame(() => {
+ const el = document.getElementById(sectionId);
+ if (el) {
+ const top = el.getBoundingClientRect().top + window.scrollY - NAV_OFFSET;
+ window.scrollTo({ top, behavior: 'smooth' });
+ setActiveSection(sectionId);
+ }
+ });
+ };
+
if (currentPage !== 'home') {
setCurrentPage('home');
setActiveSection(id || 'home');
- window.location.hash = id || 'home';
- setTimeout(() => {
- if (id && id !== 'home') {
- scrollToSection(id);
- } else {
- window.scrollTo({ top: 0, behavior: 'smooth' });
- }
- }, 100);
+ setTimeout(() => doScroll(id), 350);
return;
}
- if (!id) return;
- window.location.hash = id;
- setTimeout(() => scrollToSection(id), isMobile ? 150 : 0);
+ doScroll(id);
};
useEffect(() => {
@@ -680,10 +672,10 @@ export default function App({ previewMode = false }) {
return (