Skip to content

Commit 528ed52

Browse files
Zeff01claude
andcommitted
fix: improve service card height and description button accessibility
- Change aspect ratio from 3:4 to 3:5 for taller cards - Add minimum height of 480px to ensure sufficient space - Add minimum height of 80px to bottom section for team members - Fix read more/less button accessibility with sticky positioning - Add scrollable container for expanded descriptions with max height - Ensure read less button stays visible when description is expanded 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a6fdba6 commit 528ed52

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

‎apps/codebility/app/(marketing)/services/_components/ServicesServiceCard.tsx‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function ServiceCard({ service }: Props) {
7676

7777
return (
7878
<div
79-
className="group relative flex h-full flex-col overflow-hidden rounded-2xl bg-white/5 border border-white/10 backdrop-blur-sm transition-all duration-500 hover:shadow-2xl hover:shadow-blue-500/20 hover:border-blue-400/30 hover:bg-white/10 transform-gpu hover:-translate-y-2 hover:scale-105 aspect-[3/4]"
79+
className="group relative flex h-full flex-col overflow-hidden rounded-2xl bg-white/5 border border-white/10 backdrop-blur-sm transition-all duration-500 hover:shadow-2xl hover:shadow-blue-500/20 hover:border-blue-400/30 hover:bg-white/10 transform-gpu hover:-translate-y-2 hover:scale-105 aspect-[3/5] min-h-[480px]"
8080
style={{
8181
transformStyle: 'preserve-3d',
8282
perspective: '1000px',
@@ -126,16 +126,18 @@ function ServiceCard({ service }: Props) {
126126
{name}
127127
</h3>
128128

129-
<div>
130-
<p
131-
className={`text-gray-300 text-sm leading-relaxed ${!isDescriptionExpanded ? "line-clamp-3" : ""}`}
132-
>
133-
{description || "No description available."}
134-
</p>
129+
<div className="relative">
130+
<div className={`${isDescriptionExpanded ? 'max-h-24 overflow-y-auto pr-2' : ''}`}>
131+
<p
132+
className={`text-gray-300 text-sm leading-relaxed ${!isDescriptionExpanded ? "line-clamp-3" : ""}`}
133+
>
134+
{description || "No description available."}
135+
</p>
136+
</div>
135137
{isDescriptionLong && (
136138
<button
137139
onClick={() => setIsDescriptionExpanded(!isDescriptionExpanded)}
138-
className="mt-1 text-xs text-blue-400 hover:text-blue-300 transition-colors"
140+
className="mt-1 text-xs text-blue-400 hover:text-blue-300 transition-colors sticky bottom-0 bg-gradient-to-t from-black/50 to-transparent px-1 py-0.5 rounded"
139141
>
140142
{isDescriptionExpanded ? "Show less" : "Read more"}
141143
</button>
@@ -179,7 +181,7 @@ function ServiceCard({ service }: Props) {
179181
</div>
180182

181183
{/* Fixed Bottom Section - Always Visible */}
182-
<div className="relative px-4 pb-4 pt-2 flex-shrink-0 border-t border-white/10">
184+
<div className="relative px-4 pb-4 pt-2 flex-shrink-0 border-t border-white/10 min-h-[80px]">
183185
{/* Team Section */}
184186
{members.length > 0 ? (
185187
<div>

0 commit comments

Comments
 (0)