Blazor Wave form
This is a pretty cool trick if you like using placeholder text but don't like that the "text" goes away once the user starts to type. What this does is simply moves the "placeholder" text up to a label when the input gets focus. The cool part is it will move the "placeholder" text back once the input loses focus if there is no data in the input. We are using actual text not the placeholder attribute. This provides it with a cute but functional visual effect. See live demo
HTML
The HTML is just s normal log-in form. There is a form container, a form, and 2 form controls. Both inputs are required and the password element is of type password so it will mask the input values. Each input element also has a label that is used to let the user know the input needed.
CSS
Most of the CSS is to just set the layout and make it look nice. The CSS trick we are using is to have a couple of classes to handle the moving of the text, "focusMove" and a "focusBack" . They are just using transforms to do the move the text around.
transform: translateY(-30px);
transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.focusBack {
transform: translateY(0px);
transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
Comments
Post a Comment