aura-ui-library 1.0.4 → 1.0.6

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 CHANGED
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/index.js
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
+ Carousel: () => Carousel,
32
33
  MagneticButton: () => MagneticButton,
33
34
  Navbar: () => Navbar,
34
35
  SpotlightCard: () => SpotlightCard
@@ -3697,8 +3698,650 @@ var SpotlightCard = ({
3697
3698
  )
3698
3699
  );
3699
3700
  };
3701
+
3702
+ // src/components/Carousel/Carousel.jsx
3703
+ var import_react4 = __toESM(require("react"));
3704
+ var import_gsap = require("gsap");
3705
+ var defaults = {
3706
+ radius: 340,
3707
+ cardWidth: 280,
3708
+ cardHeight: 380,
3709
+ autoPlayInterval: 4200,
3710
+ perspective: 1100
3711
+ };
3712
+ var Carousel = ({
3713
+ slides = [],
3714
+ radius = defaults.radius,
3715
+ cardWidth = defaults.cardWidth,
3716
+ cardHeight = defaults.cardHeight,
3717
+ autoPlayInterval = defaults.autoPlayInterval,
3718
+ perspective = defaults.perspective,
3719
+ showGlare = true,
3720
+ showParticles = true,
3721
+ showScanlines = true,
3722
+ showVignette = true,
3723
+ showKenBurns = true,
3724
+ showAutoPlay = true,
3725
+ showSettingsPanel = true,
3726
+ showDots = true,
3727
+ showCounter = true,
3728
+ showCursor = true
3729
+ }) => {
3730
+ const stageRef = (0, import_react4.useRef)(null);
3731
+ const barrelRef = (0, import_react4.useRef)(null);
3732
+ const canvasRef = (0, import_react4.useRef)(null);
3733
+ const cardRefs = (0, import_react4.useRef)([]);
3734
+ const curRef = (0, import_react4.useRef)(null);
3735
+ const ringRef = (0, import_react4.useRef)(null);
3736
+ const [current, setCurrent] = (0, import_react4.useState)(0);
3737
+ const [settings, setSettings] = (0, import_react4.useState)({
3738
+ glare: showGlare,
3739
+ particles: showParticles,
3740
+ scan: showScanlines,
3741
+ auto: showAutoPlay,
3742
+ kb: showKenBurns
3743
+ });
3744
+ const N = slides.length;
3745
+ const currentRef = (0, import_react4.useRef)(0);
3746
+ const isAnimatingRef = (0, import_react4.useRef)(false);
3747
+ const settingsRef = (0, import_react4.useRef)(settings);
3748
+ const autoTimerRef = (0, import_react4.useRef)(null);
3749
+ const particlesRef = (0, import_react4.useRef)([]);
3750
+ const mouseRef = (0, import_react4.useRef)({ x: 0, y: 0 });
3751
+ const cursorPosRef = (0, import_react4.useRef)({ cx: 0, cy: 0, rx: 0, ry: 0 });
3752
+ const rafRef = (0, import_react4.useRef)(null);
3753
+ const wheelAccRef = (0, import_react4.useRef)(0);
3754
+ const wheelTimerRef = (0, import_react4.useRef)(null);
3755
+ const touchStartRef = (0, import_react4.useRef)(0);
3756
+ (0, import_react4.useEffect)(() => {
3757
+ settingsRef.current = settings;
3758
+ }, [settings]);
3759
+ (0, import_react4.useEffect)(() => {
3760
+ currentRef.current = current;
3761
+ }, [current]);
3762
+ const applyPositions = (0, import_react4.useCallback)(
3763
+ (instant = false) => {
3764
+ if (!cardRefs.current.length) return;
3765
+ const cur = currentRef.current;
3766
+ cardRefs.current.forEach((card, i) => {
3767
+ if (!card) return;
3768
+ const offset = i - cur;
3769
+ let angle = offset / N * 360;
3770
+ if (angle > 180) angle -= 360;
3771
+ if (angle < -180) angle += 360;
3772
+ const rad = angle * (Math.PI / 180);
3773
+ const x = Math.sin(rad) * radius;
3774
+ const z = Math.cos(rad) * radius - radius;
3775
+ const rotY = -angle;
3776
+ const isActive = i === cur;
3777
+ const absOff = Math.abs(angle);
3778
+ const fade = Math.max(0, 1 - absOff / 90) * 0.7 + 0.05;
3779
+ const sc = isActive ? 1 : Math.max(0.6, 1 - absOff / 280);
3780
+ const props = {
3781
+ x,
3782
+ y: 0,
3783
+ z,
3784
+ rotateY: rotY,
3785
+ scale: sc,
3786
+ opacity: isActive ? 1 : fade,
3787
+ zIndex: isActive ? 10 : Math.round((1 - absOff / 200) * 5),
3788
+ overwrite: true
3789
+ };
3790
+ if (instant) {
3791
+ import_gsap.gsap.set(card, props);
3792
+ } else {
3793
+ import_gsap.gsap.to(card, { ...props, duration: 0.85, ease: "power3.out" });
3794
+ }
3795
+ const info = card.querySelector(".bc-info");
3796
+ const line = card.querySelector(".bc-line");
3797
+ if (isActive) {
3798
+ import_gsap.gsap.to(info, {
3799
+ opacity: 1,
3800
+ y: 0,
3801
+ duration: 0.6,
3802
+ delay: 0.25,
3803
+ ease: "power2.out"
3804
+ });
3805
+ import_gsap.gsap.to(line, {
3806
+ scaleX: 1,
3807
+ duration: 0.9,
3808
+ delay: 0.35,
3809
+ ease: "power2.out"
3810
+ });
3811
+ if (settingsRef.current.kb) {
3812
+ const img = card.querySelector(".bc-img");
3813
+ if (img)
3814
+ import_gsap.gsap.fromTo(
3815
+ img,
3816
+ { scale: 1.08 },
3817
+ { scale: 1, duration: 7, ease: "none" }
3818
+ );
3819
+ }
3820
+ } else {
3821
+ import_gsap.gsap.to(info, { opacity: 0, y: 6, duration: 0.3, ease: "power2.in" });
3822
+ import_gsap.gsap.to(line, { scaleX: 0, duration: 0.25, ease: "power2.in" });
3823
+ }
3824
+ });
3825
+ },
3826
+ [N, radius]
3827
+ );
3828
+ const spawnParticles = (0, import_react4.useCallback)(() => {
3829
+ if (!settingsRef.current.particles) return;
3830
+ const { x, y } = mouseRef.current;
3831
+ for (let i = 0; i < 28; i++) {
3832
+ particlesRef.current.push({
3833
+ x,
3834
+ y,
3835
+ vx: (Math.random() - 0.5) * 4.5,
3836
+ vy: (Math.random() - 0.5) * 4.5,
3837
+ life: 1,
3838
+ decay: 0.022 + Math.random() * 0.018,
3839
+ r: Math.random() * 3 + 1
3840
+ });
3841
+ }
3842
+ }, []);
3843
+ const goTo = (0, import_react4.useCallback)(
3844
+ (idx) => {
3845
+ if (idx === currentRef.current || isAnimatingRef.current) return;
3846
+ isAnimatingRef.current = true;
3847
+ spawnParticles();
3848
+ currentRef.current = idx;
3849
+ setCurrent(idx);
3850
+ applyPositions(false);
3851
+ setTimeout(() => {
3852
+ isAnimatingRef.current = false;
3853
+ }, 900);
3854
+ },
3855
+ [applyPositions, spawnParticles]
3856
+ );
3857
+ const next = (0, import_react4.useCallback)(() => goTo((currentRef.current + 1) % N), [goTo, N]);
3858
+ const prev = (0, import_react4.useCallback)(
3859
+ () => goTo((currentRef.current - 1 + N) % N),
3860
+ [goTo, N]
3861
+ );
3862
+ const resetAuto = (0, import_react4.useCallback)(() => {
3863
+ clearInterval(autoTimerRef.current);
3864
+ if (settingsRef.current.auto) {
3865
+ autoTimerRef.current = setInterval(next, autoPlayInterval);
3866
+ }
3867
+ }, [next, autoPlayInterval]);
3868
+ (0, import_react4.useEffect)(() => {
3869
+ if (!barrelRef.current || !cardRefs.current.length) return;
3870
+ applyPositions(true);
3871
+ resetAuto();
3872
+ }, [applyPositions, resetAuto]);
3873
+ (0, import_react4.useEffect)(() => {
3874
+ const canvas = canvasRef.current;
3875
+ if (!canvas) return;
3876
+ const ctx = canvas.getContext("2d");
3877
+ const resize = () => {
3878
+ if (!stageRef.current) return;
3879
+ canvas.width = stageRef.current.offsetWidth;
3880
+ canvas.height = stageRef.current.offsetHeight;
3881
+ };
3882
+ resize();
3883
+ window.addEventListener("resize", resize);
3884
+ let frameId;
3885
+ const drawLoop = () => {
3886
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
3887
+ particlesRef.current = particlesRef.current.filter((p) => p.life > 0);
3888
+ particlesRef.current.forEach((p) => {
3889
+ p.x += p.vx;
3890
+ p.y += p.vy;
3891
+ p.vy += 0.06;
3892
+ p.life -= p.decay;
3893
+ ctx.beginPath();
3894
+ ctx.arc(p.x, p.y, p.r * p.life, 0, Math.PI * 2);
3895
+ ctx.fillStyle = `rgba(255,255,255,${p.life * 0.55})`;
3896
+ ctx.fill();
3897
+ });
3898
+ frameId = requestAnimationFrame(drawLoop);
3899
+ };
3900
+ drawLoop();
3901
+ return () => {
3902
+ window.removeEventListener("resize", resize);
3903
+ cancelAnimationFrame(frameId);
3904
+ };
3905
+ }, []);
3906
+ (0, import_react4.useEffect)(() => {
3907
+ const lerp2 = (a, b, t) => a + (b - a) * t;
3908
+ let frameId;
3909
+ const loop = () => {
3910
+ const { cx, cy, rx, ry } = cursorPosRef.current;
3911
+ const { x, y } = mouseRef.current;
3912
+ cursorPosRef.current.cx = lerp2(cx, x, 0.18);
3913
+ cursorPosRef.current.cy = lerp2(cy, y, 0.18);
3914
+ cursorPosRef.current.rx = lerp2(rx, x, 0.08);
3915
+ cursorPosRef.current.ry = lerp2(ry, y, 0.08);
3916
+ if (curRef.current) {
3917
+ curRef.current.style.left = x + "px";
3918
+ curRef.current.style.top = y + "px";
3919
+ }
3920
+ if (ringRef.current) {
3921
+ ringRef.current.style.left = cursorPosRef.current.rx + "px";
3922
+ ringRef.current.style.top = cursorPosRef.current.ry + "px";
3923
+ }
3924
+ const activeCard = cardRefs.current[currentRef.current];
3925
+ if (activeCard && settingsRef.current.glare && stageRef.current) {
3926
+ const r2 = activeCard.getBoundingClientRect();
3927
+ const pr = stageRef.current.getBoundingClientRect();
3928
+ const lx = x, ly = y;
3929
+ const cx2 = r2.left + r2.width / 2 - pr.left;
3930
+ const cy2 = r2.top + r2.height / 2 - pr.top;
3931
+ const dx = (lx - cx2) / cardWidth;
3932
+ const dy = (ly - cy2) / cardHeight;
3933
+ const glare = activeCard.querySelector(".bc-glare");
3934
+ if (glare) {
3935
+ glare.style.background = `radial-gradient(circle at ${50 + dx * 35}% ${50 + dy * 35}%, rgba(255,255,255,0.16), transparent 60%)`;
3936
+ }
3937
+ import_gsap.gsap.to(activeCard, {
3938
+ rotateX: -dy * 6,
3939
+ rotateY: dx * 6,
3940
+ duration: 0.4,
3941
+ ease: "power2.out",
3942
+ overwrite: "auto"
3943
+ });
3944
+ }
3945
+ frameId = requestAnimationFrame(loop);
3946
+ };
3947
+ loop();
3948
+ return () => cancelAnimationFrame(frameId);
3949
+ }, [cardWidth, cardHeight]);
3950
+ (0, import_react4.useEffect)(() => {
3951
+ const stage = stageRef.current;
3952
+ if (!stage) return;
3953
+ const onMove = (e) => {
3954
+ const r = stage.getBoundingClientRect();
3955
+ mouseRef.current = { x: e.clientX - r.left, y: e.clientY - r.top };
3956
+ };
3957
+ const onLeave = () => {
3958
+ const activeCard = cardRefs.current[currentRef.current];
3959
+ if (activeCard) {
3960
+ const glare = activeCard.querySelector(".bc-glare");
3961
+ if (glare) glare.style.opacity = 0;
3962
+ import_gsap.gsap.to(activeCard, {
3963
+ rotateX: 0,
3964
+ rotateY: 0,
3965
+ duration: 0.6,
3966
+ ease: "elastic.out(1,0.6)"
3967
+ });
3968
+ }
3969
+ };
3970
+ const onWheel = (e) => {
3971
+ e.preventDefault();
3972
+ wheelAccRef.current += e.deltaY;
3973
+ clearTimeout(wheelTimerRef.current);
3974
+ wheelTimerRef.current = setTimeout(() => {
3975
+ if (Math.abs(wheelAccRef.current) > 60) {
3976
+ wheelAccRef.current > 0 ? next() : prev();
3977
+ }
3978
+ wheelAccRef.current = 0;
3979
+ }, 80);
3980
+ };
3981
+ const onTouchStart = (e) => {
3982
+ touchStartRef.current = e.touches[0].pageX;
3983
+ };
3984
+ const onTouchEnd = (e) => {
3985
+ const dx = e.changedTouches[0].pageX - touchStartRef.current;
3986
+ if (dx < -40) next();
3987
+ else if (dx > 40) prev();
3988
+ };
3989
+ const onKey = (e) => {
3990
+ if (e.key === "ArrowRight") next();
3991
+ if (e.key === "ArrowLeft") prev();
3992
+ };
3993
+ stage.addEventListener("mousemove", onMove);
3994
+ stage.addEventListener("mouseleave", onLeave);
3995
+ stage.addEventListener("wheel", onWheel, { passive: false });
3996
+ stage.addEventListener("touchstart", onTouchStart, { passive: true });
3997
+ stage.addEventListener("touchend", onTouchEnd);
3998
+ window.addEventListener("keydown", onKey);
3999
+ return () => {
4000
+ stage.removeEventListener("mousemove", onMove);
4001
+ stage.removeEventListener("mouseleave", onLeave);
4002
+ stage.removeEventListener("wheel", onWheel);
4003
+ stage.removeEventListener("touchstart", onTouchStart);
4004
+ stage.removeEventListener("touchend", onTouchEnd);
4005
+ window.removeEventListener("keydown", onKey);
4006
+ };
4007
+ }, [next, prev]);
4008
+ const toggleSetting = (key) => {
4009
+ setSettings((prev2) => {
4010
+ const next2 = { ...prev2, [key]: !prev2[key] };
4011
+ settingsRef.current = next2;
4012
+ if (key === "auto") {
4013
+ clearInterval(autoTimerRef.current);
4014
+ if (next2.auto)
4015
+ autoTimerRef.current = setInterval(next2, autoPlayInterval);
4016
+ }
4017
+ return next2;
4018
+ });
4019
+ };
4020
+ return /* @__PURE__ */ import_react4.default.createElement(
4021
+ "div",
4022
+ {
4023
+ ref: stageRef,
4024
+ style: {
4025
+ width: "100%",
4026
+ height: "600px",
4027
+ background: "#000",
4028
+ overflow: "hidden",
4029
+ position: "relative",
4030
+ cursor: "none",
4031
+ fontFamily: "'Inter', system-ui, sans-serif"
4032
+ }
4033
+ },
4034
+ showCursor && /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement("div", { ref: curRef, style: S.cursor }), /* @__PURE__ */ import_react4.default.createElement("div", { ref: ringRef, style: S.ring })),
4035
+ /* @__PURE__ */ import_react4.default.createElement(
4036
+ "div",
4037
+ {
4038
+ style: {
4039
+ width: "100%",
4040
+ height: "100%",
4041
+ position: "relative",
4042
+ perspective: `${perspective}px`,
4043
+ perspectiveOrigin: "50% 45%"
4044
+ }
4045
+ },
4046
+ /* @__PURE__ */ import_react4.default.createElement(
4047
+ "div",
4048
+ {
4049
+ ref: barrelRef,
4050
+ style: {
4051
+ position: "absolute",
4052
+ left: "50%",
4053
+ top: "50%",
4054
+ transformStyle: "preserve-3d",
4055
+ transform: "translateX(-50%) translateY(-50%)"
4056
+ }
4057
+ },
4058
+ slides.map((slide, i) => /* @__PURE__ */ import_react4.default.createElement(
4059
+ "div",
4060
+ {
4061
+ key: i,
4062
+ ref: (el) => cardRefs.current[i] = el,
4063
+ onClick: () => {
4064
+ if (!isAnimatingRef.current && i !== currentRef.current)
4065
+ goTo(i);
4066
+ },
4067
+ style: {
4068
+ position: "absolute",
4069
+ width: cardWidth,
4070
+ height: cardHeight,
4071
+ marginLeft: -cardWidth / 2,
4072
+ marginTop: -cardHeight / 2,
4073
+ transformStyle: "preserve-3d",
4074
+ cursor: "pointer",
4075
+ transformOrigin: "center center"
4076
+ }
4077
+ },
4078
+ /* @__PURE__ */ import_react4.default.createElement("div", { style: S.cardInner }, /* @__PURE__ */ import_react4.default.createElement(
4079
+ "img",
4080
+ {
4081
+ className: "bc-img",
4082
+ src: slide.img,
4083
+ alt: slide.title,
4084
+ loading: "lazy",
4085
+ style: S.img,
4086
+ draggable: false
4087
+ }
4088
+ ), /* @__PURE__ */ import_react4.default.createElement("div", { style: S.overlay }), /* @__PURE__ */ import_react4.default.createElement("div", { className: "bc-glare", style: S.glare }), /* @__PURE__ */ import_react4.default.createElement(
4089
+ "div",
4090
+ {
4091
+ className: "bc-info",
4092
+ style: {
4093
+ ...S.info,
4094
+ opacity: 0,
4095
+ transform: "translateY(8px)"
4096
+ }
4097
+ },
4098
+ slide.tag && /* @__PURE__ */ import_react4.default.createElement("div", { style: S.tag }, slide.tag),
4099
+ /* @__PURE__ */ import_react4.default.createElement("div", { style: S.title }, slide.title),
4100
+ slide.sub && /* @__PURE__ */ import_react4.default.createElement("div", { style: S.sub }, slide.sub)
4101
+ ), /* @__PURE__ */ import_react4.default.createElement("div", { style: S.num }, "0", i + 1), /* @__PURE__ */ import_react4.default.createElement("div", { className: "bc-line", style: S.line }))
4102
+ ))
4103
+ )
4104
+ ),
4105
+ showScanlines && settings.scan && /* @__PURE__ */ import_react4.default.createElement("div", { style: S.scanlines }),
4106
+ showVignette && /* @__PURE__ */ import_react4.default.createElement("div", { style: S.vignette }),
4107
+ /* @__PURE__ */ import_react4.default.createElement("canvas", { ref: canvasRef, style: S.canvas }),
4108
+ /* @__PURE__ */ import_react4.default.createElement("div", { style: S.topBar }, /* @__PURE__ */ import_react4.default.createElement("div", { style: S.logo }, "Carousel"), showCounter && /* @__PURE__ */ import_react4.default.createElement("div", { style: S.counter }, "0", current + 1, " / 0", N)),
4109
+ showSettingsPanel && /* @__PURE__ */ import_react4.default.createElement("div", { style: S.settingsPanel }, [
4110
+ ["Glare", "glare"],
4111
+ ["Particles", "particles"],
4112
+ ["Scanlines", "scan"],
4113
+ ["Autoplay", "auto"],
4114
+ ["Ken Burns", "kb"]
4115
+ ].map(([label, key]) => /* @__PURE__ */ import_react4.default.createElement("div", { key, style: S.settingRow }, /* @__PURE__ */ import_react4.default.createElement("span", { style: S.settingLabel }, label), /* @__PURE__ */ import_react4.default.createElement(
4116
+ "div",
4117
+ {
4118
+ onClick: () => toggleSetting(key),
4119
+ style: {
4120
+ ...S.toggle,
4121
+ background: settings[key] ? "rgba(255,255,255,0.35)" : "rgba(255,255,255,0.12)"
4122
+ }
4123
+ },
4124
+ /* @__PURE__ */ import_react4.default.createElement(
4125
+ "div",
4126
+ {
4127
+ style: { ...S.knob, left: settings[key] ? "17px" : "3px" }
4128
+ }
4129
+ )
4130
+ )))),
4131
+ /* @__PURE__ */ import_react4.default.createElement("div", { style: S.controls }, /* @__PURE__ */ import_react4.default.createElement("button", { style: S.btn, onClick: prev }, "\u2190"), showDots && /* @__PURE__ */ import_react4.default.createElement("div", { style: { display: "flex", gap: "7px", alignItems: "center" } }, slides.map((_, i) => /* @__PURE__ */ import_react4.default.createElement(
4132
+ "div",
4133
+ {
4134
+ key: i,
4135
+ onClick: () => goTo(i),
4136
+ style: {
4137
+ width: i === current ? 22 : 6,
4138
+ height: 6,
4139
+ borderRadius: 3,
4140
+ background: i === current ? "#fff" : "rgba(255,255,255,0.2)",
4141
+ cursor: "pointer",
4142
+ transition: "all 0.35s ease"
4143
+ }
4144
+ }
4145
+ ))), /* @__PURE__ */ import_react4.default.createElement("button", { style: S.btn, onClick: next }, "\u2192"))
4146
+ );
4147
+ };
4148
+ var S = {
4149
+ cursor: {
4150
+ position: "absolute",
4151
+ width: 12,
4152
+ height: 12,
4153
+ borderRadius: "50%",
4154
+ background: "#fff",
4155
+ pointerEvents: "none",
4156
+ zIndex: 999,
4157
+ transform: "translate(-50%,-50%)",
4158
+ mixBlendMode: "difference"
4159
+ },
4160
+ ring: {
4161
+ position: "absolute",
4162
+ width: 44,
4163
+ height: 44,
4164
+ borderRadius: "50%",
4165
+ border: "1.5px solid rgba(255,255,255,0.5)",
4166
+ pointerEvents: "none",
4167
+ zIndex: 998,
4168
+ transform: "translate(-50%,-50%)"
4169
+ },
4170
+ cardInner: {
4171
+ width: "100%",
4172
+ height: "100%",
4173
+ borderRadius: 16,
4174
+ overflow: "hidden",
4175
+ position: "relative",
4176
+ border: "1px solid rgba(255,255,255,0.08)"
4177
+ },
4178
+ img: {
4179
+ width: "100%",
4180
+ height: "100%",
4181
+ objectFit: "cover",
4182
+ display: "block",
4183
+ pointerEvents: "none",
4184
+ userSelect: "none"
4185
+ },
4186
+ overlay: {
4187
+ position: "absolute",
4188
+ inset: 0,
4189
+ background: "linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.1) 55%, transparent 100%)",
4190
+ borderRadius: 16
4191
+ },
4192
+ glare: {
4193
+ position: "absolute",
4194
+ inset: 0,
4195
+ borderRadius: 16,
4196
+ pointerEvents: "none",
4197
+ opacity: 0.9
4198
+ },
4199
+ info: {
4200
+ position: "absolute",
4201
+ bottom: 0,
4202
+ left: 0,
4203
+ right: 0,
4204
+ padding: "22px 20px",
4205
+ transition: "none"
4206
+ },
4207
+ tag: {
4208
+ fontSize: 9,
4209
+ fontWeight: 600,
4210
+ letterSpacing: "0.12em",
4211
+ textTransform: "uppercase",
4212
+ color: "rgba(255,255,255,0.5)",
4213
+ marginBottom: 6
4214
+ },
4215
+ title: {
4216
+ fontSize: 20,
4217
+ fontWeight: 700,
4218
+ color: "#fff",
4219
+ lineHeight: 1.2,
4220
+ marginBottom: 4
4221
+ },
4222
+ sub: { fontSize: 12, color: "rgba(255,255,255,0.55)", lineHeight: 1.5 },
4223
+ num: {
4224
+ position: "absolute",
4225
+ top: 16,
4226
+ right: 18,
4227
+ fontSize: 10,
4228
+ fontWeight: 700,
4229
+ color: "rgba(255,255,255,0.25)",
4230
+ letterSpacing: "0.1em"
4231
+ },
4232
+ line: {
4233
+ position: "absolute",
4234
+ bottom: 0,
4235
+ left: 20,
4236
+ right: 20,
4237
+ height: 2,
4238
+ background: "linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent)",
4239
+ transform: "scaleX(0)",
4240
+ transformOrigin: "left",
4241
+ borderRadius: 2
4242
+ },
4243
+ scanlines: {
4244
+ position: "absolute",
4245
+ inset: 0,
4246
+ pointerEvents: "none",
4247
+ zIndex: 50,
4248
+ background: "repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.03) 3px, rgba(0,0,0,0.03) 4px)"
4249
+ },
4250
+ vignette: {
4251
+ position: "absolute",
4252
+ inset: 0,
4253
+ pointerEvents: "none",
4254
+ zIndex: 49,
4255
+ background: "radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.75) 100%)"
4256
+ },
4257
+ canvas: { position: "absolute", inset: 0, pointerEvents: "none", zIndex: 60 },
4258
+ topBar: {
4259
+ position: "absolute",
4260
+ top: 0,
4261
+ left: 0,
4262
+ right: 0,
4263
+ zIndex: 100,
4264
+ display: "flex",
4265
+ justifyContent: "space-between",
4266
+ alignItems: "center",
4267
+ padding: "20px 28px"
4268
+ },
4269
+ logo: {
4270
+ fontSize: 11,
4271
+ fontWeight: 700,
4272
+ letterSpacing: "0.2em",
4273
+ color: "rgba(255,255,255,0.3)",
4274
+ textTransform: "uppercase"
4275
+ },
4276
+ counter: {
4277
+ fontSize: 11,
4278
+ color: "rgba(255,255,255,0.25)",
4279
+ fontWeight: 500,
4280
+ letterSpacing: "0.06em"
4281
+ },
4282
+ settingsPanel: {
4283
+ position: "absolute",
4284
+ top: 56,
4285
+ right: 28,
4286
+ zIndex: 200,
4287
+ display: "flex",
4288
+ flexDirection: "column",
4289
+ gap: 8,
4290
+ alignItems: "flex-end"
4291
+ },
4292
+ settingRow: { display: "flex", alignItems: "center", gap: 8 },
4293
+ settingLabel: {
4294
+ fontSize: 10,
4295
+ color: "rgba(255,255,255,0.3)",
4296
+ letterSpacing: "0.06em",
4297
+ textTransform: "uppercase"
4298
+ },
4299
+ toggle: {
4300
+ width: 32,
4301
+ height: 18,
4302
+ borderRadius: 9,
4303
+ border: "1px solid rgba(255,255,255,0.15)",
4304
+ cursor: "pointer",
4305
+ position: "relative",
4306
+ transition: "background 0.25s"
4307
+ },
4308
+ knob: {
4309
+ position: "absolute",
4310
+ top: 3,
4311
+ width: 12,
4312
+ height: 12,
4313
+ borderRadius: "50%",
4314
+ background: "#fff",
4315
+ transition: "left 0.2s"
4316
+ },
4317
+ controls: {
4318
+ position: "absolute",
4319
+ bottom: 26,
4320
+ left: "50%",
4321
+ transform: "translateX(-50%)",
4322
+ zIndex: 100,
4323
+ display: "flex",
4324
+ alignItems: "center",
4325
+ gap: 20
4326
+ },
4327
+ btn: {
4328
+ width: 42,
4329
+ height: 42,
4330
+ borderRadius: "50%",
4331
+ background: "rgba(255,255,255,0.07)",
4332
+ border: "1px solid rgba(255,255,255,0.14)",
4333
+ color: "#fff",
4334
+ cursor: "pointer",
4335
+ fontSize: 16,
4336
+ display: "flex",
4337
+ alignItems: "center",
4338
+ justifyContent: "center",
4339
+ backdropFilter: "blur(12px)"
4340
+ }
4341
+ };
3700
4342
  // Annotate the CommonJS export names for ESM import in node:
3701
4343
  0 && (module.exports = {
4344
+ Carousel,
3702
4345
  MagneticButton,
3703
4346
  Navbar,
3704
4347
  SpotlightCard
package/dist/index.mjs CHANGED
@@ -3666,7 +3666,649 @@ var SpotlightCard = ({
3666
3666
  )
3667
3667
  );
3668
3668
  };
3669
+
3670
+ // src/components/Carousel/Carousel.jsx
3671
+ import React4, { useEffect as useEffect4, useRef as useRef4, useState as useState4, useCallback as useCallback4 } from "react";
3672
+ import { gsap } from "gsap";
3673
+ var defaults = {
3674
+ radius: 340,
3675
+ cardWidth: 280,
3676
+ cardHeight: 380,
3677
+ autoPlayInterval: 4200,
3678
+ perspective: 1100
3679
+ };
3680
+ var Carousel = ({
3681
+ slides = [],
3682
+ radius = defaults.radius,
3683
+ cardWidth = defaults.cardWidth,
3684
+ cardHeight = defaults.cardHeight,
3685
+ autoPlayInterval = defaults.autoPlayInterval,
3686
+ perspective = defaults.perspective,
3687
+ showGlare = true,
3688
+ showParticles = true,
3689
+ showScanlines = true,
3690
+ showVignette = true,
3691
+ showKenBurns = true,
3692
+ showAutoPlay = true,
3693
+ showSettingsPanel = true,
3694
+ showDots = true,
3695
+ showCounter = true,
3696
+ showCursor = true
3697
+ }) => {
3698
+ const stageRef = useRef4(null);
3699
+ const barrelRef = useRef4(null);
3700
+ const canvasRef = useRef4(null);
3701
+ const cardRefs = useRef4([]);
3702
+ const curRef = useRef4(null);
3703
+ const ringRef = useRef4(null);
3704
+ const [current, setCurrent] = useState4(0);
3705
+ const [settings, setSettings] = useState4({
3706
+ glare: showGlare,
3707
+ particles: showParticles,
3708
+ scan: showScanlines,
3709
+ auto: showAutoPlay,
3710
+ kb: showKenBurns
3711
+ });
3712
+ const N = slides.length;
3713
+ const currentRef = useRef4(0);
3714
+ const isAnimatingRef = useRef4(false);
3715
+ const settingsRef = useRef4(settings);
3716
+ const autoTimerRef = useRef4(null);
3717
+ const particlesRef = useRef4([]);
3718
+ const mouseRef = useRef4({ x: 0, y: 0 });
3719
+ const cursorPosRef = useRef4({ cx: 0, cy: 0, rx: 0, ry: 0 });
3720
+ const rafRef = useRef4(null);
3721
+ const wheelAccRef = useRef4(0);
3722
+ const wheelTimerRef = useRef4(null);
3723
+ const touchStartRef = useRef4(0);
3724
+ useEffect4(() => {
3725
+ settingsRef.current = settings;
3726
+ }, [settings]);
3727
+ useEffect4(() => {
3728
+ currentRef.current = current;
3729
+ }, [current]);
3730
+ const applyPositions = useCallback4(
3731
+ (instant = false) => {
3732
+ if (!cardRefs.current.length) return;
3733
+ const cur = currentRef.current;
3734
+ cardRefs.current.forEach((card, i) => {
3735
+ if (!card) return;
3736
+ const offset = i - cur;
3737
+ let angle = offset / N * 360;
3738
+ if (angle > 180) angle -= 360;
3739
+ if (angle < -180) angle += 360;
3740
+ const rad = angle * (Math.PI / 180);
3741
+ const x = Math.sin(rad) * radius;
3742
+ const z = Math.cos(rad) * radius - radius;
3743
+ const rotY = -angle;
3744
+ const isActive = i === cur;
3745
+ const absOff = Math.abs(angle);
3746
+ const fade = Math.max(0, 1 - absOff / 90) * 0.7 + 0.05;
3747
+ const sc = isActive ? 1 : Math.max(0.6, 1 - absOff / 280);
3748
+ const props = {
3749
+ x,
3750
+ y: 0,
3751
+ z,
3752
+ rotateY: rotY,
3753
+ scale: sc,
3754
+ opacity: isActive ? 1 : fade,
3755
+ zIndex: isActive ? 10 : Math.round((1 - absOff / 200) * 5),
3756
+ overwrite: true
3757
+ };
3758
+ if (instant) {
3759
+ gsap.set(card, props);
3760
+ } else {
3761
+ gsap.to(card, { ...props, duration: 0.85, ease: "power3.out" });
3762
+ }
3763
+ const info = card.querySelector(".bc-info");
3764
+ const line = card.querySelector(".bc-line");
3765
+ if (isActive) {
3766
+ gsap.to(info, {
3767
+ opacity: 1,
3768
+ y: 0,
3769
+ duration: 0.6,
3770
+ delay: 0.25,
3771
+ ease: "power2.out"
3772
+ });
3773
+ gsap.to(line, {
3774
+ scaleX: 1,
3775
+ duration: 0.9,
3776
+ delay: 0.35,
3777
+ ease: "power2.out"
3778
+ });
3779
+ if (settingsRef.current.kb) {
3780
+ const img = card.querySelector(".bc-img");
3781
+ if (img)
3782
+ gsap.fromTo(
3783
+ img,
3784
+ { scale: 1.08 },
3785
+ { scale: 1, duration: 7, ease: "none" }
3786
+ );
3787
+ }
3788
+ } else {
3789
+ gsap.to(info, { opacity: 0, y: 6, duration: 0.3, ease: "power2.in" });
3790
+ gsap.to(line, { scaleX: 0, duration: 0.25, ease: "power2.in" });
3791
+ }
3792
+ });
3793
+ },
3794
+ [N, radius]
3795
+ );
3796
+ const spawnParticles = useCallback4(() => {
3797
+ if (!settingsRef.current.particles) return;
3798
+ const { x, y } = mouseRef.current;
3799
+ for (let i = 0; i < 28; i++) {
3800
+ particlesRef.current.push({
3801
+ x,
3802
+ y,
3803
+ vx: (Math.random() - 0.5) * 4.5,
3804
+ vy: (Math.random() - 0.5) * 4.5,
3805
+ life: 1,
3806
+ decay: 0.022 + Math.random() * 0.018,
3807
+ r: Math.random() * 3 + 1
3808
+ });
3809
+ }
3810
+ }, []);
3811
+ const goTo = useCallback4(
3812
+ (idx) => {
3813
+ if (idx === currentRef.current || isAnimatingRef.current) return;
3814
+ isAnimatingRef.current = true;
3815
+ spawnParticles();
3816
+ currentRef.current = idx;
3817
+ setCurrent(idx);
3818
+ applyPositions(false);
3819
+ setTimeout(() => {
3820
+ isAnimatingRef.current = false;
3821
+ }, 900);
3822
+ },
3823
+ [applyPositions, spawnParticles]
3824
+ );
3825
+ const next = useCallback4(() => goTo((currentRef.current + 1) % N), [goTo, N]);
3826
+ const prev = useCallback4(
3827
+ () => goTo((currentRef.current - 1 + N) % N),
3828
+ [goTo, N]
3829
+ );
3830
+ const resetAuto = useCallback4(() => {
3831
+ clearInterval(autoTimerRef.current);
3832
+ if (settingsRef.current.auto) {
3833
+ autoTimerRef.current = setInterval(next, autoPlayInterval);
3834
+ }
3835
+ }, [next, autoPlayInterval]);
3836
+ useEffect4(() => {
3837
+ if (!barrelRef.current || !cardRefs.current.length) return;
3838
+ applyPositions(true);
3839
+ resetAuto();
3840
+ }, [applyPositions, resetAuto]);
3841
+ useEffect4(() => {
3842
+ const canvas = canvasRef.current;
3843
+ if (!canvas) return;
3844
+ const ctx = canvas.getContext("2d");
3845
+ const resize = () => {
3846
+ if (!stageRef.current) return;
3847
+ canvas.width = stageRef.current.offsetWidth;
3848
+ canvas.height = stageRef.current.offsetHeight;
3849
+ };
3850
+ resize();
3851
+ window.addEventListener("resize", resize);
3852
+ let frameId;
3853
+ const drawLoop = () => {
3854
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
3855
+ particlesRef.current = particlesRef.current.filter((p) => p.life > 0);
3856
+ particlesRef.current.forEach((p) => {
3857
+ p.x += p.vx;
3858
+ p.y += p.vy;
3859
+ p.vy += 0.06;
3860
+ p.life -= p.decay;
3861
+ ctx.beginPath();
3862
+ ctx.arc(p.x, p.y, p.r * p.life, 0, Math.PI * 2);
3863
+ ctx.fillStyle = `rgba(255,255,255,${p.life * 0.55})`;
3864
+ ctx.fill();
3865
+ });
3866
+ frameId = requestAnimationFrame(drawLoop);
3867
+ };
3868
+ drawLoop();
3869
+ return () => {
3870
+ window.removeEventListener("resize", resize);
3871
+ cancelAnimationFrame(frameId);
3872
+ };
3873
+ }, []);
3874
+ useEffect4(() => {
3875
+ const lerp2 = (a, b, t) => a + (b - a) * t;
3876
+ let frameId;
3877
+ const loop = () => {
3878
+ const { cx, cy, rx, ry } = cursorPosRef.current;
3879
+ const { x, y } = mouseRef.current;
3880
+ cursorPosRef.current.cx = lerp2(cx, x, 0.18);
3881
+ cursorPosRef.current.cy = lerp2(cy, y, 0.18);
3882
+ cursorPosRef.current.rx = lerp2(rx, x, 0.08);
3883
+ cursorPosRef.current.ry = lerp2(ry, y, 0.08);
3884
+ if (curRef.current) {
3885
+ curRef.current.style.left = x + "px";
3886
+ curRef.current.style.top = y + "px";
3887
+ }
3888
+ if (ringRef.current) {
3889
+ ringRef.current.style.left = cursorPosRef.current.rx + "px";
3890
+ ringRef.current.style.top = cursorPosRef.current.ry + "px";
3891
+ }
3892
+ const activeCard = cardRefs.current[currentRef.current];
3893
+ if (activeCard && settingsRef.current.glare && stageRef.current) {
3894
+ const r2 = activeCard.getBoundingClientRect();
3895
+ const pr = stageRef.current.getBoundingClientRect();
3896
+ const lx = x, ly = y;
3897
+ const cx2 = r2.left + r2.width / 2 - pr.left;
3898
+ const cy2 = r2.top + r2.height / 2 - pr.top;
3899
+ const dx = (lx - cx2) / cardWidth;
3900
+ const dy = (ly - cy2) / cardHeight;
3901
+ const glare = activeCard.querySelector(".bc-glare");
3902
+ if (glare) {
3903
+ glare.style.background = `radial-gradient(circle at ${50 + dx * 35}% ${50 + dy * 35}%, rgba(255,255,255,0.16), transparent 60%)`;
3904
+ }
3905
+ gsap.to(activeCard, {
3906
+ rotateX: -dy * 6,
3907
+ rotateY: dx * 6,
3908
+ duration: 0.4,
3909
+ ease: "power2.out",
3910
+ overwrite: "auto"
3911
+ });
3912
+ }
3913
+ frameId = requestAnimationFrame(loop);
3914
+ };
3915
+ loop();
3916
+ return () => cancelAnimationFrame(frameId);
3917
+ }, [cardWidth, cardHeight]);
3918
+ useEffect4(() => {
3919
+ const stage = stageRef.current;
3920
+ if (!stage) return;
3921
+ const onMove = (e) => {
3922
+ const r = stage.getBoundingClientRect();
3923
+ mouseRef.current = { x: e.clientX - r.left, y: e.clientY - r.top };
3924
+ };
3925
+ const onLeave = () => {
3926
+ const activeCard = cardRefs.current[currentRef.current];
3927
+ if (activeCard) {
3928
+ const glare = activeCard.querySelector(".bc-glare");
3929
+ if (glare) glare.style.opacity = 0;
3930
+ gsap.to(activeCard, {
3931
+ rotateX: 0,
3932
+ rotateY: 0,
3933
+ duration: 0.6,
3934
+ ease: "elastic.out(1,0.6)"
3935
+ });
3936
+ }
3937
+ };
3938
+ const onWheel = (e) => {
3939
+ e.preventDefault();
3940
+ wheelAccRef.current += e.deltaY;
3941
+ clearTimeout(wheelTimerRef.current);
3942
+ wheelTimerRef.current = setTimeout(() => {
3943
+ if (Math.abs(wheelAccRef.current) > 60) {
3944
+ wheelAccRef.current > 0 ? next() : prev();
3945
+ }
3946
+ wheelAccRef.current = 0;
3947
+ }, 80);
3948
+ };
3949
+ const onTouchStart = (e) => {
3950
+ touchStartRef.current = e.touches[0].pageX;
3951
+ };
3952
+ const onTouchEnd = (e) => {
3953
+ const dx = e.changedTouches[0].pageX - touchStartRef.current;
3954
+ if (dx < -40) next();
3955
+ else if (dx > 40) prev();
3956
+ };
3957
+ const onKey = (e) => {
3958
+ if (e.key === "ArrowRight") next();
3959
+ if (e.key === "ArrowLeft") prev();
3960
+ };
3961
+ stage.addEventListener("mousemove", onMove);
3962
+ stage.addEventListener("mouseleave", onLeave);
3963
+ stage.addEventListener("wheel", onWheel, { passive: false });
3964
+ stage.addEventListener("touchstart", onTouchStart, { passive: true });
3965
+ stage.addEventListener("touchend", onTouchEnd);
3966
+ window.addEventListener("keydown", onKey);
3967
+ return () => {
3968
+ stage.removeEventListener("mousemove", onMove);
3969
+ stage.removeEventListener("mouseleave", onLeave);
3970
+ stage.removeEventListener("wheel", onWheel);
3971
+ stage.removeEventListener("touchstart", onTouchStart);
3972
+ stage.removeEventListener("touchend", onTouchEnd);
3973
+ window.removeEventListener("keydown", onKey);
3974
+ };
3975
+ }, [next, prev]);
3976
+ const toggleSetting = (key) => {
3977
+ setSettings((prev2) => {
3978
+ const next2 = { ...prev2, [key]: !prev2[key] };
3979
+ settingsRef.current = next2;
3980
+ if (key === "auto") {
3981
+ clearInterval(autoTimerRef.current);
3982
+ if (next2.auto)
3983
+ autoTimerRef.current = setInterval(next2, autoPlayInterval);
3984
+ }
3985
+ return next2;
3986
+ });
3987
+ };
3988
+ return /* @__PURE__ */ React4.createElement(
3989
+ "div",
3990
+ {
3991
+ ref: stageRef,
3992
+ style: {
3993
+ width: "100%",
3994
+ height: "600px",
3995
+ background: "#000",
3996
+ overflow: "hidden",
3997
+ position: "relative",
3998
+ cursor: "none",
3999
+ fontFamily: "'Inter', system-ui, sans-serif"
4000
+ }
4001
+ },
4002
+ showCursor && /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("div", { ref: curRef, style: S.cursor }), /* @__PURE__ */ React4.createElement("div", { ref: ringRef, style: S.ring })),
4003
+ /* @__PURE__ */ React4.createElement(
4004
+ "div",
4005
+ {
4006
+ style: {
4007
+ width: "100%",
4008
+ height: "100%",
4009
+ position: "relative",
4010
+ perspective: `${perspective}px`,
4011
+ perspectiveOrigin: "50% 45%"
4012
+ }
4013
+ },
4014
+ /* @__PURE__ */ React4.createElement(
4015
+ "div",
4016
+ {
4017
+ ref: barrelRef,
4018
+ style: {
4019
+ position: "absolute",
4020
+ left: "50%",
4021
+ top: "50%",
4022
+ transformStyle: "preserve-3d",
4023
+ transform: "translateX(-50%) translateY(-50%)"
4024
+ }
4025
+ },
4026
+ slides.map((slide, i) => /* @__PURE__ */ React4.createElement(
4027
+ "div",
4028
+ {
4029
+ key: i,
4030
+ ref: (el) => cardRefs.current[i] = el,
4031
+ onClick: () => {
4032
+ if (!isAnimatingRef.current && i !== currentRef.current)
4033
+ goTo(i);
4034
+ },
4035
+ style: {
4036
+ position: "absolute",
4037
+ width: cardWidth,
4038
+ height: cardHeight,
4039
+ marginLeft: -cardWidth / 2,
4040
+ marginTop: -cardHeight / 2,
4041
+ transformStyle: "preserve-3d",
4042
+ cursor: "pointer",
4043
+ transformOrigin: "center center"
4044
+ }
4045
+ },
4046
+ /* @__PURE__ */ React4.createElement("div", { style: S.cardInner }, /* @__PURE__ */ React4.createElement(
4047
+ "img",
4048
+ {
4049
+ className: "bc-img",
4050
+ src: slide.img,
4051
+ alt: slide.title,
4052
+ loading: "lazy",
4053
+ style: S.img,
4054
+ draggable: false
4055
+ }
4056
+ ), /* @__PURE__ */ React4.createElement("div", { style: S.overlay }), /* @__PURE__ */ React4.createElement("div", { className: "bc-glare", style: S.glare }), /* @__PURE__ */ React4.createElement(
4057
+ "div",
4058
+ {
4059
+ className: "bc-info",
4060
+ style: {
4061
+ ...S.info,
4062
+ opacity: 0,
4063
+ transform: "translateY(8px)"
4064
+ }
4065
+ },
4066
+ slide.tag && /* @__PURE__ */ React4.createElement("div", { style: S.tag }, slide.tag),
4067
+ /* @__PURE__ */ React4.createElement("div", { style: S.title }, slide.title),
4068
+ slide.sub && /* @__PURE__ */ React4.createElement("div", { style: S.sub }, slide.sub)
4069
+ ), /* @__PURE__ */ React4.createElement("div", { style: S.num }, "0", i + 1), /* @__PURE__ */ React4.createElement("div", { className: "bc-line", style: S.line }))
4070
+ ))
4071
+ )
4072
+ ),
4073
+ showScanlines && settings.scan && /* @__PURE__ */ React4.createElement("div", { style: S.scanlines }),
4074
+ showVignette && /* @__PURE__ */ React4.createElement("div", { style: S.vignette }),
4075
+ /* @__PURE__ */ React4.createElement("canvas", { ref: canvasRef, style: S.canvas }),
4076
+ /* @__PURE__ */ React4.createElement("div", { style: S.topBar }, /* @__PURE__ */ React4.createElement("div", { style: S.logo }, "Carousel"), showCounter && /* @__PURE__ */ React4.createElement("div", { style: S.counter }, "0", current + 1, " / 0", N)),
4077
+ showSettingsPanel && /* @__PURE__ */ React4.createElement("div", { style: S.settingsPanel }, [
4078
+ ["Glare", "glare"],
4079
+ ["Particles", "particles"],
4080
+ ["Scanlines", "scan"],
4081
+ ["Autoplay", "auto"],
4082
+ ["Ken Burns", "kb"]
4083
+ ].map(([label, key]) => /* @__PURE__ */ React4.createElement("div", { key, style: S.settingRow }, /* @__PURE__ */ React4.createElement("span", { style: S.settingLabel }, label), /* @__PURE__ */ React4.createElement(
4084
+ "div",
4085
+ {
4086
+ onClick: () => toggleSetting(key),
4087
+ style: {
4088
+ ...S.toggle,
4089
+ background: settings[key] ? "rgba(255,255,255,0.35)" : "rgba(255,255,255,0.12)"
4090
+ }
4091
+ },
4092
+ /* @__PURE__ */ React4.createElement(
4093
+ "div",
4094
+ {
4095
+ style: { ...S.knob, left: settings[key] ? "17px" : "3px" }
4096
+ }
4097
+ )
4098
+ )))),
4099
+ /* @__PURE__ */ React4.createElement("div", { style: S.controls }, /* @__PURE__ */ React4.createElement("button", { style: S.btn, onClick: prev }, "\u2190"), showDots && /* @__PURE__ */ React4.createElement("div", { style: { display: "flex", gap: "7px", alignItems: "center" } }, slides.map((_, i) => /* @__PURE__ */ React4.createElement(
4100
+ "div",
4101
+ {
4102
+ key: i,
4103
+ onClick: () => goTo(i),
4104
+ style: {
4105
+ width: i === current ? 22 : 6,
4106
+ height: 6,
4107
+ borderRadius: 3,
4108
+ background: i === current ? "#fff" : "rgba(255,255,255,0.2)",
4109
+ cursor: "pointer",
4110
+ transition: "all 0.35s ease"
4111
+ }
4112
+ }
4113
+ ))), /* @__PURE__ */ React4.createElement("button", { style: S.btn, onClick: next }, "\u2192"))
4114
+ );
4115
+ };
4116
+ var S = {
4117
+ cursor: {
4118
+ position: "absolute",
4119
+ width: 12,
4120
+ height: 12,
4121
+ borderRadius: "50%",
4122
+ background: "#fff",
4123
+ pointerEvents: "none",
4124
+ zIndex: 999,
4125
+ transform: "translate(-50%,-50%)",
4126
+ mixBlendMode: "difference"
4127
+ },
4128
+ ring: {
4129
+ position: "absolute",
4130
+ width: 44,
4131
+ height: 44,
4132
+ borderRadius: "50%",
4133
+ border: "1.5px solid rgba(255,255,255,0.5)",
4134
+ pointerEvents: "none",
4135
+ zIndex: 998,
4136
+ transform: "translate(-50%,-50%)"
4137
+ },
4138
+ cardInner: {
4139
+ width: "100%",
4140
+ height: "100%",
4141
+ borderRadius: 16,
4142
+ overflow: "hidden",
4143
+ position: "relative",
4144
+ border: "1px solid rgba(255,255,255,0.08)"
4145
+ },
4146
+ img: {
4147
+ width: "100%",
4148
+ height: "100%",
4149
+ objectFit: "cover",
4150
+ display: "block",
4151
+ pointerEvents: "none",
4152
+ userSelect: "none"
4153
+ },
4154
+ overlay: {
4155
+ position: "absolute",
4156
+ inset: 0,
4157
+ background: "linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.1) 55%, transparent 100%)",
4158
+ borderRadius: 16
4159
+ },
4160
+ glare: {
4161
+ position: "absolute",
4162
+ inset: 0,
4163
+ borderRadius: 16,
4164
+ pointerEvents: "none",
4165
+ opacity: 0.9
4166
+ },
4167
+ info: {
4168
+ position: "absolute",
4169
+ bottom: 0,
4170
+ left: 0,
4171
+ right: 0,
4172
+ padding: "22px 20px",
4173
+ transition: "none"
4174
+ },
4175
+ tag: {
4176
+ fontSize: 9,
4177
+ fontWeight: 600,
4178
+ letterSpacing: "0.12em",
4179
+ textTransform: "uppercase",
4180
+ color: "rgba(255,255,255,0.5)",
4181
+ marginBottom: 6
4182
+ },
4183
+ title: {
4184
+ fontSize: 20,
4185
+ fontWeight: 700,
4186
+ color: "#fff",
4187
+ lineHeight: 1.2,
4188
+ marginBottom: 4
4189
+ },
4190
+ sub: { fontSize: 12, color: "rgba(255,255,255,0.55)", lineHeight: 1.5 },
4191
+ num: {
4192
+ position: "absolute",
4193
+ top: 16,
4194
+ right: 18,
4195
+ fontSize: 10,
4196
+ fontWeight: 700,
4197
+ color: "rgba(255,255,255,0.25)",
4198
+ letterSpacing: "0.1em"
4199
+ },
4200
+ line: {
4201
+ position: "absolute",
4202
+ bottom: 0,
4203
+ left: 20,
4204
+ right: 20,
4205
+ height: 2,
4206
+ background: "linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent)",
4207
+ transform: "scaleX(0)",
4208
+ transformOrigin: "left",
4209
+ borderRadius: 2
4210
+ },
4211
+ scanlines: {
4212
+ position: "absolute",
4213
+ inset: 0,
4214
+ pointerEvents: "none",
4215
+ zIndex: 50,
4216
+ background: "repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.03) 3px, rgba(0,0,0,0.03) 4px)"
4217
+ },
4218
+ vignette: {
4219
+ position: "absolute",
4220
+ inset: 0,
4221
+ pointerEvents: "none",
4222
+ zIndex: 49,
4223
+ background: "radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.75) 100%)"
4224
+ },
4225
+ canvas: { position: "absolute", inset: 0, pointerEvents: "none", zIndex: 60 },
4226
+ topBar: {
4227
+ position: "absolute",
4228
+ top: 0,
4229
+ left: 0,
4230
+ right: 0,
4231
+ zIndex: 100,
4232
+ display: "flex",
4233
+ justifyContent: "space-between",
4234
+ alignItems: "center",
4235
+ padding: "20px 28px"
4236
+ },
4237
+ logo: {
4238
+ fontSize: 11,
4239
+ fontWeight: 700,
4240
+ letterSpacing: "0.2em",
4241
+ color: "rgba(255,255,255,0.3)",
4242
+ textTransform: "uppercase"
4243
+ },
4244
+ counter: {
4245
+ fontSize: 11,
4246
+ color: "rgba(255,255,255,0.25)",
4247
+ fontWeight: 500,
4248
+ letterSpacing: "0.06em"
4249
+ },
4250
+ settingsPanel: {
4251
+ position: "absolute",
4252
+ top: 56,
4253
+ right: 28,
4254
+ zIndex: 200,
4255
+ display: "flex",
4256
+ flexDirection: "column",
4257
+ gap: 8,
4258
+ alignItems: "flex-end"
4259
+ },
4260
+ settingRow: { display: "flex", alignItems: "center", gap: 8 },
4261
+ settingLabel: {
4262
+ fontSize: 10,
4263
+ color: "rgba(255,255,255,0.3)",
4264
+ letterSpacing: "0.06em",
4265
+ textTransform: "uppercase"
4266
+ },
4267
+ toggle: {
4268
+ width: 32,
4269
+ height: 18,
4270
+ borderRadius: 9,
4271
+ border: "1px solid rgba(255,255,255,0.15)",
4272
+ cursor: "pointer",
4273
+ position: "relative",
4274
+ transition: "background 0.25s"
4275
+ },
4276
+ knob: {
4277
+ position: "absolute",
4278
+ top: 3,
4279
+ width: 12,
4280
+ height: 12,
4281
+ borderRadius: "50%",
4282
+ background: "#fff",
4283
+ transition: "left 0.2s"
4284
+ },
4285
+ controls: {
4286
+ position: "absolute",
4287
+ bottom: 26,
4288
+ left: "50%",
4289
+ transform: "translateX(-50%)",
4290
+ zIndex: 100,
4291
+ display: "flex",
4292
+ alignItems: "center",
4293
+ gap: 20
4294
+ },
4295
+ btn: {
4296
+ width: 42,
4297
+ height: 42,
4298
+ borderRadius: "50%",
4299
+ background: "rgba(255,255,255,0.07)",
4300
+ border: "1px solid rgba(255,255,255,0.14)",
4301
+ color: "#fff",
4302
+ cursor: "pointer",
4303
+ fontSize: 16,
4304
+ display: "flex",
4305
+ alignItems: "center",
4306
+ justifyContent: "center",
4307
+ backdropFilter: "blur(12px)"
4308
+ }
4309
+ };
3669
4310
  export {
4311
+ Carousel,
3670
4312
  MagneticButton,
3671
4313
  Navbar,
3672
4314
  SpotlightCard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aura-ui-library",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A modern and customizable UI library for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",