1- import React , { useState , useEffect } from 'react' ;
1+ import React , { useState , useEffect } from 'react' ;
22import { useAuth } from '../contexts/AuthContext' ;
33import { useNavigate } from 'react-router-dom' ;
44
5-
65declare global {
76 interface Window {
87 particlesJS : ( id : string , config : object ) => void ;
@@ -21,18 +20,47 @@ const Login: React.FC = () => {
2120 // Add global styles
2221 const styleTag = document . createElement ( 'style' ) ;
2322 styleTag . innerHTML = `
23+ @font-face {
24+ font-family: 'Sansation';
25+ src: url('https://fonts.cdnfonts.com/css/sansation') format('woff2');
26+ font-weight: 400;
27+ font-style: normal;
28+ }
29+
2430 body {
2531 margin: 0;
26- background-color: #130A39;
27- overflow: hidden;
32+ background: linear-gradient(135deg, #130A39 0%, #1F0F5C 50%, #341873 100%);
33+ overflow-x: hidden;
34+ font-family: 'Sansation', sans-serif;
2835 }
36+
2937 #particles-js {
3038 position: fixed;
3139 width: 100%;
3240 height: 100%;
3341 top: 0;
3442 left: 0;
35- z-index: -1;
43+ z-index: 0;
44+ }
45+
46+ .glow {
47+ filter: drop-shadow(0 0 8px rgba(174, 185, 225, 0.6));
48+ }
49+
50+ @keyframes gradientBorder {
51+ 0% { border-color: #7063A7; }
52+ 50% { border-color: #9A8BD0; }
53+ 100% { border-color: #7063A7; }
54+ }
55+
56+
57+ .card-hover {
58+ transition: transform 0.3s ease, box-shadow 0.3s ease;
59+ }
60+
61+ .card-hover:hover {
62+ transform: translateY(-5px);
63+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
3664 }
3765 ` ;
3866 document . head . appendChild ( styleTag ) ;
@@ -53,7 +81,7 @@ const Login: React.FC = () => {
5381 }
5482 } ,
5583 "color" : {
56- "value" : "#ffffff"
84+ "value" : [ "#AEB9E1" , "#9A8BD0" , "#7063A7" , "#6157FF" ]
5785 } ,
5886 "shape" : {
5987 "type" : "circle" ,
@@ -66,17 +94,17 @@ const Login: React.FC = () => {
6694 }
6795 } ,
6896 "opacity" : {
69- "value" : 0.5 ,
70- "random" : false ,
97+ "value" : 0.6 ,
98+ "random" : true ,
7199 "anim" : {
72- "enable" : false ,
100+ "enable" : true ,
73101 "speed" : 1 ,
74102 "opacity_min" : 0.1 ,
75103 "sync" : false
76104 }
77105 } ,
78106 "size" : {
79- "value" : 3 ,
107+ "value" : 4 ,
80108 "random" : true ,
81109 "anim" : {
82110 "enable" : false ,
@@ -88,7 +116,7 @@ const Login: React.FC = () => {
88116 "line_linked" : {
89117 "enable" : true ,
90118 "distance" : 150 ,
91- "color" : "#ffffff " ,
119+ "color" : "#AEB9E1 " ,
92120 "opacity" : 0.4 ,
93121 "width" : 1
94122 } ,
@@ -154,7 +182,8 @@ const Login: React.FC = () => {
154182 // Cleanup
155183 return ( ) => {
156184 document . head . removeChild ( styleTag ) ;
157- document . body . removeChild ( script ) ;
185+ const scriptElement = document . querySelector ( 'script[src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"]' ) ;
186+ if ( scriptElement ) document . body . removeChild ( scriptElement ) ;
158187 } ;
159188 } , [ ] ) ;
160189
@@ -185,6 +214,17 @@ const Login: React.FC = () => {
185214 }
186215 } ;
187216
217+ // Google G logo SVG
218+ const GoogleLogo = ( ) => (
219+ < svg width = "18" height = "18" xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 48 48" >
220+ < path fill = "#EA4335" d = "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" />
221+ < path fill = "#4285F4" d = "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" />
222+ < path fill = "#FBBC05" d = "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z" />
223+ < path fill = "#34A853" d = "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" />
224+ < path fill = "none" d = "M0 0h48v48H0z" />
225+ </ svg >
226+ ) ;
227+
188228 return (
189229 < >
190230 < div id = "particles-js" > </ div >
@@ -218,7 +258,10 @@ const Login: React.FC = () => {
218258 </ form >
219259
220260 < button onClick = { handleGoogleSignIn } style = { styles . googleButton } >
221- Sign in with Google
261+ < div style = { styles . googleButtonContent } >
262+ < GoogleLogo />
263+ < span style = { styles . googleButtonText } > Sign in with Google</ span >
264+ </ div >
222265 </ button >
223266
224267 < p style = { styles . toggle } >
@@ -245,17 +288,17 @@ const styles = {
245288 } ,
246289 card : {
247290 padding : '2rem' ,
248- backgroundColor : 'white ' ,
291+ backgroundColor : '#1E1350 ' ,
249292 borderRadius : '8px' ,
250- boxShadow : '0 2px 4px rgba(0, 0, 0, 0.1) ' ,
293+ boxShadow : '0px 0px 20px 8px #3E28A2 ' ,
251294 width : '100%' ,
252295 maxWidth : '400px' ,
253296 zIndex : 1 ,
254297 } ,
255298 title : {
256299 textAlign : 'center' as const ,
257300 marginBottom : '1.5rem' ,
258- color : '#333 ' ,
301+ color : '#AEB9E1 ' ,
259302 } ,
260303 form : {
261304 display : 'flex' ,
@@ -264,28 +307,48 @@ const styles = {
264307 } ,
265308 input : {
266309 padding : '0.75rem' ,
310+ backgroundColor : '#130A39' ,
267311 borderRadius : '4px' ,
268- border : '1px solid #ddd ' ,
312+ border : '1px solid rgba(174, 185, 225, 0.4) ' ,
269313 fontSize : '1rem' ,
314+ color : '#AEB9E1' ,
270315 } ,
271316 button : {
272317 padding : '0.75rem' ,
273- backgroundColor : '#007bff ' ,
274- color : 'white ' ,
318+ backgroundColor : '#7063A7 ' ,
319+ color : '#AEB9E1 ' ,
275320 border : 'none' ,
276321 borderRadius : '4px' ,
277322 fontSize : '1rem' ,
278323 cursor : 'pointer' ,
324+ display : 'flex' ,
325+ justifyContent : 'center' ,
326+ alignItems : 'center' ,
279327 } ,
280328 googleButton : {
281329 marginTop : '1rem' ,
282330 padding : '0.75rem' ,
283- backgroundColor : '#fff ' ,
284- color : '#333 ' ,
285- border : '1px solid #ddd ' ,
331+ backgroundColor : 'white ' ,
332+ color : '#444 ' ,
333+ border : 'none ' ,
286334 borderRadius : '4px' ,
287335 fontSize : '1rem' ,
288336 cursor : 'pointer' ,
337+ width : '100%' ,
338+ display : 'flex' ,
339+ justifyContent : 'center' ,
340+ alignItems : 'center' ,
341+ boxShadow : '0 1px 3px rgba(0, 0, 0, 0.2)' ,
342+ } ,
343+ googleButtonContent : {
344+ display : 'flex' ,
345+ alignItems : 'center' ,
346+ justifyContent : 'center' ,
347+ width : '100%' ,
348+ } ,
349+ googleButtonText : {
350+ marginLeft : '10px' ,
351+ fontWeight : '500' as const ,
289352 } ,
290353 error : {
291354 color : '#dc3545' ,
@@ -295,10 +358,10 @@ const styles = {
295358 toggle : {
296359 marginTop : '1rem' ,
297360 textAlign : 'center' as const ,
298- color : '#666 ' ,
361+ color : '#AEB9E1 ' ,
299362 } ,
300363 toggleLink : {
301- color : '#007bff ' ,
364+ color : 'rgb(159, 139, 247) ' ,
302365 cursor : 'pointer' ,
303366 } ,
304367} ;
0 commit comments