Skip to content

Glassmorphism Login Page over Photo

Full-page login with a frosted glass card over a scenic lake photo, password reveal toggle, inline validation and a simulated sign-in state.

Also known as: glass login page, frosted glass login form, login screen with background photo, sign in page background image, glass effect sign in

Glassmorphism Login Page over Photo live demo

Open in new tab

Pure CSS code (HTML, CSS, JS)

A full-page login screen built with pure CSS and a little vanilla JavaScript: a frosted glass card floats over a scenic mountain lake photo, next to a large headline on wide screens. Use it as the sign-in page of a travel app, a dashboard or any product that wants a calm, photographic first impression.

How it works

The root main.gl-page is a full-height grid. The photo is a regular img.gl-bg stretched with object-fit: cover behind everything, and .gl-page::before lays the --gl-overlay gradient on top so white text keeps its contrast. Inside .gl-shell sit the decorative .gl-aside headline (shown from 900px) and the section.gl-card. The glass effect comes from a translucent --gl-glass background, a light --gl-glass-border and backdrop-filter: blur(var(--gl-blur)) saturate(140%); an @supports not rule swaps in a more opaque tint for browsers without backdrop-filter.

The .gl-form contains an email field, a password field with a .gl-reveal button, a custom .gl-check checkbox and the .gl-submit button. The script listens for click on .gl-reveal to switch the input type and aria-pressed, for input to clear errors as soon as a field becomes valid, and for submit. On submit it calls preventDefault(), validates both fields, shows the .gl-error messages and focuses the first invalid input. Valid data adds .is-loading (which shows the .gl-spinner), disables the button and, after a short timeout, writes a confirmation into the .gl-status live region. Replace that timeout with a fetch() call to your authentication endpoint.

Customization

  • --gl-accent and --gl-accent-ink on .gl-page: color of the submit button, focus rings, logo and checkbox, and the text on top of them.
  • --gl-blur: strength of the frosted glass, e.g. 8px for a clearer view of the photo.
  • --gl-glass and --gl-glass-border: the tint and edge of the card; raise the alpha for a milkier panel.
  • --gl-overlay: the gradient over the photo; make it darker if your own image is bright.
  • Change the src of .gl-bg to use your own background. The photo comes from Unsplash and should be replaced with your own image.
  • Remove .gl-aside for a single centered card, or edit .gl-aside__quote to change the headline.
  • EMAIL_PATTERN and the >= 8 check in script.js: the validation rules for email and password length.

Use cases

  • Travel apps: a calm lake photo behind a frosted card gives sign-in a welcoming first impression
  • Dashboards and SaaS products: a full-page sign-in with email, password reveal and inline validation
  • Lifestyle brands: pair the large headline on wide screens with a glass card on top of photography
  • Member areas: remember me checkbox and social buttons sit inside a translucent card
  • Prototypes: a simulated sign-in state with spinner and status message shows the full flow

Accessibility

Every input has a visible label, autocomplete values and aria-describedby pointing to its error message; invalid fields get aria-invalid="true". The password toggle is a real button with aria-controls, aria-pressed and a label that changes between "Show password" and "Hide password". The result message lives in a role="status" region. Buttons, links and the custom checkbox all have strong focus outlines. The background photo uses an empty alt because it is decorative, and with prefers-reduced-motion: reduce transitions are removed and the spinner slows down.

Usage notes

This is a full-page template, so .gl-page uses min-height: 100dvh. The social buttons are placeholders; wire them to your OAuth provider.

Glassmorphism Login Page over Photo at a glance

Framework
Pure CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
None
Layout
Responsive, works on mobile, dark design
Category
Login Pages
License
Free for personal and commercial use

Questions about this template

Can I use the Glassmorphism Login Page over Photo code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

There is nothing to install. Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Glassmorphism Login Page over Photo – Pure CSS login pages component screenshot
Glassmorphism Login Page over Photo · Pure CSS Login Pages

More Login Pages

Centered Login Page – Bootstrap 5 login pages preview

Centered Login Page

Full-page Bootstrap 5 sign-in with a centered card, Google and GitHub buttons, validated email and password fields, a show password toggle and a Caps Lock warning.

Split Login Page – Tailwind CSS login pages preview

Split Login Page

Split-screen Tailwind CSS login page with a violet brand panel, inline validation, show/hide password toggle and a loading state.