|
| 1 | +"use client" |
| 2 | +import { useState } from "react" |
1 | 3 | import { Separator } from "./separator" |
| 4 | +import { motion } from "motion/react" |
| 5 | +import { SegmentAnimation } from "./animations/segment" |
| 6 | +import { cardVariants } from "./motion/card.motion" |
| 7 | +import { whyChooseUsContent } from "@/lib/content" |
2 | 8 |
|
3 | 9 | export const DeveloperExperienceSection = () => { |
| 10 | + const [hovered, setHovered] = useState<number | null>(null) |
| 11 | + |
4 | 12 | return ( |
5 | 13 | <section> |
6 | 14 | <Separator index={1}>Built for real projects</Separator> |
7 | 15 | <section className="min-h-[calc(100dvh-4rem)] mx-10 flex flex-col border-x border-solid border-border base:mx-16 xl:min-h-auto"> |
8 | | - <div className="py-16 px-4 grid sm:px-6 md:px-8 base:px-10 base:items-center base:grid-cols-2"> |
9 | | - <h2 className="mb-6 text-primary text-2xl md:text-fluid-3xl">Why Choose Us</h2> |
10 | | - <p className="text-muted text-fluid-base"> |
11 | | - Tailwind CSS v4 brings a modern engine — and our utilities are built for it. We’ve designed every package |
12 | | - to integrate seamlessly using the new configuration API, variant generator, and dynamic styling support. |
13 | | - </p> |
14 | | - </div> |
| 16 | + <SegmentAnimation |
| 17 | + title="Why Choose Us" |
| 18 | + description="Tailwind CSS v4 brings a modern engine — and our utilities are built for it. We’ve designed every package to integrate seamlessly using the new configuration API, variant generator, and dynamic styling support." |
| 19 | + /> |
15 | 20 | <div className="grid text-primary text-left article:border-t article:border-solid article:border-border lg:flex-100 lg:grid-cols-2 lg:article:border-r lg:article:even:border-r-0 xl:min-h-[30dvw] xl:grid-cols-4 xl:article:nth-[2]:border-r"> |
16 | | - <article className="w-full h-full py-14 px-4 flex items-center justify-between gap-x-6 sm:px-6 sm:gap-x-10 md:px-8 md:gap-x-12 base:px-10 base:gap-x-16 lg:flex-col lg:items-start"> |
17 | | - <span>/01</span> |
18 | | - <div className="text-left self-end xl:text-right"> |
19 | | - <p>Native</p> |
20 | | - <p className="mt-1 text-muted text-sm"> |
21 | | - Our utilities are built using Tailwind’s new API — no legacy plugins, no PostCSS. Just clean, |
22 | | - modern extension. |
23 | | - </p> |
24 | | - </div> |
25 | | - </article> |
26 | | - <article className="w-full h-full py-14 px-4 flex items-center justify-between gap-x-6 sm:px-6 sm:gap-x-10 md:px-8 md:gap-x-12 base:px-10 base:gap-x-16 lg:flex-col lg:items-start"> |
27 | | - <span>/02</span> |
28 | | - <div className="text-left self-end xl:text-right"> |
29 | | - <p>Dynamic Styling</p> |
30 | | - <p className="mt-1 text-muted text-sm"> |
31 | | - Use Tailwind’s new syntax like `[margin:12px]` to update our utility styles inline, without |
32 | | - modifying config files. |
33 | | - </p> |
34 | | - </div> |
35 | | - </article> |
36 | | - <article className="w-full h-full py-14 px-4 flex items-center justify-between gap-x-6 sm:px-6 sm:gap-x-10 md:px-8 md:gap-x-12 base:px-10 base:gap-x-16 lg:flex-col lg:items-start"> |
37 | | - <span>/03</span> |
38 | | - <div className="text-left self-end xl:text-right"> |
39 | | - <p>Variant Support</p> |
40 | | - <p className="mt-1 text-muted text-sm"> |
41 | | - Create custom variants easily with our utilities. Built on v4’s JIT engine, you get dynamic |
42 | | - variant control out of the box. |
43 | | - </p> |
44 | | - </div> |
45 | | - </article> |
46 | | - <article className="w-full h-full py-14 px-4 flex items-center justify-between gap-x-6 sm:px-6 sm:gap-x-10 md:px-8 md:gap-x-12 base:px-10 base:gap-x-16 lg:flex-col lg:items-start"> |
47 | | - <span>/04</span> |
48 | | - <div className="text-left self-end xl:text-right"> |
49 | | - <p>Clean Integration</p> |
50 | | - <p className="mt-1 text-muted text-sm"> |
51 | | - We follow Tailwind’s core design philosophy — fast builds, atomic classes, and a unified, |
52 | | - zero-runtime experience. |
53 | | - </p> |
54 | | - </div> |
55 | | - </article> |
| 21 | + {whyChooseUsContent.map((item, idx) => ( |
| 22 | + <motion.article |
| 23 | + key={item.number} |
| 24 | + className="group w-full h-full py-14 px-4 flex items-center justify-between gap-x-6 relative z-10 overflow-hidden sm:px-6 sm:gap-x-10 md:px-8 md:gap-x-12 base:px-10 base:gap-x-16 lg:flex-col lg:items-start hover:bg-surface hover:cursor-pointer" |
| 25 | + onMouseEnter={() => setHovered(idx)} |
| 26 | + onMouseLeave={() => setHovered(null)} |
| 27 | + transition={cardVariants} |
| 28 | + > |
| 29 | + <span>{item.number}</span> |
| 30 | + <div className="text-left self-end xl:text-right overflow-hidden"> |
| 31 | + <p className="text-lg font-medium group-hover:text-primary">{item.title}</p> |
| 32 | + <motion.p |
| 33 | + className="mt-1 text-muted overflow-hidden group-hover:text-primary" |
| 34 | + animate={ |
| 35 | + hovered === idx ? { opacity: 1, y: 0, height: "auto" } : { opacity: 0, y: 20, height: 0 } |
| 36 | + } |
| 37 | + initial={{ opacity: 0, y: 20, height: 0 }} |
| 38 | + transition={{ duration: 0.4, ease: [0.4, 0, 0.2, 1] }} |
| 39 | + > |
| 40 | + {item.desc} |
| 41 | + </motion.p> |
| 42 | + </div> |
| 43 | + </motion.article> |
| 44 | + ))} |
56 | 45 | </div> |
57 | 46 | </section> |
58 | 47 | </section> |
|
0 commit comments