Skip to content
TheChatArchiveThe Chat Archive
Geminigemini-2.5-pro-preview-05-06· GoogleHugging Face LMArena Human Preference 140K

I WANT TO DESIGN THAT 'Explore Our 100% Subsidized HRDCorp Claimable Courses'-COURSE…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Amazon Novaamazon.nova-pro-v1:0’s answer.
  1. User

    I WANT TO DESIGN THAT 'Explore Our 100% Subsidized HRDCorp Claimable Courses'-COURSE CARD SECTION ALONG WITH SIDE BAR USING NEXT JS + TAILWIND CSS

  2. Gemini Assistant

    Okay, let's design that section using Next.js (App Router) and Tailwind CSS.

    I'll break it down into components:

    1. CourseCard.tsx: For the individual course card.
    2. Sidebar.tsx: A simple placeholder sidebar.
    3. CoursesPage.tsx (or app/courses/page.tsx): The main page to display the section.

    First, make sure you have a Next.js project with Tailwind CSS set up. If not:

    npx create-next-app@latest my-garranto-clone --typescript --tailwind --eslint
    cd my-garranto-clone
    

    Let's create some mock data for the courses.

    1. Mock Data (app/lib/courseData.ts or similar location):

    // app/lib/courseData.ts
    export interface Course {
      id: string;
      imageUrl: string;
      category: string;
      title: string;
      description: string;
      isHrdCorp: boolean;
      isFreePreview?: boolean;
      learnMoreLink: string;
      duration?: string; // e.g., "16 Hours"
      level?: string;    // e.g., "Beginner"
    }
    
    export const courses: Course[] = [
      {
        id: '1',
        imageUrl: 'https://picsum.photos/seed/course1/600/400', // Replace with actual image paths
        category: 'Human Resources',
        title: 'Strategic HR Business Partner',
        description: 'Elevate your HR role to become a strategic partner in your organization.',
        isHrdCorp: true,
        isFreePreview: true,
        learnMoreLink: '#',
        duration: "2 Days",
        level: "Intermediate"
      },
      {
        id: '2',
        imageUrl: 'https://picsum.photos/seed/course2/600/400',
        category: 'Management & Leadership',
        title: 'Effective Leadership & People Management',
        description: 'Master the art of leading teams and managing people effectively for success.',
        isHrdCorp: true,
        learnMoreLink: '#',
        duration: "3 Days",
        level: "All Levels"
      },
      {
        id: '3',
        imageUrl: 'https://picsum.photos/seed/course3/600/400',
        category: 'Digital Marketing',
        title: 'Advanced SEO Strategies for 2024',
        description: 'Unlock advanced SEO techniques to dominate search rankings and drive traffic.',
        isHrdCorp: true,
        isFreePreview: true,
        learnMoreLink: '#',
        duration: "24 Hours",
        level: "Advanced"
      },
      {
        id: '4',
        imageUrl: 'https://picsum.photos/seed/course4/600/400',
        category: 'Finance',
        title: 'Financial Acumen for Non-Finance Managers',
        description: 'Understand key financial concepts to make better business decisions.',
        isHrdCorp: true,
        learnMoreLink: '#',
        duration: "1 Day",
        level: "Beginner"
      },
      // Add more courses as needed
    ];
    

    2. Course Card Component (app/components/CourseCard.tsx):

    Create a components folder in your app directory if it doesn't exist.

    // app/components/CourseCard.tsx
    import Image from 'next/image';
    import Link from 'next/link';
    import { Course } from '@/app/lib/courseData'; // Adjust path if needed
    import { Clock, BarChart3, CheckCircle2 } from 'lucide-react'; // Example icons
    
    interface CourseCardProps {
      course: Course;
    }
    
    export default function CourseCard({ course }: CourseCardProps) {
      return (
        <div className="bg-white rounded-xl shadow-lg overflow-hidden flex flex-col transition-all hover:shadow-2xl hover:-translate-y-1">
          <div className="relative w-full h-48">
            <Image
              src={course.imageUrl}
              alt={course.title}
              layout="fill"
              objectFit="cover"
            />
            {course.isHrdCorp && (
              <span className="absolute top-3 left-3 bg-green-500 text-white text-xs font-semibold px-3 py-1 rounded-full shadow-md">
                HRDCorp Claimable
              </span>
            )}
            {course.isFreePreview && (
               <span className="absolute top-3 right-3 bg-blue-500 text-white text-xs font-semibold px-3 py-1 rounded-full shadow-md">
                Free Preview
              </span>
            )}
          </div>
    
          <div className="p-6 flex flex-col flex-grow">
            <p className="text-xs text-blue-600 font-semibold uppercase tracking-wide mb-1">
              {course.category}
            </p>
            <h3 className="text-xl font-bold text-gray-800 mb-2 leading-tight">
              {course.title}
            </h3>
            <p className="text-gray-600 text-sm mb-4 line-clamp-3 flex-grow">
              {course.description}
            </p>
    
            <div className="mt-auto"> {/* Pushes elements below it to the bottom */}
              <div className="flex items-center justify-between text-sm text-gray-500 mb-4">
                {course.duration && (
                  <div className="flex items-center">
                    <Clock size={16} className="mr-1.5 text-gray-400" />
                    {course.duration}
                  </div>
                )}
                {course.level && (
                  <div className="flex items-center">
                    <BarChart3 size={16} className="mr-1.5 text-gray-400" />
                    {course.level}
                  </div>
                )}
              </div>
    
              <Link
                href={course.learnMoreLink}
                className="block w-full text-center bg-blue-600 text-white font-semibold py-3 px-4 rounded-lg hover:bg-blue-700 transition-colors duration-300"
              >
                Learn More
              </Link>
            </div>
          </div>
        </div>
      );
    }
    

    To use lucide-react icons, install it:

    npm install lucide-react
    # or
    yarn add lucide-react
    

    3. Sidebar Component (app/components/Sidebar.tsx):

    // app/components/Sidebar.tsx
    export default function Sidebar() {
      const categories = [
        'All Courses',
        'Human Resources',
        'Management & Leadership',
        'Digital Marketing',
        'Finance',
        'Technology',
        'Soft Skills',
      ];
    
      return (
        <aside className="w-full md:w-64 lg:w-72 bg-gray-50 p-6 rounded-lg shadow-md">
          <h3 className="text-xl font-semibold text-gray-800 mb-6 border-b pb-3">
            Filter Courses
          </h3>
    
          <div>
            <h4 className="text-md font-semibold text-gray-700 mb-3">Categories</h4>
            <ul className="space-y-2">
              {categories.map((category) => (
                <li key={category}>
                  <a
                    href="#"
                    className="text-gray-600 hover:text-blue-600 hover:underline transition-colors text-sm"
                  >
                    {category}
                  </a>
                </li>
              ))}
            </ul>
          </div>
    
          <div className="mt-8">
            <h4 className="text-md font-semibold text-gray-700 mb-3">Skill Level</h4>
            <ul className="space-y-2">
              {['Beginner', 'Intermediate', 'Advanced', 'All Levels'].map((level) => (
                <li key={level} className="flex items-center">
                  <input
                    type="checkbox"
                    id={`level-${level.toLowerCase()}`}
                    name={`level-${level.toLowerCase()}`}
                    className="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 mr-2"
                  />
                  <label htmlFor={`level-${level.toLowerCase()}`} className="text-sm text-gray-600">
                    {level}
                  </label>
                </li>
              ))}
            </ul>
          </div>
    
          <div className="mt-8">
            <button className="w-full bg-green-500 text-white font-semibold py-2 px-4 rounded-lg hover:bg-green-600 transition-colors">
              Apply Filters
            </button>
          </div>
        </aside>
      );
    }
    

    4. Main Page (app/courses/page.tsx): You can create a new route, e.g., /courses.

    // app/courses/page.tsx
    import CourseCard from '@/app/components/CourseCard';
    import Sidebar from '@/app/components/Sidebar';
    import { courses } from '@/app/lib/courseData'; // Adjust path if needed
    
    export default function CoursesPage() {
      return (
        <div className="bg-slate-100 min-h-screen">
          <div className="container mx-auto px-4 sm:px-6 lg:px-8 py-12 md:py-16">
            {/* Header Section */}
            <div className="text-center mb-12 md:mb-16">
              <h1 className="text-3xl sm:text-4xl md:text-5xl font-extrabold text-gray-800 leading-tight">
                Explore Our <span className="text-blue-600">100% Subsidized</span>
              </h1>
              <h2 className="text-3xl sm:text-4xl md:text-5xl font-extrabold text-green-500 leading-tight mb-4">
                HRDCorp Claimable Courses
              </h2>
              <p className="text-lg text-gray-600 max-w-3xl mx-auto">
                Unlock your potential with our wide range of professional development courses, fully claimable under HRDCorp.
                Invest in your team's growth today!
              </p>
            </div>
    
            {/* Main Content: Courses Grid and Sidebar */}
            <div className="flex flex-col md:flex-row gap-8 lg:gap-12">
              {/* Sidebar */}
              <div className="w-full md:w-1/4 lg:w-1/5 md:sticky md:top-24 self-start">
                {/* The md:sticky and md:top-24 self-start makes the sidebar sticky on medium screens and up */}
                <Sidebar />
              </div>
    
              {/* Courses Grid */}
              <main className="w-full md:w-3/4 lg:w-4/5">
                {courses.length > 0 ? (
                  <div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-6 lg:gap-8">
                    {courses.map((course) => (
                      <CourseCard key={course.id} course={course} />
                    ))}
                  </div>
                ) : (
                  <div className="text-center py-12">
                    <h3 className="text-2xl font-semibold text-gray-700">No courses found.</h3>
                    <p className="text-gray-500 mt-2">Please check back later or adjust your filters.</p>
                  </div>
                )}
    
                {/* Optional: Pagination (if you have many courses) */}
                {/* <div className="mt-12 flex justify-center">
                  <nav className="inline-flex rounded-md shadow">
                    <a href="#" className="px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                      Previous
                    </a>
                    <a href="#" className="px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-blue-600">
                      1
                    </a>
                    <a href="#" className="px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                      2
                    </a>
                    <a href="#" className="px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                      Next
                    </a>
                  </nav>
                </div> */}
              </main>
            </div>
          </div>
        </div>
      );
    }
    

    Key Tailwind Classes Used:

    • Layout: container mx-auto, flex, flex-col, md:flex-row, gap-8, grid, grid-cols-1 sm:grid-cols-2 xl:grid-cols-3.
    • Sizing: w-full, md:w-1/4, h-48.
    • Spacing: p-6, mb-4, py-12.
    • Typography: text-xl, font-bold, text-gray-800, uppercase, line-clamp-3.
    • Backgrounds & Borders: bg-white, bg-blue-600, rounded-lg, shadow-lg, border-b.
    • States: hover:bg-blue-700, hover:shadow-2xl, hover:-translate-y-1.
    • Positioning: relative, absolute, top-3 left-3, md:sticky md:top-24 self-start.
    • Images: object-cover (used with next/image's layout="fill").
    • Flex Grow/Shrink: flex-grow on the description paragraph in the card to push the button down. mt-auto on the button container.

    To Run:

    1. Save these files in the specified locations.
    2. Run your Next.js development server: npm run dev or yarn dev.
    3. Navigate to http://localhost:3000/courses (or whatever route you used for CoursesPage.tsx).

    This will give you a responsive course card section with a sidebar, similar in spirit to the Garranto Academy layout, using Next.js and Tailwind CSS. You can then customize the styles, data, and functionality further.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.