Day # 63: Wave label



Forms are a very commonly used functionality in frontend development. As developers we need to be prepared to deal with them all the time. At times, we may get inquiries from certain clients that like to have their forms displayed in a creative way.

I saw an effect in which the labels of the inputs get animated as soon as you enter some data onto them. Inspired by a wave effect that I encountered recently, I decided to copy it for today’s website.

The key here is to control each letter and animate it:


.form-control label span {

    display: inline-block;

    font-size: 18px;

    min-width: 5px;

    transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);

}


.form-control input:focus + label span,

.form-control input:valid + label span {

    color: lightblue;

    transform: translateY(-30px);

}


Comments

Popular posts from this blog

Day # 19: Checkbox animation

Day # 12: Typewriter Effect

Day # 53: Icon text