Skip to content

Commit 70cc7eb

Browse files
committed
Fix statistics cards text truncation and layout
1 parent 035b782 commit 70cc7eb

File tree

2 files changed

+59
-23
lines changed

2 files changed

+59
-23
lines changed

package-lock.json

Lines changed: 55 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Stats.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ const Stats = () => {
161161
</p>
162162

163163
{/* Interactive Stats Summary - Grid Layout */}
164-
<div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3 md:gap-4 max-w-6xl mx-auto px-2">
164+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2 sm:gap-3 md:gap-4 max-w-6xl min-h-32 px-4 py-4 sm:px-5 sm:py-5 mx-auto px-2">
165165
{statisticsData.map((stat, index) => (
166166
<motion.div
167167
key={index}
168-
className={`px-2 sm:px-3 md:px-4 py-2 sm:py-3 rounded-md sm:rounded-lg ${stat.bgColor} border ${stat.borderColor} flex flex-col items-center justify-center`}
168+
className={` px-5 sm:px-6 md:px-7 py-6 sm:py-7 min-h-36 sm:min-h-40 rounded-md sm:rounded-lg ${stat.bgColor} border ${stat.borderColor} flex flex-col items-center justify-center`}
169169
whileHover={{
170170
scale: 1.05,
171171
boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
@@ -177,9 +177,8 @@ const Stats = () => {
177177
>
178178
{stat.value}
179179
</span>
180-
<span className="text-gray-700 dark:text-gray-300 text-2xs sm:text-xs md:text-sm text-center mt-0.5 sm:mt-1 line-clamp-1">
181-
{stat.title.split('.')[0].substring(0, 12)}
182-
{stat.title.split('.')[0].length > 12 ? '...' : ''}
180+
<span className="text-gray-700 dark:text-gray-300 text-2xs sm:text-xs md:text-sm text-center mt-0.5 sm:mt-1 line-clamp-3">
181+
{stat.title}
183182
</span>
184183
</motion.div>
185184
))}

0 commit comments

Comments
 (0)