build me a modern,vishually stricking login page using html,css,js
- User
build me a modern,vishually stricking login page using html,css,js
Assistant
build me a modern,vishually stricking login page using html,css,js
I'll create a modern, visually striking login page with animated gradients, glassmorphism effects, and smooth interactions. Here's the complete code:
HTML (index.html):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modern Login</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="background">
<div class="shape"></div>
<div class="shape"></div>
</div>
<form class="login-form" id="loginForm">
<h3>Welcome Back</h3>
<p class="subtitle">Sign in to continue</p>
<div class="input-group">
<input type="text" placeholder="Username or Email" id="username" required>
<span class="input-icon">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
</span>
</div>
<div class="input-group">
<input type="password" placeholder="Password" id="password" required>
<span class="input-icon">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
</svg>
</span>
<span class="toggle-password" onclick="togglePassword()">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
<circle cx="12" cy="12" r="3"></circle>
</svg>
</span>
</div>
<div class="options">
<label class="remember-me">
<input type="checkbox">
<span class="checkmark"></span>
Remember me
</label>
<a href="#" class="forgot-password">Forgot password?</a>
</div>
<button type="submit" class="login-btn">
<span class="btn-text">Sign In</span>
<div class="btn-loader"></div>
</button>
<div class="divider">
<span>OR</span>
</div>
<div class="social-login">
<button type="button" class="social-btn google">
<svg width="20" height="20" viewBox="0 0 24 24">
<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/>
<path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/>
<path fill="#FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"/>
<path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/>
</svg>
Continue with Google
</button>
<button type="button" class="social-btn github">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
</svg>
Continue with GitHub
</button>
</div>
<p class="signup-link">
Don't have an account? <a href="#">Sign up</a>
</p>
</form>
</div>
<script src="script.js"></script>
</body>
</html>
CSS (style.css):
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
overflow: hidden;
}
.container {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.background {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.shape {
position: absolute;
border-radius: 50%;
filter: blur(70px);
animation: float 20s infinite ease-in-out;
}
.shape:first-child {
width: 500px;
height: 500px;
background: linear-gradient(180deg, #ff6b6b 0%, #feca57 100%);
top: -250px;
left: -250px;
animation-delay: 0s;
}
.shape:last-child {
width: 600px;
height: 600px;
background: linear-gradient(180deg, #5f27cd 0%, #00d2d3 100%);
bottom: -300px;
right: -300px;
animation-delay: 3s;
}
@keyframes float {
0%, 100% {
transform: translate(0, 0) rotate(0deg);
}
33% {
transform: translate(100px, -100px) rotate(120deg);
}
66% {
transform: translate(-100px, 100px) rotate(240deg);
}
}
.login-form {
position: relative;
width: 400px;
padding: 50px 40px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 20px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
animation: slideIn 0.5s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
h3 {
font-size: 32px;
font-weight: 700;
color: #fff;
text-align: center;
margin-bottom: 10px;
}
.subtitle {
color: rgba(255, 255, 255, 0.8);
text-align: center;
margin-bottom: 30px;
font-size: 14px;
}
.input-group {
position: relative;
margin-bottom: 20px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 15px 20px 15px 50px;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 10px;
color: #fff;
font-size: 16px;
transition: all 0.3s ease;
}
input::placeholder {
color: rgba(255, 255, 255, 0.6);
}
input:focus {
outline: none;
background: rgba(255, 255, 255, 0.15);
border-color: rgba(255, 255, 255, 0.4);
box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}
.input-icon {
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%);
color: rgba(255, 255, 255, 0.6);
}
.toggle-password {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
color: rgba(255, 255, 255, 0.6);
cursor: pointer;
transition: color 0.3s ease;
}
.toggle-password:hover {
color: #fff;
}
.options {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
}
.remember-me {
display: flex;
align-items: center;
color: rgba(255, 255, 255, 0.8);
font-size: 14px;
cursor: pointer;
position: relative;
padding-left: 28px;
}
.remember-me input {
position: absolute;
opacity: 0;
cursor: pointer;
}
.checkmark {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
height: 18px;
width: 18px;
background-color: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 4px;
transition: all 0.3s ease;
}
.remember-me input:checked ~ .checkmark {
background-color: #667eea;
border-color: #667eea;
}
.checkmark:after {
content: "";
position: absolute;
display: none;
left: 6px;
top: 2px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
.remember-me input:checked ~ .checkmark:after {
display: block;
}
.forgot-password {
color: rgba(255, 255, 255, 0.8);
font-size: 14px;
text-decoration: none;
transition: color 0.3s ease;
}
.forgot-password:hover {
color: #fff;
}
.login-btn {
width: 100%;
padding: 15px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 10px;
color: #fff;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.login-btn:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}
.login-btn:active {
transform: translateY(0);
}
.btn-loader {
display: none;
width: 20px;
height: 20px;
border: 2px solid #fff;
border-top-color: transparent;
border-radius: 50%;
animation: spin 0.8s linear infinite;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.login-btn.loading .btn-text {
visibility: hidden;
}
.login-btn.loading .btn-loader {
display: block;
}
@keyframes spin {
to {
transform: translate(-50%, -50%) rotate(360deg);
}
}
.divider {
text-align: center;
margin: 30px 0 20px;
position: relative;
}
.divider span {
background: rgba(255, 255, 255, 0.1);
padding: 0 15px;
color: rgba(255, 255, 255, 0.6);
font-size: 14px;
position: relative;
}
.divider::before {
content: "";
position: absolute