Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor hover #218

Merged
merged 7 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 71 additions & 98 deletions components/tracks.tsx
Original file line number Diff line number Diff line change
@@ -1,110 +1,83 @@
import Image from "next/image";
import { buttonVariants } from "./ui/button";
import Link from "next/link";
import { cn } from "@/lib/utils";
import { buttonVariants } from "./ui/button";
import styles from "../styles/tracks.module.css"; // Import the CSS module

type Props = {};

export default function Tracks({}: Props) {
function TrackCard({ title, description, imageSrc, linkHref }) {
return (
<section className="text-center md:my-20 my-10">
<h4 className="md:text-3xl text-xl text-black font-bold dark:text-white">
Our Batches
</h4>
<p>Master the Frontend Development with Frontend Freaks</p>
<div className="flex flex-col gap-3 items-center border p-4 rounded-lg">

{/* Cards Wrapper */}
<div className="flex gap-6 mt-8 md:flex-row flex-col">
<div className="flex flex-col gap-3 items-center border p-4 rounded-lg">
<Image
src="/learn_img.svg"
alt="learn"
width={250}
height={250}
className="rounded bg-white"
/>
<div className="flex flex-col gap-2 flex-grow">
<h3 className="text-xl font-bold ">Build Your Foundation</h3>
<p className="text-md text-slate-600 max-w-md dark:text-white">
Make your foundation strong by learning HTML, CSS, JS, Git, and
GitHub. Join this batch if you want to make your foundation as
strong as concrete.
</p>
</div>
<Link
href="/batch/learn/html/basic"
className={cn(buttonVariants(), "rounded-full px-8 py-2 mt-4")}
>
Join
</Link>
</div>
<div className="flex flex-col gap-3 items-center border p-4 rounded-lg">
<Image
src="/dsa_in_javascript.svg"
alt="learn"
width={250}
height={250}
className="rounded bg-white"
/>
<div className="flex flex-col gap-2 flex-grow">
<h3 className="text-xl font-bold ">DSA In Javascript</h3>
<p className="text-md text-slate-600 max-w-md dark:text-white">
Enroll for this batch to ace DSA skills with javascript, enhancing
your skills for job success.
</p>
</div>
<Link
href="/batch/dsa/loops"
className={cn(buttonVariants(), "rounded-full px-8 py-2 mt-4")}
>
Join
<div className={styles["image-container"]}>

<Link href={linkHref}>

<Image
src={imageSrc}
alt={title}
width={250}
height={250}
className="rounded bg-white"
/>
</Link>
</div>
<div className="flex flex-col gap-3 items-center border p-4 rounded-lg">
<Image
src="/build_img.svg"
alt="learn"
width={250}
height={250}
className="rounded bg-white"
/>
<div className="flex flex-col gap-2 flex-grow">
<h3 className="text-xl font-bold ">Build Projects</h3>
<p className="text-md text-slate-600 max-w-md dark:text-white">
Build the project with the latest technologies like React, Redux,
and Next.js. Join this batch if you want to be a part of it.
</p>
</div>
<Link
href="/batch/build/react/fundamentals"
className={cn(buttonVariants(), "rounded-full px-8 py-2 mt-4")}
>
Join
</Link>
</div>
<div className="flex flex-col gap-3 items-center border p-4 rounded-lg">
<Image
src="/hire_img.svg"
alt="learn"
width={250}
height={250}
className="rounded bg-white"
/>
<div className="flex flex-col gap-2 flex-grow">
<h3 className="text-xl font-bold ">Get Hired</h3>
<p className="text-md text-slate-600 max-w-md dark:text-white">
Enroll for this batch to ace interviews with tips, tricks, and
mock sessions, enhancing your skills for job success.
</p>
</div>
<Link
href="/batch/hire/hire"
className={cn(buttonVariants(), "rounded-full px-8 py-2 mt-4")}
>
Join
</Link>
<div className="flex flex-col gap-2 flex-grow">
<h3 className="text-xl font-bold">{title}</h3>
<p className="text-md text-slate-600 max-w-md dark:text-white">
{description}
</p>
</div>
<Link href={linkHref} className={cn(buttonVariants(), "rounded-full px-8 py-2 mt-4")}>
Join
</Link>
</div>
</section>
);
}

export default function Tracks() {
const trackData = [
{
title: "Build Your Foundation",
description:
"Make your foundation strong by learning HTML, CSS, JS, Git, and GitHub. Join this batch if you want to make your foundation as strong as concrete.",
imageSrc: "/learn_img.svg",
linkHref: "/batch/learn/html/basic",
},
{
title: "DSA In Javascript",
description:
"Enroll for this batch to ace DSA skills with javascript, enhancing your skills for job success.",
imageSrc: "/dsa_in_javascript.svg",
linkHref: "/batch/dsa/loops",
},
{
title: "Build Projects",
description:
"Build the project with the latest technologies like React, Redux, and Next.js. Join this batch if you want to be a part of it.",
imageSrc: "/build_img.svg",
linkHref: "/batch/build/react/fundamentals",
},
{
title: "Get Hired",
description:
"Enroll for this batch to ace interviews with tips, tricks, and mock sessions, enhancing your skills for job success.",
imageSrc: "/hire_img.svg",
linkHref: "/batch/hire/hire",
},
];

return (
<section className="text-center md:my-20 my-10">
<h4 className="md:text-3xl text-xl text-black font-bold dark:text-white">
Our Batches
</h4>
<p>Master Frontend Development with Frontend Freaks</p>

<div className="flex gap-6 mt-8 md:flex-row flex-col">
{trackData.map((track, index) => (
<TrackCard key={index} {...track} />
))}
</div>
</section>
);
}
10 changes: 10 additions & 0 deletions styles/tracks.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* components/Tracks.module.css */

.image-container {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we do it with tailwind only? instead of adding plain stylesheet?

Copy link
Contributor Author

@monisanees270798 monisanees270798 Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes definitely, I tried and it worked. Can you recheck the PR request?
@ManishBisht777 @Vishal-raj-1

cursor: pointer;
transition: transform 0.2s;
}

.image-container:hover {
transform: scale(1.15);
}