aura-ui-library 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +165 -55
- package/dist/index.mjs +173 -63
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -244,6 +244,15 @@ var Navbar = ({
|
|
|
244
244
|
const linksRef = (0, import_react2.useRef)([]);
|
|
245
245
|
const buttonRef = (0, import_react2.useRef)(null);
|
|
246
246
|
const menuOverlayRef = (0, import_react2.useRef)(null);
|
|
247
|
+
const inRouter = (0, import_react_router_dom2.useInRouterContext)();
|
|
248
|
+
const navigate = inRouter ? (0, import_react_router_dom2.useNavigate)() : null;
|
|
249
|
+
const handleNavigate = (path) => {
|
|
250
|
+
if (navigate) {
|
|
251
|
+
navigate(path);
|
|
252
|
+
} else {
|
|
253
|
+
window.location.assign(path);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
247
256
|
(0, import_react2.useEffect)(() => {
|
|
248
257
|
const handleResize = () => {
|
|
249
258
|
const mobile = window.innerWidth <= 1024;
|
|
@@ -422,23 +431,36 @@ var Navbar = ({
|
|
|
422
431
|
onMouseEnter: (e) => import_gsap2.gsap.to(e.currentTarget, { scale: 1.02 }),
|
|
423
432
|
onMouseLeave: (e) => import_gsap2.gsap.to(e.currentTarget, { scale: 1 })
|
|
424
433
|
},
|
|
425
|
-
/* @__PURE__ */ import_react2.default.createElement(import_react_router_dom2.Link, { to: "/", style: { ...styles.logo, color: "inherit" } }, /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.logoDot }), logoText)
|
|
426
|
-
), /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.navLinks }, links.map((link, i) =>
|
|
427
|
-
|
|
428
|
-
{
|
|
429
|
-
key: link.path,
|
|
430
|
-
to: link.path,
|
|
434
|
+
inRouter ? /* @__PURE__ */ import_react2.default.createElement(import_react_router_dom2.Link, { to: "/", style: { ...styles.logo, color: "inherit" } }, /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.logoDot }), logoText) : /* @__PURE__ */ import_react2.default.createElement("a", { href: "/", style: { ...styles.logo, color: "inherit" } }, /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.logoDot }), logoText)
|
|
435
|
+
), /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.navLinks }, links.map((link, i) => {
|
|
436
|
+
const linkProps = {
|
|
431
437
|
ref: (el) => linksRef.current[i] = el,
|
|
432
438
|
onMouseEnter: handleMouseEnter,
|
|
433
439
|
onMouseMove: handleMouseMove,
|
|
434
440
|
onMouseLeave: handleMouseLeave,
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
441
|
+
key: link.path
|
|
442
|
+
};
|
|
443
|
+
return inRouter ? /* @__PURE__ */ import_react2.default.createElement(
|
|
444
|
+
import_react_router_dom2.NavLink,
|
|
445
|
+
{
|
|
446
|
+
to: link.path,
|
|
447
|
+
...linkProps,
|
|
448
|
+
style: ({ isActive }) => ({
|
|
449
|
+
...styles.link,
|
|
450
|
+
color: isActive ? accentColor : textColor
|
|
451
|
+
})
|
|
452
|
+
},
|
|
453
|
+
link.label
|
|
454
|
+
) : /* @__PURE__ */ import_react2.default.createElement(
|
|
455
|
+
"a",
|
|
456
|
+
{
|
|
457
|
+
href: link.path,
|
|
458
|
+
...linkProps,
|
|
459
|
+
style: styles.link
|
|
460
|
+
},
|
|
461
|
+
link.label
|
|
462
|
+
);
|
|
463
|
+
})), /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.actions }, !isMobile && /* @__PURE__ */ import_react2.default.createElement(
|
|
442
464
|
"button",
|
|
443
465
|
{
|
|
444
466
|
ref: buttonRef,
|
|
@@ -449,7 +471,7 @@ var Navbar = ({
|
|
|
449
471
|
},
|
|
450
472
|
"Start Building",
|
|
451
473
|
/* @__PURE__ */ import_react2.default.createElement(import_fi.FiArrowUpRight, { size: 18 })
|
|
452
|
-
), /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.menuToggle, onClick: () => setIsMenuOpen(!isMenuOpen) }, isMenuOpen ? /* @__PURE__ */ import_react2.default.createElement(import_fi.FiX, null) : /* @__PURE__ */ import_react2.default.createElement(import_fi.FiMenu, null)))), isMobile && isMenuOpen && /* @__PURE__ */ import_react2.default.createElement("div", { ref: menuOverlayRef, style: styles.mobileOverlay }, links.map((link, i) => /* @__PURE__ */ import_react2.default.createElement(
|
|
474
|
+
), /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.menuToggle, onClick: () => setIsMenuOpen(!isMenuOpen) }, isMenuOpen ? /* @__PURE__ */ import_react2.default.createElement(import_fi.FiX, null) : /* @__PURE__ */ import_react2.default.createElement(import_fi.FiMenu, null)))), isMobile && isMenuOpen && /* @__PURE__ */ import_react2.default.createElement("div", { ref: menuOverlayRef, style: styles.mobileOverlay }, links.map((link, i) => inRouter ? /* @__PURE__ */ import_react2.default.createElement(
|
|
453
475
|
import_react_router_dom2.Link,
|
|
454
476
|
{
|
|
455
477
|
key: link.path,
|
|
@@ -464,6 +486,21 @@ var Navbar = ({
|
|
|
464
486
|
}
|
|
465
487
|
},
|
|
466
488
|
link.label
|
|
489
|
+
) : /* @__PURE__ */ import_react2.default.createElement(
|
|
490
|
+
"a",
|
|
491
|
+
{
|
|
492
|
+
key: link.path,
|
|
493
|
+
href: link.path,
|
|
494
|
+
onClick: () => setIsMenuOpen(false),
|
|
495
|
+
style: {
|
|
496
|
+
fontSize: "32px",
|
|
497
|
+
fontWeight: "800",
|
|
498
|
+
color: textColor,
|
|
499
|
+
textDecoration: "none",
|
|
500
|
+
letterSpacing: "-1px"
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
link.label
|
|
467
504
|
)), /* @__PURE__ */ import_react2.default.createElement(
|
|
468
505
|
"button",
|
|
469
506
|
{
|
|
@@ -500,7 +537,15 @@ var Spotlight = ({
|
|
|
500
537
|
const descriptionRef = (0, import_react3.useRef)(null);
|
|
501
538
|
const ctaRef = (0, import_react3.useRef)(null);
|
|
502
539
|
const iconsRef = (0, import_react3.useRef)([]);
|
|
503
|
-
const
|
|
540
|
+
const inRouter = (0, import_react_router_dom3.useInRouterContext)();
|
|
541
|
+
const navigate = inRouter ? (0, import_react_router_dom3.useNavigate)() : null;
|
|
542
|
+
const handleNavigate = (path) => {
|
|
543
|
+
if (navigate) {
|
|
544
|
+
navigate(path);
|
|
545
|
+
} else {
|
|
546
|
+
window.location.assign(path);
|
|
547
|
+
}
|
|
548
|
+
};
|
|
504
549
|
(0, import_react3.useEffect)(() => {
|
|
505
550
|
const container = containerRef.current;
|
|
506
551
|
const spotlight = spotlightRef.current;
|
|
@@ -679,7 +724,7 @@ var Spotlight = ({
|
|
|
679
724
|
style: { display: "inline-block" },
|
|
680
725
|
onMouseEnter: handleMouseEnter,
|
|
681
726
|
onMouseLeave: handleMouseLeave,
|
|
682
|
-
onClick: () =>
|
|
727
|
+
onClick: () => ctaLink && handleNavigate(ctaLink)
|
|
683
728
|
},
|
|
684
729
|
/* @__PURE__ */ import_react3.default.createElement("button", { style: styles.cta }, ctaText, /* @__PURE__ */ import_react3.default.createElement(import_fi2.FiArrowUpRight, { size: 22 }))
|
|
685
730
|
)));
|
|
@@ -730,7 +775,15 @@ var Carousel = ({
|
|
|
730
775
|
const navRef = (0, import_react4.useRef)(null);
|
|
731
776
|
const progressRef = (0, import_react4.useRef)(null);
|
|
732
777
|
const timerRef = (0, import_react4.useRef)(null);
|
|
733
|
-
const
|
|
778
|
+
const inRouter = (0, import_react_router_dom4.useInRouterContext)();
|
|
779
|
+
const navigate = inRouter ? (0, import_react_router_dom4.useNavigate)() : null;
|
|
780
|
+
const handleNavigate = (path) => {
|
|
781
|
+
if (navigate) {
|
|
782
|
+
navigate(path);
|
|
783
|
+
} else {
|
|
784
|
+
window.location.assign(path);
|
|
785
|
+
}
|
|
786
|
+
};
|
|
734
787
|
const isAnimating = (0, import_react4.useRef)(false);
|
|
735
788
|
const moveSlide = (0, import_react4.useCallback)((nextIndex, direction = 1) => {
|
|
736
789
|
if (isAnimating.current || nextIndex === index) return;
|
|
@@ -1008,7 +1061,7 @@ var Carousel = ({
|
|
|
1008
1061
|
style: styles.cta,
|
|
1009
1062
|
onMouseEnter: (e) => e.currentTarget.style.filter = "brightness(1.1)",
|
|
1010
1063
|
onMouseLeave: (e) => e.currentTarget.style.filter = "brightness(1)",
|
|
1011
|
-
onClick: () => slide.path &&
|
|
1064
|
+
onClick: () => slide.path && handleNavigate(slide.path)
|
|
1012
1065
|
},
|
|
1013
1066
|
slide.cta,
|
|
1014
1067
|
/* @__PURE__ */ import_react4.default.createElement(import_fi3.FiArrowRight, { size: 20 })
|
|
@@ -1079,7 +1132,15 @@ var ProductCard = ({
|
|
|
1079
1132
|
const infoRef = (0, import_react5.useRef)(null);
|
|
1080
1133
|
const actionsRef = (0, import_react5.useRef)(null);
|
|
1081
1134
|
const buttonRefs = (0, import_react5.useRef)([]);
|
|
1082
|
-
const
|
|
1135
|
+
const inRouter = (0, import_react_router_dom5.useInRouterContext)();
|
|
1136
|
+
const navigate = inRouter ? (0, import_react_router_dom5.useNavigate)() : null;
|
|
1137
|
+
const handleNavigate = (path) => {
|
|
1138
|
+
if (navigate) {
|
|
1139
|
+
navigate(path);
|
|
1140
|
+
} else {
|
|
1141
|
+
window.location.assign(path);
|
|
1142
|
+
}
|
|
1143
|
+
};
|
|
1083
1144
|
(0, import_react5.useEffect)(() => {
|
|
1084
1145
|
const ctx = import_gsap5.gsap.context(() => {
|
|
1085
1146
|
const tl = import_gsap5.gsap.timeline({ defaults: { ease: easing, duration: animationDuration } });
|
|
@@ -1269,7 +1330,7 @@ var ProductCard = ({
|
|
|
1269
1330
|
style: styles.card,
|
|
1270
1331
|
onMouseEnter: handleMouseEnter,
|
|
1271
1332
|
onMouseLeave: handleMouseLeave,
|
|
1272
|
-
onClick: () => product.path &&
|
|
1333
|
+
onClick: () => product.path && handleNavigate(product.path)
|
|
1273
1334
|
},
|
|
1274
1335
|
/* @__PURE__ */ import_react5.default.createElement("div", { style: styles.imageContainer }, /* @__PURE__ */ import_react5.default.createElement(
|
|
1275
1336
|
"img",
|
|
@@ -1355,7 +1416,15 @@ var Image = ({
|
|
|
1355
1416
|
const overlayRef = (0, import_react6.useRef)(null);
|
|
1356
1417
|
const revealRef = (0, import_react6.useRef)(null);
|
|
1357
1418
|
const textRef = (0, import_react6.useRef)(null);
|
|
1358
|
-
const
|
|
1419
|
+
const inRouter = (0, import_react_router_dom6.useInRouterContext)();
|
|
1420
|
+
const navigate = inRouter ? (0, import_react_router_dom6.useNavigate)() : null;
|
|
1421
|
+
const handleNavigate = (path) => {
|
|
1422
|
+
if (navigate) {
|
|
1423
|
+
navigate(path);
|
|
1424
|
+
} else {
|
|
1425
|
+
window.location.assign(path);
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1359
1428
|
const [isLoaded, setIsLoaded] = (0, import_react6.useState)(false);
|
|
1360
1429
|
(0, import_react6.useEffect)(() => {
|
|
1361
1430
|
if (!reveal) return;
|
|
@@ -1501,7 +1570,7 @@ var Image = ({
|
|
|
1501
1570
|
style: styles.container,
|
|
1502
1571
|
onMouseMove: handleMouseMove,
|
|
1503
1572
|
onMouseLeave: handleMouseLeave,
|
|
1504
|
-
onClick: () => to &&
|
|
1573
|
+
onClick: () => to && handleNavigate(to)
|
|
1505
1574
|
},
|
|
1506
1575
|
reveal && /* @__PURE__ */ import_react6.default.createElement("div", { ref: revealRef, style: styles.reveal }),
|
|
1507
1576
|
/* @__PURE__ */ import_react6.default.createElement(
|
|
@@ -1564,6 +1633,7 @@ var TextWriting = ({
|
|
|
1564
1633
|
showCursor = true,
|
|
1565
1634
|
scramble = true,
|
|
1566
1635
|
loop = true,
|
|
1636
|
+
autoStart = true,
|
|
1567
1637
|
onComplete
|
|
1568
1638
|
}) => {
|
|
1569
1639
|
const [currentTextIndex, setCurrentTextIndex] = (0, import_react7.useState)(0);
|
|
@@ -1574,15 +1644,17 @@ var TextWriting = ({
|
|
|
1574
1644
|
const timelineRef = (0, import_react7.useRef)(null);
|
|
1575
1645
|
const characters = (0, import_react7.useMemo)(() => "!@#$%^&*()_+{}|:<>?abcdefghijklmnopqrstuvwxyz0123456789", []);
|
|
1576
1646
|
const getRandomChar = () => characters[Math.floor(Math.random() * characters.length)];
|
|
1577
|
-
|
|
1647
|
+
(0, import_react7.useEffect)(() => {
|
|
1648
|
+
if (!autoStart) return;
|
|
1649
|
+
const targetText = texts[currentTextIndex];
|
|
1650
|
+
if (!targetText) return;
|
|
1578
1651
|
if (timelineRef.current) timelineRef.current.kill();
|
|
1579
1652
|
const ctx = import_gsap7.gsap.context(() => {
|
|
1580
1653
|
const tl = import_gsap7.gsap.timeline({
|
|
1581
1654
|
onComplete: () => {
|
|
1582
1655
|
if (loop) {
|
|
1583
1656
|
import_gsap7.gsap.delayedCall(delay, () => {
|
|
1584
|
-
|
|
1585
|
-
setCurrentTextIndex(nextIndex);
|
|
1657
|
+
setCurrentTextIndex((prev) => (prev + 1) % texts.length);
|
|
1586
1658
|
});
|
|
1587
1659
|
}
|
|
1588
1660
|
if (onComplete) onComplete();
|
|
@@ -1590,7 +1662,6 @@ var TextWriting = ({
|
|
|
1590
1662
|
});
|
|
1591
1663
|
timelineRef.current = tl;
|
|
1592
1664
|
const textArray = targetText.split("");
|
|
1593
|
-
let frame = 0;
|
|
1594
1665
|
tl.to({}, {
|
|
1595
1666
|
duration: textArray.length * speed,
|
|
1596
1667
|
onUpdate: function() {
|
|
@@ -1601,7 +1672,7 @@ var TextWriting = ({
|
|
|
1601
1672
|
if (i < charCount) {
|
|
1602
1673
|
display += textArray[i];
|
|
1603
1674
|
} else if (i === charCount && scramble) {
|
|
1604
|
-
display +=
|
|
1675
|
+
display += characters[Math.floor(Math.random() * characters.length)];
|
|
1605
1676
|
} else {
|
|
1606
1677
|
display += "";
|
|
1607
1678
|
}
|
|
@@ -1611,20 +1682,16 @@ var TextWriting = ({
|
|
|
1611
1682
|
});
|
|
1612
1683
|
tl.fromTo(
|
|
1613
1684
|
containerRef.current,
|
|
1614
|
-
{ scale: 0.98, opacity: 0
|
|
1615
|
-
{ scale: 1, opacity: 1, duration: 0.
|
|
1685
|
+
{ scale: 0.98, opacity: 0 },
|
|
1686
|
+
{ scale: 1, opacity: 1, duration: 0.6, ease: "power2.out" },
|
|
1616
1687
|
0
|
|
1617
1688
|
);
|
|
1618
1689
|
}, containerRef);
|
|
1619
|
-
return ctx;
|
|
1620
|
-
};
|
|
1621
|
-
(0, import_react7.useEffect)(() => {
|
|
1622
|
-
const ctx = animateText(texts[currentTextIndex]);
|
|
1623
1690
|
return () => {
|
|
1624
1691
|
ctx.revert();
|
|
1625
1692
|
if (timelineRef.current) timelineRef.current.kill();
|
|
1626
1693
|
};
|
|
1627
|
-
}, [currentTextIndex]);
|
|
1694
|
+
}, [currentTextIndex, texts, loop, delay, speed, scramble, autoStart]);
|
|
1628
1695
|
(0, import_react7.useEffect)(() => {
|
|
1629
1696
|
if (!showCursor) return;
|
|
1630
1697
|
const ctx = import_gsap7.gsap.context(() => {
|
|
@@ -1701,10 +1768,15 @@ var TextWriting = ({
|
|
|
1701
1768
|
"div",
|
|
1702
1769
|
{
|
|
1703
1770
|
ref: containerRef,
|
|
1704
|
-
style: styles.container,
|
|
1771
|
+
style: { ...styles.container, opacity: 1 },
|
|
1705
1772
|
onMouseEnter: handleMouseEnter,
|
|
1706
1773
|
onMouseLeave: handleMouseLeave,
|
|
1707
|
-
onClick: () =>
|
|
1774
|
+
onClick: () => {
|
|
1775
|
+
var _a;
|
|
1776
|
+
if (!((_a = timelineRef.current) == null ? void 0 : _a.isActive())) {
|
|
1777
|
+
setCurrentTextIndex((prev) => (prev + 1) % texts.length);
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1708
1780
|
},
|
|
1709
1781
|
/* @__PURE__ */ import_react7.default.createElement("div", { style: styles.iconWrap }, /* @__PURE__ */ import_react7.default.createElement(import_fi6.FiTerminal, { size: 20 })),
|
|
1710
1782
|
/* @__PURE__ */ import_react7.default.createElement("div", { ref: textRef, style: styles.text }, currentText, /* @__PURE__ */ import_react7.default.createElement("span", { ref: cursorRef, style: styles.cursor })),
|
|
@@ -1738,7 +1810,15 @@ var SideBar = ({
|
|
|
1738
1810
|
const sidebarRef = (0, import_react8.useRef)(null);
|
|
1739
1811
|
const itemsRef = (0, import_react8.useRef)([]);
|
|
1740
1812
|
const indicatorRef = (0, import_react8.useRef)(null);
|
|
1741
|
-
const
|
|
1813
|
+
const inRouter = (0, import_react_router_dom7.useInRouterContext)();
|
|
1814
|
+
const navigate = inRouter ? (0, import_react_router_dom7.useNavigate)() : null;
|
|
1815
|
+
const handleNavigate = (path) => {
|
|
1816
|
+
if (navigate) {
|
|
1817
|
+
navigate(path);
|
|
1818
|
+
} else {
|
|
1819
|
+
window.location.assign(path);
|
|
1820
|
+
}
|
|
1821
|
+
};
|
|
1742
1822
|
(0, import_react8.useEffect)(() => {
|
|
1743
1823
|
const ctx = import_gsap8.gsap.context(() => {
|
|
1744
1824
|
const tl = import_gsap8.gsap.timeline({ defaults: { ease: easing, duration: animationDuration } });
|
|
@@ -1913,22 +1993,36 @@ var SideBar = ({
|
|
|
1913
1993
|
onMouseLeave: () => setIsExpanded(false)
|
|
1914
1994
|
},
|
|
1915
1995
|
/* @__PURE__ */ import_react8.default.createElement("div", { style: styles.logoContainer }, /* @__PURE__ */ import_react8.default.createElement("div", { style: styles.logo }, /* @__PURE__ */ import_react8.default.createElement(import_fi7.FiLayers, { size: 22 })), /* @__PURE__ */ import_react8.default.createElement("span", { style: styles.logoText }, "Aura UI")),
|
|
1916
|
-
/* @__PURE__ */ import_react8.default.createElement("nav", { style: styles.nav }, /* @__PURE__ */ import_react8.default.createElement("div", { ref: indicatorRef, style: styles.indicator }), items.map((item, index) =>
|
|
1917
|
-
|
|
1918
|
-
{
|
|
1919
|
-
key: item.path,
|
|
1920
|
-
to: item.path,
|
|
1996
|
+
/* @__PURE__ */ import_react8.default.createElement("nav", { style: styles.nav }, /* @__PURE__ */ import_react8.default.createElement("div", { ref: indicatorRef, style: styles.indicator }), items.map((item, index) => {
|
|
1997
|
+
const itemProps = {
|
|
1921
1998
|
ref: (el) => itemsRef.current[index] = el,
|
|
1922
|
-
style: ({ isActive }) => ({
|
|
1923
|
-
...styles.item,
|
|
1924
|
-
...isActive ? styles.activeItem : {}
|
|
1925
|
-
}),
|
|
1926
1999
|
onMouseEnter: (e) => handleItemHover(e, index),
|
|
1927
|
-
onMouseLeave: () => handleItemLeave(index)
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
/* @__PURE__ */ import_react8.default.createElement(
|
|
1931
|
-
|
|
2000
|
+
onMouseLeave: () => handleItemLeave(index),
|
|
2001
|
+
key: item.path
|
|
2002
|
+
};
|
|
2003
|
+
return inRouter ? /* @__PURE__ */ import_react8.default.createElement(
|
|
2004
|
+
import_react_router_dom7.NavLink,
|
|
2005
|
+
{
|
|
2006
|
+
to: item.path,
|
|
2007
|
+
...itemProps,
|
|
2008
|
+
style: ({ isActive }) => ({
|
|
2009
|
+
...styles.item,
|
|
2010
|
+
...isActive ? styles.activeItem : {}
|
|
2011
|
+
})
|
|
2012
|
+
},
|
|
2013
|
+
/* @__PURE__ */ import_react8.default.createElement("div", { style: styles.icon }, renderIcon(item.icon)),
|
|
2014
|
+
/* @__PURE__ */ import_react8.default.createElement("span", { style: styles.label }, item.label)
|
|
2015
|
+
) : /* @__PURE__ */ import_react8.default.createElement(
|
|
2016
|
+
"a",
|
|
2017
|
+
{
|
|
2018
|
+
href: item.path,
|
|
2019
|
+
...itemProps,
|
|
2020
|
+
style: styles.item
|
|
2021
|
+
},
|
|
2022
|
+
/* @__PURE__ */ import_react8.default.createElement("div", { style: styles.icon }, renderIcon(item.icon)),
|
|
2023
|
+
/* @__PURE__ */ import_react8.default.createElement("span", { style: styles.label }, item.label)
|
|
2024
|
+
);
|
|
2025
|
+
})),
|
|
1932
2026
|
/* @__PURE__ */ import_react8.default.createElement("div", { style: styles.footer }, /* @__PURE__ */ import_react8.default.createElement(
|
|
1933
2027
|
"button",
|
|
1934
2028
|
{
|
|
@@ -1994,7 +2088,15 @@ var ProjectShowCase = ({
|
|
|
1994
2088
|
const lineRef = (0, import_react9.useRef)(null);
|
|
1995
2089
|
const cardsRef = (0, import_react9.useRef)([]);
|
|
1996
2090
|
const nodesRef = (0, import_react9.useRef)([]);
|
|
1997
|
-
const
|
|
2091
|
+
const inRouter = (0, import_react_router_dom8.useInRouterContext)();
|
|
2092
|
+
const navigate = inRouter ? (0, import_react_router_dom8.useNavigate)() : null;
|
|
2093
|
+
const handleNavigate = (path) => {
|
|
2094
|
+
if (navigate) {
|
|
2095
|
+
navigate(path);
|
|
2096
|
+
} else {
|
|
2097
|
+
window.location.assign(path);
|
|
2098
|
+
}
|
|
2099
|
+
};
|
|
1998
2100
|
(0, import_react9.useEffect)(() => {
|
|
1999
2101
|
const ctx = import_gsap9.gsap.context(() => {
|
|
2000
2102
|
const tl = import_gsap9.gsap.timeline({ defaults: { ease: easing, duration: animationDuration } });
|
|
@@ -2161,7 +2263,7 @@ var ProjectShowCase = ({
|
|
|
2161
2263
|
style: styles.card,
|
|
2162
2264
|
onMouseEnter: (e) => import_gsap9.gsap.to(e.currentTarget, { y: -10, boxShadow: "0 30px 60px rgba(0,0,0,0.5)" }),
|
|
2163
2265
|
onMouseLeave: (e) => import_gsap9.gsap.to(e.currentTarget, { y: 0, boxShadow: "none" }),
|
|
2164
|
-
onClick: () =>
|
|
2266
|
+
onClick: () => project.link && handleNavigate(project.link)
|
|
2165
2267
|
},
|
|
2166
2268
|
/* @__PURE__ */ import_react9.default.createElement("span", { style: styles.year }, project.year),
|
|
2167
2269
|
/* @__PURE__ */ import_react9.default.createElement("h3", { style: styles.title }, project.title),
|
|
@@ -2411,7 +2513,15 @@ var PinterestGrid = ({
|
|
|
2411
2513
|
}) => {
|
|
2412
2514
|
const containerRef = (0, import_react11.useRef)(null);
|
|
2413
2515
|
const itemsRef = (0, import_react11.useRef)([]);
|
|
2414
|
-
const
|
|
2516
|
+
const inRouter = (0, import_react_router_dom9.useInRouterContext)();
|
|
2517
|
+
const navigate = inRouter ? (0, import_react_router_dom9.useNavigate)() : null;
|
|
2518
|
+
const handleNavigate = (path) => {
|
|
2519
|
+
if (navigate) {
|
|
2520
|
+
navigate(path);
|
|
2521
|
+
} else {
|
|
2522
|
+
window.location.assign(path);
|
|
2523
|
+
}
|
|
2524
|
+
};
|
|
2415
2525
|
(0, import_react11.useEffect)(() => {
|
|
2416
2526
|
const ctx = import_gsap11.gsap.context(() => {
|
|
2417
2527
|
import_gsap11.gsap.fromTo(
|
|
@@ -2556,7 +2666,7 @@ var PinterestGrid = ({
|
|
|
2556
2666
|
import_gsap11.gsap.to(e.currentTarget.firstChild, { scale: 1, duration: 0.8 });
|
|
2557
2667
|
e.currentTarget.querySelector(".overlay").style.opacity = 0;
|
|
2558
2668
|
},
|
|
2559
|
-
onClick: () => item.path &&
|
|
2669
|
+
onClick: () => item.path && handleNavigate(item.path)
|
|
2560
2670
|
},
|
|
2561
2671
|
/* @__PURE__ */ import_react11.default.createElement(
|
|
2562
2672
|
"img",
|
package/dist/index.mjs
CHANGED
|
@@ -173,7 +173,7 @@ var Button = ({
|
|
|
173
173
|
|
|
174
174
|
// src/components/Navbar/Navbar.jsx
|
|
175
175
|
import React2, { useRef as useRef2, useEffect as useEffect2, useState } from "react";
|
|
176
|
-
import { Link, NavLink } from "react-router-dom";
|
|
176
|
+
import { Link, NavLink, useInRouterContext, useNavigate as useNavigate2 } from "react-router-dom";
|
|
177
177
|
import { gsap as gsap2 } from "gsap";
|
|
178
178
|
import { FiMenu, FiX, FiArrowRight, FiArrowUpRight } from "react-icons/fi";
|
|
179
179
|
var Navbar = ({
|
|
@@ -199,6 +199,15 @@ var Navbar = ({
|
|
|
199
199
|
const linksRef = useRef2([]);
|
|
200
200
|
const buttonRef = useRef2(null);
|
|
201
201
|
const menuOverlayRef = useRef2(null);
|
|
202
|
+
const inRouter = useInRouterContext();
|
|
203
|
+
const navigate = inRouter ? useNavigate2() : null;
|
|
204
|
+
const handleNavigate = (path) => {
|
|
205
|
+
if (navigate) {
|
|
206
|
+
navigate(path);
|
|
207
|
+
} else {
|
|
208
|
+
window.location.assign(path);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
202
211
|
useEffect2(() => {
|
|
203
212
|
const handleResize = () => {
|
|
204
213
|
const mobile = window.innerWidth <= 1024;
|
|
@@ -377,23 +386,36 @@ var Navbar = ({
|
|
|
377
386
|
onMouseEnter: (e) => gsap2.to(e.currentTarget, { scale: 1.02 }),
|
|
378
387
|
onMouseLeave: (e) => gsap2.to(e.currentTarget, { scale: 1 })
|
|
379
388
|
},
|
|
380
|
-
/* @__PURE__ */ React2.createElement(Link, { to: "/", style: { ...styles.logo, color: "inherit" } }, /* @__PURE__ */ React2.createElement("div", { style: styles.logoDot }), logoText)
|
|
381
|
-
), /* @__PURE__ */ React2.createElement("div", { style: styles.navLinks }, links.map((link, i) =>
|
|
382
|
-
|
|
383
|
-
{
|
|
384
|
-
key: link.path,
|
|
385
|
-
to: link.path,
|
|
389
|
+
inRouter ? /* @__PURE__ */ React2.createElement(Link, { to: "/", style: { ...styles.logo, color: "inherit" } }, /* @__PURE__ */ React2.createElement("div", { style: styles.logoDot }), logoText) : /* @__PURE__ */ React2.createElement("a", { href: "/", style: { ...styles.logo, color: "inherit" } }, /* @__PURE__ */ React2.createElement("div", { style: styles.logoDot }), logoText)
|
|
390
|
+
), /* @__PURE__ */ React2.createElement("div", { style: styles.navLinks }, links.map((link, i) => {
|
|
391
|
+
const linkProps = {
|
|
386
392
|
ref: (el) => linksRef.current[i] = el,
|
|
387
393
|
onMouseEnter: handleMouseEnter,
|
|
388
394
|
onMouseMove: handleMouseMove,
|
|
389
395
|
onMouseLeave: handleMouseLeave,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
396
|
+
key: link.path
|
|
397
|
+
};
|
|
398
|
+
return inRouter ? /* @__PURE__ */ React2.createElement(
|
|
399
|
+
NavLink,
|
|
400
|
+
{
|
|
401
|
+
to: link.path,
|
|
402
|
+
...linkProps,
|
|
403
|
+
style: ({ isActive }) => ({
|
|
404
|
+
...styles.link,
|
|
405
|
+
color: isActive ? accentColor : textColor
|
|
406
|
+
})
|
|
407
|
+
},
|
|
408
|
+
link.label
|
|
409
|
+
) : /* @__PURE__ */ React2.createElement(
|
|
410
|
+
"a",
|
|
411
|
+
{
|
|
412
|
+
href: link.path,
|
|
413
|
+
...linkProps,
|
|
414
|
+
style: styles.link
|
|
415
|
+
},
|
|
416
|
+
link.label
|
|
417
|
+
);
|
|
418
|
+
})), /* @__PURE__ */ React2.createElement("div", { style: styles.actions }, !isMobile && /* @__PURE__ */ React2.createElement(
|
|
397
419
|
"button",
|
|
398
420
|
{
|
|
399
421
|
ref: buttonRef,
|
|
@@ -404,7 +426,7 @@ var Navbar = ({
|
|
|
404
426
|
},
|
|
405
427
|
"Start Building",
|
|
406
428
|
/* @__PURE__ */ React2.createElement(FiArrowUpRight, { size: 18 })
|
|
407
|
-
), /* @__PURE__ */ React2.createElement("div", { style: styles.menuToggle, onClick: () => setIsMenuOpen(!isMenuOpen) }, isMenuOpen ? /* @__PURE__ */ React2.createElement(FiX, null) : /* @__PURE__ */ React2.createElement(FiMenu, null)))), isMobile && isMenuOpen && /* @__PURE__ */ React2.createElement("div", { ref: menuOverlayRef, style: styles.mobileOverlay }, links.map((link, i) => /* @__PURE__ */ React2.createElement(
|
|
429
|
+
), /* @__PURE__ */ React2.createElement("div", { style: styles.menuToggle, onClick: () => setIsMenuOpen(!isMenuOpen) }, isMenuOpen ? /* @__PURE__ */ React2.createElement(FiX, null) : /* @__PURE__ */ React2.createElement(FiMenu, null)))), isMobile && isMenuOpen && /* @__PURE__ */ React2.createElement("div", { ref: menuOverlayRef, style: styles.mobileOverlay }, links.map((link, i) => inRouter ? /* @__PURE__ */ React2.createElement(
|
|
408
430
|
Link,
|
|
409
431
|
{
|
|
410
432
|
key: link.path,
|
|
@@ -419,6 +441,21 @@ var Navbar = ({
|
|
|
419
441
|
}
|
|
420
442
|
},
|
|
421
443
|
link.label
|
|
444
|
+
) : /* @__PURE__ */ React2.createElement(
|
|
445
|
+
"a",
|
|
446
|
+
{
|
|
447
|
+
key: link.path,
|
|
448
|
+
href: link.path,
|
|
449
|
+
onClick: () => setIsMenuOpen(false),
|
|
450
|
+
style: {
|
|
451
|
+
fontSize: "32px",
|
|
452
|
+
fontWeight: "800",
|
|
453
|
+
color: textColor,
|
|
454
|
+
textDecoration: "none",
|
|
455
|
+
letterSpacing: "-1px"
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
link.label
|
|
422
459
|
)), /* @__PURE__ */ React2.createElement(
|
|
423
460
|
"button",
|
|
424
461
|
{
|
|
@@ -432,7 +469,7 @@ var Navbar = ({
|
|
|
432
469
|
|
|
433
470
|
// src/components/Spotlight/Spotlight.jsx
|
|
434
471
|
import React3, { useRef as useRef3, useEffect as useEffect3, useState as useState2 } from "react";
|
|
435
|
-
import { useNavigate as
|
|
472
|
+
import { useNavigate as useNavigate3, useInRouterContext as useInRouterContext2 } from "react-router-dom";
|
|
436
473
|
import { gsap as gsap3 } from "gsap";
|
|
437
474
|
import { FiArrowUpRight as FiArrowUpRight2, FiZap, FiTarget, FiStar } from "react-icons/fi";
|
|
438
475
|
var Spotlight = ({
|
|
@@ -455,7 +492,15 @@ var Spotlight = ({
|
|
|
455
492
|
const descriptionRef = useRef3(null);
|
|
456
493
|
const ctaRef = useRef3(null);
|
|
457
494
|
const iconsRef = useRef3([]);
|
|
458
|
-
const
|
|
495
|
+
const inRouter = useInRouterContext2();
|
|
496
|
+
const navigate = inRouter ? useNavigate3() : null;
|
|
497
|
+
const handleNavigate = (path) => {
|
|
498
|
+
if (navigate) {
|
|
499
|
+
navigate(path);
|
|
500
|
+
} else {
|
|
501
|
+
window.location.assign(path);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
459
504
|
useEffect3(() => {
|
|
460
505
|
const container = containerRef.current;
|
|
461
506
|
const spotlight = spotlightRef.current;
|
|
@@ -634,7 +679,7 @@ var Spotlight = ({
|
|
|
634
679
|
style: { display: "inline-block" },
|
|
635
680
|
onMouseEnter: handleMouseEnter,
|
|
636
681
|
onMouseLeave: handleMouseLeave,
|
|
637
|
-
onClick: () =>
|
|
682
|
+
onClick: () => ctaLink && handleNavigate(ctaLink)
|
|
638
683
|
},
|
|
639
684
|
/* @__PURE__ */ React3.createElement("button", { style: styles.cta }, ctaText, /* @__PURE__ */ React3.createElement(FiArrowUpRight2, { size: 22 }))
|
|
640
685
|
)));
|
|
@@ -642,7 +687,7 @@ var Spotlight = ({
|
|
|
642
687
|
|
|
643
688
|
// src/components/Carousel/Carousel.jsx
|
|
644
689
|
import React4, { useRef as useRef4, useEffect as useEffect4, useState as useState3, useCallback } from "react";
|
|
645
|
-
import { useNavigate as
|
|
690
|
+
import { useNavigate as useNavigate4, useInRouterContext as useInRouterContext3 } from "react-router-dom";
|
|
646
691
|
import { gsap as gsap4 } from "gsap";
|
|
647
692
|
import { FiChevronLeft, FiChevronRight, FiArrowRight as FiArrowRight2 } from "react-icons/fi";
|
|
648
693
|
var Carousel = ({
|
|
@@ -685,7 +730,15 @@ var Carousel = ({
|
|
|
685
730
|
const navRef = useRef4(null);
|
|
686
731
|
const progressRef = useRef4(null);
|
|
687
732
|
const timerRef = useRef4(null);
|
|
688
|
-
const
|
|
733
|
+
const inRouter = useInRouterContext3();
|
|
734
|
+
const navigate = inRouter ? useNavigate4() : null;
|
|
735
|
+
const handleNavigate = (path) => {
|
|
736
|
+
if (navigate) {
|
|
737
|
+
navigate(path);
|
|
738
|
+
} else {
|
|
739
|
+
window.location.assign(path);
|
|
740
|
+
}
|
|
741
|
+
};
|
|
689
742
|
const isAnimating = useRef4(false);
|
|
690
743
|
const moveSlide = useCallback((nextIndex, direction = 1) => {
|
|
691
744
|
if (isAnimating.current || nextIndex === index) return;
|
|
@@ -963,7 +1016,7 @@ var Carousel = ({
|
|
|
963
1016
|
style: styles.cta,
|
|
964
1017
|
onMouseEnter: (e) => e.currentTarget.style.filter = "brightness(1.1)",
|
|
965
1018
|
onMouseLeave: (e) => e.currentTarget.style.filter = "brightness(1)",
|
|
966
|
-
onClick: () => slide.path &&
|
|
1019
|
+
onClick: () => slide.path && handleNavigate(slide.path)
|
|
967
1020
|
},
|
|
968
1021
|
slide.cta,
|
|
969
1022
|
/* @__PURE__ */ React4.createElement(FiArrowRight2, { size: 20 })
|
|
@@ -1007,7 +1060,7 @@ var Carousel = ({
|
|
|
1007
1060
|
|
|
1008
1061
|
// src/components/ProductCard/ProductCard.jsx
|
|
1009
1062
|
import React5, { useRef as useRef5, useEffect as useEffect5, useState as useState4 } from "react";
|
|
1010
|
-
import { useNavigate as
|
|
1063
|
+
import { useNavigate as useNavigate5, useInRouterContext as useInRouterContext4 } from "react-router-dom";
|
|
1011
1064
|
import { gsap as gsap5 } from "gsap";
|
|
1012
1065
|
import { FiShoppingCart, FiEye, FiHeart, FiArrowRight as FiArrowRight3 } from "react-icons/fi";
|
|
1013
1066
|
var ProductCard = ({
|
|
@@ -1034,7 +1087,15 @@ var ProductCard = ({
|
|
|
1034
1087
|
const infoRef = useRef5(null);
|
|
1035
1088
|
const actionsRef = useRef5(null);
|
|
1036
1089
|
const buttonRefs = useRef5([]);
|
|
1037
|
-
const
|
|
1090
|
+
const inRouter = useInRouterContext4();
|
|
1091
|
+
const navigate = inRouter ? useNavigate5() : null;
|
|
1092
|
+
const handleNavigate = (path) => {
|
|
1093
|
+
if (navigate) {
|
|
1094
|
+
navigate(path);
|
|
1095
|
+
} else {
|
|
1096
|
+
window.location.assign(path);
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1038
1099
|
useEffect5(() => {
|
|
1039
1100
|
const ctx = gsap5.context(() => {
|
|
1040
1101
|
const tl = gsap5.timeline({ defaults: { ease: easing, duration: animationDuration } });
|
|
@@ -1224,7 +1285,7 @@ var ProductCard = ({
|
|
|
1224
1285
|
style: styles.card,
|
|
1225
1286
|
onMouseEnter: handleMouseEnter,
|
|
1226
1287
|
onMouseLeave: handleMouseLeave,
|
|
1227
|
-
onClick: () => product.path &&
|
|
1288
|
+
onClick: () => product.path && handleNavigate(product.path)
|
|
1228
1289
|
},
|
|
1229
1290
|
/* @__PURE__ */ React5.createElement("div", { style: styles.imageContainer }, /* @__PURE__ */ React5.createElement(
|
|
1230
1291
|
"img",
|
|
@@ -1286,7 +1347,7 @@ var ProductCard = ({
|
|
|
1286
1347
|
|
|
1287
1348
|
// src/components/Image/Image.jsx
|
|
1288
1349
|
import React6, { useRef as useRef6, useEffect as useEffect6, useState as useState5 } from "react";
|
|
1289
|
-
import { useNavigate as
|
|
1350
|
+
import { useNavigate as useNavigate6, useInRouterContext as useInRouterContext5 } from "react-router-dom";
|
|
1290
1351
|
import { gsap as gsap6 } from "gsap";
|
|
1291
1352
|
import { FiMaximize, FiLink, FiInfo, FiDownload } from "react-icons/fi";
|
|
1292
1353
|
var Image = ({
|
|
@@ -1310,7 +1371,15 @@ var Image = ({
|
|
|
1310
1371
|
const overlayRef = useRef6(null);
|
|
1311
1372
|
const revealRef = useRef6(null);
|
|
1312
1373
|
const textRef = useRef6(null);
|
|
1313
|
-
const
|
|
1374
|
+
const inRouter = useInRouterContext5();
|
|
1375
|
+
const navigate = inRouter ? useNavigate6() : null;
|
|
1376
|
+
const handleNavigate = (path) => {
|
|
1377
|
+
if (navigate) {
|
|
1378
|
+
navigate(path);
|
|
1379
|
+
} else {
|
|
1380
|
+
window.location.assign(path);
|
|
1381
|
+
}
|
|
1382
|
+
};
|
|
1314
1383
|
const [isLoaded, setIsLoaded] = useState5(false);
|
|
1315
1384
|
useEffect6(() => {
|
|
1316
1385
|
if (!reveal) return;
|
|
@@ -1456,7 +1525,7 @@ var Image = ({
|
|
|
1456
1525
|
style: styles.container,
|
|
1457
1526
|
onMouseMove: handleMouseMove,
|
|
1458
1527
|
onMouseLeave: handleMouseLeave,
|
|
1459
|
-
onClick: () => to &&
|
|
1528
|
+
onClick: () => to && handleNavigate(to)
|
|
1460
1529
|
},
|
|
1461
1530
|
reveal && /* @__PURE__ */ React6.createElement("div", { ref: revealRef, style: styles.reveal }),
|
|
1462
1531
|
/* @__PURE__ */ React6.createElement(
|
|
@@ -1519,6 +1588,7 @@ var TextWriting = ({
|
|
|
1519
1588
|
showCursor = true,
|
|
1520
1589
|
scramble = true,
|
|
1521
1590
|
loop = true,
|
|
1591
|
+
autoStart = true,
|
|
1522
1592
|
onComplete
|
|
1523
1593
|
}) => {
|
|
1524
1594
|
const [currentTextIndex, setCurrentTextIndex] = useState6(0);
|
|
@@ -1529,15 +1599,17 @@ var TextWriting = ({
|
|
|
1529
1599
|
const timelineRef = useRef7(null);
|
|
1530
1600
|
const characters = useMemo(() => "!@#$%^&*()_+{}|:<>?abcdefghijklmnopqrstuvwxyz0123456789", []);
|
|
1531
1601
|
const getRandomChar = () => characters[Math.floor(Math.random() * characters.length)];
|
|
1532
|
-
|
|
1602
|
+
useEffect7(() => {
|
|
1603
|
+
if (!autoStart) return;
|
|
1604
|
+
const targetText = texts[currentTextIndex];
|
|
1605
|
+
if (!targetText) return;
|
|
1533
1606
|
if (timelineRef.current) timelineRef.current.kill();
|
|
1534
1607
|
const ctx = gsap7.context(() => {
|
|
1535
1608
|
const tl = gsap7.timeline({
|
|
1536
1609
|
onComplete: () => {
|
|
1537
1610
|
if (loop) {
|
|
1538
1611
|
gsap7.delayedCall(delay, () => {
|
|
1539
|
-
|
|
1540
|
-
setCurrentTextIndex(nextIndex);
|
|
1612
|
+
setCurrentTextIndex((prev) => (prev + 1) % texts.length);
|
|
1541
1613
|
});
|
|
1542
1614
|
}
|
|
1543
1615
|
if (onComplete) onComplete();
|
|
@@ -1545,7 +1617,6 @@ var TextWriting = ({
|
|
|
1545
1617
|
});
|
|
1546
1618
|
timelineRef.current = tl;
|
|
1547
1619
|
const textArray = targetText.split("");
|
|
1548
|
-
let frame = 0;
|
|
1549
1620
|
tl.to({}, {
|
|
1550
1621
|
duration: textArray.length * speed,
|
|
1551
1622
|
onUpdate: function() {
|
|
@@ -1556,7 +1627,7 @@ var TextWriting = ({
|
|
|
1556
1627
|
if (i < charCount) {
|
|
1557
1628
|
display += textArray[i];
|
|
1558
1629
|
} else if (i === charCount && scramble) {
|
|
1559
|
-
display +=
|
|
1630
|
+
display += characters[Math.floor(Math.random() * characters.length)];
|
|
1560
1631
|
} else {
|
|
1561
1632
|
display += "";
|
|
1562
1633
|
}
|
|
@@ -1566,20 +1637,16 @@ var TextWriting = ({
|
|
|
1566
1637
|
});
|
|
1567
1638
|
tl.fromTo(
|
|
1568
1639
|
containerRef.current,
|
|
1569
|
-
{ scale: 0.98, opacity: 0
|
|
1570
|
-
{ scale: 1, opacity: 1, duration: 0.
|
|
1640
|
+
{ scale: 0.98, opacity: 0 },
|
|
1641
|
+
{ scale: 1, opacity: 1, duration: 0.6, ease: "power2.out" },
|
|
1571
1642
|
0
|
|
1572
1643
|
);
|
|
1573
1644
|
}, containerRef);
|
|
1574
|
-
return ctx;
|
|
1575
|
-
};
|
|
1576
|
-
useEffect7(() => {
|
|
1577
|
-
const ctx = animateText(texts[currentTextIndex]);
|
|
1578
1645
|
return () => {
|
|
1579
1646
|
ctx.revert();
|
|
1580
1647
|
if (timelineRef.current) timelineRef.current.kill();
|
|
1581
1648
|
};
|
|
1582
|
-
}, [currentTextIndex]);
|
|
1649
|
+
}, [currentTextIndex, texts, loop, delay, speed, scramble, autoStart]);
|
|
1583
1650
|
useEffect7(() => {
|
|
1584
1651
|
if (!showCursor) return;
|
|
1585
1652
|
const ctx = gsap7.context(() => {
|
|
@@ -1656,10 +1723,15 @@ var TextWriting = ({
|
|
|
1656
1723
|
"div",
|
|
1657
1724
|
{
|
|
1658
1725
|
ref: containerRef,
|
|
1659
|
-
style: styles.container,
|
|
1726
|
+
style: { ...styles.container, opacity: 1 },
|
|
1660
1727
|
onMouseEnter: handleMouseEnter,
|
|
1661
1728
|
onMouseLeave: handleMouseLeave,
|
|
1662
|
-
onClick: () =>
|
|
1729
|
+
onClick: () => {
|
|
1730
|
+
var _a;
|
|
1731
|
+
if (!((_a = timelineRef.current) == null ? void 0 : _a.isActive())) {
|
|
1732
|
+
setCurrentTextIndex((prev) => (prev + 1) % texts.length);
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1663
1735
|
},
|
|
1664
1736
|
/* @__PURE__ */ React7.createElement("div", { style: styles.iconWrap }, /* @__PURE__ */ React7.createElement(FiTerminal, { size: 20 })),
|
|
1665
1737
|
/* @__PURE__ */ React7.createElement("div", { ref: textRef, style: styles.text }, currentText, /* @__PURE__ */ React7.createElement("span", { ref: cursorRef, style: styles.cursor })),
|
|
@@ -1669,7 +1741,7 @@ var TextWriting = ({
|
|
|
1669
1741
|
|
|
1670
1742
|
// src/components/SideBar/SideBar.jsx
|
|
1671
1743
|
import React8, { useRef as useRef8, useEffect as useEffect8, useState as useState7 } from "react";
|
|
1672
|
-
import { NavLink as NavLink2, useNavigate as
|
|
1744
|
+
import { NavLink as NavLink2, useNavigate as useNavigate7, useInRouterContext as useInRouterContext6 } from "react-router-dom";
|
|
1673
1745
|
import { gsap as gsap8 } from "gsap";
|
|
1674
1746
|
import {
|
|
1675
1747
|
FiHome,
|
|
@@ -1702,7 +1774,15 @@ var SideBar = ({
|
|
|
1702
1774
|
const sidebarRef = useRef8(null);
|
|
1703
1775
|
const itemsRef = useRef8([]);
|
|
1704
1776
|
const indicatorRef = useRef8(null);
|
|
1705
|
-
const
|
|
1777
|
+
const inRouter = useInRouterContext6();
|
|
1778
|
+
const navigate = inRouter ? useNavigate7() : null;
|
|
1779
|
+
const handleNavigate = (path) => {
|
|
1780
|
+
if (navigate) {
|
|
1781
|
+
navigate(path);
|
|
1782
|
+
} else {
|
|
1783
|
+
window.location.assign(path);
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1706
1786
|
useEffect8(() => {
|
|
1707
1787
|
const ctx = gsap8.context(() => {
|
|
1708
1788
|
const tl = gsap8.timeline({ defaults: { ease: easing, duration: animationDuration } });
|
|
@@ -1877,22 +1957,36 @@ var SideBar = ({
|
|
|
1877
1957
|
onMouseLeave: () => setIsExpanded(false)
|
|
1878
1958
|
},
|
|
1879
1959
|
/* @__PURE__ */ React8.createElement("div", { style: styles.logoContainer }, /* @__PURE__ */ React8.createElement("div", { style: styles.logo }, /* @__PURE__ */ React8.createElement(FiLayers, { size: 22 })), /* @__PURE__ */ React8.createElement("span", { style: styles.logoText }, "Aura UI")),
|
|
1880
|
-
/* @__PURE__ */ React8.createElement("nav", { style: styles.nav }, /* @__PURE__ */ React8.createElement("div", { ref: indicatorRef, style: styles.indicator }), items.map((item, index) =>
|
|
1881
|
-
|
|
1882
|
-
{
|
|
1883
|
-
key: item.path,
|
|
1884
|
-
to: item.path,
|
|
1960
|
+
/* @__PURE__ */ React8.createElement("nav", { style: styles.nav }, /* @__PURE__ */ React8.createElement("div", { ref: indicatorRef, style: styles.indicator }), items.map((item, index) => {
|
|
1961
|
+
const itemProps = {
|
|
1885
1962
|
ref: (el) => itemsRef.current[index] = el,
|
|
1886
|
-
style: ({ isActive }) => ({
|
|
1887
|
-
...styles.item,
|
|
1888
|
-
...isActive ? styles.activeItem : {}
|
|
1889
|
-
}),
|
|
1890
1963
|
onMouseEnter: (e) => handleItemHover(e, index),
|
|
1891
|
-
onMouseLeave: () => handleItemLeave(index)
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
/* @__PURE__ */ React8.createElement(
|
|
1895
|
-
|
|
1964
|
+
onMouseLeave: () => handleItemLeave(index),
|
|
1965
|
+
key: item.path
|
|
1966
|
+
};
|
|
1967
|
+
return inRouter ? /* @__PURE__ */ React8.createElement(
|
|
1968
|
+
NavLink2,
|
|
1969
|
+
{
|
|
1970
|
+
to: item.path,
|
|
1971
|
+
...itemProps,
|
|
1972
|
+
style: ({ isActive }) => ({
|
|
1973
|
+
...styles.item,
|
|
1974
|
+
...isActive ? styles.activeItem : {}
|
|
1975
|
+
})
|
|
1976
|
+
},
|
|
1977
|
+
/* @__PURE__ */ React8.createElement("div", { style: styles.icon }, renderIcon(item.icon)),
|
|
1978
|
+
/* @__PURE__ */ React8.createElement("span", { style: styles.label }, item.label)
|
|
1979
|
+
) : /* @__PURE__ */ React8.createElement(
|
|
1980
|
+
"a",
|
|
1981
|
+
{
|
|
1982
|
+
href: item.path,
|
|
1983
|
+
...itemProps,
|
|
1984
|
+
style: styles.item
|
|
1985
|
+
},
|
|
1986
|
+
/* @__PURE__ */ React8.createElement("div", { style: styles.icon }, renderIcon(item.icon)),
|
|
1987
|
+
/* @__PURE__ */ React8.createElement("span", { style: styles.label }, item.label)
|
|
1988
|
+
);
|
|
1989
|
+
})),
|
|
1896
1990
|
/* @__PURE__ */ React8.createElement("div", { style: styles.footer }, /* @__PURE__ */ React8.createElement(
|
|
1897
1991
|
"button",
|
|
1898
1992
|
{
|
|
@@ -1914,7 +2008,7 @@ var SideBar = ({
|
|
|
1914
2008
|
|
|
1915
2009
|
// src/components/ProjectShowCase/ProjectShowCase.jsx
|
|
1916
2010
|
import React9, { useRef as useRef9, useEffect as useEffect9 } from "react";
|
|
1917
|
-
import { useNavigate as
|
|
2011
|
+
import { useNavigate as useNavigate8, useInRouterContext as useInRouterContext7 } from "react-router-dom";
|
|
1918
2012
|
import { gsap as gsap9 } from "gsap";
|
|
1919
2013
|
import {
|
|
1920
2014
|
FiExternalLink,
|
|
@@ -1965,7 +2059,15 @@ var ProjectShowCase = ({
|
|
|
1965
2059
|
const lineRef = useRef9(null);
|
|
1966
2060
|
const cardsRef = useRef9([]);
|
|
1967
2061
|
const nodesRef = useRef9([]);
|
|
1968
|
-
const
|
|
2062
|
+
const inRouter = useInRouterContext7();
|
|
2063
|
+
const navigate = inRouter ? useNavigate8() : null;
|
|
2064
|
+
const handleNavigate = (path) => {
|
|
2065
|
+
if (navigate) {
|
|
2066
|
+
navigate(path);
|
|
2067
|
+
} else {
|
|
2068
|
+
window.location.assign(path);
|
|
2069
|
+
}
|
|
2070
|
+
};
|
|
1969
2071
|
useEffect9(() => {
|
|
1970
2072
|
const ctx = gsap9.context(() => {
|
|
1971
2073
|
const tl = gsap9.timeline({ defaults: { ease: easing, duration: animationDuration } });
|
|
@@ -2132,7 +2234,7 @@ var ProjectShowCase = ({
|
|
|
2132
2234
|
style: styles.card,
|
|
2133
2235
|
onMouseEnter: (e) => gsap9.to(e.currentTarget, { y: -10, boxShadow: "0 30px 60px rgba(0,0,0,0.5)" }),
|
|
2134
2236
|
onMouseLeave: (e) => gsap9.to(e.currentTarget, { y: 0, boxShadow: "none" }),
|
|
2135
|
-
onClick: () =>
|
|
2237
|
+
onClick: () => project.link && handleNavigate(project.link)
|
|
2136
2238
|
},
|
|
2137
2239
|
/* @__PURE__ */ React9.createElement("span", { style: styles.year }, project.year),
|
|
2138
2240
|
/* @__PURE__ */ React9.createElement("h3", { style: styles.title }, project.title),
|
|
@@ -2369,7 +2471,7 @@ var Skills = ({
|
|
|
2369
2471
|
|
|
2370
2472
|
// src/components/PinterestGrid/PinterestGrid.jsx
|
|
2371
2473
|
import React11, { useRef as useRef11, useEffect as useEffect11, useState as useState8 } from "react";
|
|
2372
|
-
import { useNavigate as
|
|
2474
|
+
import { useNavigate as useNavigate9, useInRouterContext as useInRouterContext8 } from "react-router-dom";
|
|
2373
2475
|
import { gsap as gsap11 } from "gsap";
|
|
2374
2476
|
import { FiHeart as FiHeart2, FiShare2, FiMaximize2, FiPlus } from "react-icons/fi";
|
|
2375
2477
|
var PinterestGrid = ({
|
|
@@ -2391,7 +2493,15 @@ var PinterestGrid = ({
|
|
|
2391
2493
|
}) => {
|
|
2392
2494
|
const containerRef = useRef11(null);
|
|
2393
2495
|
const itemsRef = useRef11([]);
|
|
2394
|
-
const
|
|
2496
|
+
const inRouter = useInRouterContext8();
|
|
2497
|
+
const navigate = inRouter ? useNavigate9() : null;
|
|
2498
|
+
const handleNavigate = (path) => {
|
|
2499
|
+
if (navigate) {
|
|
2500
|
+
navigate(path);
|
|
2501
|
+
} else {
|
|
2502
|
+
window.location.assign(path);
|
|
2503
|
+
}
|
|
2504
|
+
};
|
|
2395
2505
|
useEffect11(() => {
|
|
2396
2506
|
const ctx = gsap11.context(() => {
|
|
2397
2507
|
gsap11.fromTo(
|
|
@@ -2536,7 +2646,7 @@ var PinterestGrid = ({
|
|
|
2536
2646
|
gsap11.to(e.currentTarget.firstChild, { scale: 1, duration: 0.8 });
|
|
2537
2647
|
e.currentTarget.querySelector(".overlay").style.opacity = 0;
|
|
2538
2648
|
},
|
|
2539
|
-
onClick: () => item.path &&
|
|
2649
|
+
onClick: () => item.path && handleNavigate(item.path)
|
|
2540
2650
|
},
|
|
2541
2651
|
/* @__PURE__ */ React11.createElement(
|
|
2542
2652
|
"img",
|