Improved run layout
This commit is contained in:
@@ -32,16 +32,17 @@ const ProblemCard = ({
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`group relative bg-card border border-border rounded-xl p-5 card-hover cursor-pointer animate-fade-in opacity-0`}
|
||||
className="group relative bg-card border border-border rounded-xl p-5 card-hover cursor-pointer animate-fade-in opacity-0 h-full flex flex-col justify-between"
|
||||
style={{
|
||||
animationDelay: `${index * 0.1}s`,
|
||||
animationFillMode: "forwards",
|
||||
}}
|
||||
>
|
||||
{/* Glow effect on hover */}
|
||||
<div className="absolute inset-0 rounded-xl bg-primary/5 opacity-0 group-hover:opacity-100 transition-opacity duration-300" />
|
||||
<div className="absolute inset-0 rounded-xl bg-primary/5 opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none" />
|
||||
|
||||
<div className="relative">
|
||||
{/* Content */}
|
||||
<div className="relative flex flex-col h-full">
|
||||
{/* Header */}
|
||||
<div className="flex items-start justify-between mb-3">
|
||||
<h3 className="font-semibold text-foreground group-hover:text-primary transition-colors">
|
||||
@@ -66,25 +67,30 @@ const ProblemCard = ({
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Stats */}
|
||||
<div className="flex items-center gap-4 text-sm text-muted-foreground">
|
||||
{bestTime && (
|
||||
<div className="flex items-center gap-1.5">
|
||||
<Clock className="h-4 w-4 text-primary" />
|
||||
<span className="font-mono">{bestTime}</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex items-center gap-1.5">
|
||||
<Users className="h-4 w-4" />
|
||||
<span>{attempts} runs</span>
|
||||
</div>
|
||||
</div>
|
||||
{/* Spacer */}
|
||||
<div className="flex-1" />
|
||||
|
||||
{/* Quick run button - appears on hover */}
|
||||
<div className="absolute bottom-0 right-0 opacity-0 group-hover:opacity-100 transition-all duration-300 transform translate-x-2 group-hover:translate-x-0">
|
||||
<Button size="p2">
|
||||
<Zap className="h-4 w-4" />
|
||||
</Button>
|
||||
{/* Stats + Action */}
|
||||
<div className="flex items-center justify-between mt-4 text-sm text-muted-foreground">
|
||||
<div className="flex items-center gap-4">
|
||||
{bestTime && (
|
||||
<div className="flex items-center gap-1.5">
|
||||
<Clock className="h-4 w-4 text-primary" />
|
||||
<span className="font-mono">{bestTime}</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex items-center gap-1.5">
|
||||
<Users className="h-4 w-4" />
|
||||
<span>{attempts} runs</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Quick run button */}
|
||||
<div className="opacity-0 group-hover:opacity-100 transition-all duration-300">
|
||||
<Button size="p2">
|
||||
<Zap className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user