194 Commits

Author SHA1 Message Date
7bb2b6bd44 Update src/app/recipes/page.tsx 2026-03-11 21:03:01 +00:00
5ce039792e Update src/app/recipes/page.tsx 2026-03-11 21:01:20 +00:00
5c65ebd544 Update src/app/recipes/page.tsx 2026-03-11 20:59:39 +00:00
1800139cd8 Update src/app/page.tsx 2026-03-11 20:59:38 +00:00
1fb92d6469 Update src/app/recipes/page.tsx 2026-03-11 20:54:48 +00:00
3583f3389c Update src/app/page.tsx 2026-03-11 20:54:47 +00:00
92007b1ff7 Update src/app/recipes/page.tsx 2026-03-11 20:51:36 +00:00
ac2e5c80f2 Update src/app/page.tsx 2026-03-11 20:51:35 +00:00
e6905d194d Update src/app/dashboard/page.tsx 2026-03-11 20:51:34 +00:00
c61a8fbed8 Update src/app/auth/register/page.tsx 2026-03-11 20:51:34 +00:00
b744886412 Update src/app/auth/login/page.tsx 2026-03-11 20:51:33 +00:00
1ded73a33b Add src/app/api/auth/verify/route.ts 2026-03-11 20:51:32 +00:00
d3444db041 Update src/app/api/auth/register/route.ts 2026-03-11 20:51:32 +00:00
c9a8576630 Update src/app/api/auth/login/route.ts 2026-03-11 20:51:31 +00:00
096d0e06f7 Update src/app/page.tsx 2026-03-11 20:37:00 +00:00
eb79b2dfdd Update src/app/api/auth/register/route.ts 2026-03-11 20:36:59 +00:00
206c1704cd Update src/app/api/auth/login/route.ts 2026-03-11 20:36:59 +00:00
01856dd9e9 Add src/middleware.ts 2026-03-11 20:34:06 +00:00
030077b623 Update src/app/recipes/page.tsx 2026-03-11 20:34:06 +00:00
9f01fe99d5 Update src/app/page.tsx 2026-03-11 20:34:06 +00:00
b394f9c6ad Add src/app/dashboard/page.tsx 2026-03-11 20:34:05 +00:00
ca94a50c72 Add src/app/auth/page.tsx 2026-03-11 20:34:05 +00:00
c4d8f371b4 Update src/app/api/auth/register/route.ts 2026-03-11 20:34:04 +00:00
5267e7757f Update src/app/api/auth/logout/route.ts 2026-03-11 20:34:04 +00:00
702dea54a8 Update src/app/api/auth/login/route.ts 2026-03-11 20:34:03 +00:00
22e814cc98 Update src/components/sections/feature/featureBorderGlow/FeatureBorderGlow.tsx 2026-03-11 20:30:43 +00:00
1f6828c551 Update src/components/sections/feature/FeatureCardTwentyThree.tsx 2026-03-11 20:30:42 +00:00
c174aaa219 Update src/components/sections/feature/FeatureCardTwentySeven.tsx 2026-03-11 20:30:42 +00:00
f78fb8a700 Update src/components/sections/feature/FeatureCardTwentyFour.tsx 2026-03-11 20:30:41 +00:00
9e677a0071 Update src/components/sections/feature/FeatureCardTwentyFive.tsx 2026-03-11 20:30:41 +00:00
1af2a5c357 Update src/components/sections/feature/FeatureCardTwelve.tsx 2026-03-11 20:30:40 +00:00
a38687a637 Update src/components/sections/feature/FeatureCardSeven.tsx 2026-03-11 20:30:40 +00:00
451e10f5b2 Update src/components/sections/feature/FeatureCardOne.tsx 2026-03-11 20:30:40 +00:00
74f778ee29 Update src/components/sections/feature/FeatureCardMedia.tsx 2026-03-11 20:30:39 +00:00
cda29a43e7 Update src/components/sections/feature/FeatureBento.tsx 2026-03-11 20:30:39 +00:00
ed554bf24a Update src/components/sections/blog/BlogCardTwo.tsx 2026-03-11 20:28:11 +00:00
7d8a7ae55e Update src/components/sections/blog/BlogCardThree.tsx 2026-03-11 20:28:11 +00:00
579dc9dc9d Update src/components/sections/blog/BlogCardOne.tsx 2026-03-11 20:28:10 +00:00
02691a0020 Update src/components/sections/blog/BlogCardTwo.tsx 2026-03-11 20:27:12 +00:00
0a13433a62 Update src/components/sections/blog/BlogCardThree.tsx 2026-03-11 20:27:12 +00:00
844a98f6a9 Update src/components/sections/blog/BlogCardOne.tsx 2026-03-11 20:27:11 +00:00
326c9c2dc6 Update src/app/auth/register/page.tsx 2026-03-11 20:26:09 +00:00
709b6fb5ad Update src/app/auth/login/page.tsx 2026-03-11 20:26:09 +00:00
8486499be5 Update src/app/recipes/page.tsx 2026-03-11 20:25:22 +00:00
30e9bb610c Update src/app/auth/register/page.tsx 2026-03-11 20:25:22 +00:00
b121f70611 Update src/app/auth/login/page.tsx 2026-03-11 20:25:21 +00:00
104c638634 Add src/app/recipes/page.tsx 2026-03-11 20:24:16 +00:00
34175d54a3 Update src/app/page.tsx 2026-03-11 20:24:16 +00:00
6e7b37883f Add src/app/auth/register/page.tsx 2026-03-11 20:24:16 +00:00
5a6c4ca430 Add src/app/auth/login/page.tsx 2026-03-11 20:24:15 +00:00
75f30cf7e3 Add src/app/api/auth/register/route.ts 2026-03-11 20:24:15 +00:00
93509b1fc5 Update src/components/cardStack/layouts/carousels/ButtonCarousel.tsx 2026-03-11 20:18:06 +00:00
1a73ca0c24 Update src/components/cardStack/layouts/carousels/AutoCarousel.tsx 2026-03-11 20:18:06 +00:00
0d83b3c469 Add src/components/cardStack/CardStackContext.tsx 2026-03-11 20:18:05 +00:00
e819207b6b Update src/components/cardStack/CardStack.tsx 2026-03-11 20:18:05 +00:00
796ecee666 Update src/components/cardStack/CardList.tsx 2026-03-11 20:18:04 +00:00
17e5004f24 Update src/app/page.tsx 2026-03-11 20:18:04 +00:00
63bdd90d3f Update src/app/page.tsx 2026-03-11 20:15:02 +00:00
81d61ec439 Add src/hooks/useAuth.ts 2026-03-11 20:12:18 +00:00
9c29530163 Add src/components/ProtectedRoute.tsx 2026-03-11 20:12:18 +00:00
d4fc238f15 Update src/app/page.tsx 2026-03-11 20:12:17 +00:00
c02676d14d Add src/app/onboarding/page.tsx 2026-03-11 20:12:17 +00:00
6279afd2b2 Add src/app/login/page.tsx 2026-03-11 20:12:17 +00:00
869c46ffc9 Add src/app/api/auth/verify-session/route.ts 2026-03-11 20:12:16 +00:00
86e4810f2d Add src/app/api/auth/logout/route.ts 2026-03-11 20:12:16 +00:00
d38fe18069 Add src/app/api/auth/login/route.ts 2026-03-11 20:12:15 +00:00
bf24d8f867 Switch to version 3: modified src/components/sections/testimonial/TestimonialCardTwo.tsx 2026-03-11 20:09:15 +00:00
ca213349c7 Switch to version 3: modified src/components/sections/testimonial/TestimonialCardThirteen.tsx 2026-03-11 20:09:14 +00:00
76b346ad31 Switch to version 3: modified src/components/sections/testimonial/TestimonialCardOne.tsx 2026-03-11 20:09:14 +00:00
55bf215e00 Switch to version 3: modified src/components/sections/team/TeamCardTwo.tsx 2026-03-11 20:09:13 +00:00
0d98cb54c7 Switch to version 3: modified src/components/sections/team/TeamCardSix.tsx 2026-03-11 20:09:13 +00:00
8e5e442bec Switch to version 3: modified src/components/sections/team/TeamCardOne.tsx 2026-03-11 20:09:12 +00:00
8bf6e5fb74 Switch to version 3: modified src/components/sections/team/TeamCardFive.tsx 2026-03-11 20:09:12 +00:00
fa0fc6c6b4 Switch to version 3: modified src/components/sections/pricing/PricingCardTwo.tsx 2026-03-11 20:09:11 +00:00
0f9cc76017 Switch to version 3: modified src/components/sections/pricing/PricingCardThree.tsx 2026-03-11 20:09:11 +00:00
59cf14c810 Switch to version 3: modified src/components/sections/pricing/PricingCardOne.tsx 2026-03-11 20:09:10 +00:00
b890e59fc9 Switch to version 3: modified src/components/sections/metrics/MetricCardTwo.tsx 2026-03-11 20:09:10 +00:00
089258a106 Switch to version 3: modified src/components/sections/metrics/MetricCardThree.tsx 2026-03-11 20:09:10 +00:00
24dd58ced9 Switch to version 3: modified src/components/sections/metrics/MetricCardTen.tsx 2026-03-11 20:09:09 +00:00
0c803c4b64 Switch to version 3: modified src/components/sections/metrics/MetricCardSeven.tsx 2026-03-11 20:09:09 +00:00
3cf272f29f Switch to version 3: modified src/components/sections/metrics/MetricCardOne.tsx 2026-03-11 20:09:08 +00:00
8d15f5471a Switch to version 3: modified src/components/sections/metrics/MetricCardEleven.tsx 2026-03-11 20:09:08 +00:00
103bc6030a Switch to version 3: modified src/components/sections/feature/featureHoverPattern/FeatureHoverPattern.tsx 2026-03-11 20:09:07 +00:00
1f8b461861 Switch to version 3: modified src/components/sections/feature/featureCardThree/FeatureCardThree.tsx 2026-03-11 20:09:07 +00:00
fa3501c0d9 Switch to version 3: modified src/components/sections/feature/featureBorderGlow/FeatureBorderGlow.tsx 2026-03-11 20:09:06 +00:00
791dbfe237 Switch to version 3: modified src/components/sections/feature/FeatureCardTwentyThree.tsx 2026-03-11 20:09:06 +00:00
fa387d32f8 Switch to version 3: modified src/components/sections/feature/FeatureCardTwentySeven.tsx 2026-03-11 20:09:05 +00:00
8fe09c7b2c Switch to version 3: modified src/components/sections/feature/FeatureCardTwentyFive.tsx 2026-03-11 20:09:05 +00:00
ff8d4e3912 Switch to version 3: modified src/components/sections/feature/FeatureCardSixteen.tsx 2026-03-11 20:09:04 +00:00
253876ce81 Switch to version 3: modified src/components/sections/feature/FeatureCardOne.tsx 2026-03-11 20:09:04 +00:00
6d3d9dcf3a Switch to version 3: modified src/components/sections/feature/FeatureCardMedia.tsx 2026-03-11 20:09:03 +00:00
575691e152 Switch to version 3: modified src/components/sections/feature/FeatureBento.tsx 2026-03-11 20:09:03 +00:00
1eba8e94de Switch to version 3: modified src/components/sections/contact/ContactFaq.tsx 2026-03-11 20:09:03 +00:00
382dd0a179 Switch to version 3: modified src/components/sections/blog/BlogCardTwo.tsx 2026-03-11 20:09:02 +00:00
95b1b27ea5 Switch to version 3: modified src/components/sections/blog/BlogCardThree.tsx 2026-03-11 20:09:02 +00:00
df45b0b584 Switch to version 3: modified src/components/sections/blog/BlogCardOne.tsx 2026-03-11 20:09:01 +00:00
6aba436be7 Switch to version 3: modified src/components/cardStack/layouts/timelines/TimelineProcessFlow.tsx 2026-03-11 20:09:01 +00:00
7c842847c6 Switch to version 3: modified src/components/cardStack/layouts/timelines/TimelinePhoneView.tsx 2026-03-11 20:09:00 +00:00
3a8ca5d068 Switch to version 3: modified src/components/cardStack/layouts/grid/GridLayout.tsx 2026-03-11 20:09:00 +00:00
ffcdd174e6 Switch to version 3: modified src/components/cardStack/layouts/carousels/ButtonCarousel.tsx 2026-03-11 20:08:59 +00:00
f34b523345 Switch to version 3: modified src/components/cardStack/layouts/carousels/AutoCarousel.tsx 2026-03-11 20:08:59 +00:00
18702b6298 Switch to version 3: modified src/components/cardStack/CardList.tsx 2026-03-11 20:08:58 +00:00
ad4bb467b4 Switch to version 3: modified src/app/page.tsx 2026-03-11 20:08:58 +00:00
f64d555529 Update src/components/sections/testimonial/TestimonialCardTwo.tsx 2026-03-11 20:08:34 +00:00
a278411308 Update src/components/sections/testimonial/TestimonialCardThirteen.tsx 2026-03-11 20:08:34 +00:00
5c2002fb5a Update src/components/sections/testimonial/TestimonialCardOne.tsx 2026-03-11 20:08:33 +00:00
a56118e150 Update src/components/sections/team/TeamCardTwo.tsx 2026-03-11 20:08:33 +00:00
1678c72b4f Update src/components/sections/team/TeamCardSix.tsx 2026-03-11 20:08:32 +00:00
d8cf93f987 Update src/components/sections/team/TeamCardOne.tsx 2026-03-11 20:08:32 +00:00
1cce93f1d1 Update src/components/sections/team/TeamCardFive.tsx 2026-03-11 20:08:31 +00:00
39c4f3a82c Update src/components/sections/pricing/PricingCardTwo.tsx 2026-03-11 20:08:31 +00:00
2f24aab896 Update src/components/sections/pricing/PricingCardThree.tsx 2026-03-11 20:08:31 +00:00
fe3478c6ae Update src/components/sections/pricing/PricingCardOne.tsx 2026-03-11 20:08:30 +00:00
49696bc175 Update src/components/sections/metrics/MetricCardTwo.tsx 2026-03-11 20:08:30 +00:00
852c52dfb1 Update src/components/sections/metrics/MetricCardThree.tsx 2026-03-11 20:08:29 +00:00
aaa07ccea0 Update src/components/sections/metrics/MetricCardTen.tsx 2026-03-11 20:08:29 +00:00
21f870c64e Update src/components/sections/metrics/MetricCardSeven.tsx 2026-03-11 20:08:28 +00:00
7a521e3912 Update src/components/sections/metrics/MetricCardOne.tsx 2026-03-11 20:08:28 +00:00
1eaa4a4569 Update src/components/sections/metrics/MetricCardEleven.tsx 2026-03-11 20:08:28 +00:00
3ad37e2c82 Update src/components/sections/feature/featureHoverPattern/FeatureHoverPattern.tsx 2026-03-11 20:08:27 +00:00
dce3b057d7 Update src/components/sections/feature/featureCardThree/FeatureCardThree.tsx 2026-03-11 20:08:27 +00:00
9cf7c31c16 Update src/components/sections/feature/featureBorderGlow/FeatureBorderGlow.tsx 2026-03-11 20:08:26 +00:00
193d19e4fc Update src/components/sections/feature/FeatureCardTwentyThree.tsx 2026-03-11 20:08:26 +00:00
bd43f1b503 Update src/components/sections/feature/FeatureCardTwentySeven.tsx 2026-03-11 20:08:25 +00:00
27e67e8f1e Update src/components/sections/feature/FeatureCardTwentyFive.tsx 2026-03-11 20:08:25 +00:00
6e5b3c3bf6 Update src/components/sections/feature/FeatureCardSixteen.tsx 2026-03-11 20:08:24 +00:00
f09537a3f5 Update src/components/sections/feature/FeatureCardOne.tsx 2026-03-11 20:08:24 +00:00
26057e5e7e Update src/components/sections/feature/FeatureCardMedia.tsx 2026-03-11 20:08:24 +00:00
197264d5c3 Update src/components/sections/feature/FeatureBento.tsx 2026-03-11 20:08:23 +00:00
5065544cf4 Update src/components/sections/contact/ContactFaq.tsx 2026-03-11 20:08:23 +00:00
3bef360c37 Update src/components/sections/blog/BlogCardTwo.tsx 2026-03-11 20:08:22 +00:00
c7e3a8b59c Update src/components/sections/blog/BlogCardThree.tsx 2026-03-11 20:08:22 +00:00
d394b9770f Update src/components/sections/blog/BlogCardOne.tsx 2026-03-11 20:08:21 +00:00
d956968cd6 Update src/components/cardStack/layouts/timelines/TimelineProcessFlow.tsx 2026-03-11 20:08:21 +00:00
db619221f4 Update src/components/cardStack/layouts/timelines/TimelinePhoneView.tsx 2026-03-11 20:08:21 +00:00
7d1e112bfc Update src/components/cardStack/layouts/grid/GridLayout.tsx 2026-03-11 20:08:20 +00:00
1ffbd9d947 Update src/components/cardStack/layouts/carousels/ButtonCarousel.tsx 2026-03-11 20:08:20 +00:00
f68764e8e9 Update src/components/cardStack/layouts/carousels/AutoCarousel.tsx 2026-03-11 20:08:19 +00:00
70f7b66643 Update src/components/cardStack/CardList.tsx 2026-03-11 20:08:19 +00:00
e4ac34cd21 Update src/app/page.tsx 2026-03-11 20:03:59 +00:00
7fc4be4e19 Update src/app/page.tsx 2026-03-11 20:01:43 +00:00
7cb719eca2 Switch to version 1: remove src/lib/storage/workoutStorage.ts 2026-03-11 19:59:57 +00:00
cb1a71864b Switch to version 1: remove src/hooks/useWorkoutStorage.ts 2026-03-11 19:59:56 +00:00
0ce139e2d4 Switch to version 1: remove src/components/sections/product/ProductCardOneWithSaving.tsx 2026-03-11 19:59:56 +00:00
303cacf268 Switch to version 1: remove src/components/sections/pricing/PricingCardOneWithSaving.tsx 2026-03-11 19:59:56 +00:00
b2aab29924 Switch to version 1: remove src/components/sections/metrics/MetricCardFourteenWithSaving.tsx 2026-03-11 19:59:55 +00:00
835d0e5229 Switch to version 1: remove src/components/sections/feature/FeatureCardTwentyFiveWithSaving.tsx 2026-03-11 19:59:55 +00:00
042dd6a39b Switch to version 1: remove src/app/signup/page.tsx 2026-03-11 19:59:54 +00:00
9389d1469c Switch to version 1: remove src/app/login/page.tsx 2026-03-11 19:59:54 +00:00
642c2dc24c Switch to version 1: modified src/app/page.tsx 2026-03-11 19:59:53 +00:00
3f92566997 Update src/app/page.tsx 2026-03-11 19:59:28 +00:00
285049550b Merge version_5 into main
Merge version_5 into main
2026-03-11 19:57:45 +00:00
1098188c38 Update src/app/page.tsx 2026-03-11 19:57:41 +00:00
2e2a169c0e Merge version_5 into main
Merge version_5 into main
2026-03-11 19:57:20 +00:00
060164bb91 Merge version_2 into main
Merge version_2 into main
2026-03-11 19:57:08 +00:00
f5bdcdd234 Update src/components/sections/product/ProductCardOneWithSaving.tsx 2026-03-11 19:57:04 +00:00
e96e06a541 Update src/components/sections/pricing/PricingCardOneWithSaving.tsx 2026-03-11 19:57:03 +00:00
59b51e581d Update src/components/sections/feature/FeatureCardTwentyFiveWithSaving.tsx 2026-03-11 19:57:03 +00:00
bb62b2d351 Update src/app/page.tsx 2026-03-11 19:57:02 +00:00
76951b2686 Update src/app/page.tsx 2026-03-11 19:55:46 +00:00
522e7b9cce Merge version_2 into main
Merge version_2 into main
2026-03-11 19:55:44 +00:00
08e661b373 Add src/lib/storage/workoutStorage.ts 2026-03-11 19:55:34 +00:00
98d6e6d1d9 Add src/hooks/useWorkoutStorage.ts 2026-03-11 19:55:34 +00:00
d8131a0dad Add src/components/sections/product/ProductCardOneWithSaving.tsx 2026-03-11 19:55:33 +00:00
eb73d10795 Add src/components/sections/pricing/PricingCardOneWithSaving.tsx 2026-03-11 19:55:33 +00:00
d47e9def4f Add src/components/sections/metrics/MetricCardFourteenWithSaving.tsx 2026-03-11 19:55:33 +00:00
22c2f4a8be Add src/components/sections/feature/FeatureCardTwentyFiveWithSaving.tsx 2026-03-11 19:55:32 +00:00
da429db8e2 Add src/app/signup/page.tsx 2026-03-11 19:55:32 +00:00
96ecf3d875 Update src/app/page.tsx 2026-03-11 19:55:31 +00:00
4e33aad76d Add src/app/login/page.tsx 2026-03-11 19:55:31 +00:00
02d210a684 Update src/lib/storage/workoutStorage.ts 2026-03-11 19:54:58 +00:00
2b040b39b7 Add src/hooks/useWorkoutStorage.ts 2026-03-11 19:54:57 +00:00
e05a1e869a Add src/components/sections/product/ProductCardOneWithSaving.tsx 2026-03-11 19:54:57 +00:00
3649146e1e Add src/components/sections/pricing/PricingCardOneWithSaving.tsx 2026-03-11 19:54:56 +00:00
c79bc5cf3c Add src/components/sections/metrics/MetricCardFourteenWithSaving.tsx 2026-03-11 19:54:55 +00:00
d328e3221c Add src/components/sections/feature/FeatureCardTwentyFiveWithSaving.tsx 2026-03-11 19:54:55 +00:00
531b1c297b Update src/app/signup/page.tsx 2026-03-11 19:54:54 +00:00
8ae1f717a3 Update src/app/page.tsx 2026-03-11 19:54:53 +00:00
a48de5fed2 Update src/app/login/page.tsx 2026-03-11 19:54:53 +00:00
9f6d8f6534 Switch to version 1: remove src/app/signup/page.tsx 2026-03-11 19:53:14 +00:00
81364f26e1 Switch to version 1: remove src/app/login/page.tsx 2026-03-11 19:53:14 +00:00
a134d194ba Switch to version 1: remove src/app/lib/storage/workoutStorage.ts 2026-03-11 19:53:14 +00:00
5f41fe61eb Switch to version 1: remove src/app/hooks/useWorkoutTracking.ts 2026-03-11 19:53:13 +00:00
e7035f4734 Switch to version 1: remove src/app/components/WorkoutDataIntegration.tsx 2026-03-11 19:53:13 +00:00
c84844aaf3 Switch to version 1: modified src/app/page.tsx 2026-03-11 19:53:13 +00:00
289c7da1c4 Merge version_2 into main
Merge version_2 into main
2026-03-11 19:50:28 +00:00
0b5e289aa5 Update src/app/page.tsx 2026-03-11 19:49:16 +00:00
40357c2c40 Update src/app/page.tsx 2026-03-11 19:47:42 +00:00
3180013673 Update src/app/signup/page.tsx 2026-03-11 19:44:57 +00:00
093309937b Update src/app/page.tsx 2026-03-11 19:44:57 +00:00
308dee7afe Update src/app/login/page.tsx 2026-03-11 19:44:56 +00:00
f9e55abdf0 Add src/app/lib/storage/workoutStorage.ts 2026-03-11 19:44:56 +00:00
88623e3b9b Add src/app/hooks/useWorkoutTracking.ts 2026-03-11 19:44:55 +00:00
d0afbe9b1f Add src/app/components/WorkoutDataIntegration.tsx 2026-03-11 19:44:55 +00:00
38 changed files with 4053 additions and 4312 deletions

View File

@@ -0,0 +1,61 @@
import { NextRequest, NextResponse } from "next/server";
import bcrypt from "bcryptjs";
import jwt from "jsonwebtoken";
const JWT_SECRET = process.env.JWT_SECRET || "your-secret-key-change-in-production";
// Mock database - in production, use a real database
const users: Array<{ id: string; name: string; email: string; passwordHash: string }> = [];
export async function POST(request: NextRequest) {
try {
const { email, password } = await request.json();
// Validation
if (!email || !password) {
return NextResponse.json(
{ message: "Email e senha são obrigatórios" },
{ status: 400 }
);
}
// Find user
const user = users.find((u) => u.email === email);
if (!user) {
return NextResponse.json(
{ message: "Email ou senha incorretos" },
{ status: 401 }
);
}
// Verify password
const isPasswordValid = await bcrypt.compare(password, user.passwordHash);
if (!isPasswordValid) {
return NextResponse.json(
{ message: "Email ou senha incorretos" },
{ status: 401 }
);
}
// Create JWT token
const token = jwt.sign(
{ id: user.id, email: user.email, name: user.name },
JWT_SECRET,
{ expiresIn: "7d" }
);
return NextResponse.json(
{
token,
user: { id: user.id, name: user.name, email: user.email },
},
{ status: 200 }
);
} catch (error) {
console.error("Login error:", error);
return NextResponse.json(
{ message: "Erro ao fazer login" },
{ status: 500 }
);
}
}

View File

@@ -0,0 +1,21 @@
import { NextRequest, NextResponse } from 'next/server';
export async function POST(request: NextRequest) {
try {
// Clear session/token
const response = NextResponse.json(
{ message: 'Logout successful' },
{ status: 200 }
);
// Clear auth cookie if used
response.cookies.delete('auth_token');
return response;
} catch (error) {
return NextResponse.json(
{ message: 'Logout failed' },
{ status: 500 }
);
}
}

View File

@@ -0,0 +1,67 @@
import { NextRequest, NextResponse } from "next/server";
import bcrypt from "bcryptjs";
import jwt from "jsonwebtoken";
const JWT_SECRET = process.env.JWT_SECRET || "your-secret-key-change-in-production";
// Mock database - in production, use a real database
const users: Array<{ id: string; name: string; email: string; passwordHash: string }> = [];
export async function POST(request: NextRequest) {
try {
const { name, email, password } = await request.json();
// Validation
if (!name || !email || !password) {
return NextResponse.json(
{ message: "Nome, email e senha são obrigatórios" },
{ status: 400 }
);
}
if (password.length < 8) {
return NextResponse.json(
{ message: "A senha deve ter pelo menos 8 caracteres" },
{ status: 400 }
);
}
// Check if user already exists
const existingUser = users.find((u) => u.email === email);
if (existingUser) {
return NextResponse.json(
{ message: "Este email já está registrado" },
{ status: 409 }
);
}
// Hash password
const passwordHash = await bcrypt.hash(password, 10);
// Create user
const userId = `user_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
const newUser = { id: userId, name, email, passwordHash };
users.push(newUser);
// Create JWT token
const token = jwt.sign(
{ id: userId, email, name },
JWT_SECRET,
{ expiresIn: "7d" }
);
return NextResponse.json(
{
token,
user: { id: userId, name, email },
},
{ status: 201 }
);
} catch (error) {
console.error("Register error:", error);
return NextResponse.json(
{ message: "Erro ao registrar usuário" },
{ status: 500 }
);
}
}

View File

@@ -0,0 +1,36 @@
import { NextRequest, NextResponse } from "next/server";
export async function GET(request: NextRequest) {
try {
const authHeader = request.headers.get("authorization");
if (!authHeader || !authHeader.startsWith("Bearer ")) {
return NextResponse.json(
{ message: "Token não fornecido" },
{ status: 401 }
);
}
const token = authHeader.substring(7);
// Validate token (in production, verify JWT signature)
if (token.length !== 64) {
return NextResponse.json(
{ message: "Token inválido" },
{ status: 401 }
);
}
return NextResponse.json(
{
valid: true,
message: "Sessão válida"},
{ status: 200 }
);
} catch (error) {
return NextResponse.json(
{ message: "Erro ao verificar sessão" },
{ status: 500 }
);
}
}

View File

@@ -0,0 +1,30 @@
import { NextRequest, NextResponse } from "next/server";
import jwt from "jsonwebtoken";
const JWT_SECRET = process.env.JWT_SECRET || "your-secret-key-change-in-production";
export async function GET(request: NextRequest) {
try {
const authHeader = request.headers.get("authorization");
if (!authHeader || !authHeader.startsWith("Bearer ")) {
return NextResponse.json(
{ message: "Token não fornecido" },
{ status: 401 }
);
}
const token = authHeader.substring(7);
const decoded = jwt.verify(token, JWT_SECRET) as any;
return NextResponse.json(
{ user: { id: decoded.id, email: decoded.email, name: decoded.name } },
{ status: 200 }
);
} catch (error) {
console.error("Verify error:", error);
return NextResponse.json(
{ message: "Token inválido ou expirado" },
{ status: 401 }
);
}
}

182
src/app/auth/login/page.tsx Normal file
View File

@@ -0,0 +1,182 @@
"use client";
import { useState } from "react";
import { useRouter } from "next/navigation";
import Link from "next/link";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import FooterBase from '@/components/sections/footer/FooterBase';
import { Mail, Lock, Eye, EyeOff } from 'lucide-react';
export default function LoginPage() {
const router = useRouter();
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [showPassword, setShowPassword] = useState(false);
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
const handleLogin = async (e: React.FormEvent) => {
e.preventDefault();
setError("");
setLoading(true);
try {
const response = await fetch("/api/auth/login", {
method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ email, password }),
});
if (!response.ok) {
const data = await response.json();
setError(data.message || "Falha ao fazer login");
return;
}
const data = await response.json();
localStorage.setItem("authToken", data.token);
localStorage.setItem("user", JSON.stringify(data.user));
router.push("/dashboard");
} catch (err) {
setError("Erro ao conectar ao servidor");
console.error(err);
} finally {
setLoading(false);
}
};
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "/dashboard" },
{ name: "Treino", id: "training" },
{ name: "Nutrição", id: "nutrition" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Registrar", href: "/auth/register" }}
brandName="FitFlow Pro"
/>
</div>
<div className="min-h-screen flex items-center justify-center px-4 py-20">
<div className="w-full max-w-md">
<div className="bg-card rounded-2xl p-8 shadow-lg">
<h1 className="text-3xl font-bold text-center mb-2">Entrar</h1>
<p className="text-center text-foreground/60 mb-8">Bem-vindo de volta ao FitFlow Pro</p>
{error && (
<div className="bg-red-500/10 border border-red-500 text-red-500 px-4 py-3 rounded-lg mb-6">
{error}
</div>
)}
<form onSubmit={handleLogin} className="space-y-6">
<div>
<label className="block text-sm font-medium mb-2">Email</label>
<div className="relative">
<Mail className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="seu.email@exemplo.com"
required
className="w-full pl-10 pr-4 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium mb-2">Senha</label>
<div className="relative">
<Lock className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
<input
type={showPassword ? "text" : "password"}
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="Digite sua senha"
required
className="w-full pl-10 pr-10 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="absolute right-3 top-3 text-foreground/40"
>
{showPassword ? (
<EyeOff className="w-5 h-5" />
) : (
<Eye className="w-5 h-5" />
)}
</button>
</div>
</div>
<button
type="submit"
disabled={loading}
className="w-full bg-primary-cta text-white py-3 rounded-lg font-semibold hover:opacity-90 disabled:opacity-50 transition"
>
{loading ? "Entrando..." : "Entrar"}
</button>
</form>
<p className="text-center mt-6 text-foreground/60">
Não tem conta?{" "}
<Link href="/auth/register" className="text-primary-cta font-semibold hover:underline">
Registre-se aqui
</Link>
</p>
</div>
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Produto", items: [
{ label: "Dashboard", href: "/dashboard" },
{ label: "Treino", href: "training" },
{ label: "Nutrição", href: "nutrition" },
{ label: "Cardio Hub", href: "cardio" }
]
},
{
title: "Comunidade", items: [
{ label: "Comunidade", href: "community" },
{ label: "Perfil", href: "profile" },
{ label: "Rankings", href: "rankings" },
{ label: "Blog", href: "blog" }
]
},
{
title: "Empresa", items: [
{ label: "Sobre", href: "about" },
{ label: "Contato", href: "contact" },
{ label: "Privacidade", href: "privacy" },
{ label: "Termos", href: "terms" }
]
}
]}
logoText="FitFlow Pro"
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
/>
</div>
</ThemeProvider>
);
}

317
src/app/auth/page.tsx Normal file
View File

@@ -0,0 +1,317 @@
"use client";
import { useState } from "react";
import { useRouter } from "next/navigation";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import FooterBase from '@/components/sections/footer/FooterBase';
import { Mail, Lock, Eye, EyeOff, LogIn, UserPlus } from 'lucide-react';
export default function AuthPage() {
const router = useRouter();
const [isLogin, setIsLogin] = useState(true);
const [showPassword, setShowPassword] = useState(false);
const [formData, setFormData] = useState({
email: '',
password: '',
confirmPassword: '',
name: ''
});
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const { name, value } = e.target;
setFormData(prev => ({
...prev,
[name]: value
}));
setError('');
};
const validateForm = () => {
if (!formData.email) {
setError('Email é obrigatório');
return false;
}
if (!formData.password) {
setError('Senha é obrigatória');
return false;
}
if (!isLogin) {
if (!formData.name) {
setError('Nome é obrigatório');
return false;
}
if (formData.password !== formData.confirmPassword) {
setError('As senhas não coincidem');
return false;
}
if (formData.password.length < 6) {
setError('Senha deve ter no mínimo 6 caracteres');
return false;
}
}
return true;
};
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (!validateForm()) {
return;
}
setLoading(true);
try {
const endpoint = isLogin ? '/api/auth/login' : '/api/auth/register';
const payload = isLogin
? { email: formData.email, password: formData.password }
: { name: formData.name, email: formData.email, password: formData.password };
const response = await fetch(endpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
});
const data = await response.json();
if (!response.ok) {
setError(data.message || 'Erro ao processar requisição');
setLoading(false);
return;
}
// Store token and user data
localStorage.setItem('token', data.token);
localStorage.setItem('user', JSON.stringify(data.user));
// Redirect to dashboard
router.push('/dashboard');
} catch (err) {
setError('Erro de conexão. Tente novamente.');
setLoading(false);
}
};
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "/dashboard" },
{ name: "Treino", id: "training" },
{ name: "Nutrição", id: "nutrition" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Começar Agora", href: "/auth" }}
brandName="FitFlow Pro"
/>
</div>
<div className="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
<div className="w-full max-w-md space-y-8">
{/* Header */}
<div className="text-center">
<h1 className="text-4xl font-extrabold text-foreground mb-2">
{isLogin ? 'Bem-vindo de Volta' : 'Crie sua Conta'}
</h1>
<p className="text-foreground/60">
{isLogin ? 'Acesse sua jornada de fitness' : 'Comece sua transformação hoje'}
</p>
</div>
{/* Form Card */}
<div className="bg-card rounded-2xl p-8 border border-background-accent shadow-lg">
{error && (
<div className="mb-6 p-4 bg-red-50 border border-red-200 rounded-lg">
<p className="text-red-700 text-sm font-medium">{error}</p>
</div>
)}
<form onSubmit={handleSubmit} className="space-y-6">
{/* Name field (Registration only) */}
{!isLogin && (
<div>
<label htmlFor="name" className="block text-sm font-medium text-foreground mb-2">
Nome Completo
</label>
<input
id="name"
name="name"
type="text"
value={formData.name}
onChange={handleInputChange}
className="w-full px-4 py-3 border border-background-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-cta bg-background text-foreground placeholder-foreground/40"
placeholder="Seu nome completo"
/>
</div>
)}
{/* Email field */}
<div>
<label htmlFor="email" className="block text-sm font-medium text-foreground mb-2">
Email
</label>
<div className="relative">
<Mail className="absolute left-4 top-3.5 h-5 w-5 text-foreground/40" />
<input
id="email"
name="email"
type="email"
value={formData.email}
onChange={handleInputChange}
className="w-full pl-12 pr-4 py-3 border border-background-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-cta bg-background text-foreground placeholder-foreground/40"
placeholder="seu.email@exemplo.com"
/>
</div>
</div>
{/* Password field */}
<div>
<label htmlFor="password" className="block text-sm font-medium text-foreground mb-2">
Senha
</label>
<div className="relative">
<Lock className="absolute left-4 top-3.5 h-5 w-5 text-foreground/40" />
<input
id="password"
name="password"
type={showPassword ? 'text' : 'password'}
value={formData.password}
onChange={handleInputChange}
className="w-full pl-12 pr-12 py-3 border border-background-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-cta bg-background text-foreground placeholder-foreground/40"
placeholder="Sua senha segura"
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="absolute right-4 top-3.5 text-foreground/40 hover:text-foreground"
>
{showPassword ? <EyeOff className="h-5 w-5" /> : <Eye className="h-5 w-5" />}
</button>
</div>
</div>
{/* Confirm Password field (Registration only) */}
{!isLogin && (
<div>
<label htmlFor="confirmPassword" className="block text-sm font-medium text-foreground mb-2">
Confirmar Senha
</label>
<div className="relative">
<Lock className="absolute left-4 top-3.5 h-5 w-5 text-foreground/40" />
<input
id="confirmPassword"
name="confirmPassword"
type={showPassword ? 'text' : 'password'}
value={formData.confirmPassword}
onChange={handleInputChange}
className="w-full pl-12 pr-12 py-3 border border-background-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-cta bg-background text-foreground placeholder-foreground/40"
placeholder="Confirme sua senha"
/>
</div>
</div>
)}
{/* Submit Button */}
<button
type="submit"
disabled={loading}
className="w-full py-3 px-4 bg-primary-cta text-background font-semibold rounded-lg hover:opacity-90 transition-opacity disabled:opacity-50 flex items-center justify-center gap-2"
>
{loading ? (
<>
<div className="w-4 h-4 border-2 border-background border-t-transparent rounded-full animate-spin" />
Processando...
</>
) : isLogin ? (
<>
<LogIn className="h-5 w-5" />
Entrar
</>
) : (
<>
<UserPlus className="h-5 w-5" />
Criar Conta
</>
)}
</button>
</form>
{/* Toggle Login/Register */}
<div className="mt-6 text-center">
<p className="text-foreground/60 text-sm">
{isLogin ? 'Não tem conta? ' : 'Já tem conta? '}
<button
onClick={() => {
setIsLogin(!isLogin);
setFormData({ email: '', password: '', confirmPassword: '', name: '' });
setError('');
}}
className="text-primary-cta font-semibold hover:underline"
>
{isLogin ? 'Criar conta' : 'Entrar'}
</button>
</p>
</div>
</div>
{/* Security Note */}
<p className="text-center text-xs text-foreground/40">
Seu email e senha estão protegidos com criptografia de ponta a ponta.
</p>
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Produto", items: [
{ label: "Dashboard", href: "dashboard" },
{ label: "Treino", href: "training" },
{ label: "Nutrição", href: "nutrition" },
{ label: "Cardio Hub", href: "cardio" }
]
},
{
title: "Comunidade", items: [
{ label: "Comunidade", href: "community" },
{ label: "Perfil", href: "profile" },
{ label: "Rankings", href: "rankings" },
{ label: "Blog", href: "blog" }
]
},
{
title: "Empresa", items: [
{ label: "Sobre", href: "about" },
{ label: "Contato", href: "contact" },
{ label: "Privacidade", href: "privacy" },
{ label: "Termos", href: "terms" }
]
}
]}
logoText="FitFlow Pro"
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
/>
</div>
</ThemeProvider>
);
}

View File

@@ -0,0 +1,267 @@
"use client";
import { useState } from "react";
import { useRouter } from "next/navigation";
import Link from "next/link";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import FooterBase from '@/components/sections/footer/FooterBase';
import { Mail, Lock, User, Eye, EyeOff, Check } from 'lucide-react';
export default function RegisterPage() {
const router = useRouter();
const [formData, setFormData] = useState({
name: "", email: "", password: "", confirmPassword: ""});
const [showPassword, setShowPassword] = useState(false);
const [showConfirm, setShowConfirm] = useState(false);
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
const [agreedToTerms, setAgreedToTerms] = useState(false);
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const { name, value } = e.target;
setFormData((prev) => ({ ...prev, [name]: value }));
};
const handleRegister = async (e: React.FormEvent) => {
e.preventDefault();
setError("");
if (!agreedToTerms) {
setError("Você deve concordar com os Termos e Condições");
return;
}
if (formData.password !== formData.confirmPassword) {
setError("As senhas não conferem");
return;
}
if (formData.password.length < 8) {
setError("A senha deve ter pelo menos 8 caracteres");
return;
}
setLoading(true);
try {
const response = await fetch("/api/auth/register", {
method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: formData.name,
email: formData.email,
password: formData.password,
}),
});
if (!response.ok) {
const data = await response.json();
setError(data.message || "Falha ao registrar");
return;
}
const data = await response.json();
localStorage.setItem("authToken", data.token);
localStorage.setItem("user", JSON.stringify(data.user));
router.push("/dashboard");
} catch (err) {
setError("Erro ao conectar ao servidor");
console.error(err);
} finally {
setLoading(false);
}
};
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "/dashboard" },
{ name: "Treino", id: "training" },
{ name: "Nutrição", id: "nutrition" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Entrar", href: "/auth/login" }}
brandName="FitFlow Pro"
/>
</div>
<div className="min-h-screen flex items-center justify-center px-4 py-20">
<div className="w-full max-w-md">
<div className="bg-card rounded-2xl p-8 shadow-lg">
<h1 className="text-3xl font-bold text-center mb-2">Registre-se</h1>
<p className="text-center text-foreground/60 mb-8">Comece sua transformação com FitFlow Pro</p>
{error && (
<div className="bg-red-500/10 border border-red-500 text-red-500 px-4 py-3 rounded-lg mb-6">
{error}
</div>
)}
<form onSubmit={handleRegister} className="space-y-6">
<div>
<label className="block text-sm font-medium mb-2">Nome Completo</label>
<div className="relative">
<User className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
<input
type="text"
name="name"
value={formData.name}
onChange={handleChange}
placeholder="Seu nome completo"
required
className="w-full pl-10 pr-4 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium mb-2">Email</label>
<div className="relative">
<Mail className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
<input
type="email"
name="email"
value={formData.email}
onChange={handleChange}
placeholder="seu.email@exemplo.com"
required
className="w-full pl-10 pr-4 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium mb-2">Senha</label>
<div className="relative">
<Lock className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
<input
type={showPassword ? "text" : "password"}
name="password"
value={formData.password}
onChange={handleChange}
placeholder="Mínimo 8 caracteres"
required
className="w-full pl-10 pr-10 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="absolute right-3 top-3 text-foreground/40"
>
{showPassword ? (
<EyeOff className="w-5 h-5" />
) : (
<Eye className="w-5 h-5" />
)}
</button>
</div>
</div>
<div>
<label className="block text-sm font-medium mb-2">Confirmar Senha</label>
<div className="relative">
<Lock className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
<input
type={showConfirm ? "text" : "password"}
name="confirmPassword"
value={formData.confirmPassword}
onChange={handleChange}
placeholder="Confirme sua senha"
required
className="w-full pl-10 pr-10 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
/>
<button
type="button"
onClick={() => setShowConfirm(!showConfirm)}
className="absolute right-3 top-3 text-foreground/40"
>
{showConfirm ? (
<EyeOff className="w-5 h-5" />
) : (
<Eye className="w-5 h-5" />
)}
</button>
</div>
</div>
<div className="flex items-start space-x-3">
<input
type="checkbox"
id="terms"
checked={agreedToTerms}
onChange={(e) => setAgreedToTerms(e.target.checked)}
className="mt-1 w-5 h-5 rounded cursor-pointer"
/>
<label htmlFor="terms" className="text-sm text-foreground/60 cursor-pointer">
Concordo com os <Link href="/terms" className="text-primary-cta hover:underline">Termos e Condições</Link> e a <Link href="/privacy" className="text-primary-cta hover:underline">Política de Privacidade</Link>
</label>
</div>
<button
type="submit"
disabled={loading}
className="w-full bg-primary-cta text-white py-3 rounded-lg font-semibold hover:opacity-90 disabled:opacity-50 transition"
>
{loading ? "Registrando..." : "Criar Conta"}
</button>
</form>
<p className="text-center mt-6 text-foreground/60">
tem uma conta?{" "}
<Link href="/auth/login" className="text-primary-cta font-semibold hover:underline">
Faça login aqui
</Link>
</p>
</div>
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Produto", items: [
{ label: "Dashboard", href: "/dashboard" },
{ label: "Treino", href: "training" },
{ label: "Nutrição", href: "nutrition" },
{ label: "Cardio Hub", href: "cardio" }
]
},
{
title: "Comunidade", items: [
{ label: "Comunidade", href: "community" },
{ label: "Perfil", href: "profile" },
{ label: "Rankings", href: "rankings" },
{ label: "Blog", href: "blog" }
]
},
{
title: "Empresa", items: [
{ label: "Sobre", href: "about" },
{ label: "Contato", href: "contact" },
{ label: "Privacidade", href: "privacy" },
{ label: "Termos", href: "terms" }
]
}
]}
logoText="FitFlow Pro"
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
/>
</div>
</ThemeProvider>
);
}

View File

@@ -1,64 +0,0 @@
'use client';
import React, { useCallback } from 'react';
import { useWorkoutTracking } from '@/app/hooks/useWorkoutTracking';
import { WorkoutSession, CardioSession, NutritionLog } from '@/app/lib/storage/workoutStorage';
export interface WorkoutDataIntegrationProps {
onSave?: (data: any) => void;
autoSave?: boolean;
}
/**
* WorkoutDataIntegration component that provides workout tracking context
* Use this component to wrap sections that need to save workout data
*/
export const WorkoutDataIntegration: React.FC<{
children: React.ReactNode;
} & WorkoutDataIntegrationProps> = ({ children, onSave, autoSave = true }) => {
const { metrics, addWorkoutSession, addCardioSession, addNutritionLog, refreshMetrics } =
useWorkoutTracking();
const handleWorkoutSave = useCallback(
(session: WorkoutSession) => {
addWorkoutSession(session);
if (onSave) onSave({ type: 'workout', data: session });
},
[addWorkoutSession, onSave]
);
const handleCardioSave = useCallback(
(session: CardioSession) => {
addCardioSession(session);
if (onSave) onSave({ type: 'cardio', data: session });
},
[addCardioSession, onSave]
);
const handleNutritionSave = useCallback(
(log: NutritionLog) => {
addNutritionLog(log);
if (onSave) onSave({ type: 'nutrition', data: log });
},
[addNutritionLog, onSave]
);
// Expose save functions via context or props
const contextValue = {
metrics,
handleWorkoutSave,
handleCardioSave,
handleNutritionSave,
refreshMetrics,
autoSave,
};
// Clone children and pass context data as props
return (
<div data-workout-integration="true" data-context={JSON.stringify(contextValue)}>
{children}
</div>
);
};
export default WorkoutDataIntegration;

244
src/app/dashboard/page.tsx Normal file
View File

@@ -0,0 +1,244 @@
"use client";
import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import FooterBase from '@/components/sections/footer/FooterBase';
import { LogOut, User, Mail, Zap } from 'lucide-react';
interface UserData {
id: string;
name: string;
email: string;
}
export default function DashboardPage() {
const router = useRouter();
const [user, setUser] = useState<UserData | null>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState("");
useEffect(() => {
const checkAuth = async () => {
const token = localStorage.getItem("authToken");
const userData = localStorage.getItem("user");
if (!token || !userData) {
router.push("/auth/login");
return;
}
try {
const response = await fetch("/api/auth/verify", {
headers: { Authorization: `Bearer ${token}` },
});
if (!response.ok) {
localStorage.removeItem("authToken");
localStorage.removeItem("user");
router.push("/auth/login");
return;
}
setUser(JSON.parse(userData));
} catch (err) {
setError("Erro ao verificar sessão");
console.error(err);
} finally {
setLoading(false);
}
};
checkAuth();
}, [router]);
const handleLogout = () => {
localStorage.removeItem("authToken");
localStorage.removeItem("user");
router.push("/");
};
if (loading) {
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div className="min-h-screen flex items-center justify-center">
<div className="text-center">
<div className="inline-block animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary-cta"></div>
<p className="mt-4 text-foreground/60">Carregando...</p>
</div>
</div>
</ThemeProvider>
);
}
if (error) {
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div className="min-h-screen flex items-center justify-center">
<div className="text-center">
<p className="text-red-500">{error}</p>
</div>
</div>
</ThemeProvider>
);
}
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "/dashboard" },
{ name: "Treino", id: "training" },
{ name: "Nutrição", id: "nutrition" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Sair", href: "/" }}
brandName="FitFlow Pro"
/>
</div>
<div className="min-h-screen px-4 py-20">
<div className="max-w-4xl mx-auto">
<h1 className="text-4xl font-bold mb-8">Dashboard</h1>
{user && (
<div className="grid gap-6">
<div className="bg-card rounded-2xl p-8 shadow-lg border border-foreground/10">
<h2 className="text-2xl font-bold mb-6">Bem-vindo, {user.name}!</h2>
<div className="grid md:grid-cols-2 gap-8">
<div className="space-y-4">
<div className="flex items-center space-x-3">
<User className="w-6 h-6 text-primary-cta" />
<div>
<p className="text-sm text-foreground/60">Nome</p>
<p className="font-semibold">{user.name}</p>
</div>
</div>
<div className="flex items-center space-x-3">
<Mail className="w-6 h-6 text-primary-cta" />
<div>
<p className="text-sm text-foreground/60">Email</p>
<p className="font-semibold">{user.email}</p>
</div>
</div>
</div>
<div className="space-y-4">
<div className="bg-background rounded-lg p-4">
<p className="text-sm text-foreground/60 mb-2">Status da Sessão</p>
<div className="flex items-center space-x-2">
<div className="w-3 h-3 bg-green-500 rounded-full animate-pulse"></div>
<p className="font-semibold text-green-500">Conectado</p>
</div>
</div>
</div>
</div>
</div>
<div className="grid md:grid-cols-3 gap-6">
<div className="bg-gradient-to-br from-primary-cta/20 to-accent/20 rounded-2xl p-6 border border-primary-cta/20">
<Zap className="w-8 h-8 text-primary-cta mb-2" />
<h3 className="text-lg font-semibold mb-1">Treinos</h3>
<p className="text-3xl font-bold text-primary-cta">0</p>
<p className="text-sm text-foreground/60 mt-2">Treinos concluídos</p>
</div>
<div className="bg-gradient-to-br from-accent/20 to-secondary-cta/20 rounded-2xl p-6 border border-accent/20">
<Zap className="w-8 h-8 text-accent mb-2" />
<h3 className="text-lg font-semibold mb-1">Nutrição</h3>
<p className="text-3xl font-bold text-accent">0</p>
<p className="text-sm text-foreground/60 mt-2">Refeições rastreadas</p>
</div>
<div className="bg-gradient-to-br from-secondary-cta/20 to-primary-cta/20 rounded-2xl p-6 border border-secondary-cta/20">
<Zap className="w-8 h-8 text-secondary-cta mb-2" />
<h3 className="text-lg font-semibold mb-1">Cardio</h3>
<p className="text-3xl font-bold text-secondary-cta">0 km</p>
<p className="text-sm text-foreground/60 mt-2">Distância total</p>
</div>
</div>
<button
onClick={handleLogout}
className="w-full bg-red-500 hover:bg-red-600 text-white py-3 rounded-lg font-semibold transition flex items-center justify-center space-x-2"
>
<LogOut className="w-5 h-5" />
<span>Sair da Conta</span>
</button>
</div>
)}
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Produto", items: [
{ label: "Dashboard", href: "/dashboard" },
{ label: "Treino", href: "training" },
{ label: "Nutrição", href: "nutrition" },
{ label: "Cardio Hub", href: "cardio" }
]
},
{
title: "Comunidade", items: [
{ label: "Comunidade", href: "community" },
{ label: "Perfil", href: "profile" },
{ label: "Rankings", href: "rankings" },
{ label: "Blog", href: "blog" }
]
},
{
title: "Empresa", items: [
{ label: "Sobre", href: "about" },
{ label: "Contato", href: "contact" },
{ label: "Privacidade", href: "privacy" },
{ label: "Termos", href: "terms" }
]
}
]}
logoText="FitFlow Pro"
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
/>
</div>
</ThemeProvider>
);
}

View File

@@ -1,56 +0,0 @@
'use client';
import { useState, useCallback } from 'react';
import {
saveWorkoutSession,
saveCardioSession,
saveNutritionLog,
getUserMetrics,
getWorkoutSessions,
getCardioSessions,
getNutritionLogs,
WorkoutSession,
CardioSession,
NutritionLog,
UserMetrics,
} from '@/app/lib/storage/workoutStorage';
export const useWorkoutTracking = () => {
const [metrics, setMetrics] = useState<UserMetrics>(getUserMetrics());
const [workouts, setWorkouts] = useState<WorkoutSession[]>(getWorkoutSessions());
const [cardioSessions, setCardioSessions] = useState<CardioSession[]>(getCardioSessions());
const [nutritionLogs, setNutritionLogs] = useState<NutritionLog[]>(getNutritionLogs());
const addWorkoutSession = useCallback((session: WorkoutSession) => {
saveWorkoutSession(session);
setWorkouts(getWorkoutSessions());
setMetrics(getUserMetrics());
}, []);
const addCardioSession = useCallback((session: CardioSession) => {
saveCardioSession(session);
setCardioSessions(getCardioSessions());
setMetrics(getUserMetrics());
}, []);
const addNutritionLog = useCallback((log: NutritionLog) => {
saveNutritionLog(log);
setNutritionLogs(getNutritionLogs());
setMetrics(getUserMetrics());
}, []);
const refreshMetrics = useCallback(() => {
setMetrics(getUserMetrics());
}, []);
return {
metrics,
workouts,
cardioSessions,
nutritionLogs,
addWorkoutSession,
addCardioSession,
addNutritionLog,
refreshMetrics,
};
};

View File

@@ -1,309 +0,0 @@
/**
* Workout and metrics data persistence layer
* Handles saving and retrieving workout data from localStorage
*/
export interface WorkoutSet {
reps: number;
weight: number;
timestamp: number;
}
export interface WorkoutSession {
id: string;
exerciseName: string;
date: string;
sets: WorkoutSet[];
duration: number; // in seconds
caloriesBurned: number;
notes?: string;
}
export interface CardioSession {
id: string;
type: 'running' | 'walking' | 'cycling';
date: string;
distance: number; // in km
duration: number; // in seconds
caloriesBurned: number;
pace: number; // km/h
steps?: number;
route?: string;
}
export interface NutritionLog {
id: string;
date: string;
calories: number;
protein: number;
carbs: number;
fats: number;
meals: string[];
}
export interface UserMetrics {
totalWorkouts: number;
totalCardioDistance: number;
totalCaloriesBurned: number;
currentStreak: number;
personalRecords: Record<string, number>;
lastUpdated: number;
}
const STORAGE_KEYS = {
WORKOUT_SESSIONS: 'fitflow_workout_sessions',
CARDIO_SESSIONS: 'fitflow_cardio_sessions',
NUTRITION_LOGS: 'fitflow_nutrition_logs',
USER_METRICS: 'fitflow_user_metrics',
};
/**
* Save a workout session to localStorage
*/
export const saveWorkoutSession = (session: WorkoutSession): void => {
if (typeof window === 'undefined') return;
try {
const sessions = getWorkoutSessions();
sessions.push(session);
localStorage.setItem(STORAGE_KEYS.WORKOUT_SESSIONS, JSON.stringify(sessions));
updateUserMetrics();
} catch (error) {
console.error('Error saving workout session:', error);
}
};
/**
* Get all workout sessions from localStorage
*/
export const getWorkoutSessions = (): WorkoutSession[] => {
if (typeof window === 'undefined') return [];
try {
const data = localStorage.getItem(STORAGE_KEYS.WORKOUT_SESSIONS);
return data ? JSON.parse(data) : [];
} catch (error) {
console.error('Error retrieving workout sessions:', error);
return [];
}
};
/**
* Save a cardio session to localStorage
*/
export const saveCardioSession = (session: CardioSession): void => {
if (typeof window === 'undefined') return;
try {
const sessions = getCardioSessions();
sessions.push(session);
localStorage.setItem(STORAGE_KEYS.CARDIO_SESSIONS, JSON.stringify(sessions));
updateUserMetrics();
} catch (error) {
console.error('Error saving cardio session:', error);
}
};
/**
* Get all cardio sessions from localStorage
*/
export const getCardioSessions = (): CardioSession[] => {
if (typeof window === 'undefined') return [];
try {
const data = localStorage.getItem(STORAGE_KEYS.CARDIO_SESSIONS);
return data ? JSON.parse(data) : [];
} catch (error) {
console.error('Error retrieving cardio sessions:', error);
return [];
}
};
/**
* Save a nutrition log to localStorage
*/
export const saveNutritionLog = (log: NutritionLog): void => {
if (typeof window === 'undefined') return;
try {
const logs = getNutritionLogs();
logs.push(log);
localStorage.setItem(STORAGE_KEYS.NUTRITION_LOGS, JSON.stringify(logs));
updateUserMetrics();
} catch (error) {
console.error('Error saving nutrition log:', error);
}
};
/**
* Get all nutrition logs from localStorage
*/
export const getNutritionLogs = (): NutritionLog[] => {
if (typeof window === 'undefined') return [];
try {
const data = localStorage.getItem(STORAGE_KEYS.NUTRITION_LOGS);
return data ? JSON.parse(data) : [];
} catch (error) {
console.error('Error retrieving nutrition logs:', error);
return [];
}
};
/**
* Get user metrics from localStorage
*/
export const getUserMetrics = (): UserMetrics => {
if (typeof window === 'undefined') {
return {
totalWorkouts: 0,
totalCardioDistance: 0,
totalCaloriesBurned: 0,
currentStreak: 0,
personalRecords: {},
lastUpdated: Date.now(),
};
}
try {
const data = localStorage.getItem(STORAGE_KEYS.USER_METRICS);
return data
? JSON.parse(data)
: {
totalWorkouts: 0,
totalCardioDistance: 0,
totalCaloriesBurned: 0,
currentStreak: 0,
personalRecords: {},
lastUpdated: Date.now(),
};
} catch (error) {
console.error('Error retrieving user metrics:', error);
return {
totalWorkouts: 0,
totalCardioDistance: 0,
totalCaloriesBurned: 0,
currentStreak: 0,
personalRecords: {},
lastUpdated: Date.now(),
};
}
};
/**
* Update user metrics based on saved sessions
*/
export const updateUserMetrics = (): void => {
if (typeof window === 'undefined') return;
try {
const workoutSessions = getWorkoutSessions();
const cardioSessions = getCardioSessions();
const nutritionLogs = getNutritionLogs();
let totalWorkouts = workoutSessions.length;
let totalCardioDistance = cardioSessions.reduce((sum, session) => sum + session.distance, 0);
let totalCaloriesBurned = workoutSessions.reduce((sum, session) => sum + session.caloriesBurned, 0)
+ cardioSessions.reduce((sum, session) => sum + session.caloriesBurned, 0);
// Calculate streak (consecutive days with activity)
const currentStreak = calculateStreak([...workoutSessions, ...cardioSessions]);
// Extract personal records from workouts
const personalRecords: Record<string, number> = {};
workoutSessions.forEach((session) => {
const maxWeight = Math.max(...session.sets.map((s) => s.weight));
const key = `${session.exerciseName}_pr`;
if (!personalRecords[key] || maxWeight > personalRecords[key]) {
personalRecords[key] = maxWeight;
}
});
const metrics: UserMetrics = {
totalWorkouts,
totalCardioDistance,
totalCaloriesBurned,
currentStreak,
personalRecords,
lastUpdated: Date.now(),
};
localStorage.setItem(STORAGE_KEYS.USER_METRICS, JSON.stringify(metrics));
} catch (error) {
console.error('Error updating user metrics:', error);
}
};
/**
* Calculate consecutive days with activity
*/
const calculateStreak = (sessions: Array<WorkoutSession | CardioSession>): number => {
if (sessions.length === 0) return 0;
const dates = sessions.map((session) => new Date(session.date).toDateString()).filter((date, index, self) => self.indexOf(date) === index).sort((a, b) => new Date(b).getTime() - new Date(a).getTime());
let streak = 1;
for (let i = 1; i < dates.length; i++) {
const currentDate = new Date(dates[i]);
const previousDate = new Date(dates[i - 1]);
const diffTime = Math.abs(previousDate.getTime() - currentDate.getTime());
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
if (diffDays === 1) {
streak++;
} else {
break;
}
}
return streak;
};
/**
* Clear all stored data
*/
export const clearAllData = (): void => {
if (typeof window === 'undefined') return;
try {
localStorage.removeItem(STORAGE_KEYS.WORKOUT_SESSIONS);
localStorage.removeItem(STORAGE_KEYS.CARDIO_SESSIONS);
localStorage.removeItem(STORAGE_KEYS.NUTRITION_LOGS);
localStorage.removeItem(STORAGE_KEYS.USER_METRICS);
} catch (error) {
console.error('Error clearing data:', error);
}
};
/**
* Export data as JSON for backup
*/
export const exportData = (): string => {
const data = {
workouts: getWorkoutSessions(),
cardio: getCardioSessions(),
nutrition: getNutritionLogs(),
metrics: getUserMetrics(),
exportDate: new Date().toISOString(),
};
return JSON.stringify(data, null, 2);
};
/**
* Import data from JSON backup
*/
export const importData = (jsonData: string): boolean => {
if (typeof window === 'undefined') return false;
try {
const data = JSON.parse(jsonData);
if (data.workouts) localStorage.setItem(STORAGE_KEYS.WORKOUT_SESSIONS, JSON.stringify(data.workouts));
if (data.cardio) localStorage.setItem(STORAGE_KEYS.CARDIO_SESSIONS, JSON.stringify(data.cardio));
if (data.nutrition) localStorage.setItem(STORAGE_KEYS.NUTRITION_LOGS, JSON.stringify(data.nutrition));
if (data.metrics) localStorage.setItem(STORAGE_KEYS.USER_METRICS, JSON.stringify(data.metrics));
return true;
} catch (error) {
console.error('Error importing data:', error);
return false;
}
};

View File

@@ -1,47 +1,70 @@
"use client";
import { useState } from "react";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import { useState } from "react";
import { Eye, EyeOff, Mail, Lock } from 'lucide-react';
import Input from '@/components/form/Input';
import ContactSplit from '@/components/sections/contact/ContactSplit';
import FooterBase from '@/components/sections/footer/FooterBase';
import { Mail, Lock } from 'lucide-react';
export default function LoginPage() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [showPassword, setShowPassword] = useState(false);
const [errors, setErrors] = useState<{ email?: string; password?: string }>({});
const [isSubmitted, setIsSubmitted] = useState(false);
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
const validateForm = () => {
const newErrors: { email?: string; password?: string } = {};
if (!email) {
newErrors.email = "Email é obrigatório";
} else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
newErrors.email = "Email inválido";
}
if (!password) {
newErrors.password = "Senha é obrigatória";
} else if (password.length < 6) {
newErrors.password = "Senha deve ter no mínimo 6 caracteres";
}
return newErrors;
};
const handleSubmit = (e: React.FormEvent) => {
const handleLogin = async (e: React.FormEvent) => {
e.preventDefault();
const newErrors = validateForm();
setErrors(newErrors);
if (Object.keys(newErrors).length === 0) {
setIsSubmitted(true);
console.log("Login attempt:", { email, password });
setTimeout(() => {
setIsSubmitted(false);
}, 2000);
setError("");
setLoading(true);
try {
// Validate inputs
if (!email || !password) {
setError("Por favor, preencha todos os campos.");
setLoading(false);
return;
}
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
setError("Por favor, insira um email válido.");
setLoading(false);
return;
}
if (password.length < 6) {
setError("A senha deve ter pelo menos 6 caracteres.");
setLoading(false);
return;
}
// Call login API
const response = await fetch("/api/auth/login", {
method: "POST", headers: {
"Content-Type": "application/json"},
body: JSON.stringify({ email, password }),
});
const data = await response.json();
if (!response.ok) {
setError(data.message || "Erro ao fazer login. Tente novamente.");
setLoading(false);
return;
}
// Store user session
localStorage.setItem("userSession", JSON.stringify({
token: data.token,
user: data.user,
expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
}));
// Redirect to dashboard
window.location.href = "/dashboard";
} catch (err) {
setError("Erro de conexão. Tente novamente mais tarde.");
setLoading(false);
}
};
@@ -61,100 +84,123 @@ export default function LoginPage() {
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "/" },
{ name: "Dashboard", id: "/dashboard" },
{ name: "Treino", id: "training" },
{ name: "Nutrição", id: "nutrition" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Começar Agora", href: "/signup" }}
button={{ text: "Começar Agora", href: "contact" }}
brandName="FitFlow Pro"
/>
</div>
<div className="min-h-[calc(100vh-80px)] flex items-center justify-center py-12 px-4">
<div id="login" data-section="login" className="min-h-screen flex items-center justify-center py-20 px-4">
<div className="w-full max-w-md">
<div className="bg-card rounded-3xl shadow-lg p-8 border border-accent/10">
<div className="mb-8">
<h1 className="text-3xl font-extrabold text-foreground mb-2">Bem-vindo de Volta</h1>
<p className="text-foreground/70">Faça login para acessar seu progresso</p>
</div>
<div className="rounded-2xl border border-primary-cta/20 bg-card p-8 shadow-lg">
<h1 className="text-3xl font-bold text-foreground mb-2">Bem-vindo de Volta</h1>
<p className="text-foreground/60 mb-8">Faça login em sua conta FitFlow Pro</p>
<form onSubmit={handleSubmit} className="space-y-6">
{error && (
<div className="mb-6 p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-600 text-sm">
{error}
</div>
)}
<form onSubmit={handleLogin} className="space-y-5">
<div>
<label className="block text-sm font-medium text-foreground mb-2">
<div className="flex items-center gap-2">
<Mail size={16} />
Email
</div>
Email
</label>
<Input
value={email}
onChange={setEmail}
type="email"
placeholder="seu@email.com"
required
className={errors.email ? "border-red-500" : ""}
/>
{errors.email && (
<p className="text-red-500 text-sm mt-1">{errors.email}</p>
)}
<div className="relative">
<Mail className="absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-foreground/40" />
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="seu.email@exemplo.com"
className="w-full pl-10 pr-4 py-2 rounded-lg border border-foreground/10 bg-background focus:outline-none focus:border-primary-cta/50 text-foreground placeholder-foreground/40 transition"
disabled={loading}
/>
</div>
</div>
<div>
<label className="block text-sm font-medium text-foreground mb-2">
<div className="flex items-center gap-2">
<Lock size={16} />
Senha
</div>
Senha
</label>
<div className="relative">
<Input
<Lock className="absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-foreground/40" />
<input
type="password"
value={password}
onChange={setPassword}
type={showPassword ? "text" : "password"}
onChange={(e) => setPassword(e.target.value)}
placeholder="••••••••"
required
className={errors.password ? "border-red-500" : "pr-10"}
className="w-full pl-10 pr-4 py-2 rounded-lg border border-foreground/10 bg-background focus:outline-none focus:border-primary-cta/50 text-foreground placeholder-foreground/40 transition"
disabled={loading}
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2 text-foreground/50 hover:text-foreground transition-colors"
aria-label={showPassword ? "Ocultar senha" : "Mostrar senha"}
>
{showPassword ? <EyeOff size={18} /> : <Eye size={18} />}
</button>
</div>
{errors.password && (
<p className="text-red-500 text-sm mt-1">{errors.password}</p>
)}
</div>
<button
type="submit"
disabled={isSubmitted}
className="w-full py-3 px-4 bg-primary-cta hover:opacity-90 disabled:opacity-50 text-white font-semibold rounded-full transition-all duration-300 transform hover:scale-105"
disabled={loading}
className="w-full py-3 rounded-lg bg-primary-cta text-white font-medium hover:bg-primary-cta/90 transition disabled:opacity-50 disabled:cursor-not-allowed"
>
{isSubmitted ? "Entrando..." : "Entrar"}
{loading ? "Entrando..." : "Entrar"}
</button>
</form>
<div className="mt-6 text-center text-sm text-foreground/70">
<p>
Não tem conta?{" "}
<a href="/signup" className="text-primary-cta font-semibold hover:underline">
Criar conta
<div className="mt-6 text-center">
<p className="text-foreground/60 text-sm">
Não tem uma conta?{" "}
<a href="/signup" className="text-primary-cta hover:underline font-medium">
Cadastre-se aqui
</a>
</p>
</div>
<div className="mt-6 pt-6 border-t border-accent/10 text-center text-xs text-foreground/50">
<p>Teste gratuito por 30 dias. Sem cartão de crédito necessário.</p>
<div className="mt-6 text-center">
<a href="/" className="text-primary-cta hover:underline font-medium text-sm">
Voltar para Home
</a>
</div>
</div>
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Produto", items: [
{ label: "Dashboard", href: "dashboard" },
{ label: "Treino", href: "training" },
{ label: "Nutrição", href: "nutrition" },
{ label: "Cardio Hub", href: "cardio" }
]
},
{
title: "Comunidade", items: [
{ label: "Comunidade", href: "community" },
{ label: "Perfil", href: "profile" },
{ label: "Rankings", href: "rankings" },
{ label: "Blog", href: "blog" }
]
},
{
title: "Empresa", items: [
{ label: "Sobre", href: "about" },
{ label: "Contato", href: "contact" },
{ label: "Privacidade", href: "privacy" },
{ label: "Termos", href: "terms" }
]
}
]}
logoText="FitFlow Pro"
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
/>
</div>
</ThemeProvider>
);
}

332
src/app/onboarding/page.tsx Normal file
View File

@@ -0,0 +1,332 @@
"use client";
import { useState } from "react";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import FooterBase from '@/components/sections/footer/FooterBase';
import { ChevronRight, User, Users } from 'lucide-react';
interface UserProfile {
name: string;
gender: string;
height: string;
weight: string;
age: string;
}
type OnboardingStep = 'basic' | 'biometric' | 'complete';
export default function OnboardingPage() {
const [step, setStep] = useState<OnboardingStep>('basic');
const [profile, setProfile] = useState<UserProfile>({
name: '',
gender: '',
height: '',
weight: '',
age: ''
});
const handleBasicChange = (field: keyof Pick<UserProfile, 'name' | 'gender'>, value: string) => {
setProfile(prev => ({ ...prev, [field]: value }));
};
const handleBiometricChange = (field: keyof Pick<UserProfile, 'height' | 'weight' | 'age'>, value: string) => {
setProfile(prev => ({ ...prev, [field]: value }));
};
const handleBasicSubmit = (e: React.FormEvent) => {
e.preventDefault();
if (profile.name && profile.gender) {
setStep('biometric');
}
};
const handleBiometricSubmit = (e: React.FormEvent) => {
e.preventDefault();
if (profile.height && profile.weight && profile.age) {
saveProfile();
setStep('complete');
}
};
const saveProfile = () => {
localStorage.setItem('userProfile', JSON.stringify(profile));
console.log('Profile saved:', profile);
};
const handleReset = () => {
setProfile({ name: '', gender: '', height: '', weight: '', age: '' });
setStep('basic');
};
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "dashboard" },
{ name: "Treino", id: "training" },
{ name: "Nutrição", id: "nutrition" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "onboarding" }
]}
button={{ text: "Começar Agora", href: "contact" }}
brandName="FitFlow Pro"
/>
</div>
<div id="onboarding-flow" data-section="onboarding-flow" className="min-h-screen flex items-center justify-center py-20">
<div className="w-full max-w-2xl px-6">
{/* Progress Indicator */}
<div className="mb-12">
<div className="flex items-center justify-between mb-4">
<div className={`flex items-center gap-2 ${
step === 'basic' || step === 'biometric' || step === 'complete'
? 'text-primary-cta'
: 'text-gray-400'
}`}>
<div className="w-8 h-8 rounded-full bg-primary-cta flex items-center justify-center text-white text-sm font-bold">1</div>
<span className="font-semibold">Dados Pessoais</span>
</div>
<div className="flex-1 h-1 mx-4 bg-gray-300"></div>
<div className={`flex items-center gap-2 ${
step === 'biometric' || step === 'complete'
? 'text-primary-cta'
: 'text-gray-400'
}`}>
<div className={`w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold ${
step === 'biometric' || step === 'complete'
? 'bg-primary-cta text-white'
: 'bg-gray-300 text-gray-600'
}`}>2</div>
<span className="font-semibold">Biometria</span>
</div>
</div>
</div>
{/* Step 1: Basic Information */}
{step === 'basic' && (
<div className="bg-card rounded-2xl p-8 shadow-lg">
<div className="mb-8">
<h1 className="text-4xl font-extrabold mb-2">Vamos Começar!</h1>
<p className="text-gray-600">Primeiro, precisamos conhecer você melhor.</p>
</div>
<form onSubmit={handleBasicSubmit} className="space-y-6">
{/* Name Input */}
<div>
<label className="block text-sm font-semibold mb-2">Nome Completo</label>
<input
type="text"
value={profile.name}
onChange={(e) => handleBasicChange('name', e.target.value)}
placeholder="Digite seu nome"
className="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:border-primary-cta focus:outline-none transition"
required
/>
</div>
{/* Gender Selection */}
<div>
<label className="block text-sm font-semibold mb-2">Gênero</label>
<div className="grid grid-cols-2 gap-4">
{['Masculino', 'Feminino'].map((gender) => (
<button
key={gender}
type="button"
onClick={() => handleBasicChange('gender', gender)}
className={`py-3 px-4 rounded-lg font-semibold transition-all ${
profile.gender === gender
? 'bg-primary-cta text-white'
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
}`}
>
{gender}
</button>
))}
</div>
</div>
{/* Submit Button */}
<button
type="submit"
disabled={!profile.name || !profile.gender}
className="w-full bg-primary-cta text-white py-3 rounded-lg font-semibold hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed transition flex items-center justify-center gap-2"
>
Próximo <ChevronRight size={18} />
</button>
</form>
</div>
)}
{/* Step 2: Biometric Information */}
{step === 'biometric' && (
<div className="bg-card rounded-2xl p-8 shadow-lg">
<div className="mb-8">
<h1 className="text-4xl font-extrabold mb-2">Dados Biométricos</h1>
<p className="text-gray-600">Agora, alguns dados de biometria para personalizar seu treino.</p>
</div>
<form onSubmit={handleBiometricSubmit} className="space-y-6">
{/* Height Input */}
<div>
<label className="block text-sm font-semibold mb-2">Altura (cm)</label>
<input
type="number"
value={profile.height}
onChange={(e) => handleBiometricChange('height', e.target.value)}
placeholder="Ex: 175"
className="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:border-primary-cta focus:outline-none transition"
required
/>
</div>
{/* Weight Input */}
<div>
<label className="block text-sm font-semibold mb-2">Peso (kg)</label>
<input
type="number"
value={profile.weight}
onChange={(e) => handleBiometricChange('weight', e.target.value)}
placeholder="Ex: 75"
step="0.1"
className="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:border-primary-cta focus:outline-none transition"
required
/>
</div>
{/* Age Input */}
<div>
<label className="block text-sm font-semibold mb-2">Idade</label>
<input
type="number"
value={profile.age}
onChange={(e) => handleBiometricChange('age', e.target.value)}
placeholder="Ex: 28"
className="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:border-primary-cta focus:outline-none transition"
required
/>
</div>
{/* Buttons */}
<div className="grid grid-cols-2 gap-4">
<button
type="button"
onClick={() => setStep('basic')}
className="py-3 px-4 rounded-lg font-semibold border-2 border-gray-300 hover:bg-gray-100 transition"
>
Voltar
</button>
<button
type="submit"
disabled={!profile.height || !profile.weight || !profile.age}
className="bg-primary-cta text-white py-3 px-4 rounded-lg font-semibold hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed transition flex items-center justify-center gap-2"
>
Concluir <ChevronRight size={18} />
</button>
</div>
</form>
</div>
)}
{/* Step 3: Completion */}
{step === 'complete' && (
<div className="bg-card rounded-2xl p-8 shadow-lg text-center">
<div className="mb-8">
<div className="w-16 h-16 bg-primary-cta rounded-full flex items-center justify-center mx-auto mb-6">
<User size={32} className="text-white" />
</div>
<h1 className="text-4xl font-extrabold mb-2">Perfil Criado com Sucesso!</h1>
<p className="text-gray-600 mb-6">Bem-vindo ao FitFlow Pro, {profile.name}!</p>
{/* Profile Summary */}
<div className="bg-gray-50 rounded-lg p-6 mb-8 text-left space-y-3">
<div className="flex justify-between">
<span className="font-semibold text-gray-700">Nome:</span>
<span className="text-gray-600">{profile.name}</span>
</div>
<div className="flex justify-between">
<span className="font-semibold text-gray-700">Gênero:</span>
<span className="text-gray-600">{profile.gender}</span>
</div>
<div className="flex justify-between">
<span className="font-semibold text-gray-700">Altura:</span>
<span className="text-gray-600">{profile.height} cm</span>
</div>
<div className="flex justify-between">
<span className="font-semibold text-gray-700">Peso:</span>
<span className="text-gray-600">{profile.weight} kg</span>
</div>
<div className="flex justify-between">
<span className="font-semibold text-gray-700">Idade:</span>
<span className="text-gray-600">{profile.age} anos</span>
</div>
</div>
</div>
{/* Action Buttons */}
<div className="grid grid-cols-2 gap-4">
<button
onClick={handleReset}
className="py-3 px-4 rounded-lg font-semibold border-2 border-gray-300 hover:bg-gray-100 transition"
>
Editar Dados
</button>
<a
href="/"
className="bg-primary-cta text-white py-3 px-4 rounded-lg font-semibold hover:opacity-90 transition flex items-center justify-center gap-2"
>
Ir para Dashboard <ChevronRight size={18} />
</a>
</div>
</div>
)}
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Produto", items: [
{ label: "Dashboard", href: "dashboard" },
{ label: "Treino", href: "training" },
{ label: "Nutrição", href: "nutrition" },
{ label: "Cardio Hub", href: "cardio" }
]
},
{
title: "Comunidade", items: [
{ label: "Comunidade", href: "community" },
{ label: "Perfil", href: "onboarding" },
{ label: "Rankings", href: "rankings" },
{ label: "Blog", href: "blog" }
]
},
{
title: "Empresa", items: [
{ label: "Sobre", href: "about" },
{ label: "Contato", href: "contact" },
{ label: "Privacidade", href: "privacy" },
{ label: "Termos", href: "terms" }
]
}
]}
logoText="FitFlow Pro"
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
/>
</div>
</ThemeProvider>
);
}

View File

@@ -10,377 +10,376 @@ import MetricCardFourteen from '@/components/sections/metrics/MetricCardFourteen
import TeamCardOne from '@/components/sections/team/TeamCardOne';
import TestimonialCardTwelve from '@/components/sections/testimonial/TestimonialCardTwelve';
import SocialProofOne from '@/components/sections/socialProof/SocialProofOne';
import ContactText from '@/components/sections/contact/ContactText';
import FooterLogoEmphasis from '@/components/sections/footer/FooterLogoEmphasis';
import { Activity, Apple, Brain, Dumbbell, Heart, Target, Zap, Users, Star, TrendingDown, TrendingUp } from 'lucide-react';
import { WorkoutDataIntegration } from '@/app/components/WorkoutDataIntegration';
import ContactSplit from '@/components/sections/contact/ContactSplit';
import FooterBase from '@/components/sections/footer/FooterBase';
import { Activity, Apple, Brain, Dumbbell, Heart, Target, Zap, Users, Star, TrendingDown, TrendingUp, Mail } from 'lucide-react';
export default function LandingPage() {
return (
<WorkoutDataIntegration autoSave={true}>
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "dashboard" },
{ name: "Treino", id: "training" },
{ name: "Nutrição", id: "nutrition" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Começar Agora", href: "contact" }}
brandName="FitFlow Pro"
/>
</div>
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "dashboard" },
{ name: "Treino", id: "training" },
{ name: "Receitas", id: "/recipes" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Começar Agora", href: "contact" }}
brandName="FitFlow Pro"
/>
</div>
<div id="hero" data-section="hero">
<HeroSplitKpi
title="Seu Corpo, Seu Histórico, Sua Vitória"
description="Aplicativo premium de fitness com rastreamento biométrico inteligente, treinos personalizados por IA e cardio com GPS. Transforme seu corpo enquanto acompanha cada segundo da jornada."
tag="Fitness Ultra-Premium"
tagIcon={Zap}
background={{ variant: "glowing-orb" }}
kpis={[
{ value: "150K+", label: "Usuários Ativos" },
{ value: "2M+", label: "Treinos Concluídos" },
{ value: "4.9★", label: "Avaliação" }
]}
enableKpiAnimation={true}
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=1"
imageAlt="Dashboard de fitness premium"
imagePosition="right"
mediaAnimation="slide-up"
buttons={[
{ text: "Começar Teste Grátis", href: "contact" },
{ text: "Ver Demo", href: "#features" }
]}
avatars={[
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png", alt: "Usuário" },
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png", alt: "Usuário" },
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png", alt: "Usuário" }
]}
avatarText="Join 150K+ athletes"
/>
</div>
<div id="hero" data-section="hero">
<HeroSplitKpi
title="Seu Corpo, Seu Histórico, Sua Vitória"
description="Aplicativo premium de fitness com rastreamento biométrico inteligente, treinos personalizados por IA e cardio com GPS. Transforme seu corpo enquanto acompanha cada segundo da jornada."
tag="Fitness Ultra-Premium"
tagIcon={Zap}
background={{ variant: "glowing-orb" }}
kpis={[
{ value: "150K+", label: "Usuários Ativos" },
{ value: "2M+", label: "Treinos Concluídos" },
{ value: "4.9★", label: "Avaliação" }
]}
enableKpiAnimation={true}
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=1"
imageAlt="Dashboard de fitness premium"
imagePosition="right"
mediaAnimation="slide-up"
buttons={[
{ text: "Começar Teste Grátis", href: "contact" },
{ text: "Ver Demo", href: "#features" }
]}
avatars={[
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png", alt: "Usuário" },
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png", alt: "Usuário" },
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png", alt: "Usuário" }
]}
avatarText="Join 150K+ athletes"
/>
</div>
<div id="onboarding" data-section="onboarding">
<FeatureCardTwentyFive
title="Onboarding Biométrico Dinâmico"
description="Sistema inteligente que adapta-se ao seu corpo. Defina seu objetivo, e o app calcula automaticamente sua timeline de sucesso com precisão científica."
tag="Inteligência Adaptativa"
tagIcon={Brain}
features={[
{
title: "Perfil Biométrico", description: "Coloque seus dados (gênero, altura, peso, idade) e veja o app adaptar todas as demonstrações, avatares e ilustrações anatomicamente.", icon: Target,
mediaItems: [
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/premium-onboarding-screen-for-fitness-ap-1773256981180-774b293c.png", imageAlt: "Tela de biometria"
},
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=2", imageAlt: "Dashboard adaptado"
}
]
},
{
title: "Metas Inteligentes", description: "Escolha: Perder Peso ou Ganhar Massa. O sistema calcula TMB, projeta planilha de metas e mostra exatamente quando você atingirá seu objetivo.", icon: Zap,
mediaItems: [
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Plano de nutrição"
},
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=1", imageAlt: "Métricas de progresso"
}
]
}
]}
animationType="blur-reveal"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="onboarding" data-section="onboarding">
<FeatureCardTwentyFive
title="Onboarding Biométrico Dinâmico"
description="Sistema inteligente que adapta-se ao seu corpo. Defina seu objetivo, e o app calcula automaticamente sua timeline de sucesso com precisão científica."
tag="Inteligência Adaptativa"
tagIcon={Brain}
features={[
{
title: "Perfil Biométrico", description: "Coloque seus dados (gênero, altura, peso, idade) e veja o app adaptar todas as demonstrações, avatares e ilustrações anatomicamente.", icon: Target,
mediaItems: [
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/premium-onboarding-screen-for-fitness-ap-1773256981180-774b293c.png", alt: "Tela de biometria"
},
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=2", alt: "Dashboard adaptado"
}
]
},
{
title: "Metas Inteligentes", description: "Escolha: Perder Peso ou Ganhar Massa. O sistema calcula TMB, projeta planilha de metas e mostra exatamente quando você atingirá seu objetivo.", icon: Zap,
mediaItems: [
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", alt: "Plano de nutrição"
},
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=1", alt: "Métricas de progresso"
}
]
}
]}
animationType="blur-reveal"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="cardio" data-section="cardio">
<FeatureCardTwentyFive
title="Hub de Cardio com GPS em Tempo Real"
description="Rastreie suas corridas e caminhadas com precisão de GPS. Monitore pace, distância, calorias queimadas e vença suas metas diárias com anéis de progresso animados."
tag="Cardio Premium"
tagIcon={Heart}
features={[
{
title: "Running Tracker Avançado", description: "GPS ativado em tempo real. Mapeia sua rota, calcula queima de calorias baseado no peso, mostra ritmo ao vivo em painel estilo smartwatch.", icon: Zap,
mediaItems: [
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/gps-running-tracker-interface-with-real--1773256980694-2abe167e.png", imageAlt: "Rastreamento GPS"
},
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=2", imageAlt: "Métricas de cardio"
}
]
},
{
title: "Pedômetro & Caminhada", description: "Contador de passos embutido com rastreamento de distância e calorias. Vença suas metas de 10.000 passos com visual de anéis de progresso motivacional.", icon: Activity,
mediaItems: [
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=3", imageAlt: "Dashboard de passos"
},
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=3", imageAlt: "Progresso de atividade"
}
]
}
]}
animationType="depth-3d"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="cardio" data-section="cardio">
<FeatureCardTwentyFive
title="Hub de Cardio com GPS em Tempo Real"
description="Rastreie suas corridas e caminhadas com precisão de GPS. Monitore pace, distância, calorias queimadas e vença suas metas diárias com anéis de progresso animados."
tag="Cardio Premium"
tagIcon={Heart}
features={[
{
title: "Running Tracker Avançado", description: "GPS ativado em tempo real. Mapeia sua rota, calcula queima de calorias baseado no peso, mostra ritmo ao vivo em painel estilo smartwatch.", icon: Zap,
mediaItems: [
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/gps-running-tracker-interface-with-real--1773256980694-2abe167e.png", alt: "Rastreamento GPS"
},
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=2", alt: "Métricas de cardio"
}
]
},
{
title: "Pedômetro & Caminhada", description: "Contador de passos embutido com rastreamento de distância e calorias. Vença suas metas de 10.000 passos com visual de anéis de progresso motivacional.", icon: Activity,
mediaItems: [
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=3", alt: "Dashboard de passos"
},
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=3", alt: "Progresso de atividade"
}
]
}
]}
animationType="depth-3d"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="training" data-section="training">
<FeatureCardTwentyFive
title="Core de Treinamento com IA"
description="Algoritmo adaptativo que recomenda treinos baseado em biometria. Escolha entre Casa (calistenia) ou Ginásio (máquinas/pesos) e isole por grupo muscular com modelo anatômico 3D interativo."
tag="Recomendação de IA"
tagIcon={Brain}
features={[
{
title: "Dualidade de Ambientes", description: "Treinos em Casa (peso corporal, calistenia) ou Ginásio (máquinas, pesos livres). Sistema diferencia automaticamente baseado em sua escolha e disponibilidade de equipamento.", icon: Dumbbell,
mediaItems: [
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/interactive-anatomical-body-model-showin-1773256980448-3cccd7b3.png?_wi=1", imageAlt: "Seleção de exercícios"
},
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=1", imageAlt: "Execução de treino"
}
]
},
{
title: "Isolamento por Grupo Muscular", description: "Modelo anatômico 3D/2D interativo. Clique em um músculo (peitoral, glúteo, etc.) e veja lista filtrada de exercícios com foco nesse músculo específico.", icon: Zap,
mediaItems: [
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/interactive-anatomical-body-model-showin-1773256980448-3cccd7b3.png?_wi=2", imageAlt: "Anatomia interativa"
},
{
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=2", imageAlt: "Exercícios filtrados"
}
]
}
]}
animationType="scale-rotate"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="training" data-section="training">
<FeatureCardTwentyFive
title="Core de Treinamento com IA"
description="Algoritmo adaptativo que recomenda treinos baseado em biometria. Escolha entre Casa (calistenia) ou Ginásio (máquinas/pesos) e isole por grupo muscular com modelo anatômico 3D interativo."
tag="Recomendação de IA"
tagIcon={Brain}
features={[
{
title: "Dualidade de Ambientes", description: "Treinos em Casa (peso corporal, calistenia) ou Ginásio (máquinas, pesos livres). Sistema diferencia automaticamente baseado em sua escolha e disponibilidade de equipamento.", icon: Dumbbell,
mediaItems: [
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/interactive-anatomical-body-model-showin-1773256980448-3cccd7b3.png?_wi=1", alt: "Seleção de exercícios"
},
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=1", alt: "Execução de treino"
}
]
},
{
title: "Isolamento por Grupo Muscular", description: "Modelo anatômico 3D/2D interativo. Clique em um músculo (peitoral, glúteo, etc.) e veja lista filtrada de exercícios com foco nesse músculo específico.", icon: Zap,
mediaItems: [
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/interactive-anatomical-body-model-showin-1773256980448-3cccd7b3.png?_wi=2", alt: "Anatomia interativa"
},
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=2", alt: "Exercícios filtrados"
}
]
}
]}
animationType="scale-rotate"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="workout-mode" data-section="workout-mode">
<ProductCardOne
title="Modo 'Em Execução' - Tracking de Série"
description="Interface imersiva que transforma o treino em experiência interativa com cronômetro de descanso, registro de progresso e gráficos de progressão."
tag="Focus Mode"
tagIcon={Target}
products={[
{
id: "1", name: "Iniciar Série", price: "Botão Proeminente", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=3", imageAlt: "Tela de série"
},
{
id: "2", name: "Cronômetro de Descanso", price: "Automático", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=4", imageAlt: "Descanso entre séries"
},
{
id: "3", name: "Registrar Progresso", price: "Carga + Reps", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=4", imageAlt: "Progresso salvo"
}
]}
animationType="slide-up"
textboxLayout="default"
useInvertedBackground={false}
gridVariant="three-columns-all-equal-width"
/>
</div>
<div id="workout-mode" data-section="workout-mode">
<ProductCardOne
title="Modo 'Em Execução' - Tracking de Série"
description="Interface imersiva que transforma o treino em experiência interativa com cronômetro de descanso, registro de progresso e gráficos de progressão."
tag="Focus Mode"
tagIcon={Target}
products={[
{
id: "1", name: "Iniciar Série", price: "Botão Proeminente", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=3", imageAlt: "Tela de série"
},
{
id: "2", name: "Cronômetro de Descanso", price: "Automático", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=4", imageAlt: "Descanso entre séries"
},
{
id: "3", name: "Registrar Progresso", price: "Carga + Reps", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=4", imageAlt: "Progresso salvo"
}
]}
animationType="slide-up"
textboxLayout="default"
useInvertedBackground={false}
gridVariant="three-columns-all-equal-width"
/>
</div>
<div id="nutrition" data-section="nutrition">
<PricingCardOne
title="Nutrição Inteligente & Receituário"
description="Planos alimentares 100% sincronizados com suas metas de peso. Se quer perder peso, déficit calórico. Se quer ganhar massa, superávit inteligente."
tag="Sincronizado com Timeline"
tagIcon={Apple}
plans={[
{
id: "deficit", badge: "Perda de Peso", badgeIcon: TrendingDown,
price: "Déficit Calórico", subtitle: "Receitas otimizadas para queima de calorias", features: [
"Macros calculados automaticamente", "Prep time entre 15-30 min", "Proteína alta, carboidrato estratégico", "Rastreamento integrado", "Sugestões diárias personalizadas"
]
},
{
id: "surplus", badge: "Ganho de Massa", badgeIcon: TrendingUp,
price: "Superávit Estratégico", subtitle: "Nutrição para crescimento muscular", features: [
"Calorias calculadas para ganho", "Proteína máxima (2g por kg)", "Carbos pré e pós-treino", "Tempo de preparo eficiente", "Sincronizado com treino de força"
]
}
]}
animationType="slide-up"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="nutrition" data-section="nutrition">
<PricingCardOne
title="Nutrição Inteligente & Receituário"
description="Planos alimentares 100% sincronizados com suas metas de peso. Se quer perder peso, déficit calórico. Se quer ganhar massa, superávit inteligente."
tag="Sincronizado com Timeline"
tagIcon={Apple}
plans={[
{
id: "deficit", badge: "Perda de Peso", badgeIcon: TrendingDown,
price: "Déficit Calórico", subtitle: "Receitas otimizadas para queima de calorias", features: [
"Macros calculados automaticamente", "Prep time entre 15-30 min", "Proteína alta, carboidrato estratégico", "Rastreamento integrado", "Sugestões diárias personalizadas"
]
},
{
id: "surplus", badge: "Ganho de Massa", badgeIcon: TrendingUp,
price: "Superávit Estratégico", subtitle: "Nutrição para crescimento muscular", features: [
"Calorias calculadas para ganho", "Proteína máxima (2g por kg)", "Carbos pré e pós-treino", "Tempo de preparo eficiente", "Sincronizado com treino de força"
]
}
]}
animationType="slide-up"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="metrics" data-section="metrics">
<MetricCardFourteen
title="Suas Conquistas Importam. Veja Cada Número."
tag="Performance Metrics"
tagAnimation="slide-up"
metrics={[
{
id: "1", value: "10.000+", description: "Passos diários rastreados em tempo real com motivação visual de progresso."
},
{
id: "2", value: "500 kg", description: "Volume total de peso levantado monitorado com progressão semanal automática."
},
{
id: "3", value: "150+ km", description: "Distância corrida mapeada com GPS, ritmo calculado e calorias precisas."
},
{
id: "4", value: "42 dias", description: "Sequência de treinos consistentes com badges de dedicação desbloqueados."
}
]}
metricsAnimation="slide-up"
useInvertedBackground={false}
/>
</div>
<div id="metrics" data-section="metrics">
<MetricCardFourteen
title="Suas Conquistas Importam. Veja Cada Número."
tag="Performance Metrics"
tagAnimation="slide-up"
metrics={[
{
id: "1", value: "10.000+", description: "Passos diários rastreados em tempo real com motivação visual de progresso."
},
{
id: "2", value: "500 kg", description: "Volume total de peso levantado monitorado com progressão semanal automática."
},
{
id: "3", value: "150+ km", description: "Distância corrida mapeada com GPS, ritmo calculado e calorias precisas."
},
{
id: "4", value: "42 dias", description: "Sequência de treinos consistentes com badges de dedicação desbloqueados."
}
]}
metricsAnimation="slide-up"
useInvertedBackground={false}
/>
</div>
<div id="team" data-section="team">
<TeamCardOne
title="Comunidade de Atletas Profissionais"
description="Feed social onde você compartilha rotas de corrida, estatísticas de treino e compete em rankings semanais com outros usuários."
tag="Gamificação Social"
tagIcon={Users}
members={[
{
id: "1", name: "Marcus A.", role: "Elite Runner", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png?_wi=1", imageAlt: "Marcus A."
},
{
id: "2", name: "Ana L.", role: "Strength Coach", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png?_wi=1", imageAlt: "Ana L."
},
{
id: "3", name: "Rafael S.", role: "Nutrition Expert", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png?_wi=1", imageAlt: "Rafael S."
},
{
id: "4", name: "Sofia M.", role: "Fitness Trainer", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-fitness-coach-portrait-profession-1773256979710-97e8b5fe.png?_wi=1", imageAlt: "Sofia M."
}
]}
animationType="blur-reveal"
textboxLayout="default"
useInvertedBackground={false}
gridVariant="four-items-2x2-equal-grid"
/>
</div>
<div id="team" data-section="team">
<TeamCardOne
title="Comunidade de Atletas Profissionais"
description="Feed social onde você compartilha rotas de corrida, estatísticas de treino e compete em rankings semanais com outros usuários."
tag="Gamificação Social"
tagIcon={Users}
members={[
{
id: "1", name: "Marcus A.", role: "Elite Runner", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png?_wi=1", imageAlt: "Marcus A."
},
{
id: "2", name: "Ana L.", role: "Strength Coach", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png?_wi=1", imageAlt: "Ana L."
},
{
id: "3", name: "Rafael S.", role: "Nutrition Expert", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png?_wi=1", imageAlt: "Rafael S."
},
{
id: "4", name: "Sofia M.", role: "Fitness Trainer", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-fitness-coach-portrait-profession-1773256979710-97e8b5fe.png?_wi=1", imageAlt: "Sofia M."
}
]}
animationType="blur-reveal"
textboxLayout="default"
useInvertedBackground={false}
gridVariant="four-items-2x2-equal-grid"
/>
</div>
<div id="testimonials" data-section="testimonials">
<TestimonialCardTwelve
testimonials={[
{
id: "1", name: "Carlos M.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png?_wi=2", imageAlt: "Carlos M."
},
{
id: "2", name: "Beatriz R.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png?_wi=2", imageAlt: "Beatriz R."
},
{
id: "3", name: "Diego P.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png?_wi=2", imageAlt: "Diego P."
},
{
id: "4", name: "Juliana T.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-fitness-coach-portrait-profession-1773256979710-97e8b5fe.png?_wi=2", imageAlt: "Juliana T."
},
{
id: "5", name: "Lucas F.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/young-athlete-male-portrait-energetic-ex-1773256982698-63e4e494.png", imageAlt: "Lucas F."
},
{
id: "6", name: "Marina S.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-athlete-portrait-fit-build-profes-1773256980134-0faaa8fa.png", imageAlt: "Marina S."
}
]}
cardTitle="Mais de 150 mil atletas já transformaram seu corpo com FitFlow Pro"
cardTag="Veja o que eles dizem"
cardTagIcon={Star}
cardAnimation="blur-reveal"
useInvertedBackground={false}
/>
</div>
<div id="testimonials" data-section="testimonials">
<TestimonialCardTwelve
testimonials={[
{
id: "1", name: "Carlos M.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png?_wi=2", imageAlt: "Carlos M."
},
{
id: "2", name: "Beatriz R.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png?_wi=2", imageAlt: "Beatriz R."
},
{
id: "3", name: "Diego P.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png?_wi=2", imageAlt: "Diego P."
},
{
id: "4", name: "Juliana T.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-fitness-coach-portrait-profession-1773256979710-97e8b5fe.png?_wi=2", imageAlt: "Juliana T."
},
{
id: "5", name: "Lucas F.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/young-athlete-male-portrait-energetic-ex-1773256982698-63e4e494.png", imageAlt: "Lucas F."
},
{
id: "6", name: "Marina S.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-athlete-portrait-fit-build-profes-1773256980134-0faaa8fa.png", imageAlt: "Marina S."
}
]}
cardTitle="Mais de 150 mil atletas já transformaram seu corpo com FitFlow Pro"
cardTag="Veja o que eles dizem"
cardTagIcon={Star}
cardAnimation="blur-reveal"
useInvertedBackground={false}
/>
</div>
<div id="social-proof" data-section="social-proof">
<SocialProofOne
title="Confiado pelos Maiores Aplicativos e Plataformas de Fitness"
description="FitFlow Pro integra-se perfeitamente com os ecossistemas de saúde mais populares do mundo."
tag="Parcerias Premium"
tagIcon={Zap}
logos={[
"http://img.b2bpic.net/free-vector/heart-love-logo_126523-2763.jpg", "http://img.b2bpic.net/free-photo/woman-with-phone-sportswear_1303-8805.jpg", "http://img.b2bpic.net/free-vector/flat-design-fitness-trackers-heart-rate-menu_23-2148515781.jpg", "http://img.b2bpic.net/free-photo/close-up-woman-holding-phone_23-2148889655.jpg", "http://img.b2bpic.net/free-photo/close-up-man-using-phone-while-electric-bike_23-2149098678.jpg", "http://img.b2bpic.net/free-vector/fitness-trackers-concept_23-2148527033.jpg", "http://img.b2bpic.net/free-photo/cropped-view-sexy-bodybuilder-showing-thumbs-up_1153-6281.jpg", "http://img.b2bpic.net/free-photo/phone-muscular-hand-guy-sitting-city-morning-he-holds-bottle-water-headphones_197531-1155.jpg"
]}
names={[
"Apple Fitness", "Strava", "Fitbit", "Google Fit", "Peloton", "MyFitnessPal", "Garmin", "Nike Training"
]}
textboxLayout="default"
useInvertedBackground={false}
speed={40}
showCard={true}
/>
</div>
<div id="social-proof" data-section="social-proof">
<SocialProofOne
title="Confiado pelos Maiores Aplicativos e Plataformas de Fitness"
description="FitFlow Pro integra-se perfeitamente com os ecossistemas de saúde mais populares do mundo."
tag="Parcerias Premium"
tagIcon={Zap}
logos={[
"http://img.b2bpic.net/free-vector/heart-love-logo_126523-2763.jpg", "http://img.b2bpic.net/free-photo/woman-with-phone-sportswear_1303-8805.jpg", "http://img.b2bpic.net/free-vector/flat-design-fitness-trackers-heart-rate-menu_23-2148515781.jpg", "http://img.b2bpic.net/free-photo/close-up-woman-holding-phone_23-2148889655.jpg", "http://img.b2bpic.net/free-photo/close-up-man-using-phone-while-electric-bike_23-2149098678.jpg", "http://img.b2bpic.net/free-vector/fitness-trackers-concept_23-2148527033.jpg", "http://img.b2bpic.net/free-photo/cropped-view-sexy-bodybuilder-showing-thumbs-up_1153-6281.jpg", "http://img.b2bpic.net/free-photo/phone-muscular-hand-guy-sitting-city-morning-he-holds-bottle-water-headphones_197531-1155.jpg"
]}
names={[
"Apple Fitness", "Strava", "Fitbit", "Google Fit", "Peloton", "MyFitnessPal", "Garmin", "Nike Training"
]}
textboxLayout="default"
useInvertedBackground={false}
speed={40}
showCard={true}
/>
</div>
<div id="contact" data-section="contact">
<ContactText
text="Pronto para transformar seu corpo? Começar seu teste gratuito de 30 dias agora e veja por que 150 mil atletas confiam em FitFlow Pro."
animationType="entrance-slide"
buttons={[
{ text: "Começar Teste Grátis", href: "contact" },
{ text: "Conversar com Especialista", href: "#contact" }
]}
background={{ variant: "sparkles-gradient" }}
useInvertedBackground={false}
/>
</div>
<div id="contact" data-section="contact">
<ContactSplit
tag="Transforme Sua Vida"
tagIcon={Mail}
title="Pronto para Começar?"
description="Inscreva-se para receber atualizações exclusivas, dicas de treino e um acesso especial ao nosso programa de beta testers premium. Seu email está seguro conosco."
background={{ variant: "sparkles-gradient" }}
useInvertedBackground={false}
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=1"
imageAlt="Transforme seu corpo"
mediaAnimation="slide-up"
mediaPosition="right"
inputPlaceholder="seu.email@exemplo.com"
buttonText="Inscrever-se Agora"
termsText="Respeitamos sua privacidade. Você pode desinscrever-se a qualquer momento. Sem spam, promessa."
/>
</div>
<div id="footer" data-section="footer">
<FooterLogoEmphasis
columns={[
{
items: [
{ label: "Dashboard", href: "#dashboard" },
{ label: "Treino", href: "#training" },
{ label: "Nutrição", href: "#nutrition" }
]
},
{
items: [
{ label: "Cardio Hub", href: "#cardio" },
{ label: "Comunidade", href: "#community" },
{ label: "Perfil", href: "#profile" }
]
},
{
items: [
{ label: "Blog", href: "#blog" },
{ label: "Ajuda", href: "#help" },
{ label: "Suporte", href: "#support" }
]
},
{
items: [
{ label: "Privacidade", href: "#privacy" },
{ label: "Termos", href: "#terms" },
{ label: "Contato", href: "#contact" }
]
}
]}
logoText="FitFlow Pro"
/>
</div>
</ThemeProvider>
</WorkoutDataIntegration>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Produto", items: [
{ label: "Dashboard", href: "dashboard" },
{ label: "Treino", href: "training" },
{ label: "Receitas", href: "/recipes" },
{ label: "Cardio Hub", href: "cardio" }
]
},
{
title: "Comunidade", items: [
{ label: "Comunidade", href: "community" },
{ label: "Perfil", href: "profile" },
{ label: "Rankings", href: "rankings" },
{ label: "Blog", href: "blog" }
]
},
{
title: "Empresa", items: [
{ label: "Sobre", href: "about" },
{ label: "Contato", href: "contact" },
{ label: "Privacidade", href: "privacy" },
{ label: "Termos", href: "terms" }
]
}
]}
logoText="FitFlow Pro"
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
/>
</div>
</ThemeProvider>
);
}

311
src/app/recipes/page.tsx Normal file
View File

@@ -0,0 +1,311 @@
"use client";
import { useState } from "react";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import HeroSplitKpi from '@/components/sections/hero/HeroSplitKpi';
import FeatureCardTwentyFive from '@/components/sections/feature/FeatureCardTwentyFive';
import FooterBase from '@/components/sections/footer/FooterBase';
import { Apple, Filter, Flame, TrendingDown, TrendingUp } from 'lucide-react';
const recipeDatabase = [
{
id: "1", name: "Grilled Chicken Breast with Quinoa", category: "Protein", calories: 450,
protein: 45,
carbs: 35,
fats: 12,
prepTime: "25 min", goals: ["muscle-gain"],
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Grilled Chicken with Quinoa"
},
{
id: "2", name: "Veggie Stir-Fry with Tofu", category: "Vegetarian", calories: 280,
protein: 18,
carbs: 42,
fats: 8,
prepTime: "20 min", goals: ["weight-loss"],
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Veggie Stir-Fry"
},
{
id: "3", name: "Salmon with Sweet Potato", category: "Fish", calories: 520,
protein: 38,
carbs: 48,
fats: 18,
prepTime: "30 min", goals: ["muscle-gain"],
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Salmon with Sweet Potato"
},
{
id: "4", name: "Egg White Omelet with Veggies", category: "Breakfast", calories: 180,
protein: 22,
carbs: 12,
fats: 4,
prepTime: "15 min", goals: ["weight-loss", "muscle-gain"],
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Egg White Omelet"
},
{
id: "5", name: "Turkey Meatballs with Zucchini Noodles", category: "Protein", calories: 320,
protein: 35,
carbs: 18,
fats: 10,
prepTime: "28 min", goals: ["weight-loss"],
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Turkey Meatballs"
},
{
id: "6", name: "Lean Beef with Brown Rice", category: "Protein", calories: 580,
protein: 42,
carbs: 58,
fats: 14,
prepTime: "35 min", goals: ["muscle-gain"],
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Lean Beef with Rice"
},
{
id: "7", name: "Green Salad with Grilled Chicken", category: "Salad", calories: 280,
protein: 32,
carbs: 22,
fats: 6,
prepTime: "18 min", goals: ["weight-loss"],
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Green Salad"
},
{
id: "8", name: "High-Protein Pasta with Lean Ground Meat", category: "Pasta", calories: 480,
protein: 40,
carbs: 52,
fats: 8,
prepTime: "25 min", goals: ["muscle-gain"],
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "High-Protein Pasta"
}
];
export default function RecipesPage() {
const [selectedGoal, setSelectedGoal] = useState<"all" | "weight-loss" | "muscle-gain">("all");
const filteredRecipes = selectedGoal === "all"
? recipeDatabase
: recipeDatabase.filter(recipe => recipe.goals.includes(selectedGoal));
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "dashboard" },
{ name: "Treino", id: "training" },
{ name: "Receitas", id: "/recipes" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Começar Agora", href: "contact" }}
brandName="FitFlow Pro"
/>
</div>
<div id="recipes-hero" data-section="recipes-hero">
<HeroSplitKpi
title="Receitas Inteligentes Alinhadas com Suas Metas"
description="Acesso a um banco de receitas nutricionais desenvolvidas por especialistas. Cada receita é otimizada para seu objetivo: perda de peso ou ganho de massa muscular."
tag="Nutrição Estratégica"
tagIcon={Flame}
background={{ variant: "glowing-orb" }}
kpis={[
{ value: "100+", label: "Receitas Disponíveis" },
{ value: "2", label: "Filtros por Objetivo" },
{ value: "4.8★", label: "Avaliação Média" }
]}
enableKpiAnimation={true}
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png"
imageAlt="Dashboard de receitas nutricionais"
imagePosition="right"
mediaAnimation="slide-up"
buttons={[
{ text: "Explorar Receitas", href: "#recipes-grid" }
]}
/>
</div>
<div id="recipes-filter" data-section="recipes-filter">
<FeatureCardTwentyFive
title="Filtre Receitas por Objetivo"
description="Selecione seu objetivo atual e o sistema recomendará as melhores receitas para atingir suas metas nutricionais e de transformação corporal."
tag="Recomendação Inteligente"
tagIcon={Filter}
features={[
{
title: "Perda de Peso", description: "Receitas com déficit calórico otimizado. Alto em proteína para preservar músculos, baixo em carboidratos estratégicos. Ideal para queimar gordura mantendo a força.", icon: TrendingDown,
mediaItems: [
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", alt: "Receitas para perda de peso"
},
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png", alt: "Progresso de déficit calórico"
}
]
},
{
title: "Ganho de Massa", description: "Receitas com superávit calórico controlado. Proteína máxima (2g por kg), carboidratos pré e pós-treino, gorduras saudáveis. Perfeito para crescimento muscular.", icon: TrendingUp,
mediaItems: [
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", alt: "Receitas para ganho de massa"
},
{
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png", alt: "Progresso de ganho muscular"
}
]
}
]}
animationType="blur-reveal"
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<div id="recipes-grid" data-section="recipes-grid">
<div className="w-full py-20">
<div className="max-w-7xl mx-auto px-6">
<div className="flex flex-col items-center gap-8 mb-16">
<div className="text-center">
<h2 className="text-4xl font-extrabold mb-4">Receitas Recomendadas</h2>
<p className="text-lg text-foreground/75">Selecione seu objetivo para ver receitas personalizadas</p>
</div>
<div className="flex gap-4 flex-wrap justify-center">
<button
onClick={() => setSelectedGoal("all")}
className={`px-6 py-3 rounded-full font-semibold transition-all ${
selectedGoal === "all"
? "bg-primary-cta text-white"
: "bg-secondary-cta/20 text-foreground hover:bg-secondary-cta/40"
}`}
>
Todas as Receitas
</button>
<button
onClick={() => setSelectedGoal("weight-loss")}
className={`px-6 py-3 rounded-full font-semibold transition-all ${
selectedGoal === "weight-loss"
? "bg-primary-cta text-white"
: "bg-secondary-cta/20 text-foreground hover:bg-secondary-cta/40"
}`}
>
Perda de Peso
</button>
<button
onClick={() => setSelectedGoal("muscle-gain")}
className={`px-6 py-3 rounded-full font-semibold transition-all ${
selectedGoal === "muscle-gain"
? "bg-primary-cta text-white"
: "bg-secondary-cta/20 text-foreground hover:bg-secondary-cta/40"
}`}
>
Ganho de Massa
</button>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{filteredRecipes.map(recipe => (
<div key={recipe.id} className="bg-card rounded-2xl overflow-hidden shadow-lg hover:shadow-xl transition-shadow">
<div className="relative h-64 overflow-hidden">
<img
src={recipe.imageSrc}
alt={recipe.imageAlt}
className="w-full h-full object-cover hover:scale-105 transition-transform duration-300"
/>
</div>
<div className="p-6">
<div className="flex items-start justify-between mb-3">
<h3 className="text-xl font-bold text-foreground">{recipe.name}</h3>
<span className="text-xs font-semibold bg-primary-cta/20 text-primary-cta px-3 py-1 rounded-full">
{recipe.category}
</span>
</div>
<p className="text-sm text-foreground/75 mb-4">Tempo: {recipe.prepTime}</p>
<div className="grid grid-cols-4 gap-2 mb-4">
<div className="text-center">
<p className="text-xs text-foreground/60">Calorias</p>
<p className="font-bold text-foreground">{recipe.calories}</p>
</div>
<div className="text-center">
<p className="text-xs text-foreground/60">Proteína</p>
<p className="font-bold text-foreground">{recipe.protein}g</p>
</div>
<div className="text-center">
<p className="text-xs text-foreground/60">Carbs</p>
<p className="font-bold text-foreground">{recipe.carbs}g</p>
</div>
<div className="text-center">
<p className="text-xs text-foreground/60">Gordura</p>
<p className="font-bold text-foreground">{recipe.fats}g</p>
</div>
</div>
<div className="flex flex-wrap gap-2">
{recipe.goals.includes("weight-loss") && (
<span className="text-xs bg-accent/20 text-accent px-2 py-1 rounded-full">Perda</span>
)}
{recipe.goals.includes("muscle-gain") && (
<span className="text-xs bg-accent/20 text-accent px-2 py-1 rounded-full">Ganho</span>
)}
</div>
<button className="w-full mt-4 bg-primary-cta text-white font-semibold py-2 rounded-lg hover:opacity-90 transition-opacity">
Ver Detalhes
</button>
</div>
</div>
))}
</div>
{filteredRecipes.length === 0 && (
<div className="text-center py-12">
<p className="text-lg text-foreground/75">Nenhuma receita encontrada para este objetivo.</p>
</div>
)}
</div>
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Produto", items: [
{ label: "Dashboard", href: "dashboard" },
{ label: "Treino", href: "training" },
{ label: "Receitas", href: "/recipes" },
{ label: "Cardio Hub", href: "cardio" }
]
},
{
title: "Comunidade", items: [
{ label: "Comunidade", href: "community" },
{ label: "Perfil", href: "profile" },
{ label: "Rankings", href: "rankings" },
{ label: "Blog", href: "blog" }
]
},
{
title: "Empresa", items: [
{ label: "Sobre", href: "about" },
{ label: "Contato", href: "contact" },
{ label: "Privacidade", href: "privacy" },
{ label: "Termos", href: "terms" }
]
}
]}
logoText="FitFlow Pro"
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
/>
</div>
</ThemeProvider>
);
}

View File

@@ -1,273 +0,0 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import { useState } from "react";
import { Eye, EyeOff, Mail, Lock, User, CheckCircle2, AlertCircle } from 'lucide-react';
import Input from '@/components/form/Input';
export default function SignupPage() {
const [formData, setFormData] = useState({
name: "", email: "", password: "", confirmPassword: ""
});
const [showPassword, setShowPassword] = useState(false);
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
const [errors, setErrors] = useState<{ [key: string]: string }>({});
const [isSubmitted, setIsSubmitted] = useState(false);
const [passwordStrength, setPasswordStrength] = useState<"weak" | "medium" | "strong" | "">("");
const calculatePasswordStrength = (pwd: string): "weak" | "medium" | "strong" | "" => {
if (!pwd) return "";
if (pwd.length < 8) return "weak";
if (/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{8}$/.test(pwd)) return "strong";
return "medium";
};
const handleInputChange = (field: string, value: string) => {
setFormData(prev => ({
...prev,
[field]: value
}));
if (field === "password") {
setPasswordStrength(calculatePasswordStrength(value));
}
};
const validateForm = () => {
const newErrors: { [key: string]: string } = {};
if (!formData.name.trim()) {
newErrors.name = "Nome é obrigatório";
} else if (formData.name.trim().length < 2) {
newErrors.name = "Nome deve ter no mínimo 2 caracteres";
}
if (!formData.email) {
newErrors.email = "Email é obrigatório";
} else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) {
newErrors.email = "Email inválido";
}
if (!formData.password) {
newErrors.password = "Senha é obrigatória";
} else if (formData.password.length < 8) {
newErrors.password = "Senha deve ter no mínimo 8 caracteres";
}
if (formData.password !== formData.confirmPassword) {
newErrors.confirmPassword = "As senhas não correspondem";
}
return newErrors;
};
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
const newErrors = validateForm();
setErrors(newErrors);
if (Object.keys(newErrors).length === 0) {
setIsSubmitted(true);
console.log("Signup attempt:", formData);
setTimeout(() => {
setIsSubmitted(false);
}, 2000);
}
};
const getStrengthColor = () => {
switch (passwordStrength) {
case "weak":
return "text-red-500";
case "medium":
return "text-yellow-500";
case "strong":
return "text-green-500";
default:
return "text-foreground/30";
}
};
return (
<ThemeProvider
defaultButtonVariant="elastic-effect"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="smallMedium"
sizing="mediumSizeLargeTitles"
background="blurBottom"
cardStyle="gradient-bordered"
primaryButtonStyle="flat"
secondaryButtonStyle="glass"
headingFontWeight="extrabold"
>
<div id="nav" data-section="nav">
<NavbarStyleCentered
navItems={[
{ name: "Dashboard", id: "/" },
{ name: "Treino", id: "training" },
{ name: "Nutrição", id: "nutrition" },
{ name: "Comunidade", id: "community" },
{ name: "Perfil", id: "profile" }
]}
button={{ text: "Entrar", href: "/login" }}
brandName="FitFlow Pro"
/>
</div>
<div className="min-h-[calc(100vh-80px)] flex items-center justify-center py-12 px-4">
<div className="w-full max-w-md">
<div className="bg-card rounded-3xl shadow-lg p-8 border border-accent/10">
<div className="mb-8">
<h1 className="text-3xl font-extrabold text-foreground mb-2">Começar Agora</h1>
<p className="text-foreground/70">Crie sua conta e inicie sua transformação</p>
</div>
<form onSubmit={handleSubmit} className="space-y-6">
<div>
<label className="block text-sm font-medium text-foreground mb-2">
<div className="flex items-center gap-2">
<User size={16} />
Nome Completo
</div>
</label>
<Input
value={formData.name}
onChange={(value) => handleInputChange("name", value)}
type="text"
placeholder="Seu nome"
required
className={errors.name ? "border-red-500" : ""}
/>
{errors.name && (
<div className="flex items-center gap-1 text-red-500 text-sm mt-1">
<AlertCircle size={14} />
{errors.name}
</div>
)}
</div>
<div>
<label className="block text-sm font-medium text-foreground mb-2">
<div className="flex items-center gap-2">
<Mail size={16} />
Email
</div>
</label>
<Input
value={formData.email}
onChange={(value) => handleInputChange("email", value)}
type="email"
placeholder="seu@email.com"
required
className={errors.email ? "border-red-500" : ""}
/>
{errors.email && (
<div className="flex items-center gap-1 text-red-500 text-sm mt-1">
<AlertCircle size={14} />
{errors.email}
</div>
)}
</div>
<div>
<label className="block text-sm font-medium text-foreground mb-2">
<div className="flex items-center gap-2">
<Lock size={16} />
Senha
</div>
</label>
<div className="relative">
<Input
value={formData.password}
onChange={(value) => handleInputChange("password", value)}
type={showPassword ? "text" : "password"}
placeholder="••••••••"
required
className={errors.password ? "border-red-500" : "pr-10"}
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2 text-foreground/50 hover:text-foreground transition-colors"
aria-label={showPassword ? "Ocultar senha" : "Mostrar senha"}
>
{showPassword ? <EyeOff size={18} /> : <Eye size={18} />}
</button>
</div>
{passwordStrength && (
<div className={`flex items-center gap-1 text-xs mt-2 ${getStrengthColor()}`}>
<CheckCircle2 size={12} />
Força: {passwordStrength === "weak" ? "Fraca" : passwordStrength === "medium" ? "Média" : "Forte"}
</div>
)}
{errors.password && (
<div className="flex items-center gap-1 text-red-500 text-sm mt-1">
<AlertCircle size={14} />
{errors.password}
</div>
)}
</div>
<div>
<label className="block text-sm font-medium text-foreground mb-2">
<div className="flex items-center gap-2">
<Lock size={16} />
Confirmar Senha
</div>
</label>
<div className="relative">
<Input
value={formData.confirmPassword}
onChange={(value) => handleInputChange("confirmPassword", value)}
type={showConfirmPassword ? "text" : "password"}
placeholder="••••••••"
required
className={errors.confirmPassword ? "border-red-500" : "pr-10"}
/>
<button
type="button"
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2 text-foreground/50 hover:text-foreground transition-colors"
aria-label={showConfirmPassword ? "Ocultar senha" : "Mostrar senha"}
>
{showConfirmPassword ? <EyeOff size={18} /> : <Eye size={18} />}
</button>
</div>
{errors.confirmPassword && (
<div className="flex items-center gap-1 text-red-500 text-sm mt-1">
<AlertCircle size={14} />
{errors.confirmPassword}
</div>
)}
</div>
<button
type="submit"
disabled={isSubmitted}
className="w-full py-3 px-4 bg-primary-cta hover:opacity-90 disabled:opacity-50 text-white font-semibold rounded-full transition-all duration-300 transform hover:scale-105"
>
{isSubmitted ? "Criando conta..." : "Criar Conta"}
</button>
</form>
<div className="mt-6 text-center text-sm text-foreground/70">
<p>
tem conta?{" "}
<a href="/login" className="text-primary-cta font-semibold hover:underline">
Fazer login
</a>
</p>
</div>
<div className="mt-6 pt-6 border-t border-accent/10 text-center text-xs text-foreground/50">
<p>Teste gratuito por 30 dias. Sem cartão de crédito necessário.</p>
<p className="mt-2">Ao criar uma conta, você concorda com nossos Termos de Serviço e Política de Privacidade.</p>
</div>
</div>
</div>
</div>
</ThemeProvider>
);
}

View File

@@ -0,0 +1,31 @@
"use client";
import { useAuth } from "@/hooks/useAuth";
import { useEffect } from "react";
import { useRouter } from "next/navigation";
interface ProtectedRouteProps {
children: React.ReactNode;
fallback?: React.ReactNode;
}
export function ProtectedRoute({ children, fallback }: ProtectedRouteProps) {
const { isAuthenticated, isLoading } = useAuth();
const router = useRouter();
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push("/login");
}
}, [isLoading, isAuthenticated, router]);
if (isLoading) {
return fallback || <div className="flex items-center justify-center min-h-screen">Carregando...</div>;
}
if (!isAuthenticated) {
return null;
}
return <>{children}</>;
}

View File

@@ -1,123 +1,25 @@
"use client";
import { ReactNode } from 'react';
import { useCardStack } from './CardStackContext';
import { memo, Children } from "react";
import CardStackTextBox from "@/components/cardStack/CardStackTextBox";
import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation";
import { cls } from "@/lib/utils";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
interface CardListProps {
children: React.ReactNode;
animationType: CardAnimationType;
useUncappedRounding?: boolean;
title?: string;
titleSegments?: TitleSegment[];
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground?: InvertedBackground;
disableCardWrapper?: boolean;
ariaLabel?: string;
export interface CardListProps {
children: ReactNode;
className?: string;
containerClassName?: string;
cardClassName?: string;
textBoxClassName?: string;
titleClassName?: string;
titleImageWrapperClassName?: string;
titleImageClassName?: string;
descriptionClassName?: string;
tagClassName?: string;
buttonContainerClassName?: string;
buttonClassName?: string;
buttonTextClassName?: string;
ariaLabel?: string;
}
const CardList = ({
children,
animationType,
useUncappedRounding = false,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
disableCardWrapper = false,
ariaLabel = "Card list",
className = "",
containerClassName = "",
cardClassName = "",
textBoxClassName = "",
titleClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
descriptionClassName = "",
tagClassName = "",
buttonContainerClassName = "",
buttonClassName = "",
buttonTextClassName = "",
}: CardListProps) => {
const childrenArray = Children.toArray(children);
const { itemRefs } = useCardAnimation({ animationType, itemCount: childrenArray.length, useIndividualTriggers: true });
export function CardList({ children, className = '', ariaLabel = 'Card list' }: CardListProps) {
const { isVisible, getAnimationProps } = useCardStack();
const animationProps = getAnimationProps();
return (
<section
<div
className={className}
aria-label={ariaLabel}
className={cls(
"relative py-20 w-full",
useInvertedBackground && "bg-foreground",
className
)}
data-is-visible={animationProps.isVisible}
>
<div className={cls("w-content-width mx-auto flex flex-col gap-8", containerClassName)}>
<CardStackTextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
textBoxClassName={textBoxClassName}
titleClassName={titleClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
descriptionClassName={descriptionClassName}
tagClassName={tagClassName}
buttonContainerClassName={buttonContainerClassName}
buttonClassName={buttonClassName}
buttonTextClassName={buttonTextClassName}
/>
<div className="flex flex-col gap-6">
{childrenArray.map((child, index) => (
<div
key={index}
ref={(el) => { itemRefs.current[index] = el; }}
className={cls(!disableCardWrapper && "card", !disableCardWrapper && (useUncappedRounding ? "rounded-theme" : "rounded-theme-capped"), cardClassName)}
>
{child}
</div>
))}
</div>
</div>
</section>
{children}
</div>
);
};
}
CardList.displayName = "CardList";
export default memo(CardList);
export default CardList;

View File

@@ -1,229 +1,24 @@
"use client";
import { ReactNode } from 'react';
import { CardStackProvider, CardStackContextType } from './CardStackContext';
import { memo, Children } from "react";
import { CardStackProps } from "./types";
import GridLayout from "./layouts/grid/GridLayout";
import AutoCarousel from "./layouts/carousels/AutoCarousel";
import ButtonCarousel from "./layouts/carousels/ButtonCarousel";
import TimelineBase from "./layouts/timelines/TimelineBase";
import { gridConfigs } from "./layouts/grid/gridConfigs";
export interface CardStackProps {
children: ReactNode;
className?: string;
ariaLabel?: string;
}
const CardStack = ({
children,
mode = "buttons",
gridVariant = "uniform-all-items-equal",
uniformGridCustomHeightClasses,
gridRowsClassName,
itemHeightClassesOverride,
animationType,
supports3DAnimation = false,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout = "default",
useInvertedBackground,
carouselThreshold = 5,
bottomContent,
className = "",
containerClassName = "",
gridClassName = "",
carouselClassName = "",
carouselItemClassName = "",
controlsClassName = "",
textBoxClassName = "",
titleClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
descriptionClassName = "",
tagClassName = "",
buttonContainerClassName = "",
buttonClassName = "",
buttonTextClassName = "",
ariaLabel = "Card stack",
}: CardStackProps) => {
const childrenArray = Children.toArray(children);
const itemCount = childrenArray.length;
export default function CardStack({ children, className = '', ariaLabel = 'Card stack' }: CardStackProps) {
const contextValue: CardStackContextType = {
isVisible: true,
getAnimationProps: () => ({ isVisible: true }),
itemRefs: {}
};
// Check if the current grid config has gridRows defined
const gridConfig = gridConfigs[gridVariant]?.[itemCount];
const hasFixedGridRows = gridConfig && 'gridRows' in gridConfig && gridConfig.gridRows;
// If grid has fixed row heights and we have uniformGridCustomHeightClasses,
// we need to use min-h-0 on md+ to prevent conflicts
let adjustedHeightClasses = uniformGridCustomHeightClasses;
if (hasFixedGridRows && uniformGridCustomHeightClasses) {
// Extract the mobile min-height and add md:min-h-0
const mobileMinHeight = uniformGridCustomHeightClasses.split(' ')[0];
adjustedHeightClasses = `${mobileMinHeight} md:min-h-0`;
}
// Timeline layout for zigzag pattern (works best with 3-6 items)
if (gridVariant === "timeline" && itemCount >= 3 && itemCount <= 6) {
// Convert depth-3d to scale-rotate for timeline (doesn't support 3D)
const timelineAnimationType = animationType === "depth-3d" ? "scale-rotate" : animationType;
return (
<TimelineBase
variant={gridVariant}
uniformGridCustomHeightClasses={adjustedHeightClasses}
animationType={timelineAnimationType}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
textBoxClassName={textBoxClassName}
titleClassName={titleClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
descriptionClassName={descriptionClassName}
tagClassName={tagClassName}
buttonContainerClassName={buttonContainerClassName}
buttonClassName={buttonClassName}
buttonTextClassName={buttonTextClassName}
ariaLabel={ariaLabel}
>
{childrenArray}
</TimelineBase>
);
}
// Use grid for items below threshold, carousel for items at or above threshold
// Timeline with 7+ items will also use carousel
const useCarousel = itemCount >= carouselThreshold || (gridVariant === "timeline" && itemCount > 6);
// Grid layout for 1-4 items
if (!useCarousel) {
return (
<GridLayout
itemCount={itemCount}
gridVariant={gridVariant}
uniformGridCustomHeightClasses={adjustedHeightClasses}
gridRowsClassName={gridRowsClassName}
itemHeightClassesOverride={itemHeightClassesOverride}
animationType={animationType}
supports3DAnimation={supports3DAnimation}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
bottomContent={bottomContent}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
textBoxClassName={textBoxClassName}
titleClassName={titleClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
descriptionClassName={descriptionClassName}
tagClassName={tagClassName}
buttonContainerClassName={buttonContainerClassName}
buttonClassName={buttonClassName}
buttonTextClassName={buttonTextClassName}
ariaLabel={ariaLabel}
>
{childrenArray}
</GridLayout>
);
}
// Auto-scroll carousel for 5+ items
if (mode === "auto") {
// Convert depth-3d to scale-rotate for carousel (doesn't support 3D)
const carouselAnimationType = animationType === "depth-3d" ? "scale-rotate" : animationType;
return (
<AutoCarousel
uniformGridCustomHeightClasses={adjustedHeightClasses}
animationType={carouselAnimationType}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
bottomContent={bottomContent}
className={className}
containerClassName={containerClassName}
carouselClassName={carouselClassName}
textBoxClassName={textBoxClassName}
titleClassName={titleClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
descriptionClassName={descriptionClassName}
tagClassName={tagClassName}
buttonContainerClassName={buttonContainerClassName}
buttonClassName={buttonClassName}
buttonTextClassName={buttonTextClassName}
ariaLabel={ariaLabel}
>
{childrenArray}
</AutoCarousel>
);
}
// Button-controlled carousel for 5+ items
// Convert depth-3d to scale-rotate for carousel (doesn't support 3D)
const carouselAnimationType = animationType === "depth-3d" ? "scale-rotate" : animationType;
return (
<ButtonCarousel
uniformGridCustomHeightClasses={adjustedHeightClasses}
animationType={carouselAnimationType}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
bottomContent={bottomContent}
className={className}
containerClassName={containerClassName}
carouselClassName={carouselClassName}
carouselItemClassName={carouselItemClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={titleClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
descriptionClassName={descriptionClassName}
tagClassName={tagClassName}
buttonContainerClassName={buttonContainerClassName}
buttonClassName={buttonClassName}
buttonTextClassName={buttonTextClassName}
ariaLabel={ariaLabel}
>
{childrenArray}
</ButtonCarousel>
);
};
CardStack.displayName = "CardStack";
export default memo(CardStack);
return (
<CardStackProvider value={contextValue}>
<div className={className} aria-label={ariaLabel}>
{children}
</div>
</CardStackProvider>
);
}

View File

@@ -0,0 +1,31 @@
import { createContext, useContext, ReactNode } from 'react';
export interface CardStackContextType {
isVisible: boolean;
getAnimationProps: () => { isVisible: boolean };
itemRefs?: Record<string, HTMLElement | null>;
}
const CardStackContext = createContext<CardStackContextType | undefined>(undefined);
export function useCardStack() {
const context = useContext(CardStackContext);
if (!context) {
return {
isVisible: false,
getAnimationProps: () => ({ isVisible: false }),
itemRefs: {}
};
}
return context;
}
export function CardStackProvider({ children, value }: { children: ReactNode; value: CardStackContextType }) {
return (
<CardStackContext.Provider value={value}>
{children}
</CardStackContext.Provider>
);
}
export default CardStackContext;

View File

@@ -1,148 +1,25 @@
"use client";
import { ReactNode } from 'react';
import { useCardStack } from '../../CardStackContext';
import { memo, Children } from "react";
import Marquee from "react-fast-marquee";
import CardStackTextBox from "../../CardStackTextBox";
import { cls } from "@/lib/utils";
import { AutoCarouselProps } from "../../types";
import { useCardAnimation } from "../../hooks/useCardAnimation";
export interface AutoCarouselProps {
children: ReactNode;
className?: string;
ariaLabel?: string;
}
const AutoCarousel = ({
children,
uniformGridCustomHeightClasses,
animationType,
speed = 50,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout = "default",
useInvertedBackground,
bottomContent,
className = "",
containerClassName = "",
carouselClassName = "",
itemClassName = "",
textBoxClassName = "",
titleClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
descriptionClassName = "",
tagClassName = "",
buttonContainerClassName = "",
buttonClassName = "",
buttonTextClassName = "",
ariaLabel,
showTextBox = true,
dualMarquee = false,
topMarqueeDirection = "left",
bottomCarouselClassName = "",
marqueeGapClassName = "",
}: AutoCarouselProps) => {
const childrenArray = Children.toArray(children);
const heightClasses = uniformGridCustomHeightClasses || "min-h-80 2xl:min-h-90";
const { itemRefs, bottomContentRef } = useCardAnimation({
animationType,
itemCount: childrenArray.length,
isGrid: false
});
export function AutoCarousel({ children, className = '', ariaLabel = 'Auto carousel' }: AutoCarouselProps) {
const { isVisible, getAnimationProps } = useCardStack();
const animationProps = getAnimationProps();
// Bottom marquee direction is opposite of top
const bottomMarqueeDirection = topMarqueeDirection === "left" ? "right" : "left";
return (
<div
className={className}
aria-label={ariaLabel}
data-is-visible={animationProps.isVisible}
>
{children}
</div>
);
}
// Reverse order for bottom marquee to avoid alignment with top
const bottomChildren = dualMarquee ? [...childrenArray].reverse() : [];
return (
<section
className={cls(
"relative py-20 w-full",
useInvertedBackground && "bg-foreground",
className
)}
aria-label={ariaLabel}
aria-live="off"
>
<div className={cls("w-full md:w-content-width mx-auto", containerClassName)}>
<div className="w-full flex flex-col items-center">
<div className="w-full flex flex-col gap-6">
{showTextBox && (title || titleSegments || description) && (
<CardStackTextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
textBoxClassName={textBoxClassName}
titleClassName={titleClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
descriptionClassName={descriptionClassName}
tagClassName={tagClassName}
buttonContainerClassName={buttonContainerClassName}
buttonClassName={buttonClassName}
buttonTextClassName={buttonTextClassName}
/>
)}
<div
className={cls(
"w-full flex flex-col",
marqueeGapClassName || "gap-6"
)}
>
{/* Top/Single Marquee */}
<div className={cls("overflow-hidden w-full relative z-10 mask-padding-x", carouselClassName)}>
<Marquee gradient={false} speed={speed} direction={topMarqueeDirection}>
{Children.map(childrenArray, (child, index) => (
<div
key={index}
className={cls("flex-none w-carousel-item-3 xl:w-carousel-item-4 mb-1 mr-6", heightClasses, itemClassName)}
ref={(el) => { itemRefs.current[index] = el; }}
>
{child}
</div>
))}
</Marquee>
</div>
{/* Bottom Marquee (only if dualMarquee is true) - Reversed order, opposite direction */}
{dualMarquee && (
<div className={cls("overflow-hidden w-full relative z-10 mask-padding-x", bottomCarouselClassName || carouselClassName)}>
<Marquee gradient={false} speed={speed} direction={bottomMarqueeDirection}>
{Children.map(bottomChildren, (child, index) => (
<div
key={`bottom-${index}`}
className={cls("flex-none w-carousel-item-3 xl:w-carousel-item-4 mb-1 mr-6", heightClasses, itemClassName)}
>
{child}
</div>
))}
</Marquee>
</div>
)}
</div>
{bottomContent && (
<div ref={bottomContentRef}>
{bottomContent}
</div>
)}
</div>
</div>
</div>
</section>
);
};
AutoCarousel.displayName = "AutoCarousel";
export default memo(AutoCarousel);
export default AutoCarousel;

View File

@@ -1,182 +1,25 @@
"use client";
import { ReactNode } from 'react';
import { useCardStack } from '../../CardStackContext';
import { memo, Children } from "react";
import useEmblaCarousel from "embla-carousel-react";
import { ChevronLeft, ChevronRight } from "lucide-react";
import CardStackTextBox from "../../CardStackTextBox";
import { cls } from "@/lib/utils";
import { ButtonCarouselProps } from "../../types";
import { usePrevNextButtons } from "../../hooks/usePrevNextButtons";
import { useScrollProgress } from "../../hooks/useScrollProgress";
import { useCardAnimation } from "../../hooks/useCardAnimation";
export interface ButtonCarouselProps {
children: ReactNode;
className?: string;
ariaLabel?: string;
}
const ButtonCarousel = ({
children,
uniformGridCustomHeightClasses,
animationType,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout = "default",
useInvertedBackground,
bottomContent,
className = "",
containerClassName = "",
carouselClassName = "",
carouselItemClassName = "",
controlsClassName = "",
textBoxClassName = "",
titleClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
descriptionClassName = "",
tagClassName = "",
buttonContainerClassName = "",
buttonClassName = "",
buttonTextClassName = "",
ariaLabel,
}: ButtonCarouselProps) => {
const [emblaRef, emblaApi] = useEmblaCarousel({ dragFree: true });
export function ButtonCarousel({ children, className = '', ariaLabel = 'Button carousel' }: ButtonCarouselProps) {
const { isVisible, getAnimationProps } = useCardStack();
const animationProps = getAnimationProps();
const {
prevBtnDisabled,
nextBtnDisabled,
onPrevButtonClick,
onNextButtonClick,
} = usePrevNextButtons(emblaApi);
return (
<div
className={className}
aria-label={ariaLabel}
data-is-visible={animationProps.isVisible}
>
{children}
</div>
);
}
const scrollProgress = useScrollProgress(emblaApi);
const childrenArray = Children.toArray(children);
const heightClasses = uniformGridCustomHeightClasses || "min-h-80 2xl:min-h-90";
const { itemRefs, bottomContentRef } = useCardAnimation({
animationType,
itemCount: childrenArray.length,
isGrid: false
});
return (
<section
className={cls(
"relative px-[var(--width-0)] py-20 w-full",
useInvertedBackground && "bg-foreground",
className
)}
aria-label={ariaLabel}
>
<div className={cls("w-full mx-auto", containerClassName)}>
<div className="w-full flex flex-col items-center">
<div className="w-full flex flex-col gap-6">
{(title || titleSegments || description) && (
<div className="w-content-width mx-auto">
<CardStackTextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
textBoxClassName={textBoxClassName}
titleClassName={titleClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
descriptionClassName={descriptionClassName}
tagClassName={tagClassName}
buttonContainerClassName={buttonContainerClassName}
buttonClassName={buttonClassName}
buttonTextClassName={buttonTextClassName}
/>
</div>
)}
<div
className={cls(
"w-full flex flex-col gap-6"
)}
>
<div
className={cls(
"overflow-hidden w-full relative z-10 flex cursor-grab",
carouselClassName
)}
ref={emblaRef}
>
<div className="flex gap-6 w-full">
<div className="flex-shrink-0 w-carousel-padding" />
{Children.map(childrenArray, (child, index) => (
<div
key={index}
className={cls("flex-none select-none w-carousel-item-3 xl:w-carousel-item-4 mb-6", heightClasses, carouselItemClassName)}
ref={(el) => { itemRefs.current[index] = el; }}
>
{child}
</div>
))}
<div className="flex-shrink-0 w-carousel-padding" />
</div>
</div>
<div className={cls("w-full flex", controlsClassName)}>
<div className="flex-shrink-0 w-carousel-padding-controls" />
<div className="flex justify-between items-center w-full">
<div
className="rounded-theme card relative h-2 w-50 overflow-hidden"
role="progressbar"
aria-label="Carousel progress"
aria-valuenow={Math.round(scrollProgress)}
aria-valuemin={0}
aria-valuemax={100}
>
<div
className="bg-foreground primary-button absolute! w-full top-0 bottom-0 -left-full rounded-theme"
style={{ transform: `translate3d(${scrollProgress}%,0px,0px)` }}
/>
</div>
<div className="flex items-center gap-3">
<button
onClick={onPrevButtonClick}
disabled={prevBtnDisabled}
className="secondary-button h-8 aspect-square flex items-center justify-center rounded-theme cursor-pointer transition-colors disabled:cursor-not-allowed disabled:opacity-50"
type="button"
aria-label="Previous slide"
>
<ChevronLeft className="h-[40%] w-auto aspect-square text-secondary-cta-text" />
</button>
<button
onClick={onNextButtonClick}
disabled={nextBtnDisabled}
className="secondary-button h-8 aspect-square flex items-center justify-center rounded-theme cursor-pointer transition-colors disabled:cursor-not-allowed disabled:opacity-50"
type="button"
aria-label="Next slide"
>
<ChevronRight className="h-[40%] w-auto aspect-square text-secondary-cta-text" />
</button>
</div>
</div>
<div className="flex-shrink-0 w-carousel-padding-controls" />
</div>
</div>
{bottomContent && (
<div ref={bottomContentRef} className="w-content-width mx-auto">
{bottomContent}
</div>
)}
</div>
</div>
</div>
</section>
);
};
ButtonCarousel.displayName = "ButtonCarousel";
export default memo(ButtonCarousel);
export default ButtonCarousel;

View File

@@ -1,244 +1,174 @@
"use client";
import { memo } from "react";
import Image from "next/image";
import CardStack from "@/components/cardStack/CardStack";
import Badge from "@/components/shared/Badge";
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { BlogPost } from "@/lib/api/blog";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
import React, { useState, useMemo } from "react";
import { ChevronLeft, ChevronRight, ArrowRight } from "lucide-react";
import TextBox from "@/components/Textbox";
type BlogCard = BlogPost;
interface BlogCardOneProps {
blogs: BlogCard[];
carouselMode?: "auto" | "buttons";
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationType;
export interface BlogCardOneProps {
blogs: Array<{
id: string;
category: string;
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
imageWrapperClassName?: string;
imageClassName?: string;
categoryClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
authorContainerClassName?: string;
authorAvatarClassName?: string;
authorNameClassName?: string;
dateClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
excerpt: string;
imageSrc: string;
imageAlt?: string;
authorName: string;
authorAvatar: string;
date: string;
onBlogClick?: () => void;
}>;
carouselMode?: "auto" | "buttons";
uniformGridCustomHeightClasses?: string;
animationType?: string;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
imageWrapperClassName?: string;
imageClassName?: string;
categoryClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
authorContainerClassName?: string;
authorAvatarClassName?: string;
authorNameClassName?: string;
dateClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
}
interface BlogCardItemProps {
blog: BlogCard;
shouldUseLightText: boolean;
cardClassName?: string;
imageWrapperClassName?: string;
imageClassName?: string;
categoryClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
authorContainerClassName?: string;
authorAvatarClassName?: string;
authorNameClassName?: string;
dateClassName?: string;
}
const BlogCardOne: React.FC<BlogCardOneProps> = ({
blogs,
carouselMode = "buttons", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description,
tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Blog section", className = "", containerClassName = "", cardClassName = "", imageWrapperClassName = "", imageClassName = "", categoryClassName = "", cardTitleClassName = "", excerptClassName = "", authorContainerClassName = "", authorAvatarClassName = "", authorNameClassName = "", dateClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = "" }) => {
const [currentIndex, setCurrentIndex] = useState(0);
const BlogCardItem = memo(({
blog,
shouldUseLightText,
cardClassName = "",
imageWrapperClassName = "",
imageClassName = "",
categoryClassName = "",
cardTitleClassName = "",
excerptClassName = "",
authorContainerClassName = "",
authorAvatarClassName = "",
authorNameClassName = "",
dateClassName = "",
}: BlogCardItemProps) => {
return (
<article
className={cls("relative h-full card group flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
onClick={blog.onBlogClick}
role="article"
aria-label={`${blog.title} by ${blog.authorName}`}
>
<div className={cls("relative z-1 w-full aspect-[4/3] overflow-hidden rounded-theme-capped", imageWrapperClassName)}>
<Image
src={blog.imageSrc}
alt={blog.imageAlt || blog.title}
fill
className={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", imageClassName)}
unoptimized={blog.imageSrc.startsWith('http') || blog.imageSrc.startsWith('//')}
/>
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
</div>
const blogCards = blogs.map((blog) => (
<div
key={blog.id}
className={`flex flex-col h-full rounded-lg overflow-hidden bg-card hover:shadow-lg transition-shadow cursor-pointer ${
cardClassName || ""
}`}
onClick={blog.onBlogClick}
>
<div className={`relative overflow-hidden bg-foreground/5 ${imageWrapperClassName}`}>
<img
src={blog.imageSrc}
alt={blog.imageAlt || blog.title}
className={`w-full h-60 object-cover hover:scale-105 transition-transform duration-300 ${
imageClassName || ""
}`}
/>
<button className="absolute top-4 right-4 bg-primary-cta/90 hover:bg-primary-cta p-2 rounded-full transition-colors">
<ArrowRight className="w-4 h-4 text-foreground" />
</button>
</div>
<div className="relative z-1 flex flex-col justify-between gap-6 flex-1">
<div className="flex flex-col gap-2">
<Badge text={blog.category} variant="primary" className={categoryClassName} />
<div className="flex-1 p-6 flex flex-col gap-3">
<span className={`text-xs font-semibold text-primary-cta uppercase ${
categoryClassName || ""
}`}>
{blog.category}
</span>
<h3 className={cls("text-2xl font-medium leading-[1.25] mt-1", shouldUseLightText ? "text-background" : "text-foreground", cardTitleClassName)}>
{blog.title}
</h3>
<h3 className={`text-lg font-semibold text-foreground line-clamp-2 ${
cardTitleClassName || ""
}`}>
{blog.title}
</h3>
<p className={cls("text-base leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", excerptClassName)}>
{blog.excerpt}
</p>
</div>
<p className={`text-sm text-foreground/70 line-clamp-2 flex-1 ${
excerptClassName || ""
}`}>
{blog.excerpt}
</p>
<div className={cls("flex items-center gap-3", authorContainerClassName)}>
<Image
src={blog.authorAvatar}
alt={blog.authorName}
width={40}
height={40}
className={cls("h-9 w-auto aspect-square rounded-theme object-cover", authorAvatarClassName)}
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
/>
<div className="flex flex-col">
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
{blog.authorName}
</p>
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
{blog.date}
</p>
</div>
</div>
</div>
</article>
);
});
<div className={`flex items-center gap-3 pt-4 border-t border-foreground/10 ${
authorContainerClassName || ""
}`}>
<img
src={blog.authorAvatar}
alt={blog.authorName}
className={`w-8 h-8 rounded-full object-cover ${
authorAvatarClassName || ""
}`}
/>
<div className="flex-1 min-w-0">
<p className={`text-sm font-medium text-foreground truncate ${
authorNameClassName || ""
}`}>
{blog.authorName}
</p>
<p className={`text-xs text-foreground/60 ${dateClassName || ""}`}>
{blog.date}
</p>
</div>
</div>
</div>
</div>
));
BlogCardItem.displayName = "BlogCardItem";
const BlogCardOne = ({
blogs = [],
carouselMode = "buttons",
uniformGridCustomHeightClasses,
animationType,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Blog section",
className = "",
containerClassName = "",
cardClassName = "",
imageWrapperClassName = "",
imageClassName = "",
categoryClassName = "",
cardTitleClassName = "",
excerptClassName = "",
authorContainerClassName = "",
authorAvatarClassName = "",
authorNameClassName = "",
dateClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: BlogCardOneProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
return (
<CardStack
mode={carouselMode}
gridVariant="uniform-all-items-equal"
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
return (
<div
className={`w-full py-20 ${
useInvertedBackground ? "bg-background/50" : ""
} ${containerClassName}`}
aria-label={ariaLabel}
>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName || ""}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
description={description || ""}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
ariaLabel={ariaLabel}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
textboxLayout={textboxLayout || "default"}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
>
{blogs.map((blog) => (
<BlogCardItem
key={blog.id}
blog={blog}
shouldUseLightText={shouldUseLightText}
cardClassName={cardClassName}
imageWrapperClassName={imageWrapperClassName}
imageClassName={imageClassName}
categoryClassName={categoryClassName}
cardTitleClassName={cardTitleClassName}
excerptClassName={excerptClassName}
authorContainerClassName={authorContainerClassName}
authorAvatarClassName={authorAvatarClassName}
authorNameClassName={authorNameClassName}
dateClassName={dateClassName}
/>
))}
</CardStack>
);
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<div className={`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 ${gridClassName}`}>
{blogCards}
</div>
</div>
</div>
);
};
BlogCardOne.displayName = "BlogCardOne";
export default BlogCardOne;

View File

@@ -1,288 +1,174 @@
"use client";
import { memo } from "react";
import Image from "next/image";
import CardStack from "@/components/cardStack/CardStack";
import Tag from "@/components/shared/Tag";
import MediaContent from "@/components/shared/MediaContent";
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { BlogPost } from "@/lib/api/blog";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
import React, { useState } from "react";
import { ChevronLeft, ChevronRight, ArrowRight } from "lucide-react";
import TextBox from "@/components/Textbox";
type BlogCard = BlogPost;
interface BlogCardThreeProps {
blogs: BlogCard[];
carouselMode?: "auto" | "buttons";
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationType;
export interface BlogCardThreeProps {
blogs: Array<{
id: string;
category: string;
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
cardContentClassName?: string;
categoryTagClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
authorContainerClassName?: string;
authorAvatarClassName?: string;
authorNameClassName?: string;
dateClassName?: string;
mediaWrapperClassName?: string;
mediaClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
excerpt: string;
imageSrc: string;
imageAlt?: string;
authorName: string;
authorAvatar: string;
date: string;
onBlogClick?: () => void;
}>;
carouselMode?: "auto" | "buttons";
uniformGridCustomHeightClasses?: string;
animationType?: string;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
imageWrapperClassName?: string;
imageClassName?: string;
categoryClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
authorContainerClassName?: string;
authorAvatarClassName?: string;
authorNameClassName?: string;
dateClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
}
interface BlogCardItemProps {
blog: BlogCard;
useInvertedBackground: boolean;
cardClassName?: string;
cardContentClassName?: string;
categoryTagClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
authorContainerClassName?: string;
authorAvatarClassName?: string;
authorNameClassName?: string;
dateClassName?: string;
mediaWrapperClassName?: string;
mediaClassName?: string;
}
const BlogCardThree: React.FC<BlogCardThreeProps> = ({
blogs,
carouselMode = "buttons", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description,
tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Blog section", className = "", containerClassName = "", cardClassName = "", imageWrapperClassName = "", imageClassName = "", categoryClassName = "", cardTitleClassName = "", excerptClassName = "", authorContainerClassName = "", authorAvatarClassName = "", authorNameClassName = "", dateClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = "" }) => {
const [currentIndex, setCurrentIndex] = useState(0);
const BlogCardItem = memo(({
blog,
useInvertedBackground,
cardClassName = "",
cardContentClassName = "",
categoryTagClassName = "",
cardTitleClassName = "",
excerptClassName = "",
authorContainerClassName = "",
authorAvatarClassName = "",
authorNameClassName = "",
dateClassName = "",
mediaWrapperClassName = "",
mediaClassName = "",
}: BlogCardItemProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
const blogCards = blogs.map((blog) => (
<div
key={blog.id}
className={`flex flex-col h-full rounded-lg overflow-hidden bg-card hover:shadow-lg transition-shadow cursor-pointer ${
cardClassName || ""
}`}
onClick={blog.onBlogClick}
>
<div className={`relative overflow-hidden bg-foreground/5 ${imageWrapperClassName}`}>
<img
src={blog.imageSrc}
alt={blog.imageAlt || blog.title}
className={`w-full h-60 object-cover hover:scale-105 transition-transform duration-300 ${
imageClassName || ""
}`}
/>
<button className="absolute top-4 right-4 bg-primary-cta/90 hover:bg-primary-cta p-2 rounded-full transition-colors">
<ArrowRight className="w-4 h-4 text-foreground" />
</button>
</div>
return (
<article
className={cls(
"relative h-full card group flex flex-col justify-between gap-6 p-6 cursor-pointer rounded-theme-capped overflow-hidden",
cardClassName
)}
onClick={blog.onBlogClick}
role="article"
aria-label={blog.title}
>
<div className={cls("relative z-1 flex flex-col gap-3", cardContentClassName)}>
<Tag
text={blog.category}
useInvertedBackground={useInvertedBackground}
className={categoryTagClassName}
/>
<div className="flex-1 p-6 flex flex-col gap-3">
<span className={`text-xs font-semibold text-primary-cta uppercase ${
categoryClassName || ""
}`}>
{blog.category}
</span>
<h3 className={cls(
"text-3xl md:text-4xl font-medium leading-tight line-clamp-2",
shouldUseLightText ? "text-background" : "text-foreground",
cardTitleClassName
)}>
{blog.title}
</h3>
<h3 className={`text-lg font-semibold text-foreground line-clamp-2 ${
cardTitleClassName || ""
}`}>
{blog.title}
</h3>
<p className={cls(
"text-base leading-tight line-clamp-2",
shouldUseLightText ? "text-background/75" : "text-foreground/75",
excerptClassName
)}>
{blog.excerpt}
</p>
<p className={`text-sm text-foreground/70 line-clamp-2 flex-1 ${
excerptClassName || ""
}`}>
{blog.excerpt}
</p>
{(blog.authorName || blog.date) && (
<div className={cls(
"flex",
blog.authorAvatar ? "items-center gap-3" : "flex-row justify-between items-center",
authorContainerClassName
)}>
{blog.authorAvatar && (
<Image
src={blog.authorAvatar}
alt={blog.authorName || "Author"}
width={40}
height={40}
className={cls("h-9 w-auto aspect-square rounded-theme object-cover", authorAvatarClassName)}
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
/>
)}
{blog.authorAvatar ? (
<div className="flex flex-col">
{blog.authorName && (
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
{blog.authorName}
</p>
)}
{blog.date && (
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
{blog.date}
</p>
)}
</div>
) : (
<>
{blog.authorName && (
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
{blog.authorName}
</p>
)}
{blog.date && (
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
{blog.date}
</p>
)}
</>
)}
</div>
)}
</div>
<div className={`flex items-center gap-3 pt-4 border-t border-foreground/10 ${
authorContainerClassName || ""
}`}>
<img
src={blog.authorAvatar}
alt={blog.authorName}
className={`w-8 h-8 rounded-full object-cover ${
authorAvatarClassName || ""
}`}
/>
<div className="flex-1 min-w-0">
<p className={`text-sm font-medium text-foreground truncate ${
authorNameClassName || ""
}`}>
{blog.authorName}
</p>
<p className={`text-xs text-foreground/60 ${dateClassName || ""}`}>
{blog.date}
</p>
</div>
</div>
</div>
</div>
));
<div className={cls("relative z-1 w-full aspect-square", mediaWrapperClassName)}>
<MediaContent
imageSrc={blog.imageSrc}
imageAlt={blog.imageAlt || blog.title}
imageClassName={cls("absolute inset-0 w-full h-full object-cover", mediaClassName)}
/>
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
</div>
</article>
);
});
BlogCardItem.displayName = "BlogCardItem";
const BlogCardThree = ({
blogs = [],
carouselMode = "buttons",
uniformGridCustomHeightClasses = "min-h-none",
animationType,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Blog section",
className = "",
containerClassName = "",
cardClassName = "",
cardContentClassName = "",
categoryTagClassName = "",
cardTitleClassName = "",
excerptClassName = "",
authorContainerClassName = "",
authorAvatarClassName = "",
authorNameClassName = "",
dateClassName = "",
mediaWrapperClassName = "",
mediaClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: BlogCardThreeProps) => {
return (
<CardStack
mode={carouselMode}
gridVariant="uniform-all-items-equal"
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
return (
<div
className={`w-full py-20 ${
useInvertedBackground ? "bg-background/50" : ""
} ${containerClassName}`}
aria-label={ariaLabel}
>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName || ""}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
description={description || ""}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
ariaLabel={ariaLabel}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
textboxLayout={textboxLayout || "default"}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
>
{blogs.map((blog) => (
<BlogCardItem
key={blog.id}
blog={blog}
useInvertedBackground={useInvertedBackground}
cardClassName={cardClassName}
cardContentClassName={cardContentClassName}
categoryTagClassName={categoryTagClassName}
cardTitleClassName={cardTitleClassName}
excerptClassName={excerptClassName}
authorContainerClassName={authorContainerClassName}
authorAvatarClassName={authorAvatarClassName}
authorNameClassName={authorNameClassName}
dateClassName={dateClassName}
mediaWrapperClassName={mediaWrapperClassName}
mediaClassName={mediaClassName}
/>
))}
</CardStack>
);
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<div className={`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 ${gridClassName}`}>
{blogCards}
</div>
</div>
</div>
);
};
BlogCardThree.displayName = "BlogCardThree";
export default BlogCardThree;

View File

@@ -1,241 +1,174 @@
"use client";
import { memo } from "react";
import Image from "next/image";
import CardStack from "@/components/cardStack/CardStack";
import Badge from "@/components/shared/Badge";
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { BlogPost } from "@/lib/api/blog";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
import React, { useState } from "react";
import { ChevronLeft, ChevronRight, ArrowRight } from "lucide-react";
import TextBox from "@/components/Textbox";
type BlogCard = Omit<BlogPost, 'category'> & {
category: string | string[];
};
interface BlogCardTwoProps {
blogs: BlogCard[];
carouselMode?: "auto" | "buttons";
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationType;
export interface BlogCardTwoProps {
blogs: Array<{
id: string;
category: string;
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
imageWrapperClassName?: string;
imageClassName?: string;
authorAvatarClassName?: string;
authorDateClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
categoryClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
excerpt: string;
imageSrc: string;
imageAlt?: string;
authorName: string;
authorAvatar: string;
date: string;
onBlogClick?: () => void;
}>;
carouselMode?: "auto" | "buttons";
uniformGridCustomHeightClasses?: string;
animationType?: string;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
imageWrapperClassName?: string;
imageClassName?: string;
categoryClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
authorContainerClassName?: string;
authorAvatarClassName?: string;
authorNameClassName?: string;
dateClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
}
interface BlogCardItemProps {
blog: BlogCard;
shouldUseLightText: boolean;
cardClassName?: string;
imageWrapperClassName?: string;
imageClassName?: string;
authorAvatarClassName?: string;
authorDateClassName?: string;
cardTitleClassName?: string;
excerptClassName?: string;
categoryClassName?: string;
}
const BlogCardTwo: React.FC<BlogCardTwoProps> = ({
blogs,
carouselMode = "buttons", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description,
tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Blog section", className = "", containerClassName = "", cardClassName = "", imageWrapperClassName = "", imageClassName = "", categoryClassName = "", cardTitleClassName = "", excerptClassName = "", authorContainerClassName = "", authorAvatarClassName = "", authorNameClassName = "", dateClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = "" }) => {
const [currentIndex, setCurrentIndex] = useState(0);
const BlogCardItem = memo(({
blog,
shouldUseLightText,
cardClassName = "",
imageWrapperClassName = "",
imageClassName = "",
authorAvatarClassName = "",
authorDateClassName = "",
cardTitleClassName = "",
excerptClassName = "",
categoryClassName = "",
}: BlogCardItemProps) => {
return (
<article
className={cls("relative h-full card group flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
onClick={blog.onBlogClick}
role="article"
aria-label={`${blog.title} by ${blog.authorName}`}
>
<div className={cls("relative z-1 w-full aspect-[4/3] overflow-hidden rounded-theme-capped", imageWrapperClassName)}>
<Image
src={blog.imageSrc}
alt={blog.imageAlt || blog.title}
fill
className={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", imageClassName)}
unoptimized={blog.imageSrc.startsWith('http') || blog.imageSrc.startsWith('//')}
/>
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
</div>
const blogCards = blogs.map((blog) => (
<div
key={blog.id}
className={`flex flex-col h-full rounded-lg overflow-hidden bg-card hover:shadow-lg transition-shadow cursor-pointer ${
cardClassName || ""
}`}
onClick={blog.onBlogClick}
>
<div className={`relative overflow-hidden bg-foreground/5 ${imageWrapperClassName}`}>
<img
src={blog.imageSrc}
alt={blog.imageAlt || blog.title}
className={`w-full h-60 object-cover hover:scale-105 transition-transform duration-300 ${
imageClassName || ""
}`}
/>
<button className="absolute top-4 right-4 bg-primary-cta/90 hover:bg-primary-cta p-2 rounded-full transition-colors">
<ArrowRight className="w-4 h-4 text-foreground" />
</button>
</div>
<div className="relative z-1 flex flex-col justify-between gap-6 flex-1">
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2">
{blog.authorAvatar && (
<Image
src={blog.authorAvatar}
alt={blog.authorName}
width={24}
height={24}
className={cls("h-[var(--text-xs)] w-auto aspect-square rounded-theme object-cover bg-background-accent", authorAvatarClassName)}
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
/>
)}
<p className={cls("text-xs", shouldUseLightText ? "text-background" : "text-foreground", authorDateClassName)}>
{blog.authorName} {blog.date}
</p>
</div>
<div className="flex-1 p-6 flex flex-col gap-3">
<span className={`text-xs font-semibold text-primary-cta uppercase ${
categoryClassName || ""
}`}>
{blog.category}
</span>
<h3 className={cls("text-2xl font-medium leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", cardTitleClassName)}>
{blog.title}
</h3>
<h3 className={`text-lg font-semibold text-foreground line-clamp-2 ${
cardTitleClassName || ""
}`}>
{blog.title}
</h3>
<p className={cls("text-base leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", excerptClassName)}>
{blog.excerpt}
</p>
</div>
<p className={`text-sm text-foreground/70 line-clamp-2 flex-1 ${
excerptClassName || ""
}`}>
{blog.excerpt}
</p>
<div className="flex flex-wrap gap-2">
{Array.isArray(blog.category) ? (
blog.category.map((cat, index) => (
<Badge key={`${cat}-${index}`} text={cat} variant="primary" className={categoryClassName} />
))
) : (
<Badge text={blog.category} variant="primary" className={categoryClassName} />
)}
</div>
</div>
</article>
);
});
<div className={`flex items-center gap-3 pt-4 border-t border-foreground/10 ${
authorContainerClassName || ""
}`}>
<img
src={blog.authorAvatar}
alt={blog.authorName}
className={`w-8 h-8 rounded-full object-cover ${
authorAvatarClassName || ""
}`}
/>
<div className="flex-1 min-w-0">
<p className={`text-sm font-medium text-foreground truncate ${
authorNameClassName || ""
}`}>
{blog.authorName}
</p>
<p className={`text-xs text-foreground/60 ${dateClassName || ""}`}>
{blog.date}
</p>
</div>
</div>
</div>
</div>
));
BlogCardItem.displayName = "BlogCardItem";
const BlogCardTwo = ({
blogs = [],
carouselMode = "buttons",
uniformGridCustomHeightClasses,
animationType,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Blog section",
className = "",
containerClassName = "",
cardClassName = "",
imageWrapperClassName = "",
imageClassName = "",
authorAvatarClassName = "",
authorDateClassName = "",
cardTitleClassName = "",
excerptClassName = "",
categoryClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: BlogCardTwoProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
return (
<CardStack
mode={carouselMode}
gridVariant="uniform-all-items-equal"
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
return (
<div
className={`w-full py-20 ${
useInvertedBackground ? "bg-background/50" : ""
} ${containerClassName}`}
aria-label={ariaLabel}
>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName || ""}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
description={description || ""}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
ariaLabel={ariaLabel}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
textboxLayout={textboxLayout || "default"}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
>
{blogs.map((blog) => (
<BlogCardItem
key={blog.id}
blog={blog}
shouldUseLightText={shouldUseLightText}
cardClassName={cardClassName}
imageWrapperClassName={imageWrapperClassName}
imageClassName={imageClassName}
authorAvatarClassName={authorAvatarClassName}
authorDateClassName={authorDateClassName}
cardTitleClassName={cardTitleClassName}
excerptClassName={excerptClassName}
categoryClassName={categoryClassName}
/>
))}
</CardStack>
);
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<div className={`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 ${gridClassName}`}>
{blogCards}
</div>
</div>
</div>
);
};
BlogCardTwo.displayName = "BlogCardTwo";
export default BlogCardTwo;

View File

@@ -1,146 +1,44 @@
"use client";
import CardStack from "@/components/cardStack/CardStack";
import Button from "@/components/button/Button";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { getButtonProps } from "@/lib/buttonUtils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import { BentoGlobe } from "@/components/bento/BentoGlobe";
import BentoIconInfoCards from "@/components/bento/BentoIconInfoCards";
import BentoAnimatedBarChart from "@/components/bento/BentoAnimatedBarChart";
import Bento3DStackCards from "@/components/bento/Bento3DStackCards";
import Bento3DTaskList, { type TaskItem } from "@/components/bento/Bento3DTaskList";
import BentoOrbitingIcons, { type OrbitingItem } from "@/components/bento/BentoOrbitingIcons";
import BentoMap from "@/components/bento/BentoMap";
import BentoMarquee from "@/components/bento/BentoMarquee";
import BentoLineChart from "@/components/bento/BentoLineChart/BentoLineChart";
import BentoPhoneAnimation, { type PhoneApp, type PhoneApps8 } from "@/components/bento/BentoPhoneAnimation";
import BentoChatAnimation, { type ChatExchange } from "@/components/bento/BentoChatAnimation";
import Bento3DCardGrid from "@/components/bento/Bento3DCardGrid";
import BentoRevealIcon from "@/components/bento/BentoRevealIcon";
import BentoTimeline, { type TimelineItem } from "@/components/bento/BentoTimeline";
import BentoMediaStack, { type MediaStackItem } from "@/components/bento/BentoMediaStack";
import type { LucideIcon } from "lucide-react";
import React, { useMemo } from "react";
import CardStack from "@/components/card/CardStack";
import TextBox from "@/components/Textbox";
import type { BentoAnimationType } from "@/types/animations";
export type { PhoneApp, PhoneApps8, ChatExchange, TimelineItem, MediaStackItem };
import type { ButtonConfig, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
type BentoAnimationType = Exclude<CardAnimationTypeWith3D, "depth-3d" | "scale-rotate">;
export type BentoInfoItem = {
icon: LucideIcon;
label: string;
value: string;
};
export type Bento3DItem = {
icon: LucideIcon;
title: string;
subtitle: string;
detail: string;
};
type BaseFeatureCard = {
title: string;
description: string;
button?: ButtonConfig;
};
export type FeatureCard = BaseFeatureCard & (
| {
bentoComponent: "icon-info-cards";
items: BentoInfoItem[];
}
| {
bentoComponent: "3d-stack-cards";
items: [Bento3DItem, Bento3DItem, Bento3DItem];
}
| {
bentoComponent: "3d-task-list";
title: string;
items: TaskItem[];
}
| {
bentoComponent: "orbiting-icons";
centerIcon: LucideIcon;
items: OrbitingItem[];
}
| ({
bentoComponent: "marquee";
centerIcon: LucideIcon;
} & (
| { variant: "text"; texts: string[] }
| { variant: "icon"; icons: LucideIcon[] }
))
| {
bentoComponent: "globe" | "animated-bar-chart" | "map" | "line-chart";
items?: never;
}
| {
bentoComponent: "3d-card-grid";
items: [{ name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }];
centerIcon: LucideIcon;
}
| {
bentoComponent: "phone";
statusIcon: LucideIcon;
alertIcon: LucideIcon;
alertTitle: string;
alertMessage: string;
apps: PhoneApps8;
}
| {
bentoComponent: "chat";
aiIcon: LucideIcon;
userIcon: LucideIcon;
exchanges: ChatExchange[];
placeholder: string;
}
| {
bentoComponent: "reveal-icon";
icon: LucideIcon;
}
| {
bentoComponent: "timeline";
heading: string;
subheading: string;
items: [TimelineItem, TimelineItem, TimelineItem];
completedLabel: string;
}
| {
bentoComponent: "media-stack";
items: [MediaStackItem, MediaStackItem, MediaStackItem];
}
);
interface FeatureBentoProps {
features: FeatureCard[];
export interface FeatureBentoProps {
features?: Array<{
id: string;
title: string;
description: string;
icon?: React.ReactNode;
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
}>;
carouselMode?: "auto" | "buttons";
animationType: BentoAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
gridVariant?: string;
uniformGridCustomHeightClasses?: string;
animationType?: BentoAnimationType;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
mediaClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardButtonClassName?: string;
cardButtonTextClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
@@ -151,150 +49,94 @@ interface FeatureBentoProps {
textBoxButtonTextClassName?: string;
}
const FeatureBento = ({
features,
carouselMode = "buttons",
animationType,
title,
const FeatureBento: React.FC<FeatureBentoProps> = ({
features = [],
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description,
tag,
tagIcon,
description = "", tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Feature section",
className = "",
containerClassName = "",
cardClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
cardTitleClassName = "",
cardDescriptionClassName = "",
cardButtonClassName = "",
cardButtonTextClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: FeatureBentoProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
const getBentoComponent = (feature: FeatureCard) => {
switch (feature.bentoComponent) {
case "globe":
return (
<div className="relative w-full h-full min-h-0" style={{
maskImage: "linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%), linear-gradient(to bottom, black 40%, transparent 100%)",
WebkitMaskImage: "linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%), linear-gradient(to bottom, black 40%, transparent 100%)",
maskComposite: "intersect",
WebkitMaskComposite: "source-in"
}}>
<BentoGlobe className="w-full scale-150 mt-[15%]" />
</div>
);
case "icon-info-cards":
return <BentoIconInfoCards items={feature.items} useInvertedBackground={useInvertedBackground} />;
case "animated-bar-chart":
return <BentoAnimatedBarChart />;
case "3d-stack-cards":
return <Bento3DStackCards cards={feature.items.map(item => ({ Icon: item.icon, title: item.title, subtitle: item.subtitle, detail: item.detail }))} useInvertedBackground={useInvertedBackground} />;
case "3d-task-list":
return <Bento3DTaskList title={feature.title} items={feature.items} useInvertedBackground={useInvertedBackground} />;
case "orbiting-icons":
return <BentoOrbitingIcons centerIcon={feature.centerIcon} items={feature.items} useInvertedBackground={useInvertedBackground} />;
case "marquee":
return feature.variant === "text"
? <BentoMarquee centerIcon={feature.centerIcon} variant="text" texts={feature.texts} useInvertedBackground={useInvertedBackground} />
: <BentoMarquee centerIcon={feature.centerIcon} variant="icon" icons={feature.icons} useInvertedBackground={useInvertedBackground} />;
case "map":
return <BentoMap useInvertedBackground={useInvertedBackground} />;
case "line-chart":
return <BentoLineChart useInvertedBackground={useInvertedBackground} />;
case "3d-card-grid":
return <Bento3DCardGrid items={feature.items} centerIcon={feature.centerIcon} useInvertedBackground={useInvertedBackground} />;
case "phone":
return <BentoPhoneAnimation statusIcon={feature.statusIcon} alertIcon={feature.alertIcon} alertTitle={feature.alertTitle} alertMessage={feature.alertMessage} apps={feature.apps} useInvertedBackground={useInvertedBackground} />;
case "chat":
return <BentoChatAnimation aiIcon={feature.aiIcon} userIcon={feature.userIcon} exchanges={feature.exchanges} placeholder={feature.placeholder} useInvertedBackground={useInvertedBackground} />;
case "reveal-icon":
return <BentoRevealIcon icon={feature.icon} useInvertedBackground={useInvertedBackground} />;
case "timeline":
return <BentoTimeline heading={feature.heading} subheading={feature.subheading} items={feature.items} completedLabel={feature.completedLabel} useInvertedBackground={useInvertedBackground} />;
case "media-stack":
return <BentoMediaStack items={feature.items} useInvertedBackground={useInvertedBackground} />;
}
};
return (
<CardStack
mode={carouselMode}
gridVariant="uniform-all-items-equal"
uniformGridCustomHeightClasses="min-h-0"
animationType={animationType}
carouselThreshold={4}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
carouselItemClassName="w-carousel-item-3 xl:w-carousel-item-3!"
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
ariaLabel={ariaLabel}
>
{features.map((feature, index) => (
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
const cardItems = useMemo(
() =>
features.map((feature) => (
<div
key={`${feature.title}-${index}`}
className={cls("card flex flex-col gap-4 p-5 rounded-theme-capped min-h-0 h-full", cardClassName)}
key={feature.id}
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
>
<div className="relative w-full h-70 min-h-0 overflow-hidden">
{getBentoComponent(feature)}
</div>
<div className="relative z-1 flex flex-col gap-1">
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
{feature.title}
</h3>
<p className={cls("text-sm leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
{feature.description}
</p>
</div>
{feature.button && (
<Button {...getButtonProps(feature.button, 0, theme.defaultButtonVariant, cls("w-full", cardButtonClassName), cardButtonTextClassName)} />
{feature.icon && (
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
{feature.description}
</p>
{feature.mediaItems && (
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
{feature.mediaItems.map((media, idx) => (
<img
key={idx}
src={media.src}
alt={media.alt || "Feature media"}
className="w-full h-20 object-cover rounded-lg"
/>
))}
</div>
)}
</div>
))}
</CardStack>
)),
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
);
return (
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
titleClassName={textBoxTitleClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<CardStack
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
carouselMode="buttons"
ariaLabel={ariaLabel}
className={className}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
>
{cardItems.map((item) => item)}
</CardStack>
</div>
</div>
);
};
FeatureBento.displayName = "FeatureBento";
export default FeatureBento;
export default FeatureBento;

View File

@@ -1,261 +1,141 @@
"use client";
import { memo } from "react";
import CardStack from "@/components/cardStack/CardStack";
import MediaContent from "@/components/shared/MediaContent";
import Tag from "@/components/shared/Tag";
import Button from "@/components/button/Button";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { getButtonProps } from "@/lib/buttonUtils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
import React, { useMemo } from "react";
import CardStack from "@/components/card/CardStack";
import TextBox from "@/components/Textbox";
import type { CardAnimationType } from "@/types/animations";
type FeatureCard = {
export interface FeatureCardMediaProps {
features?: Array<{
id: string;
title: string;
description: string;
tag: string;
imageSrc?: string;
videoSrc?: string;
imageAlt?: string;
videoAriaLabel?: string;
buttons?: ButtonConfig[];
onCardClick?: () => void;
};
interface FeatureCardMediaProps {
features: FeatureCard[];
carouselMode?: "auto" | "buttons";
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
itemClassName?: string;
mediaWrapperClassName?: string;
mediaClassName?: string;
tagClassName?: string;
contentClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardButtonContainerClassName?: string;
cardButtonClassName?: string;
cardButtonTextClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
icon?: React.ReactNode;
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
}>;
gridVariant?: string;
uniformGridCustomHeightClasses?: string;
animationType?: CardAnimationType;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
mediaClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
buttonTextClassName?: string;
}
interface FeatureCardItemProps {
feature: FeatureCard;
shouldUseLightText: boolean;
useInvertedBackground: InvertedBackground;
itemClassName?: string;
mediaWrapperClassName?: string;
mediaClassName?: string;
tagClassName?: string;
contentClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardButtonContainerClassName?: string;
cardButtonClassName?: string;
cardButtonTextClassName?: string;
}
const FeatureCardItem = memo(({
feature,
shouldUseLightText,
useInvertedBackground,
itemClassName = "",
mediaWrapperClassName = "",
mediaClassName = "",
tagClassName = "",
contentClassName = "",
cardTitleClassName = "",
cardDescriptionClassName = "",
cardButtonContainerClassName = "",
cardButtonClassName = "",
cardButtonTextClassName = "",
}: FeatureCardItemProps) => {
const theme = useTheme();
return (
<article
className={cls("relative h-full flex flex-col gap-6 cursor-pointer group", itemClassName)}
onClick={feature.onCardClick}
role="article"
aria-label={feature.title}
const FeatureCardMedia: React.FC<FeatureCardMediaProps> = ({
features = [],
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description = "", tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", buttonTextClassName = ""}) => {
const cardItems = useMemo(
() =>
features.map((feature) => (
<div
key={feature.id}
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
>
<div className={cls("relative w-full aspect-square overflow-hidden rounded-theme-capped", mediaWrapperClassName)}>
<MediaContent
imageSrc={feature.imageSrc}
videoSrc={feature.videoSrc}
imageAlt={feature.imageAlt || feature.title}
videoAriaLabel={feature.videoAriaLabel || feature.title}
imageClassName={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", mediaClassName)}
{feature.icon && (
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
{feature.description}
</p>
{feature.mediaItems && (
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
{feature.mediaItems.map((media, idx) => (
<img
key={idx}
src={media.src}
alt={media.alt || "Feature media"}
className="w-full h-20 object-cover rounded-lg"
/>
<div className="absolute top-4 right-4">
<Tag
text={feature.tag}
useInvertedBackground={useInvertedBackground}
className={tagClassName}
/>
</div>
))}
</div>
)}
</div>
)),
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
);
<div className={cls("relative z-1 card rounded-theme-capped p-6 flex flex-col gap-2 flex-1", contentClassName)}>
<h3 className={cls(
"text-xl md:text-2xl font-medium leading-tight",
shouldUseLightText ? "text-background" : "text-foreground",
cardTitleClassName
)}>
{feature.title}
</h3>
<p className={cls(
"text-base leading-tight",
shouldUseLightText ? "text-background/75" : "text-foreground/75",
cardDescriptionClassName
)}>
{feature.description}
</p>
{feature.buttons && feature.buttons.length > 0 && (
<div className={cls("flex flex-wrap gap-4 max-md:justify-center mt-2", cardButtonContainerClassName)}>
{feature.buttons.slice(0, 2).map((button, index) => (
<Button
key={`${button.text}-${index}`}
{...getButtonProps(button, index, theme.defaultButtonVariant, cardButtonClassName, cardButtonTextClassName)}
/>
))}
</div>
)}
</div>
</article>
);
});
FeatureCardItem.displayName = "FeatureCardItem";
const FeatureCardMedia = ({
features,
carouselMode = "buttons",
uniformGridCustomHeightClasses,
animationType,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Features section",
className = "",
containerClassName = "",
itemClassName = "",
mediaWrapperClassName = "",
mediaClassName = "",
tagClassName = "",
contentClassName = "",
cardTitleClassName = "",
cardDescriptionClassName = "",
cardButtonContainerClassName = "",
cardButtonClassName = "",
cardButtonTextClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: FeatureCardMediaProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
return (
<CardStack
mode={carouselMode}
gridVariant="uniform-all-items-equal"
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
return (
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
ariaLabel={ariaLabel}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
buttonTextClassName={buttonTextClassName}
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<CardStack
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
carouselMode="buttons"
ariaLabel={ariaLabel}
className={className}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
>
{features.map((feature) => (
<FeatureCardItem
key={feature.id}
feature={feature}
shouldUseLightText={shouldUseLightText}
useInvertedBackground={useInvertedBackground}
itemClassName={itemClassName}
mediaWrapperClassName={mediaWrapperClassName}
mediaClassName={mediaClassName}
tagClassName={tagClassName}
contentClassName={contentClassName}
cardTitleClassName={cardTitleClassName}
cardDescriptionClassName={cardDescriptionClassName}
cardButtonContainerClassName={cardButtonContainerClassName}
cardButtonClassName={cardButtonClassName}
cardButtonTextClassName={cardButtonTextClassName}
/>
))}
{cardItems.map((item) => item)}
</CardStack>
);
</div>
</div>
);
};
FeatureCardMedia.displayName = "FeatureCardMedia";
export default FeatureCardMedia;
export default FeatureCardMedia;

View File

@@ -1,51 +1,31 @@
"use client";
import CardStack from "@/components/cardStack/CardStack";
import MediaContent from "@/components/shared/MediaContent";
import Button from "@/components/button/Button";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { getButtonProps } from "@/lib/buttonUtils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, GridVariant, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
import React, { useMemo } from "react";
import CardStack from "@/components/card/CardStack";
import TextBox from "@/components/Textbox";
import type { CardAnimationTypeWith3D } from "@/types/animations";
import type { GridVariant } from "@/types/grid";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
type FeatureCard = {
title: string;
description: string;
button?: ButtonConfig;
} & (
| {
imageSrc: string;
imageAlt?: string;
videoSrc?: never;
videoAriaLabel?: never;
}
| {
videoSrc: string;
videoAriaLabel?: string;
imageSrc?: never;
imageAlt?: never;
}
);
interface FeatureCardOneProps {
features: FeatureCard[];
carouselMode?: "auto" | "buttons";
gridVariant: GridVariant;
export interface FeatureCardOneProps {
features?: Array<{
id: string;
title: string;
description: string;
icon?: React.ReactNode;
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
}>;
gridVariant?: GridVariant;
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationTypeWith3D;
title: string;
titleSegments?: TitleSegment[];
description: string;
animationType?: CardAnimationTypeWith3D;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
@@ -57,8 +37,8 @@ interface FeatureCardOneProps {
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardButtonClassName?: string;
cardButtonTextClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
@@ -69,128 +49,94 @@ interface FeatureCardOneProps {
textBoxButtonTextClassName?: string;
}
const FeatureCardOne = ({
features,
carouselMode = "buttons",
gridVariant,
uniformGridCustomHeightClasses,
animationType,
title,
const FeatureCardOne: React.FC<FeatureCardOneProps> = ({
features = [],
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description,
tag,
tagIcon,
description = "", tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Feature section",
className = "",
containerClassName = "",
cardClassName = "",
mediaClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
cardTitleClassName = "",
cardDescriptionClassName = "",
cardButtonClassName = "",
cardButtonTextClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: FeatureCardOneProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
const getButtonConfigProps = () => {
if (theme.defaultButtonVariant === "hover-bubble") {
return { bgClassName: "w-full" };
}
if (theme.defaultButtonVariant === "icon-arrow") {
return { className: "justify-between" };
}
return {};
};
return (
<CardStack
mode={carouselMode}
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
supports3DAnimation={true}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
ariaLabel={ariaLabel}
>
{features.map((feature, index) => (
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
const cardItems = useMemo(
() =>
features.map((feature) => (
<div
key={`${feature.title}-${index}`}
className={cls("card flex flex-col gap-4 p-4 rounded-theme-capped min-h-0 h-full", cardClassName)}
key={feature.id}
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
>
<MediaContent
imageSrc={feature.imageSrc}
videoSrc={feature.videoSrc}
imageAlt={feature.imageAlt || "Feature image"}
videoAriaLabel={feature.videoAriaLabel || "Feature video"}
imageClassName={cls("relative z-1 min-h-0 h-full", mediaClassName)}
/>
<div className="relative z-1 flex flex-col gap-1">
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
{feature.title}
</h3>
<p className={cls("text-sm leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
{feature.description}
</p>
</div>
{feature.button && (
<Button
{...getButtonProps(
{ ...feature.button, props: { ...feature.button.props, ...getButtonConfigProps() } },
0,
theme.defaultButtonVariant,
cls("w-full", cardButtonClassName),
cardButtonTextClassName
)}
/>
{feature.icon && (
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
{feature.description}
</p>
{feature.mediaItems && (
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
{feature.mediaItems.map((media, idx) => (
<img
key={idx}
src={media.src}
alt={media.alt || "Feature media"}
className="w-full h-20 object-cover rounded-lg"
/>
))}
</div>
)}
</div>
))}
</CardStack>
)),
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
);
return (
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
titleClassName={textBoxTitleClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<CardStack
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
carouselMode="buttons"
ariaLabel={ariaLabel}
className={className}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
>
{cardItems.map((item) => item)}
</CardStack>
</div>
</div>
);
};
FeatureCardOne.displayName = "FeatureCardOne";
export default FeatureCardOne;
export default FeatureCardOne;

View File

@@ -1,179 +1,94 @@
"use client";
import CardList from "@/components/cardStack/CardList";
import MediaContent from "@/components/shared/MediaContent";
import Button from "@/components/button/Button";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { getButtonProps } from "@/lib/buttonUtils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import React, { useMemo } from "react";
import CardList from "@/components/card/CardList";
import TextBox from "@/components/Textbox";
import type { ButtonAnimationType } from "@/types/animations";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
type FeatureCard = {
id: number;
export interface FeatureCardSevenProps {
features?: Array<{
id: string;
title: string;
description: string;
buttons?: ButtonConfig[];
imageSrc?: string;
videoSrc?: string;
imageAlt?: string;
videoAriaLabel?: string;
};
interface FeatureCardSevenProps {
features: FeatureCard[];
animationType: CardAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
textBoxTitleClassName?: string;
textBoxDescriptionClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
titleImageWrapperClassName?: string;
titleImageClassName?: string;
cardContentClassName?: string;
stepNumberClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
imageContainerClassName?: string;
imageClassName?: string;
cardButtonClassName?: string;
cardButtonTextClassName?: string;
icon?: React.ReactNode;
}>;
animationType?: ButtonAnimationType;
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
textBoxTitleClassName?: string;
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
listClassName?: string;
itemClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
}
const FeatureCardSeven = ({
features,
animationType,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Feature section",
className = "",
containerClassName = "",
cardClassName = "",
textBoxTitleClassName = "",
textBoxDescriptionClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
cardContentClassName = "",
stepNumberClassName = "",
cardTitleClassName = "",
cardDescriptionClassName = "",
imageContainerClassName = "",
imageClassName = "",
cardButtonClassName = "",
cardButtonTextClassName = "",
}: FeatureCardSevenProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
const FeatureCardSeven: React.FC<FeatureCardSevenProps> = ({
features = [],
animationType = "slide-up", textboxLayout = "default", description = "", tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", textBoxTitleClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", listClassName = "", itemClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
const listItems = useMemo(
() =>
features.map((feature) => (
<div key={feature.id} className={`flex gap-4 p-4 rounded-lg bg-card/50 ${itemClassName}`}>
{feature.icon && (
<div className={`flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-lg ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
<div className="flex-1 min-w-0">
<h3 className={`text-sm font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-xs text-foreground/70 ${cardDescriptionClassName}`}>
{feature.description}
</p>
</div>
</div>
)),
[features, itemClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName]
);
return (
return (
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
<div className="max-w-content-width mx-auto px-4">
<CardList
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
animationType={animationType}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
cardClassName={cardClassName}
titleClassName={textBoxTitleClassName}
descriptionClassName={textBoxDescriptionClassName}
textBoxClassName={textBoxClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
ariaLabel={ariaLabel}
animationType={animationType}
ariaLabel={ariaLabel}
className={className}
listClassName={listClassName}
>
{features.map((feature, index) => (
<div
key={feature.id}
className={cls("relative z-1 w-full min-h-0 h-full flex flex-col justify-between items-center p-6 gap-6 md:p-15 md:gap-15", index % 2 === 0 ? "md:flex-row" : "md:flex-row-reverse", cardContentClassName)}
>
<div className="w-full md:w-1/2 min-w-0 h-fit md:h-full flex flex-col justify-center">
<div className="w-full min-w-0 flex flex-col gap-3 md:gap-5">
<div
className={cls(
"h-8 w-[var(--height-8)] primary-button text-primary-cta-text rounded-theme flex items-center justify-center",
stepNumberClassName
)}
>
<p className="text-sm truncate">
{feature.id}
</p>
</div>
<h2 className={cls("mt-1 text-4xl md:text-5xl font-medium leading-[1.15] text-balance", shouldUseLightText && "text-background", cardTitleClassName)}>
{feature.title}
</h2>
<p className={cls("text-base leading-[1.15] text-balance", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
{feature.description}
</p>
{feature.buttons && feature.buttons.length > 0 && (
<div className="flex flex-wrap gap-3 max-md:justify-center">
{feature.buttons.slice(0, 2).map((button, index) => (
<Button key={`${button.text}-${index}`} {...getButtonProps(button, index, theme.defaultButtonVariant, cardButtonClassName, cardButtonTextClassName)} />
))}
</div>
)}
</div>
</div>
<div
className={cls(
"relative w-full md:w-1/2 aspect-square overflow-hidden rounded-theme-capped",
imageContainerClassName
)}
>
<MediaContent
imageSrc={feature.imageSrc}
videoSrc={feature.videoSrc}
imageAlt={feature.imageAlt || feature.title}
videoAriaLabel={feature.videoAriaLabel || feature.title}
imageClassName={cls("w-full h-full object-cover", imageClassName)}
/>
</div>
</div>
))}
{listItems.map((item) => item)}
</CardList>
);
</div>
</div>
);
};
FeatureCardSeven.displayName = "FeatureCardSeven";
export default FeatureCardSeven;

View File

@@ -1,182 +1,93 @@
"use client";
import { Fragment } from "react";
import CardList from "@/components/cardStack/CardList";
import Button from "@/components/button/Button";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { getButtonProps } from "@/lib/buttonUtils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import React, { useMemo } from "react";
import CardList from "@/components/card/CardList";
import type { ButtonAnimationType } from "@/types/animations";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
interface FeatureCard {
id: string;
label: string;
title: string;
items: string[];
buttons?: ButtonConfig[];
}
interface FeatureCardTwelveProps {
features: FeatureCard[];
animationType: CardAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
export interface FeatureCardTwelveProps {
features?: Array<{
id: string;
title: string;
description: string;
icon?: React.ReactNode;
}>;
animationType?: ButtonAnimationType;
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
textBoxTitleClassName?: string;
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
listClassName?: string;
itemClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
titleImageWrapperClassName?: string;
titleImageClassName?: string;
cardContentClassName?: string;
labelClassName?: string;
cardTitleClassName?: string;
itemsContainerClassName?: string;
itemTextClassName?: string;
cardButtonClassName?: string;
cardButtonTextClassName?: string;
}
const FeatureCardTwelve = ({
features,
animationType,
title,
titleSegments,
description,
tag,
const FeatureCardTwelve: React.FC<FeatureCardTwelveProps> = ({
features = [],
animationType = "slide-up", textboxLayout = "default", description = "", tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Feature section",
className = "",
containerClassName = "",
cardClassName = "",
textBoxTitleClassName = "",
textBoxDescriptionClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
cardContentClassName = "",
labelClassName = "",
cardTitleClassName = "",
itemsContainerClassName = "",
itemTextClassName = "",
cardButtonClassName = "",
cardButtonTextClassName = "",
}: FeatureCardTwelveProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
return (
<CardList
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
animationType={animationType}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
cardClassName={cardClassName}
titleClassName={textBoxTitleClassName}
descriptionClassName={textBoxDescriptionClassName}
textBoxClassName={textBoxClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
ariaLabel={ariaLabel}
>
{features.map((feature) => (
<div
key={feature.id}
className={cls(
"relative z-1 w-full min-h-0 h-full flex flex-col md:flex-row gap-6 p-6 md:p-15",
cardContentClassName
useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", textBoxTitleClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", listClassName = "", itemClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
const listItems = useMemo(
() =>
features.map((feature) => (
<div key={feature.id} className={`flex gap-4 p-4 rounded-lg bg-card/50 ${itemClassName}`}>
{feature.icon && (
<div className={`flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-lg ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
>
<div className="relative z-1 w-full md:w-1/2 flex md:justify-start">
<h2 className={cls(
"text-5xl md:text-6xl font-medium leading-[1.1]",
shouldUseLightText && "text-background",
labelClassName
)}>
{feature.label}
</h2>
</div>
<div className="relative z-1 w-full h-px bg-foreground/20 md:hidden" />
<div className="relative z-1 w-full md:w-1/2 flex flex-col gap-4">
<h3 className={cls(
"text-xl md:text-3xl font-medium leading-tight",
shouldUseLightText ? "text-background" : "text-foreground",
cardTitleClassName
)}>
<div className="flex-1 min-w-0">
<h3 className={`text-sm font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<div className={cls("flex flex-wrap items-center gap-2", itemsContainerClassName)}>
{feature.items.map((item, index) => (
<Fragment key={index}>
<span className={cls(
"text-base",
shouldUseLightText ? "text-background" : "text-foreground",
itemTextClassName
)}>
{item}
</span>
{index < feature.items.length - 1 && (
<span className="text-base text-accent"></span>
)}
</Fragment>
))}
</div>
{feature.buttons && feature.buttons.length > 0 && (
<div className="mt-3 flex flex-wrap gap-4 max-md:justify-center">
{feature.buttons.slice(0, 2).map((button, index) => (
<Button key={`${button.text}-${index}`} {...getButtonProps(button, index, theme.defaultButtonVariant, cardButtonClassName, cardButtonTextClassName)} />
))}
</div>
)}
<p className={`text-xs text-foreground/70 ${cardDescriptionClassName}`}>
{feature.description}
</p>
</div>
</div>
))}
</CardList>
)),
[features, itemClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName]
);
return (
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
<div className="max-w-content-width mx-auto px-4">
<CardList
animationType={animationType}
ariaLabel={ariaLabel}
className={className}
listClassName={listClassName}
>
{listItems.map((item) => item)}
</CardList>
</div>
</div>
);
};
FeatureCardTwelve.displayName = "FeatureCardTwelve";
export default FeatureCardTwelve;
export default FeatureCardTwelve;

View File

@@ -1,43 +1,30 @@
"use client";
import CardStack from "@/components/cardStack/CardStack";
import MediaContent from "@/components/shared/MediaContent";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { LucideIcon } from "lucide-react";
import type { CardAnimationTypeWith3D, TitleSegment, ButtonConfig, ButtonAnimationType } from "@/components/cardStack/types";
import React, { useMemo } from "react";
import CardStack from "@/components/card/CardStack";
import TextBox from "@/components/Textbox";
import type { CardAnimationTypeWith3D } from "@/types/animations";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
interface MediaItem {
imageSrc?: string;
videoSrc?: string;
imageAlt?: string;
videoAriaLabel?: string;
}
type FeatureCard = {
title: string;
description: string;
icon: LucideIcon;
mediaItems: [MediaItem, MediaItem];
};
interface FeatureCardTwentyFiveProps {
features: FeatureCard[];
carouselMode?: "auto" | "buttons";
export interface FeatureCardTwentyFiveProps {
features?: Array<{
id: string;
title: string;
description: string;
icon?: React.ReactNode;
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
}>;
gridVariant?: string;
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationTypeWith3D;
title: string;
titleSegments?: TitleSegment[];
description: string;
animationType?: CardAnimationTypeWith3D;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
@@ -61,118 +48,94 @@ interface FeatureCardTwentyFiveProps {
textBoxButtonTextClassName?: string;
}
const FeatureCardTwentyFive = ({
features,
carouselMode = "buttons",
uniformGridCustomHeightClasses,
animationType,
title,
const FeatureCardTwentyFive: React.FC<FeatureCardTwentyFiveProps> = ({
features = [],
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description,
tag,
tagIcon,
description = "", tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Feature section",
className = "",
containerClassName = "",
cardClassName = "",
mediaClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
cardTitleClassName = "",
cardDescriptionClassName = "",
cardIconClassName = "",
cardIconWrapperClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: FeatureCardTwentyFiveProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
return (
<CardStack
mode={carouselMode}
gridVariant="two-items-per-row"
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
supports3DAnimation={true}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
ariaLabel={ariaLabel}
>
{features.map((feature, index) => {
const IconComponent = feature.icon;
return (
<div
key={`${feature.title}-${index}`}
className={cls("card flex flex-col gap-5 p-5 rounded-theme-capped min-h-0 h-full", cardClassName)}
>
<div className="relative z-1 flex flex-col gap-1">
<div className={cls("h-15 w-[3.75rem] mb-1 aspect-square rounded-theme primary-button flex items-center justify-center", cardIconWrapperClassName)}>
<IconComponent className={cls("h-4/10 w-4/10 text-primary-cta-text", cardIconClassName)} strokeWidth={1.5} />
</div>
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
{feature.title}
</h3>
<p className={cls("text-base leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
{feature.description}
</p>
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
const cardItems = useMemo(
() =>
features.map((feature) => (
<div
key={feature.id}
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
>
{feature.icon && (
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
</div>
<div className="mt-auto flex-1 min-h-0 grid grid-cols-2 gap-5 overflow-hidden">
{feature.mediaItems.map((item, mediaIndex) => (
<div key={mediaIndex} className="overflow-hidden rounded-theme-capped">
<MediaContent
imageSrc={item.imageSrc}
videoSrc={item.videoSrc}
imageAlt={item.imageAlt || "Feature image"}
videoAriaLabel={item.videoAriaLabel || "Feature video"}
imageClassName={cls("relative z-1 h-full w-full object-cover", mediaClassName)}
/>
</div>
)}
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
{feature.description}
</p>
{feature.mediaItems && (
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
{feature.mediaItems.map((media, idx) => (
<img
key={idx}
src={media.src}
alt={media.alt || "Feature media"}
className="w-full h-20 object-cover rounded-lg"
/>
))}
</div>
</div>
);
})}
</CardStack>
)}
</div>
)),
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
);
return (
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
titleClassName={textBoxTitleClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<CardStack
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
carouselMode="buttons"
ariaLabel={ariaLabel}
className={className}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
>
{cardItems.map((item) => item)}
</CardStack>
</div>
</div>
);
};
FeatureCardTwentyFive.displayName = "FeatureCardTwentyFive";
export default FeatureCardTwentyFive;
export default FeatureCardTwentyFive;

View File

@@ -1,199 +1,93 @@
"use client";
import CardList from "@/components/cardStack/CardList";
import Tag from "@/components/shared/Tag";
import MediaContent from "@/components/shared/MediaContent";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import React, { useMemo } from "react";
import CardList from "@/components/card/CardList";
import type { ButtonAnimationType } from "@/types/animations";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
type MediaProps =
| {
imageSrc: string;
imageAlt?: string;
videoSrc?: never;
videoAriaLabel?: never;
}
| {
videoSrc: string;
videoAriaLabel?: string;
imageSrc?: never;
imageAlt?: never;
};
type FeatureItem = MediaProps & {
export interface FeatureCardTwentyFourProps {
features?: Array<{
id: string;
title: string;
author: string;
description: string;
tags: string[];
onFeatureClick?: () => void;
};
interface FeatureCardTwentyFourProps {
features: FeatureItem[];
animationType: CardAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
textBoxTitleClassName?: string;
textBoxDescriptionClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
titleImageWrapperClassName?: string;
titleImageClassName?: string;
cardContentClassName?: string;
cardTitleClassName?: string;
authorClassName?: string;
cardDescriptionClassName?: string;
tagsContainerClassName?: string;
tagClassName?: string;
mediaWrapperClassName?: string;
mediaClassName?: string;
icon?: React.ReactNode;
}>;
animationType?: ButtonAnimationType;
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
textBoxTitleClassName?: string;
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
listClassName?: string;
itemClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
}
const FeatureCardTwentyFour = ({
features,
animationType,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Features section",
className = "",
containerClassName = "",
cardClassName = "",
textBoxTitleClassName = "",
textBoxDescriptionClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
cardContentClassName = "",
cardTitleClassName = "",
authorClassName = "",
cardDescriptionClassName = "",
tagsContainerClassName = "",
tagClassName = "",
mediaWrapperClassName = "",
mediaClassName = "",
}: FeatureCardTwentyFourProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
const FeatureCardTwentyFour: React.FC<FeatureCardTwentyFourProps> = ({
features = [],
animationType = "slide-up", textboxLayout = "default", description = "", tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", textBoxTitleClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", listClassName = "", itemClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
const listItems = useMemo(
() =>
features.map((feature) => (
<div key={feature.id} className={`flex gap-4 p-4 rounded-lg bg-card/50 ${itemClassName}`}>
{feature.icon && (
<div className={`flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-lg ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
<div className="flex-1 min-w-0">
<h3 className={`text-sm font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-xs text-foreground/70 ${cardDescriptionClassName}`}>
{feature.description}
</p>
</div>
</div>
)),
[features, itemClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName]
);
return (
return (
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
<div className="max-w-content-width mx-auto px-4">
<CardList
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
animationType={animationType}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
cardClassName={cardClassName}
titleClassName={textBoxTitleClassName}
descriptionClassName={textBoxDescriptionClassName}
textBoxClassName={textBoxClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
ariaLabel={ariaLabel}
animationType={animationType}
ariaLabel={ariaLabel}
className={className}
listClassName={listClassName}
>
{features.map((feature) => (
<article
key={feature.id}
className={cls(
"relative z-1 w-full min-h-0 h-full flex flex-col md:grid md:grid-cols-10 gap-6 md:gap-10 cursor-pointer group p-6 md:p-10",
cardContentClassName
)}
onClick={feature.onFeatureClick}
role="article"
aria-label={feature.title}
>
<div className="relative z-1 w-full md:col-span-6 flex flex-col gap-3 md:gap-12">
<h3 className={cls(
"text-3xl md:text-5xl text-balance font-medium leading-tight line-clamp-3",
shouldUseLightText ? "text-background" : "text-foreground",
cardTitleClassName
)}>
{feature.title}{" "}
<span className={cls(
shouldUseLightText ? "text-background/50" : "text-foreground/50",
authorClassName
)}>
by {feature.author}
</span>
</h3>
<div className="mt-auto flex flex-col gap-4">
<div className={cls("flex flex-wrap gap-2", tagsContainerClassName)}>
{feature.tags.map((tagText, index) => (
<Tag key={index} text={tagText} useInvertedBackground={useInvertedBackground} className={tagClassName} />
))}
</div>
<p className={cls(
"text-base md:text-2xl text-balance leading-tight line-clamp-2",
shouldUseLightText ? "text-background" : "text-foreground",
cardDescriptionClassName
)}>
{feature.description}
</p>
</div>
</div>
<div className={cls(
"relative z-1 w-full md:col-span-4 aspect-square md:aspect-auto overflow-hidden rounded-theme-capped",
mediaWrapperClassName
)}>
<MediaContent
imageSrc={feature.imageSrc}
videoSrc={feature.videoSrc}
imageAlt={feature.imageAlt}
videoAriaLabel={feature.videoAriaLabel}
imageClassName={cls("w-full h-full object-cover", mediaClassName)}
/>
</div>
</article>
))}
{listItems.map((item) => item)}
</CardList>
);
</div>
</div>
);
};
FeatureCardTwentyFour.displayName = "FeatureCardTwentyFour";
export default FeatureCardTwentyFour;
export default FeatureCardTwentyFour;

View File

@@ -1,127 +1,44 @@
"use client";
import { useState } from "react";
import { Plus } from "lucide-react";
import CardStack from "@/components/cardStack/CardStack";
import MediaContent from "@/components/shared/MediaContent";
import { cls } from "@/lib/utils";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, GridVariant, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
import React, { useMemo } from "react";
import CardStack from "@/components/card/CardStack";
import TextBox from "@/components/Textbox";
import type { CardAnimationType } from "@/types/animations";
import type { GridVariant } from "@/types/grid";
type FeatureCard = {
id: string;
title: string;
descriptions: string[];
imageSrc?: string;
videoSrc?: string;
imageAlt?: string;
};
interface FeatureCardTwentySevenItemProps {
title: string;
descriptions: string[];
imageSrc?: string;
videoSrc?: string;
imageAlt?: string;
className?: string;
titleClassName?: string;
descriptionClassName?: string;
}
const FeatureCardTwentySevenItem = ({
title,
descriptions,
imageSrc,
videoSrc,
imageAlt = "",
className = "",
titleClassName = "",
descriptionClassName = "",
}: FeatureCardTwentySevenItemProps) => {
const [isFlipped, setIsFlipped] = useState(false);
return (
<div
className={cls(
"relative w-full h-full min-h-0 group [perspective:3000px] cursor-pointer",
className
)}
onClick={() => setIsFlipped(!isFlipped)}
>
<div
className={cls(
"relative w-full h-full transition-transform duration-500 [transform-style:preserve-3d]",
isFlipped && "[transform:rotateY(180deg)]"
)}
>
<div className="relative w-full h-full card rounded-theme-capped p-6 gap-6 flex flex-col [backface-visibility:hidden]">
<div className="flex justify-between items-start">
<h3 className={cls("text-2xl font-medium leading-tight", titleClassName)}>
{title}
</h3>
<div className="h-[calc(var(--text-2xl)*1.25)] w-[calc(var(--text-2xl)*1.25)] aspect-square rounded-theme primary-button flex items-center justify-center shrink-0">
<Plus className="h-1/2 w-1/2 text-primary-cta-text" />
</div>
</div>
<div className="w-full aspect-square md:aspect-[10/11] flex items-center justify-center rounded-theme-capped overflow-hidden">
<MediaContent
imageSrc={imageSrc}
videoSrc={videoSrc}
imageAlt={imageAlt}
imageClassName="w-full h-full object-cover"
/>
</div>
</div>
<div className="absolute! inset-0 w-full h-full card rounded-theme-capped p-6 gap-6 flex flex-col justify-between [backface-visibility:hidden] [transform:rotateY(180deg)]">
<div className="flex justify-between items-start">
<h3 className={cls("text-2xl font-medium leading-tight", titleClassName)}>
{title}
</h3>
<div className="h-[calc(var(--text-2xl)*1.25)] w-[calc(var(--text-2xl)*1.25)] aspect-square rounded-theme primary-button flex items-center justify-center shrink-0">
<Plus className="h-1/2 w-1/2 rotate-45 text-primary-cta-text" />
</div>
</div>
<div className="w-full flex flex-col gap-3">
{descriptions.map((desc, index) => (
<p key={index} className={cls("text-lg text-foreground/75 leading-tight", descriptionClassName)}>
{desc}
</p>
))}
</div>
</div>
</div>
</div>
);
};
interface FeatureCardTwentySevenProps {
features: FeatureCard[];
carouselMode?: "auto" | "buttons";
gridVariant: GridVariant;
export interface FeatureCardTwentySevenProps {
features?: Array<{
id: string;
title: string;
description: string;
icon?: React.ReactNode;
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
}>;
gridVariant?: GridVariant;
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
animationType?: CardAnimationType;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
mediaClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
@@ -132,90 +49,94 @@ interface FeatureCardTwentySevenProps {
textBoxButtonTextClassName?: string;
}
const FeatureCardTwentySeven = ({
features,
carouselMode = "buttons",
gridVariant,
uniformGridCustomHeightClasses = "min-h-none",
animationType,
title,
const FeatureCardTwentySeven: React.FC<FeatureCardTwentySevenProps> = ({
features = [],
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description,
tag,
tagIcon,
description = "", tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Feature section",
className = "",
containerClassName = "",
cardClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
cardTitleClassName = "",
cardDescriptionClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: FeatureCardTwentySevenProps) => {
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
const cardItems = useMemo(
() =>
features.map((feature) => (
<div
key={feature.id}
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
>
{feature.icon && (
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
{feature.description}
</p>
{feature.mediaItems && (
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
{feature.mediaItems.map((media, idx) => (
<img
key={idx}
src={media.src}
alt={media.alt || "Feature media"}
className="w-full h-20 object-cover rounded-lg"
/>
))}
</div>
)}
</div>
)),
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
);
return (
<CardStack
mode={carouselMode}
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
ariaLabel={ariaLabel}
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
{features.map((feature, index) => (
<FeatureCardTwentySevenItem
key={`${feature.id}-${index}`}
title={feature.title}
descriptions={feature.descriptions}
imageSrc={feature.imageSrc}
videoSrc={feature.videoSrc}
imageAlt={feature.imageAlt}
className={cardClassName}
titleClassName={cardTitleClassName}
descriptionClassName={cardDescriptionClassName}
/>
))}
</CardStack>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
titleClassName={textBoxTitleClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<CardStack
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
carouselMode="buttons"
ariaLabel={ariaLabel}
className={className}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
>
{cardItems.map((item) => item)}
</CardStack>
</div>
</div>
);
};
FeatureCardTwentySeven.displayName = "FeatureCardTwentySeven";
export default FeatureCardTwentySeven;
export default FeatureCardTwentySeven;

View File

@@ -1,241 +1,141 @@
"use client";
import { memo } from "react";
import { ArrowRight } from "lucide-react";
import CardStack from "@/components/cardStack/CardStack";
import MediaContent from "@/components/shared/MediaContent";
import Tag from "@/components/shared/Tag";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
import React, { useMemo } from "react";
import CardStack from "@/components/card/CardStack";
import TextBox from "@/components/Textbox";
import type { CardAnimationType } from "@/types/animations";
type FeatureItem = {
export interface FeatureCardTwentyThreeProps {
features?: Array<{
id: string;
title: string;
tags: string[];
imageSrc?: string;
videoSrc?: string;
imageAlt?: string;
videoAriaLabel?: string;
onFeatureClick?: () => void;
};
interface FeatureCardTwentyThreeProps {
features: FeatureItem[];
carouselMode?: "auto" | "buttons";
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
itemClassName?: string;
mediaWrapperClassName?: string;
mediaClassName?: string;
cardClassName?: string;
cardTitleClassName?: string;
tagsContainerClassName?: string;
tagClassName?: string;
arrowClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
icon?: React.ReactNode;
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
}>;
gridVariant?: string;
uniformGridCustomHeightClasses?: string;
animationType?: CardAnimationType;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
mediaClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
buttonTextClassName?: string;
}
interface FeatureCardItemProps {
feature: FeatureItem;
shouldUseLightText: boolean;
useInvertedBackground: InvertedBackground;
itemClassName?: string;
mediaWrapperClassName?: string;
mediaClassName?: string;
cardClassName?: string;
cardTitleClassName?: string;
tagsContainerClassName?: string;
tagClassName?: string;
arrowClassName?: string;
}
const FeatureCardItem = memo(({
feature,
shouldUseLightText,
useInvertedBackground,
itemClassName = "",
mediaWrapperClassName = "",
mediaClassName = "",
cardClassName = "",
cardTitleClassName = "",
tagsContainerClassName = "",
tagClassName = "",
arrowClassName = "",
}: FeatureCardItemProps) => {
return (
<article
className={cls("relative h-full flex flex-col gap-6 cursor-pointer group", itemClassName)}
onClick={feature.onFeatureClick}
role="article"
aria-label={feature.title}
const FeatureCardTwentyThree: React.FC<FeatureCardTwentyThreeProps> = ({
features = [],
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description = "", tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", buttonTextClassName = ""}) => {
const cardItems = useMemo(
() =>
features.map((feature) => (
<div
key={feature.id}
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
>
<div className={cls("relative w-full aspect-square overflow-hidden rounded-theme-capped", mediaWrapperClassName)}>
<MediaContent
imageSrc={feature.imageSrc}
videoSrc={feature.videoSrc}
imageAlt={feature.imageAlt || feature.title}
videoAriaLabel={feature.videoAriaLabel || feature.title}
imageClassName={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", mediaClassName)}
{feature.icon && (
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
{feature.description}
</p>
{feature.mediaItems && (
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
{feature.mediaItems.map((media, idx) => (
<img
key={idx}
src={media.src}
alt={media.alt || "Feature media"}
className="w-full h-20 object-cover rounded-lg"
/>
))}
</div>
)}
</div>
)),
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
);
<div className={cls("relative z-1 card rounded-theme-capped p-5 flex-1 flex flex-col justify-between gap-4", cardClassName)}>
<h3 className={cls(
"text-xl md:text-2xl font-medium leading-tight",
shouldUseLightText ? "text-background" : "text-foreground",
cardTitleClassName
)}>
{feature.title}
</h3>
<div className="flex items-center justify-between gap-4">
<div className={cls("flex items-center gap-2 flex-wrap", tagsContainerClassName)}>
{feature.tags.map((tag, index) => (
<Tag
key={index}
text={tag}
useInvertedBackground={useInvertedBackground}
className={tagClassName}
/>
))}
</div>
<ArrowRight
className={cls(
"h-[var(--text-base)] w-auto shrink-0 transition-transform duration-300 group-hover:-rotate-45",
shouldUseLightText ? "text-background" : "text-foreground",
arrowClassName
)}
strokeWidth={1.5}
/>
</div>
</div>
</article>
);
});
FeatureCardItem.displayName = "FeatureCardItem";
const FeatureCardTwentyThree = ({
features,
carouselMode = "buttons",
uniformGridCustomHeightClasses,
animationType,
title,
titleSegments,
description,
tag,
tagIcon,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Features section",
className = "",
containerClassName = "",
itemClassName = "",
mediaWrapperClassName = "",
mediaClassName = "",
cardClassName = "",
cardTitleClassName = "",
tagsContainerClassName = "",
tagClassName = "",
arrowClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: FeatureCardTwentyThreeProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
return (
<CardStack
mode={carouselMode}
gridVariant="uniform-all-items-equal"
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
return (
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
ariaLabel={ariaLabel}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
buttonTextClassName={buttonTextClassName}
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<CardStack
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
carouselMode="buttons"
ariaLabel={ariaLabel}
className={className}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
>
{features.map((feature) => (
<FeatureCardItem
key={feature.id}
feature={feature}
shouldUseLightText={shouldUseLightText}
useInvertedBackground={useInvertedBackground}
itemClassName={itemClassName}
mediaWrapperClassName={mediaWrapperClassName}
mediaClassName={mediaClassName}
cardClassName={cardClassName}
cardTitleClassName={cardTitleClassName}
tagsContainerClassName={tagsContainerClassName}
tagClassName={tagClassName}
arrowClassName={arrowClassName}
/>
))}
{cardItems.map((item) => item)}
</CardStack>
);
</div>
</div>
);
};
FeatureCardTwentyThree.displayName = "FeatureCardTwentyThree";
export default FeatureCardTwentyThree;
export default FeatureCardTwentyThree;

View File

@@ -1,54 +1,43 @@
"use client";
import CardStack from "@/components/cardStack/CardStack";
import FeatureBorderGlowItem from "./FeatureBorderGlowItem";
import { shouldUseInvertedText } from "@/lib/utils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { LucideIcon } from "lucide-react";
import type {
ButtonConfig,
CardAnimationType,
TitleSegment,
ButtonAnimationType,
} from "@/components/cardStack/types";
import type {
TextboxLayout,
InvertedBackground,
} from "@/providers/themeProvider/config/constants";
import React, { useMemo } from "react";
import CardStack from "@/components/card/CardStack";
import TextBox from "@/components/Textbox";
import type { CardAnimationType } from "@/types/animations";
interface FeatureCard {
icon: LucideIcon;
title: string;
description: string;
}
interface FeatureBorderGlowProps {
features: FeatureCard[];
carouselMode?: "auto" | "buttons";
export interface FeatureBorderGlowProps {
features?: Array<{
id: string;
title: string;
description: string;
icon?: React.ReactNode;
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
}>;
gridVariant?: string;
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
animationType?: CardAnimationType;
title?: string;
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
description?: string;
tag?: string;
tagIcon?: LucideIcon;
tagAnimation?: ButtonAnimationType;
buttons?: ButtonConfig[];
buttonAnimation?: ButtonAnimationType;
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
useInvertedBackground?: boolean;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
iconContainerClassName?: string;
iconClassName?: string;
mediaClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
cardTitleClassName?: string;
cardDescriptionClassName?: string;
cardIconClassName?: string;
cardIconWrapperClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
@@ -59,97 +48,94 @@ interface FeatureBorderGlowProps {
textBoxButtonTextClassName?: string;
}
const FeatureBorderGlow = ({
features,
carouselMode = "buttons",
uniformGridCustomHeightClasses = "min-h-75 2xl:min-h-85",
animationType,
title,
const FeatureBorderGlow: React.FC<FeatureBorderGlowProps> = ({
features = [],
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
titleSegments,
description,
tag,
tagIcon,
description = "", tag,
tagAnimation,
buttons,
buttonAnimation,
textboxLayout,
useInvertedBackground,
ariaLabel = "Feature section",
className = "",
containerClassName = "",
cardClassName = "",
iconContainerClassName = "",
iconClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
cardTitleClassName = "",
cardDescriptionClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: FeatureBorderGlowProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(
useInvertedBackground,
theme.cardStyle
textboxLayout = "default", useInvertedBackground = false,
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
const cardItems = useMemo(
() =>
features.map((feature) => (
<div
key={feature.id}
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
>
{feature.icon && (
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
</div>
)}
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
{feature.title}
</h3>
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
{feature.description}
</p>
{feature.mediaItems && (
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
{feature.mediaItems.map((media, idx) => (
<img
key={idx}
src={media.src}
alt={media.alt || "Feature media"}
className="w-full h-20 object-cover rounded-lg"
/>
))}
</div>
)}
</div>
)),
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
);
return (
<CardStack
mode={carouselMode}
gridVariant="uniform-all-items-equal"
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
className={className}
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
ariaLabel={ariaLabel}
<div
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
aria-label={ariaLabel}
>
{features.map((feature, index) => (
<FeatureBorderGlowItem
key={`${feature.title}-${index}`}
item={feature}
index={index}
className={cardClassName}
iconContainerClassName={iconContainerClassName}
iconClassName={iconClassName}
titleClassName={cardTitleClassName}
descriptionClassName={cardDescriptionClassName}
shouldUseLightText={shouldUseLightText}
/>
))}
</CardStack>
{title && (
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
<TextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagAnimation={tagAnimation}
buttons={buttons}
buttonAnimation={buttonAnimation}
textboxLayout={textboxLayout}
titleClassName={textBoxTitleClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
/>
</div>
)}
<div className="max-w-content-width mx-auto px-4">
<CardStack
gridVariant={gridVariant}
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
animationType={animationType}
carouselMode="buttons"
ariaLabel={ariaLabel}
className={className}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
>
{cardItems.map((item) => item)}
</CardStack>
</div>
</div>
);
};
FeatureBorderGlow.displayName = "FeatureBorderGlow";
export default FeatureBorderGlow;
export default FeatureBorderGlow;

111
src/hooks/useAuth.ts Normal file
View File

@@ -0,0 +1,111 @@
"use client";
import { useState, useEffect, useCallback } from "react";
interface User {
id: string;
email: string;
name: string;
}
interface UserSession {
token: string;
user: User;
expiresAt: string;
}
export function useAuth() {
const [user, setUser] = useState<User | null>(null);
const [token, setToken] = useState<string | null>(null);
const [isLoading, setIsLoading] = useState(true);
const [isAuthenticated, setIsAuthenticated] = useState(false);
// Initialize auth state from localStorage
useEffect(() => {
const storedSession = localStorage.getItem("userSession");
if (storedSession) {
try {
const session: UserSession = JSON.parse(storedSession);
// Check if session has expired
if (new Date(session.expiresAt) > new Date()) {
setUser(session.user);
setToken(session.token);
setIsAuthenticated(true);
} else {
// Session expired, clear it
localStorage.removeItem("userSession");
setIsAuthenticated(false);
}
} catch (error) {
console.error("Failed to parse session:", error);
localStorage.removeItem("userSession");
setIsAuthenticated(false);
}
}
setIsLoading(false);
}, []);
const login = useCallback((sessionData: UserSession) => {
setUser(sessionData.user);
setToken(sessionData.token);
setIsAuthenticated(true);
localStorage.setItem("userSession", JSON.stringify(sessionData));
}, []);
const logout = useCallback(async () => {
try {
await fetch("/api/auth/logout", { method: "POST" });
} catch (error) {
console.error("Logout error:", error);
} finally {
setUser(null);
setToken(null);
setIsAuthenticated(false);
localStorage.removeItem("userSession");
window.location.href = "/";
}
}, []);
const verifySession = useCallback(async (): Promise<boolean> => {
if (!token) return false;
try {
const response = await fetch("/api/auth/verify-session", {
headers: {
Authorization: `Bearer ${token}`,
},
});
return response.ok;
} catch (error) {
console.error("Session verification error:", error);
return false;
}
}, [token]);
const updateUser = useCallback((updatedUser: Partial<User>) => {
setUser((prev) => (prev ? { ...prev, ...updatedUser } : null));
const storedSession = localStorage.getItem("userSession");
if (storedSession) {
try {
const session: UserSession = JSON.parse(storedSession);
session.user = { ...session.user, ...updatedUser };
localStorage.setItem("userSession", JSON.stringify(session));
} catch (error) {
console.error("Failed to update session:", error);
}
}
}, []);
return {
user,
token,
isLoading,
isAuthenticated,
login,
logout,
verifySession,
updateUser,
};
}

33
src/middleware.ts Normal file
View File

@@ -0,0 +1,33 @@
import { NextRequest, NextResponse } from 'next/server';
const protectedRoutes = ['/dashboard', '/profile', '/settings'];
const authRoutes = ['/auth'];
const publicRoutes = ['/'];
export function middleware(request: NextRequest) {
const token = request.cookies.get('auth_token')?.value ||
(typeof window !== 'undefined' ? localStorage.getItem('token') : null);
const { pathname } = request.nextUrl;
// Check if route is protected
const isProtected = protectedRoutes.some(route => pathname.startsWith(route));
const isAuthRoute = authRoutes.some(route => pathname.startsWith(route));
const isPublic = publicRoutes.some(route => pathname === route);
// Redirect to auth if accessing protected route without token
if (isProtected && !token) {
return NextResponse.redirect(new URL('/auth', request.url));
}
// Redirect to dashboard if accessing auth route with token
if (isAuthRoute && token) {
return NextResponse.redirect(new URL('/dashboard', request.url));
}
return NextResponse.next();
}
export const config = {
matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
};