11<!DOCTYPE html>
22< html lang ="en ">
3+
34< head >
45 < meta charset ="UTF-8 ">
56 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
910 < link rel ="stylesheet " href ="login.css ">
1011 < link rel ="stylesheet " href ="theme.css ">
1112</ head >
13+
1214< body >
1315 < script >
1416 // Redirect if already logged in
1921
2022 < div class ="form-container ">
2123 < div style ="position: absolute; top: 20px; right: 20px; ">
22- < button class ="theme-toggle " aria-label ="Toggle dark/light mode " style ="background: rgba(46, 125, 50, 0.1); border: 1px solid rgba(46, 125, 50, 0.3); color: #2e7d32; ">
24+ < button class ="theme-toggle " aria-label ="Toggle dark/light mode "
25+ style ="background: rgba(46, 125, 50, 0.1); border: 1px solid rgba(46, 125, 50, 0.3); color: #2e7d32; ">
2326 < i class ="fas fa-sun sun-icon "> </ i >
2427 < i class ="fas fa-moon moon-icon "> </ i >
2528 < span class ="theme-text "> Light</ span >
2629 </ button >
2730 </ div >
28-
31+
2932 < div class ="brand-section ">
3033 < div class ="brand-icon ">
3134 < i class ="fas fa-seedling "> </ i >
3235 </ div >
3336 < h2 > Welcome Back</ h2 >
3437 < p class ="form-subtitle "> Sign in to access your AgriTech dashboard</ p >
3538 </ div >
36-
39+
3740 < form onsubmit ="handleLogin(event) ">
3841 < div class ="input-group ">
3942 < i class ="fas fa-envelope "> </ i >
4043 < input type ="email " id ="email " placeholder ="Enter your email " required >
4144 </ div >
42-
45+
4346 < div class ="input-group ">
4447 < i class ="fas fa-lock "> </ i >
4548 < input type ="password " id ="password " placeholder ="Enter your password " required >
4649 < button type ="button " class ="password-toggle " onclick ="togglePassword() ">
4750 < i class ="fas fa-eye " id ="password-eye "> </ i >
4851 </ button >
4952 </ div >
50-
53+
5154 < div class ="forgot-password ">
5255 < a href ="forgot-password.html "> Forgot Password?</ a >
5356 </ div >
54-
57+
5558 < button type ="submit " id ="login-btn ">
5659 < span id ="login-text "> Sign In</ span >
5760 </ button >
58-
61+
5962 < div class ="divider ">
6063 < span > or continue with</ span >
6164 </ div >
62-
65+
6366 < button type ="button " id ="google-login-btn " class ="google-btn ">
6467 < span class ="google-logo ">
6568 < svg class ="google-icon " viewBox ="0 0 533.5 544.3 ">
66- < path fill ="#4285F4 " d ="M533.5 278.4c0-18.5-1.6-37.1-5-55.2H272v104.5h146.9c-6.4 34.7-25.7 64.1-54.9 83.5l89 69.4c52-47.8 80.5-118.3 80.5-202.2z "/>
67- < path fill ="#34A853 " d ="M272 544.3c73.6 0 135.4-24.3 180.5-65.9l-89-69.4c-24.7 16.6-56.4 26.2-91.5 26.2-70.4 0-130-47.6-151.3-111.5l-93.6 72.3c43.3 85.1 132.1 147.3 244.9 147.3z "/>
68- < path fill ="#FBBC04 " d ="M120.7 323.7c-10.4-30.7-10.4-63.6 0-94.3L27 157c-40.7 79.7-40.7 172 0 251.7l93.7-72.3z "/>
69- < path fill ="#EA4335 " d ="M272 107.7c38.6-.6 75.5 13.6 104 39.4l77.7-77.7C403.2 23.9 340.2-.2 272 0 159.2 0 70.5 62.2 27.2 147.3l93.6 72.4c21.4-63.9 81-111.5 151.2-112z "/>
69+ < path fill ="#4285F4 "
70+ d ="M533.5 278.4c0-18.5-1.6-37.1-5-55.2H272v104.5h146.9c-6.4 34.7-25.7 64.1-54.9 83.5l89 69.4c52-47.8 80.5-118.3 80.5-202.2z " />
71+ < path fill ="#34A853 "
72+ d ="M272 544.3c73.6 0 135.4-24.3 180.5-65.9l-89-69.4c-24.7 16.6-56.4 26.2-91.5 26.2-70.4 0-130-47.6-151.3-111.5l-93.6 72.3c43.3 85.1 132.1 147.3 244.9 147.3z " />
73+ < path fill ="#FBBC04 "
74+ d ="M120.7 323.7c-10.4-30.7-10.4-63.6 0-94.3L27 157c-40.7 79.7-40.7 172 0 251.7l93.7-72.3z " />
75+ < path fill ="#EA4335 "
76+ d ="M272 107.7c38.6-.6 75.5 13.6 104 39.4l77.7-77.7C403.2 23.9 340.2-.2 272 0 159.2 0 70.5 62.2 27.2 147.3l93.6 72.4c21.4-63.9 81-111.5 151.2-112z " />
7077 </ svg >
7178 </ span >
7279 < span > Continue with Google</ span >
7380 </ button >
74-
7581 < p > Don't have an account? < a href ="register.html "> Create Account</ a > </ p >
7682 </ form >
7783 </ div >
@@ -81,7 +87,7 @@ <h2>Welcome Back</h2>
8187 function togglePassword ( ) {
8288 const passwordInput = document . getElementById ( 'password' ) ;
8389 const eyeIcon = document . getElementById ( 'password-eye' ) ;
84-
90+
8591 if ( passwordInput . type === 'password' ) {
8692 passwordInput . type = 'text' ;
8793 eyeIcon . className = 'fas fa-eye-slash' ;
@@ -98,37 +104,31 @@ <h2>Welcome Back</h2>
98104 // Enhanced login handler with loading state
99105 function handleLogin ( event ) {
100106 event . preventDefault ( ) ;
101-
107+
102108 const loginBtn = document . getElementById ( 'login-btn' ) ;
103109 const loginText = document . getElementById ( 'login-text' ) ;
104110 const emailInput = document . getElementById ( 'email' ) ;
105111 const passwordInput = document . getElementById ( 'password' ) ;
106-
112+
107113 // Add loading state
108114 loginBtn . classList . add ( 'loading' ) ;
109115 loginText . textContent = 'Signing In...' ;
110116 loginBtn . disabled = true ;
111-
117+
112118 // Reset previous states
113119 emailInput . classList . remove ( 'error' , 'success' ) ;
114120 passwordInput . classList . remove ( 'error' , 'success' ) ;
115-
116- // Get form data
117- const email = emailInput . value . trim ( ) ;
118- const password = passwordInput . value ;
119-
120- // Attempt login using AuthManager
121+
122+ // Simulate login process (replace with your actual login logic)
121123 setTimeout ( ( ) => {
122- const result = window . authManager . login ( email , password ) ;
123-
124- if ( result . success ) {
124+ const email = emailInput . value ;
125+ const password = passwordInput . value ;
126+
127+ if ( email && password ) {
125128 emailInput . classList . add ( 'success' ) ;
126129 passwordInput . classList . add ( 'success' ) ;
127130 loginText . textContent = 'Success!' ;
128-
129- showAuthMessage ( result . message , 'success' ) ;
130-
131- // Redirect to main page
131+
132132 setTimeout ( ( ) => {
133133 window . location . href = 'main.html' ;
134134 } , 1000 ) ;
@@ -147,7 +147,7 @@ <h2>Welcome Back</h2>
147147 }
148148
149149 // Google login handler
150- document . getElementById ( 'google-login-btn' ) . addEventListener ( 'click' , function ( ) {
150+ document . getElementById ( 'google-login-btn' ) . addEventListener ( 'click' , function ( ) {
151151 this . style . transform = 'scale(0.98)' ;
152152 setTimeout ( ( ) => {
153153 this . style . transform = '' ;
@@ -159,17 +159,17 @@ <h2>Welcome Back</h2>
159159
160160 // Add input focus animations
161161 document . querySelectorAll ( 'input' ) . forEach ( input => {
162- input . addEventListener ( 'focus' , function ( ) {
162+ input . addEventListener ( 'focus' , function ( ) {
163163 this . parentElement . style . transform = 'translateY(-2px)' ;
164164 } ) ;
165-
166- input . addEventListener ( 'blur' , function ( ) {
165+
166+ input . addEventListener ( 'blur' , function ( ) {
167167 this . parentElement . style . transform = 'translateY(0)' ;
168168 } ) ;
169169 } ) ;
170170
171171 // Add keyboard navigation
172- document . addEventListener ( 'keydown' , function ( e ) {
172+ document . addEventListener ( 'keydown' , function ( e ) {
173173 if ( e . key === 'Enter' ) {
174174 const form = document . querySelector ( 'form' ) ;
175175 if ( document . activeElement . tagName === 'INPUT' ) {
@@ -187,4 +187,5 @@ <h2>Welcome Back</h2>
187187 < script src ="theme.js "> </ script >
188188 < script src ="auth.js "> </ script >
189189</ body >
190+
190191</ html >
0 commit comments