From 9188da12825d5b44b6d9fdd315563525b299c599 Mon Sep 17 00:00:00 2001 From: Barchakuz Date: Sun, 12 May 2024 01:16:55 +0500 Subject: [PATCH] Hover effect --- app/components/UpcomingWebinars.tsx | 85 ++++++++++++++++++ app/components/ui/card-hover-effect.tsx | 111 ++++++++++++++++++++++++ app/page.tsx | 2 + 3 files changed, 198 insertions(+) create mode 100644 app/components/UpcomingWebinars.tsx create mode 100644 app/components/ui/card-hover-effect.tsx diff --git a/app/components/UpcomingWebinars.tsx b/app/components/UpcomingWebinars.tsx new file mode 100644 index 0000000..cb29c58 --- /dev/null +++ b/app/components/UpcomingWebinars.tsx @@ -0,0 +1,85 @@ +'use client' +import Link from "next/link" +import { HoverEffect } from "./ui/card-hover-effect"; + +function UpcomingWebinars() { + + const featuredWebinars = [ + { + title: 'Understanding Music Theory', + description: + 'Dive deep into the fundamentals of music theory and enhance your musical skills.', + slug: 'understanding-music-theory', + isFeatured: true, + }, + { + title: 'The Art of Songwriting', + description: + 'Learn the craft of songwriting from experienced musicians and songwriters.', + slug: 'the-art-of-songwriting', + isFeatured: true, + }, + { + title: 'Mastering Your Instrument', + description: + 'Advanced techniques to master your musical instrument of choice.', + slug: 'mastering-your-instrument', + isFeatured: true, + }, + { + title: 'Music Production Essentials', + description: + 'Get started with music production with this comprehensive overview.', + slug: 'music-production-essentials', + isFeatured: true, + }, + // Added two more webinars + { + title: 'Live Performance Techniques', + description: + 'Enhance your live performance skills with expert tips and strategies.', + slug: 'live-performance-techniques', + isFeatured: true, + }, + { + title: 'Digital Music Marketing', + description: + 'Learn how to promote your music effectively in the digital age.', + slug: 'digital-music-marketing', + isFeatured: true, + }, + ]; + + return ( +
+
+
+

FEATURED WEBINARS

+

Enhance Your Musical Journey

+
+ +
+ ( + { + title: webinar.title, + description: webinar.description, + link: '/' + } + ))} + /> +
+ +
+ + View All webinars + +
+
+
+ ) +} + +export default UpcomingWebinars \ No newline at end of file diff --git a/app/components/ui/card-hover-effect.tsx b/app/components/ui/card-hover-effect.tsx new file mode 100644 index 0000000..59cc447 --- /dev/null +++ b/app/components/ui/card-hover-effect.tsx @@ -0,0 +1,111 @@ +import { cn } from "@/app/utils/cn"; +import { AnimatePresence, motion } from "framer-motion"; +import Link from "next/link"; +import { useState } from "react"; + +export const HoverEffect = ({ + items, + className, +}: { + items: { + title: string; + description: string; + link: string; + }[]; + className?: string; +}) => { + let [hoveredIndex, setHoveredIndex] = useState(null); + + return ( +
+ {items.map((item, idx) => ( + setHoveredIndex(idx)} + onMouseLeave={() => setHoveredIndex(null)} + > + + {hoveredIndex === idx && ( + + )} + + + {item.title} + {item.description} + + + ))} +
+ ); +}; + +export const Card = ({ + className, + children, +}: { + className?: string; + children: React.ReactNode; +}) => { + return ( +
+
+
{children}
+
+
+ ); +}; +export const CardTitle = ({ + className, + children, +}: { + className?: string; + children: React.ReactNode; +}) => { + return ( +

+ {children} +

+ ); +}; +export const CardDescription = ({ + className, + children, +}: { + className?: string; + children: React.ReactNode; +}) => { + return ( +

+ {children} +

+ ); +}; diff --git a/app/page.tsx b/app/page.tsx index d047a48..871a1af 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -3,6 +3,7 @@ import HeroSection from "./components/HeroSection"; import FeaturedCourse from "./components/FeaturedCourse"; import WhyChooseUs from "./components/WhyChooseUs"; import MusicSchoolCards from "./components/MusicSchoolCards"; +import UpcomingWebinars from "./components/UpcomingWebinars"; export default function Home() { return ( @@ -11,6 +12,7 @@ export default function Home() { + ); }