Skip to content

Commit cf91dc6

Browse files
committed
fix: enhance TopicsList hover effects and tooltip positioning
1 parent 8e9abda commit cf91dc6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/app/components/TopicsList.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ export default function TopicsList() {
1313
<div key={id} className="relative group">
1414
<Link
1515
href={`/topics/${id}`}
16-
className="w-full bg-purple text-white p-6 sm:p-8 rounded-2xl shadow-lg hover:shadow-xl transition-all duration-200 text-left flex flex-col justify-between min-h-[150px] border-2 border-transparent hover:border-white/20 group"
16+
className="w-full bg-purple text-white p-6 sm:p-8 rounded-2xl shadow-lg hover:shadow-xl transition-all duration-200 text-left flex flex-col justify-between min-h-[150px] border-2 border-transparent hover:border-white/20 group hover:scale-[1.02] hover:-translate-y-1"
1717
>
18-
<div>
18+
<div className="relative">
1919
<h2 className="text-2xl font-staatliches text-white mb-2 pr-10">
2020
{topic.title}
2121
</h2>
2222
<div
23-
className="absolute top-6 sm:top-8 right-6 sm:right-8 w-8 h-8 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors border border-white/40"
23+
className="absolute top-0 right-0 w-8 h-8 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-all duration-200 border border-white/40"
2424
onMouseEnter={() => setHoveredTopic(id)}
2525
onMouseLeave={() => setHoveredTopic(null)}
2626
>
@@ -30,11 +30,12 @@ export default function TopicsList() {
3030
</Link>
3131

3232
<div
33-
className={`absolute z-10 w-80 p-5 bg-white rounded-xl shadow-xl top-full mt-2 right-0 text-left border-2 border-purple transition-all duration-200 origin-top-right ${
33+
className={`absolute z-10 w-80 p-5 bg-white rounded-xl shadow-xl right-6 sm:right-8 text-left border-2 border-purple transition-all duration-200 origin-top-right ${
3434
hoveredTopic === id
3535
? 'opacity-100 scale-100 translate-y-0'
3636
: 'opacity-0 scale-95 translate-y-2 pointer-events-none'
3737
}`}
38+
style={{ top: '4rem' }}
3839
>
3940
<div className="space-y-3">
4041
{topic.description.map((paragraph) => (

0 commit comments

Comments
 (0)