Update index.html
Browse files- index.html +101 -99
index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Ultra Modern Login</title>
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet">
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
@@ -14,20 +14,25 @@
|
|
| 14 |
padding: 0;
|
| 15 |
box-sizing: border-box;
|
| 16 |
font-family: 'Poppins', sans-serif;
|
|
|
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
body {
|
| 20 |
min-height: 100vh;
|
|
|
|
|
|
|
| 21 |
display: flex;
|
| 22 |
justify-content: center;
|
| 23 |
align-items: center;
|
| 24 |
-
background-color: #0f0f1a;
|
| 25 |
-
overflow: hidden;
|
| 26 |
position: relative;
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
|
| 29 |
/* --- AURORA BACKGROUND ANIMATION --- */
|
| 30 |
-
/* Using a pseudo-element for the flowing gradient background */
|
| 31 |
body::before {
|
| 32 |
content: '';
|
| 33 |
position: absolute;
|
|
@@ -40,7 +45,7 @@
|
|
| 40 |
animation: auroraMove 15s ease infinite alternate;
|
| 41 |
opacity: 0.5;
|
| 42 |
z-index: -1;
|
| 43 |
-
filter: blur(80px);
|
| 44 |
}
|
| 45 |
|
| 46 |
@keyframes auroraMove {
|
|
@@ -49,44 +54,39 @@
|
|
| 49 |
100% { transform: translate(5%, -10%) rotate(-5deg); }
|
| 50 |
}
|
| 51 |
|
| 52 |
-
/* ---
|
| 53 |
.login-card-container {
|
| 54 |
-
/* Perspective for 3D tilt */
|
| 55 |
perspective: 1500px;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
-
/* ---
|
| 59 |
.login-card {
|
| 60 |
-
width:
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
border-radius: 50px;
|
| 65 |
-
|
| 66 |
-
/* Refined Glassmorphism */
|
| 67 |
background: rgba(255, 255, 255, 0.05);
|
| 68 |
-
backdrop-filter: blur(
|
| 69 |
-
-webkit-backdrop-filter: blur(
|
| 70 |
border: 1px solid rgba(255, 255, 255, 0.15);
|
| 71 |
-
/* Inner glow to define rounded edges */
|
| 72 |
box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05),
|
| 73 |
-
0 20px 40px rgba(0, 0, 0, 0.3);
|
| 74 |
-
|
| 75 |
color: #fff;
|
| 76 |
text-align: center;
|
| 77 |
-
|
| 78 |
-
/* Smooth tilt transition */
|
| 79 |
-
transition: transform 0.2s ease-out;
|
| 80 |
transform-style: preserve-3d;
|
| 81 |
will-change: transform;
|
| 82 |
}
|
| 83 |
|
| 84 |
.login-card h2 {
|
| 85 |
font-weight: 700;
|
| 86 |
-
font-size:
|
| 87 |
-
margin-bottom:
|
| 88 |
-
letter-spacing: -
|
| 89 |
-
/* Gradient text effect */
|
| 90 |
background: linear-gradient(to right, #fff, #c4b5fd);
|
| 91 |
-webkit-background-clip: text;
|
| 92 |
-webkit-text-fill-color: transparent;
|
|
@@ -95,39 +95,39 @@
|
|
| 95 |
.login-card p.subtitle {
|
| 96 |
font-size: 14px;
|
| 97 |
color: rgba(255, 255, 255, 0.6);
|
| 98 |
-
margin-bottom:
|
| 99 |
}
|
| 100 |
|
| 101 |
-
/* --- INPUT FIELDS
|
| 102 |
.input-group {
|
| 103 |
position: relative;
|
| 104 |
-
margin-bottom:
|
| 105 |
text-align: left;
|
| 106 |
}
|
| 107 |
|
| 108 |
.input-group i.field-icon {
|
| 109 |
position: absolute;
|
| 110 |
top: 50%;
|
| 111 |
-
left:
|
| 112 |
transform: translateY(-50%);
|
| 113 |
color: rgba(255, 255, 255, 0.5);
|
| 114 |
-
font-size:
|
|
|
|
| 115 |
transition: 0.3s;
|
| 116 |
}
|
| 117 |
|
| 118 |
-
/* Full "Pill" shaped inputs */
|
| 119 |
.input-group input {
|
| 120 |
width: 100%;
|
| 121 |
-
padding:
|
| 122 |
-
border-radius: 50px;
|
| 123 |
border: none;
|
| 124 |
outline: none;
|
| 125 |
background: rgba(255, 255, 255, 0.08);
|
| 126 |
color: #fff;
|
| 127 |
-
|
|
|
|
| 128 |
font-weight: 400;
|
| 129 |
transition: all 0.3s ease;
|
| 130 |
-
/* Subtle inner shadow for depth */
|
| 131 |
box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1);
|
| 132 |
}
|
| 133 |
|
|
@@ -135,56 +135,58 @@
|
|
| 135 |
color: rgba(255, 255, 255, 0.4);
|
| 136 |
}
|
| 137 |
|
| 138 |
-
/* Input Focus State */
|
| 139 |
.input-group input:focus {
|
| 140 |
background: rgba(255, 255, 255, 0.15);
|
| 141 |
-
box-shadow: 0 0
|
| 142 |
}
|
|
|
|
| 143 |
.input-group input:focus + i.field-icon {
|
| 144 |
color: #c4b5fd;
|
| 145 |
}
|
| 146 |
|
| 147 |
-
/* Password toggle eye */
|
| 148 |
.toggle-password {
|
| 149 |
position: absolute;
|
| 150 |
-
right:
|
| 151 |
top: 50%;
|
| 152 |
transform: translateY(-50%);
|
| 153 |
cursor: pointer;
|
| 154 |
color: rgba(255, 255, 255, 0.5);
|
| 155 |
transition: 0.3s;
|
|
|
|
| 156 |
}
|
| 157 |
.toggle-password:hover { color: #fff; }
|
| 158 |
|
| 159 |
-
/* ---
|
| 160 |
.login-btn {
|
| 161 |
width: 100%;
|
| 162 |
-
padding:
|
| 163 |
border-radius: 50px;
|
| 164 |
border: none;
|
| 165 |
-
|
| 166 |
-
font-size: 18px;
|
| 167 |
font-weight: 600;
|
| 168 |
color: #fff;
|
| 169 |
cursor: pointer;
|
| 170 |
-
/* Vibrant gradient */
|
| 171 |
background: linear-gradient(135deg, #4F46E5, #EC4899);
|
| 172 |
-
box-shadow: 0 10px
|
| 173 |
-
transition: all 0.
|
| 174 |
margin-top: 10px;
|
|
|
|
|
|
|
| 175 |
}
|
| 176 |
|
| 177 |
.login-btn:hover {
|
| 178 |
-
/* Shift gradient and lift button */
|
| 179 |
background: linear-gradient(135deg, #4338ca, #db2777);
|
| 180 |
-
transform: translateY(-
|
| 181 |
-
box-shadow: 0 15px
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
}
|
| 183 |
|
| 184 |
-
/* --- FOOTER LINKS --- */
|
| 185 |
.links {
|
| 186 |
-
margin-top:
|
| 187 |
-
font-size:
|
| 188 |
color: rgba(255, 255, 255, 0.6);
|
| 189 |
}
|
| 190 |
.links a {
|
|
@@ -193,14 +195,23 @@
|
|
| 193 |
font-weight: 600;
|
| 194 |
margin-left: 5px;
|
| 195 |
}
|
| 196 |
-
.links a:hover { text-decoration: underline; }
|
| 197 |
|
| 198 |
-
/* ---
|
| 199 |
.shake { animation: shake 0.4s ease-in-out; }
|
| 200 |
@keyframes shake {
|
| 201 |
0%, 100% { transform: translateX(0); }
|
| 202 |
-
25% { transform: translateX(-
|
| 203 |
-
75% { transform: translateX(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
}
|
| 205 |
</style>
|
| 206 |
</head>
|
|
@@ -213,12 +224,12 @@
|
|
| 213 |
|
| 214 |
<form id="loginForm">
|
| 215 |
<div class="input-group">
|
| 216 |
-
<input type="
|
| 217 |
<i class="fa-regular fa-user field-icon"></i>
|
| 218 |
</div>
|
| 219 |
|
| 220 |
<div class="input-group">
|
| 221 |
-
<input type="password" id="password" placeholder="Password">
|
| 222 |
<i class="fa-solid fa-lock field-icon"></i>
|
| 223 |
<i class="fa-regular fa-eye toggle-password" id="togglePassword"></i>
|
| 224 |
</div>
|
|
@@ -232,79 +243,70 @@
|
|
| 232 |
</div>
|
| 233 |
</div>
|
| 234 |
|
| 235 |
-
|
| 236 |
<script>
|
| 237 |
-
/
|
|
|
|
|
|
|
| 238 |
const card = document.getElementById('tiltCard');
|
| 239 |
const container = document.querySelector('.login-card-container');
|
| 240 |
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
card.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
|
| 253 |
-
});
|
| 254 |
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
card.style.transform = `rotateX(0deg) rotateY(0deg)`;
|
| 258 |
-
});
|
| 259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
|
| 261 |
-
// 2. PASSWORD
|
| 262 |
const passwordInput = document.getElementById('password');
|
| 263 |
const toggleBtn = document.getElementById('togglePassword');
|
| 264 |
|
| 265 |
toggleBtn.addEventListener('click', () => {
|
| 266 |
const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
|
| 267 |
passwordInput.setAttribute('type', type);
|
| 268 |
-
|
| 269 |
toggleBtn.classList.toggle('fa-eye');
|
| 270 |
toggleBtn.classList.toggle('fa-eye-slash');
|
| 271 |
});
|
| 272 |
|
| 273 |
-
|
| 274 |
-
// 3. FORM SUBMISSION MOCKUP (Validation & Loading)
|
| 275 |
const form = document.getElementById('loginForm');
|
| 276 |
const loginBtn = document.getElementById('loginBtn');
|
| 277 |
-
const originalBtnText = loginBtn.innerText;
|
| 278 |
|
| 279 |
form.addEventListener('submit', (e) => {
|
| 280 |
-
e.preventDefault();
|
| 281 |
|
| 282 |
const username = document.getElementById('username').value;
|
| 283 |
const password = document.getElementById('password').value;
|
| 284 |
|
| 285 |
-
|
| 286 |
-
|
| 287 |
card.classList.add('shake');
|
| 288 |
-
// Remove class after animation plays
|
| 289 |
setTimeout(() => card.classList.remove('shake'), 400);
|
| 290 |
return;
|
| 291 |
}
|
| 292 |
|
| 293 |
-
//
|
| 294 |
-
loginBtn.
|
| 295 |
loginBtn.style.opacity = '0.8';
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
// Simulate network request delay
|
| 299 |
setTimeout(() => {
|
| 300 |
-
loginBtn.
|
| 301 |
-
loginBtn.style.background = 'linear-gradient(135deg, #10B981, #059669)';
|
| 302 |
-
|
| 303 |
-
// Optional: redirect after success
|
| 304 |
-
// window.location.href = '/dashboard';
|
| 305 |
}, 2000);
|
| 306 |
});
|
| 307 |
-
|
| 308 |
</script>
|
| 309 |
</body>
|
| 310 |
</html>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
<title>Ultra Modern Login</title>
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet">
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
|
|
| 14 |
padding: 0;
|
| 15 |
box-sizing: border-box;
|
| 16 |
font-family: 'Poppins', sans-serif;
|
| 17 |
+
/* Disable blue highlight on touch devices */
|
| 18 |
+
-webkit-tap-highlight-color: transparent;
|
| 19 |
}
|
| 20 |
|
| 21 |
body {
|
| 22 |
min-height: 100vh;
|
| 23 |
+
/* Fix for mobile height issues */
|
| 24 |
+
min-height: -webkit-fill-available;
|
| 25 |
display: flex;
|
| 26 |
justify-content: center;
|
| 27 |
align-items: center;
|
| 28 |
+
background-color: #0f0f1a;
|
| 29 |
+
overflow: hidden; /* Prevents scrollbars */
|
| 30 |
position: relative;
|
| 31 |
+
/* Disables browser handling of gestures like pinch-zoom */
|
| 32 |
+
touch-action: none;
|
| 33 |
}
|
| 34 |
|
| 35 |
/* --- AURORA BACKGROUND ANIMATION --- */
|
|
|
|
| 36 |
body::before {
|
| 37 |
content: '';
|
| 38 |
position: absolute;
|
|
|
|
| 45 |
animation: auroraMove 15s ease infinite alternate;
|
| 46 |
opacity: 0.5;
|
| 47 |
z-index: -1;
|
| 48 |
+
filter: blur(80px);
|
| 49 |
}
|
| 50 |
|
| 51 |
@keyframes auroraMove {
|
|
|
|
| 54 |
100% { transform: translate(5%, -10%) rotate(-5deg); }
|
| 55 |
}
|
| 56 |
|
| 57 |
+
/* --- CARD CONTAINER --- */
|
| 58 |
.login-card-container {
|
|
|
|
| 59 |
perspective: 1500px;
|
| 60 |
+
width: 100%;
|
| 61 |
+
display: flex;
|
| 62 |
+
justify-content: center;
|
| 63 |
+
padding: 20px;
|
| 64 |
}
|
| 65 |
|
| 66 |
+
/* --- GLASS CARD STYLING --- */
|
| 67 |
.login-card {
|
| 68 |
+
width: 100%;
|
| 69 |
+
max-width: 420px; /* Responsive limit */
|
| 70 |
+
padding: 50px 30px;
|
| 71 |
+
border-radius: 40px;
|
|
|
|
|
|
|
|
|
|
| 72 |
background: rgba(255, 255, 255, 0.05);
|
| 73 |
+
backdrop-filter: blur(25px);
|
| 74 |
+
-webkit-backdrop-filter: blur(25px);
|
| 75 |
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
|
|
| 76 |
box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05),
|
| 77 |
+
0 20px 40px rgba(0, 0, 0, 0.3);
|
|
|
|
| 78 |
color: #fff;
|
| 79 |
text-align: center;
|
| 80 |
+
transition: transform 0.1s ease-out; /* Faster transition for smoother tilt */
|
|
|
|
|
|
|
| 81 |
transform-style: preserve-3d;
|
| 82 |
will-change: transform;
|
| 83 |
}
|
| 84 |
|
| 85 |
.login-card h2 {
|
| 86 |
font-weight: 700;
|
| 87 |
+
font-size: 32px;
|
| 88 |
+
margin-bottom: 8px;
|
| 89 |
+
letter-spacing: -0.5px;
|
|
|
|
| 90 |
background: linear-gradient(to right, #fff, #c4b5fd);
|
| 91 |
-webkit-background-clip: text;
|
| 92 |
-webkit-text-fill-color: transparent;
|
|
|
|
| 95 |
.login-card p.subtitle {
|
| 96 |
font-size: 14px;
|
| 97 |
color: rgba(255, 255, 255, 0.6);
|
| 98 |
+
margin-bottom: 35px;
|
| 99 |
}
|
| 100 |
|
| 101 |
+
/* --- INPUT FIELDS --- */
|
| 102 |
.input-group {
|
| 103 |
position: relative;
|
| 104 |
+
margin-bottom: 20px;
|
| 105 |
text-align: left;
|
| 106 |
}
|
| 107 |
|
| 108 |
.input-group i.field-icon {
|
| 109 |
position: absolute;
|
| 110 |
top: 50%;
|
| 111 |
+
left: 20px;
|
| 112 |
transform: translateY(-50%);
|
| 113 |
color: rgba(255, 255, 255, 0.5);
|
| 114 |
+
font-size: 16px;
|
| 115 |
+
pointer-events: none; /* Allows clicking through icon */
|
| 116 |
transition: 0.3s;
|
| 117 |
}
|
| 118 |
|
|
|
|
| 119 |
.input-group input {
|
| 120 |
width: 100%;
|
| 121 |
+
padding: 16px 50px 16px 50px;
|
| 122 |
+
border-radius: 50px;
|
| 123 |
border: none;
|
| 124 |
outline: none;
|
| 125 |
background: rgba(255, 255, 255, 0.08);
|
| 126 |
color: #fff;
|
| 127 |
+
/* Font size 16px prevents iOS zoom on focus */
|
| 128 |
+
font-size: 16px;
|
| 129 |
font-weight: 400;
|
| 130 |
transition: all 0.3s ease;
|
|
|
|
| 131 |
box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1);
|
| 132 |
}
|
| 133 |
|
|
|
|
| 135 |
color: rgba(255, 255, 255, 0.4);
|
| 136 |
}
|
| 137 |
|
|
|
|
| 138 |
.input-group input:focus {
|
| 139 |
background: rgba(255, 255, 255, 0.15);
|
| 140 |
+
box-shadow: 0 0 15px rgba(124, 58, 237, 0.3), inset 2px 2px 5px rgba(0,0,0,0.1);
|
| 141 |
}
|
| 142 |
+
|
| 143 |
.input-group input:focus + i.field-icon {
|
| 144 |
color: #c4b5fd;
|
| 145 |
}
|
| 146 |
|
|
|
|
| 147 |
.toggle-password {
|
| 148 |
position: absolute;
|
| 149 |
+
right: 20px;
|
| 150 |
top: 50%;
|
| 151 |
transform: translateY(-50%);
|
| 152 |
cursor: pointer;
|
| 153 |
color: rgba(255, 255, 255, 0.5);
|
| 154 |
transition: 0.3s;
|
| 155 |
+
padding: 5px; /* Bigger touch target */
|
| 156 |
}
|
| 157 |
.toggle-password:hover { color: #fff; }
|
| 158 |
|
| 159 |
+
/* --- BUTTON --- */
|
| 160 |
.login-btn {
|
| 161 |
width: 100%;
|
| 162 |
+
padding: 16px;
|
| 163 |
border-radius: 50px;
|
| 164 |
border: none;
|
| 165 |
+
font-size: 16px;
|
|
|
|
| 166 |
font-weight: 600;
|
| 167 |
color: #fff;
|
| 168 |
cursor: pointer;
|
|
|
|
| 169 |
background: linear-gradient(135deg, #4F46E5, #EC4899);
|
| 170 |
+
box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
|
| 171 |
+
transition: all 0.3s ease;
|
| 172 |
margin-top: 10px;
|
| 173 |
+
/* Disable selection */
|
| 174 |
+
user-select: none;
|
| 175 |
}
|
| 176 |
|
| 177 |
.login-btn:hover {
|
|
|
|
| 178 |
background: linear-gradient(135deg, #4338ca, #db2777);
|
| 179 |
+
transform: translateY(-3px) scale(1.02);
|
| 180 |
+
box-shadow: 0 15px 30px rgba(124, 58, 237, 0.6);
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
.login-btn:active {
|
| 184 |
+
transform: translateY(0) scale(0.98);
|
| 185 |
}
|
| 186 |
|
|
|
|
| 187 |
.links {
|
| 188 |
+
margin-top: 25px;
|
| 189 |
+
font-size: 13px;
|
| 190 |
color: rgba(255, 255, 255, 0.6);
|
| 191 |
}
|
| 192 |
.links a {
|
|
|
|
| 195 |
font-weight: 600;
|
| 196 |
margin-left: 5px;
|
| 197 |
}
|
|
|
|
| 198 |
|
| 199 |
+
/* --- ANIMATIONS --- */
|
| 200 |
.shake { animation: shake 0.4s ease-in-out; }
|
| 201 |
@keyframes shake {
|
| 202 |
0%, 100% { transform: translateX(0); }
|
| 203 |
+
25% { transform: translateX(-8px); }
|
| 204 |
+
75% { transform: translateX(8px); }
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
/* Mobile Adjustments */
|
| 208 |
+
@media (max-width: 480px) {
|
| 209 |
+
.login-card {
|
| 210 |
+
padding: 40px 20px;
|
| 211 |
+
}
|
| 212 |
+
.login-card h2 {
|
| 213 |
+
font-size: 28px;
|
| 214 |
+
}
|
| 215 |
}
|
| 216 |
</style>
|
| 217 |
</head>
|
|
|
|
| 224 |
|
| 225 |
<form id="loginForm">
|
| 226 |
<div class="input-group">
|
| 227 |
+
<input type="email" id="username" placeholder="Email" autocomplete="off" required>
|
| 228 |
<i class="fa-regular fa-user field-icon"></i>
|
| 229 |
</div>
|
| 230 |
|
| 231 |
<div class="input-group">
|
| 232 |
+
<input type="password" id="password" placeholder="Password" required>
|
| 233 |
<i class="fa-solid fa-lock field-icon"></i>
|
| 234 |
<i class="fa-regular fa-eye toggle-password" id="togglePassword"></i>
|
| 235 |
</div>
|
|
|
|
| 243 |
</div>
|
| 244 |
</div>
|
| 245 |
|
|
|
|
| 246 |
<script>
|
| 247 |
+
/* --- LOGIC --- */
|
| 248 |
+
|
| 249 |
+
// 1. TILT EFFECT
|
| 250 |
const card = document.getElementById('tiltCard');
|
| 251 |
const container = document.querySelector('.login-card-container');
|
| 252 |
|
| 253 |
+
// Only apply tilt on non-touch devices to save battery/performance on mobile
|
| 254 |
+
if (window.matchMedia("(pointer: fine)").matches) {
|
| 255 |
+
container.addEventListener('mousemove', (e) => {
|
| 256 |
+
const rect = container.getBoundingClientRect();
|
| 257 |
+
const x = e.clientX - rect.left - rect.width / 2;
|
| 258 |
+
const y = e.clientY - rect.top - rect.height / 2;
|
| 259 |
+
|
| 260 |
+
// Reduced multiplier for subtler effect
|
| 261 |
+
const multiple = 15;
|
| 262 |
+
const rotateX = (y / rect.height) * -multiple;
|
| 263 |
+
const rotateY = (x / rect.width) * multiple;
|
|
|
|
|
|
|
| 264 |
|
| 265 |
+
card.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
|
| 266 |
+
});
|
|
|
|
|
|
|
| 267 |
|
| 268 |
+
container.addEventListener('mouseleave', () => {
|
| 269 |
+
card.style.transform = `rotateX(0deg) rotateY(0deg)`;
|
| 270 |
+
});
|
| 271 |
+
}
|
| 272 |
|
| 273 |
+
// 2. PASSWORD TOGGLE
|
| 274 |
const passwordInput = document.getElementById('password');
|
| 275 |
const toggleBtn = document.getElementById('togglePassword');
|
| 276 |
|
| 277 |
toggleBtn.addEventListener('click', () => {
|
| 278 |
const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
|
| 279 |
passwordInput.setAttribute('type', type);
|
|
|
|
| 280 |
toggleBtn.classList.toggle('fa-eye');
|
| 281 |
toggleBtn.classList.toggle('fa-eye-slash');
|
| 282 |
});
|
| 283 |
|
| 284 |
+
// 3. SUBMIT ANIMATION
|
|
|
|
| 285 |
const form = document.getElementById('loginForm');
|
| 286 |
const loginBtn = document.getElementById('loginBtn');
|
|
|
|
| 287 |
|
| 288 |
form.addEventListener('submit', (e) => {
|
| 289 |
+
e.preventDefault();
|
| 290 |
|
| 291 |
const username = document.getElementById('username').value;
|
| 292 |
const password = document.getElementById('password').value;
|
| 293 |
|
| 294 |
+
// Simple validation check
|
| 295 |
+
if (username === "" || password === "") {
|
| 296 |
card.classList.add('shake');
|
|
|
|
| 297 |
setTimeout(() => card.classList.remove('shake'), 400);
|
| 298 |
return;
|
| 299 |
}
|
| 300 |
|
| 301 |
+
// Loading state
|
| 302 |
+
loginBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Authenticating...';
|
| 303 |
loginBtn.style.opacity = '0.8';
|
| 304 |
+
|
|
|
|
|
|
|
| 305 |
setTimeout(() => {
|
| 306 |
+
loginBtn.innerHTML = 'Success!';
|
| 307 |
+
loginBtn.style.background = 'linear-gradient(135deg, #10B981, #059669)';
|
|
|
|
|
|
|
|
|
|
| 308 |
}, 2000);
|
| 309 |
});
|
|
|
|
| 310 |
</script>
|
| 311 |
</body>
|
| 312 |
</html>
|