11import React , { useState , ChangeEvent , FormEvent , useContext } from "react" ;
22import axios from "axios" ;
33import { useNavigate , Link } from "react-router-dom" ;
4+ import { motion } from "framer-motion" ;
45import { ThemeContext } from "../../context/ThemeContext" ;
56import type { ThemeContextType } from "../../context/ThemeContext" ;
67import { useUser } from "../../context/UserContext" ;
@@ -87,7 +88,12 @@ const Login: React.FC = () => {
8788
8889 < div className = "relative w-full max-w-md px-4 sm:px-6" >
8990 { /* Branding */ }
90- < div className = "text-center mb-10" >
91+ < motion . div
92+ initial = { { opacity : 0 , y : - 20 } }
93+ animate = { { opacity : 1 , y : 0 } }
94+ transition = { { duration : 0.6 } }
95+ className = "text-center mb-10"
96+ >
9197 < div className = "inline-flex items-center justify-center w-20 h-20 bg-white rounded-3xl mb-6 shadow-2xl transform hover:scale-105 transition-transform duration-300 overflow-hidden" >
9298 < img
9399 src = "/crl-icon.png"
@@ -110,15 +116,16 @@ const Login: React.FC = () => {
110116 >
111117 Track your GitHub journey
112118 </ p >
113- </ div >
119+ </ motion . div >
114120
115121 { /* Form Card */ }
116- < div
122+ < motion . div
123+ initial = { { opacity : 0 , y : 30 } }
124+ animate = { { opacity : 1 , y : 0 } }
125+ transition = { { duration : 0.6 , delay : 0.2 } }
117126 className = { `rounded-3xl p-6 sm:p-10 shadow-2xl border ${ mode === "dark" ? "bg-white/10 backdrop-blur-xl border-white/20 text-white" : "bg-white border-gray-200 text-black" } ` }
118127 >
119- < h2
120- className = { `text-2xl font-bold text-center mb-8 ${ mode === "dark" ? "text-white" : "text-gray-800" } ` }
121- >
128+ < h2 className = { `text-2xl font-bold text-center mb-8 ${ mode === "dark" ? "text-white" : "text-gray-800" } ` } >
122129 Welcome Back
123130 </ h2 >
124131
@@ -197,12 +204,10 @@ const Login: React.FC = () => {
197204 </ Link >
198205 </ p >
199206 </ div >
200- </ div >
207+ </ motion . div >
201208 </ div >
202209
203- < div
204- className = { `${ mode === "dark" ? "from-slate-900" : "from-slate-100" } absolute bottom-0 left-0 w-full h-20 bg-gradient-to-t to-transparent` }
205- />
210+ < div className = { `${ mode === "dark" ? "from-slate-900" : "from-slate-100" } absolute bottom-0 left-0 w-full h-20 bg-gradient-to-t to-transparent pointer-events-none` } />
206211 </ div >
207212 ) ;
208213} ;
0 commit comments