import React, { useState } from 'react';
import { motion } from 'framer-motion';
export default function LoginPage({ onNavigate }) {
// A RoleCard component that accepts a 'tint' prop for different color schemes
const RoleCard = ({ title, description, buttonText, role, tint }) => {
const handleNavigationClick = () => {
if (typeof onNavigate === 'function') {
onNavigate(role);
} else {
console.error("Error: onNavigate prop is missing or not a function. Navigation is disabled.");
}
};
const tintStyles = {
yellow: {
card: {
backgroundColor: 'rgba(251, 191, 36, 0.1)',
border: '1px solid rgba(251, 191, 36, 0.3)',
},
button: {
backgroundColor: '#FBBF24',
color: '#1a202c',
}
},
red: {
card: {
backgroundColor: 'rgba(239, 68, 68, 0.1)',
border: '1px solid rgba(239, 68, 68, 0.3)',
},
button: {
backgroundColor: '#EF4444',
color: 'white',
}
},
};
const currentStyle = tintStyles[tint] || {};
return (
{title}
{description}
{buttonText}
);
};
// Animation variants for the main container to stagger its children
const containerVariants = {
hidden: { opacity: 1 }, // Parent is visible, children are not
visible: {
opacity: 1,
transition: {
staggerChildren: 0.2, // Time between each child animation
}
}
};
// Animation variant for the title (fades in from the left)
const titleVariant = {
hidden: { opacity: 0, x: -50 },
visible: {
opacity: 1,
x: 0,
transition: {
duration: 0.5,
ease: "easeOut"
}
}
};
// Animation variant for the admin card (fades in from the top)
const adminCardVariant = {
hidden: { opacity: 0, y: -50 },
visible: {
opacity: 1,
y: 0,
transition: {
duration: 0.5,
ease: "easeOut"
}
}
};
// Animation variant for the applicant card (fades in from the bottom)
const applicantCardVariant = {
hidden: { opacity: 0, y: 50 },
visible: {
opacity: 1,
y: 0,
transition: {
duration: 0.5,
ease: "easeOut"
}
}
};
return (
{/* Background shapes updated to red and yellow */}
<>
>
{/* Main animation container */}
IRIS
Intelligent Recruitment Insight System
);
};