Fireship · @fireship
Animated CSS Login Form w/ Password Validation Meter
Uploaded May 18, 2020 · Length 14:37
Summary
Create an animated login form with HTML and CSS, including password validation meter and animation effects.
- animated login form
- css animation
- password validation
- html form
- css pseudo elements
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:01
HTML forms are usually very boring but
- 0:04
there's no reason that they can't be one
- 0:05
of the most creative aspects of your UI
- 0:07
and you don't even need a library like
- 0:08
material design to make that happen in
- 0:10
today's video we'll build an animated
- 0:12
login form from scratch with HTML and
- 0:14
CSS notice how it moves the label up
- 0:16
when an input field is focused and also
- 0:19
slides in a border underneath but when
- 0:21
it comes to the password we'll throw in
- 0:22
some JavaScript with spell to take
- 0:24
things to another level we'll write a
- 0:25
simple algorithm to analyze the password
- 0:27
strength then show the end user a
- 0:29
strength meter along with validation
- 0:31
errors based on the content of their
- 0:33
password in order to make all this
- 0:34
happen from scratch they learned about
- 0:36
CSS transforms and transition animations
- 0:38
pseudo elements like after box shadows
- 0:41
and gradients and even a little bit of
- 0:42
red X if you're new here like and
- 0:44
subscribe and if you like the format of
- 0:46
this video make sure to let me know what
- 0:47
you want to see next in the comments
- 0:49
let's start by taking a closer look at
- 0:51
what we're building today what we have
- 0:52
here is just a regular HTML form input
- 0:54
along with a label when the user focuses
- 0:56
in on a form input we translate the
- 0:58
label up along the y-axis and scale it
- 1:01
down a little bit this behavior was made
- 1:02
famous by material design but you can
- 1:04
easily implement it on your own with
- 1:06
just a few lines of CSS when the input
- 1:08
is focused we also animate in a border
- 1:10
from the left side but it's not handled
- 1:12
with a border it actually uses a CSS
- 1:14
pseudo element which we'll talk about
- 1:15
later
- 1:16
now our password field is really over
- 1:18
the top when the user starts typing it
- 1:19
animates this password meter based on
- 1:21
the strength of the password I'll show
- 1:23
you how to use a box shadow to create
- 1:24
this shudder like effect for each bar in
- 1:26
the meter in addition we'll also
- 1:28
validate different patterns in the
- 1:30
password string to show the user
- 1:32
specific validation errors and finally
- 1:34
we'll add a little button in the form
- 1:35
input so the user can see their password
- 1:37
text this tutorial is designed for you
- 1:40
to follow along step by step and you can
- 1:41
find the project's source code on github
- 1:43
well mostly be talking about HTML and
- 1:45
CSS but we'll use felt to you manage our
- 1:47
JavaScript and application state and if
- 1:50
you've never used smelt before don't
- 1:51
worry you're gonna love it it's super
- 1:53
intuitive and easy to learn to get
- 1:54
things started we'll head over to spelt
- 1:56
dev you'll see a command here that you
- 1:58
can run with NP X to create a new small


