Skip to content

Commit 4d05061

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

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@headlessui/react": "^2.2.0",
13+
"@next/third-parties": "^15.1.6",
1314
"next": "15.1.4",
1415
"react": "^19.0.0",
1516
"react-dom": "^19.0.0",
@@ -25,5 +26,6 @@
2526
"postcss": "^8",
2627
"tailwindcss": "^3.4.1",
2728
"typescript": "^5"
28-
}
29+
},
30+
"packageManager": "[email protected]+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1"
2931
}

pnpm-lock.yaml

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

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) => (

src/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
22
import { Inter, Staatliches } from "next/font/google";
33
import "./globals.css";
44
import Navigation from "./components/Navigation";
5+
import { GoogleAnalytics } from '@next/third-parties/google'
56

67
const inter = Inter({ subsets: ['latin'] });
78
const staatliches = Staatliches({ weight: '400', subsets: ['latin'] });
@@ -21,6 +22,7 @@ export default function RootLayout({
2122
<body className={`${inter.className} ${staatliches.className} font-inter bg-athens-gray text-purple pt-12 pb-24`}>
2223
<Navigation />
2324
{children}
25+
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID || ''} />
2426
</body>
2527
</html>
2628
);

0 commit comments

Comments
 (0)