-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathHowItWorks.tsx
More file actions
97 lines (91 loc) · 2.71 KB
/
Copy pathHowItWorks.tsx
File metadata and controls
97 lines (91 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { motion, useAnimation } from 'framer-motion';
import { useInView } from 'react-intersection-observer';
import { useEffect } from 'react';
import { Card, CardContent, CardHeader, CardTitle } from '../../ui/card';
import { MedalIcon, MapIcon, PlaneIcon, GiftIcon } from '../../utils/Icons';
interface FeatureProps {
icon: JSX.Element;
title: string;
description: string;
}
const features: FeatureProps[] = [
{
icon: <MedalIcon />,
title: 'Sign in',
description:
'Sign in with Google to generate secret UUIDs, or generate your own using a random key generator',
},
{
icon: <MapIcon />,
title: 'Setup',
description:
'Setup the taskserver for your Taskwarrior clients by following the documentation',
},
{
icon: <PlaneIcon />,
title: 'Share',
description:
'Sign in on multiple devices and use the same UUIDs to sync tasks across all the clients or your team',
},
{
icon: <GiftIcon />,
title: 'Deploy your own',
description:
'You can also deploy your own server instance by following this documentation',
},
];
const cardVariants = {
hidden: { opacity: 0, x: -50 },
visible: { opacity: 1, x: 0, transition: { duration: 0.6 } },
hover: { scale: 1.05, transition: { duration: 0.3 } },
};
export const HowItWorks = () => {
const controls = useAnimation();
const { ref, inView } = useInView();
useEffect(() => {
if (inView) {
controls.start('visible');
}
}, [controls, inView]);
return (
<section
id="howItWorks"
data-testid="#howItWorks"
className="container text-center py-24 sm:py-32 scroll-mt-16"
>
<h2 className="text-3xl md:text-4xl font-bold ">
How It{' '}
<span className="inline bg-gradient-to-r from-[#61DAFB] to-[#1fc0f1] text-transparent bg-clip-text">
Works{' '}
</span>
</h2>
<br />
<br />
<div
ref={ref}
className="grid md:grid-cols-2 lg:grid-cols-4 gap-8 gap-y-10"
>
{features.map(({ icon, title, description }: FeatureProps) => (
<motion.div
key={title}
initial="hidden"
animate={controls}
variants={cardVariants}
whileHover="hover"
className="bg-muted rounded-lg"
>
<Card className="bg-muted/50 relative flex flex-col justify-center items-center">
<CardHeader>
<CardTitle className="grid gap-4 place-items-center">
{icon}
{title}
</CardTitle>
</CardHeader>
<CardContent>{description}</CardContent>
</Card>
</motion.div>
))}
</div>
</section>
);
};