forked from creatorcluster/renderdragon.org
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPopularTools.tsx
More file actions
170 lines (159 loc) · 4.98 KB
/
PopularTools.tsx
File metadata and controls
170 lines (159 loc) · 4.98 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import { motion } from 'framer-motion';
import { IconDownload, IconMusic, IconRobot, IconPhoto, IconUser } from '@tabler/icons-react';
import { cn } from '@/lib/utils';
interface Tool {
id: number;
title: string;
description: string;
icon: React.ElementType;
path: string;
color: string;
}
const PopularTools = () => {
const tools: Tool[] = [
{
id: 1,
title: 'Osmium',
description: 'Osmium will be the first and the last tool for your copyright checks.',
icon: IconMusic,
path: 'https://osmiumchecks.vercel.app/',
color: 'from-blue-500/80 to-blue-600/80'
},
{
id: 2,
title: 'YouTube Tools',
description: 'Download YouTube thumbnails and see detail analytics of a video.',
icon: IconDownload,
path: '/youtube-downloader',
color: 'from-purple-500/80 to-purple-600/80'
},
{
id: 3,
title: 'Background Generator',
description: 'Create unique and stunning backgrounds for your thumbnails.',
icon: IconPhoto,
path: '/background-generator',
color: 'from-green-500/80 to-green-600/80'
},
{
id: 4,
title: 'Player Renderer',
description: 'Render a 3D model of a Minecraft player skin.',
icon: IconUser,
path: '/player-renderer',
color: 'from-red-500/80 to-red-600/80'
}
];
const [hoveredId, setHoveredId] = useState<number | null>(null);
const containerVariants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: {
staggerChildren: 0.15,
delayChildren: 0.2
}
}
};
const itemVariants = {
hidden: { opacity: 0, y: 20 },
visible: {
opacity: 1,
y: 0,
transition: {
duration: 0.6
}
}
};
return (
<section className="py-20 bg-card/50">
<div className="container mx-auto px-4">
<motion.div
className="text-center mb-12"
initial={{ opacity: 0, y: -20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
>
<h2 className="text-3xl md:text-4xl font-vt323 mb-4">
Popular <span className="text-cow-purple">Tools</span>
</h2>
<p className=" max-w-2xl mx-auto">
A collection of our most used tools to help you with your content creation.
</p>
</motion.div>
<motion.div
className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"
variants={containerVariants}
initial="hidden"
whileInView="visible"
viewport={{ once: true }}
>
{tools.map((tool) => {
const isExternal = tool.path.startsWith('http');
const card = (
<div
className={cn(
"h-full pixel-corners flex flex-col p-6 bg-gradient-to-br border-2",
tool.color,
"border-white/10 text-white transition-all duration-300",
hoveredId === tool.id ? "border-white/30 shadow-lg scale-[1.02]" : ""
)}
>
<motion.div
className="p-3 bg-white/10 rounded-md w-fit mb-4"
whileHover={{ rotate: [0, -10, 10, -5, 5, 0] }}
transition={{ duration: 0.5 }}
>
<tool.icon className="h-6 w-6" />
</motion.div>
<h3 className="text-xl font-vt323 mb-2">{tool.title}</h3>
<p className="text-white/70 text-sm flex-grow">
{tool.description}
</p>
<motion.div
className={cn(
"mt-4 text-sm font-semibold",
"transition-transform duration-300",
hoveredId === tool.id ? "translate-x-2" : ""
)}
whileHover={{ x: 5 }}
>
Try it now
</motion.div>
</div>
);
return (
<motion.div
key={tool.id}
variants={itemVariants}
>
{isExternal ? (
<a
href={tool.path}
className="block"
onMouseEnter={() => setHoveredId(tool.id)}
onMouseLeave={() => setHoveredId(null)}
>
{card}
</a>
) : (
<Link
to={tool.path}
className="block"
onMouseEnter={() => setHoveredId(tool.id)}
onMouseLeave={() => setHoveredId(null)}
>
{card}
</Link>
)}
</motion.div>
)})}
</motion.div>
</div>
</section>
);
};
export default React.memo(PopularTools);