<div class="container">
  <div class="form" id="login">
    <h1 class="form__title">Welcome Back</h1>
    <div class="form__input-group">
      <input type="text" class="form__input" autofocus placeholder="Username" id="usernameInput">
    </div>
    <div class="form__input-group">
      <input type="password" class="form__input" autofocus placeholder="Password" id="passwordInput">
      <div class="padding"></div>
      <a href="#"><button class="form__button" id="loginButton">Sign In</button></a>
    </div>
  </div>
</div>
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

* {
  font-family: "Poppins", sans-serif;
  margin: 0;
}

body {
  --bg-color: #ede9f8;
  --color-primary: #2d3436;
  --color-secondary: #252c6a;
  --border-radius: 4px;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
}

.container {
  width: 400px;
  max-width: 400px;
  margin: 1rem;
  padding: 2rem;
  border-radius: var(--border-radius);
  background: white;
}

.form--hidden {
  display: none;
}

.form > *:first-child {
  margin-top: 0;
}

.form > *:last-child {
  margin-bottom: 0;
}

.form__title {
  margin-bottom: 2rem;
  text-align: center;
}

.form__input-group {
  margin-bottom: 1rem;
}

.form__input {
  display: block;
  width: 100%;
  padding: 0.75rem;
  box-sizing: border-box;
  border-radius: var(--border-radius);
  border: 1px solid #dddddd;
  outline: none;
  background: #eeeeee;
  transition: background 0.2s, border-color 0.2s;
}

.form__input:focus {
  border-color: var(--color-primary);
  background: #ffffff;
}

.form__button {
  width: 100%;
  padding: 1rem 2rem;
  font-weight: bold;
  font-size: 1.1rem;
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius);
  outline: none;
  cursor: pointer;
  background: var(--color-primary);
  -webkit-user-select: none; /* No Userselect */
}

.form__button:active {
  transform: scale(0.98);
}
.padding {
  padding-bottom: 10px; /* Padding */
}
let box = new gsap.timeline();

box.from(".container", { width: "0%", stagger: 0.4, duration: 1.5 });
box.from(".form__title", { opacity: 0, y: -30 });
box.from(".form__input-group input", { opacity: 0, stagger: 0.3 });

box.from(".form__button ", { opacity: 0, y: 20 });

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/gsap/3.8.0/gsap.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/gsap/3.8.0/ScrollTrigger.min.js