Category Β· Authentication Difficulty Level Β· Intermediate Published on Β· January 22, 2024

Glassmorphism Login Form

Modern glassmorphism login form with frosted glass effect, smooth animations, floating labels, and elegant validation states. Perfect for contemporary web applications.

#login #form #glassmorphism #authentication #modern

Responsive Design

Yes

Dark Mode Support

Yes

lines

655

Browser Compatibility

No

Live Preview

Interact with the component without leaving the page.

500px

Glassmorphism Login Form

A stunning modern login form featuring the popular glassmorphism design trend. This component combines frosted glass effects, smooth animations, and elegant user interactions to create a premium authentication experience.

Features

  • Glassmorphism Design: Frosted glass effect with backdrop blur and transparency
  • Floating Labels: Smooth animated labels that float on focus
  • Real-time Validation: Instant feedback with elegant error states
  • Password Toggle: Show/hide password functionality with animated icons
  • Loading States: Beautiful loading animation during form submission
  • Social Login: Ready-to-use social authentication buttons
  • Responsive Design: Optimized for all device sizes
  • Accessibility: WCAG compliant with proper ARIA labels

Design Elements

  • Background Animation: Floating geometric shapes with smooth motion
  • Interactive Feedback: Hover and focus states with micro-animations
  • Visual Hierarchy: Clear typography and spacing for optimal UX
  • Color Scheme: Gradient backgrounds with semi-transparent overlays

Form Validation

  • Email format validation with regex pattern matching
  • Password strength requirements (minimum 6 characters)
  • Real-time error display with smooth transitions
  • Success states with confirmation feedback

Customization Options

/* Custom color scheme */
.login-container {
  background: linear-gradient(135deg, #your-color-1, #your-color-2);
}

/* Custom glass opacity */
.login-card {
  background: rgba(255, 255, 255, 0.15); /* Adjust opacity */
  backdrop-filter: blur(25px); /* Adjust blur intensity */
}

/* Custom button styling */
.login-button {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

Browser Support

  • Chrome 76+ (full support)
  • Firefox 72+ (full support)
  • Safari 14+ (full support)
  • Edge 79+ (full support)

Performance Features

  • Hardware-accelerated animations using transform and opacity
  • Optimized backdrop-filter for smooth glass effects
  • Minimal JavaScript footprint
  • CSS-only animations where possible

Security Considerations

  • Client-side validation for UX (server-side validation required)
  • Password masking with toggle functionality
  • Form submission prevention on validation errors
  • HTTPS recommended for production use

HTML

73

lines

CSS

407

lines

JavaScript

175

lines


                <div class="login-container">
  <div class="background-shapes">
    <div class="shape shape-1"></div>
    <div class="shape shape-2"></div>
    <div class="shape shape-3"></div>
  </div>
  
  <div class="login-card">
    <div class="login-header">
      <div class="logo">
        <div class="logo-icon">πŸ”</div>
        <h1 class="logo-text">SecureApp</h1>
      </div>
      <p class="welcome-text">Welcome back! Please sign in to your account.</p>
    </div>
    
    <form class="login-form" id="loginForm">
      <div class="form-group">
        <div class="input-container">
          <input type="email" id="email" class="form-input" required>
          <label for="email" class="form-label">Email Address</label>
          <div class="input-highlight"></div>
        </div>
        <div class="error-message" id="emailError"></div>
      </div>
      
      <div class="form-group">
        <div class="input-container">
          <input type="password" id="password" class="form-input" required>
          <label for="password" class="form-label">Password</label>
          <button type="button" class="password-toggle" id="passwordToggle">
            <span class="toggle-icon">πŸ‘οΈ</span>
          </button>
          <div class="input-highlight"></div>
        </div>
        <div class="error-message" id="passwordError"></div>
      </div>
      
      <div class="form-options">
        <label class="checkbox-container">
          <input type="checkbox" id="remember">
          <span class="checkmark"></span>
          <span class="checkbox-text">Remember me</span>
        </label>
        <a href="#" class="forgot-link">Forgot password?</a>
      </div>
      
      <button type="submit" class="login-button">
        <span class="button-text">Sign In</span>
        <div class="button-loader"></div>
      </button>
      
      <div class="divider">
        <span class="divider-text">or continue with</span>
      </div>
      
      <div class="social-login">
        <button type="button" class="social-button google">
          <span class="social-icon">πŸ”</span>
          <span class="social-text">Google</span>
        </button>
        <button type="button" class="social-button github">
          <span class="social-icon">πŸ™</span>
          <span class="social-text">GitHub</span>
        </button>
      </div>
      
      <p class="signup-text">
        Don't have an account? <a href="#" class="signup-link">Sign up</a>
      </p>
    </form>
  </div>
</div>

              
73lines
2498characters
HTMLLanguage

Related Code Snippets

Explore template packs

Need larger building blocks? Browse responsive landing pages and component bundles.

Open HTML Template Library β†’