Back to Login PagesLogin Page

Animated Gradient

A slow, continuously shifting full-page gradient with a floating card.

About This Template

A CSS keyframe animation slowly cycles the background through warm-to-cool tones, while the glass card gently floats up and down. Eye-catching for a landing/marketing-style sign-in without needing any JavaScript.

Login PageCategory
HTML & CSSFormat
AnimatedGradientCSS-only
Full Preview
Animated Gradient login page template preview
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Animated Gradient Login Page Template — Free HTML & CSS</title>
<meta name="description" content="Free animated gradient login page template with a slow, shifting CSS-only background and a floating glass card. No JavaScript needed — free HTML & CSS.">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://fatimahopefoundation.com/templates/login-pages/09-animated-gradient">

<meta property="og:type" content="website">
<meta property="og:title" content="Animated Gradient Login Page Template — Free HTML & CSS">
<meta property="og:description" content="Free animated gradient login page template with a slow, shifting CSS-only background and a floating glass card. No JavaScript needed — free HTML & CSS.">
<meta property="og:url" content="https://fatimahopefoundation.com/templates/login-pages/09-animated-gradient">
<meta property="og:image" content="https://fatimahopefoundation.com/images/login/09-animated-gradient.png">
<meta property="og:site_name" content="Fatima Hope Foundation">

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Animated Gradient Login Page Template — Free HTML & CSS">
<meta name="twitter:description" content="Free animated gradient login page template with a slow, shifting CSS-only background and a floating glass card. No JavaScript needed — free HTML & CSS.">
<meta name="twitter:image" content="https://fatimahopefoundation.com/images/login/09-animated-gradient.png">

<link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="login-wrap">
    <section class="login-card">
      <div class="brand-mark">◆</div>
      <h1>Welcome back</h1>
      <p class="subtitle">Sign in to your workspace</p>

      <form class="login-form">
        <label class="field">
          <span>Email</span>
          <input type="email" placeholder="you@example.com" required>
        </label>
        <label class="field">
          <span>Password</span>
          <input type="password" placeholder="••••••••" required>
        </label>

        <div class="row-between">
          <label class="checkbox">
            <input type="checkbox">
            <span>Remember me</span>
          </label>
          <a href="#" class="link">Forgot password?</a>
        </div>

        <button type="submit" class="btn-primary">Sign In</button>
      </form>

      <div class="divider"><span>or continue with</span></div>

      <div class="social-row">
        <button class="btn-social" type="button">Google</button>
        <button class="btn-social" type="button">Apple</button>
      </div>

      <p class="footer-text">Don't have an account? <a href="#">Sign up</a></p>
    </section>
  </main>
</body>
</html>
style.css
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  min-height: 100vh;
  color: #fff;
  background: linear-gradient(-45deg, #ff5f6d, #ffc371, #24c6dc, #514a9d);
  background-size: 400% 400%;
  animation: gradientShift 16s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 22px;
  padding: 40px 36px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: floatCard 6s ease-in-out infinite;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 20px;
}

h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.subtitle { color: rgba(255, 255, 255, 0.85); font-size: 14px; margin-bottom: 28px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }

.field input {
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 400;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.7); }
.field input:focus { border-color: #fff; background: rgba(255, 255, 255, 0.18); }

.row-between { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { accent-color: #fff; }
.link { color: #fff; font-weight: 600; text-decoration: none; opacity: .9; }
.link:hover { opacity: 1; text-decoration: underline; }

.btn-primary {
  margin-top: 4px;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #514a9d;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(255, 255, 255, 0.4); }
.btn-primary:active { transform: scale(0.98); }

.divider { display: flex; align-items: center; text-align: center; color: rgba(255, 255, 255, 0.8); font-size: 12px; margin: 24px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.35); }
.divider span { padding: 0 12px; }

.social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-social {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-social:hover { background: rgba(255, 255, 255, 0.2); }

.footer-text { margin-top: 24px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.footer-text a { color: #fff; font-weight: 700; text-decoration: none; }
.footer-text a:hover { text-decoration: underline; }