Mockup login con HTML y CSS
Mockup para un login
Hoy tenia ganas de hacer alguna cosa sencilla y de paso entrenar un poco HTML y CSS, no todo va ser programación.
En esta ocasión estoy haciendo unas pruebas de HTML y CSS para una pantalla de login. Prueba ver el resultado final desde aquí.
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Mockup</title>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
}
#login {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.4);
max-width: 320px;
min-width: 320px;
width: 320px;
max-height: 409px;
min-height: 409px;
height: 409px;
margin: 0 auto;
}
#login img {
left: calc(50% - 130px);
position: relative;
width: 260px;
top: 10px;
}
.form > div {
margin: 20px auto;
text-align: center;
color: #00bfd6;
font-size: 23px;
font-weight: bold;
}
.form form div {
text-align: center;
margin: 15px;
}
.form form div input {
width: 100%;
border-bottom: 1px solid #ff9300;
border-top: 0;
border-left: 0;
border-right: 0;
}
.form form {
width: calc(100% - 40px);
left: 20px;
position: relative;
}
* { box-sizing:border-box; }
.group {
position:relative;
margin-bottom:45px;
}
input {
font-size:20px;
padding:10px 10px 10px 5px;
display:block;
width:300px;
border:none;
border-bottom:1px solid #757575;
}
input:focus {
outline:none;
}
label {
color: #ff9300;
font-size: 14px;
font-weight: normal;
position: absolute;
pointer-events: none;
left: 5px;
top: 20px;
transition:0.2s ease all;
-moz-transition:0.2s ease all;
-webkit-transition:0.2s ease all;
}
input:focus ~ label, input:valid ~ label {
top: -5px;
font-size: 11px;
color: #FF9300;
font-weight: bold;
}
.bar {
position:relative;
display:block;
}
.bar:before, .bar:after {
content:'';
height:2px;
width:0;
bottom:1px;
position:absolute;
background:#FF9300;
transition:0.2s ease all;
-moz-transition:0.2s ease all;
-webkit-transition:0.2s ease all;
}
.bar:before {
left:50%;
}
.bar:after {
right:50%;
}
input:focus ~ .bar:before, input:focus ~ .bar:after {
width:50%;
}
.highlight {
position:absolute;
height:60%;
width:100px;
top:25%;
left:0;
pointer-events:none;
opacity:0.5;
}
input:focus ~ .highlight {
-webkit-animation:inputHighlighter 0.3s ease;
-moz-animation:inputHighlighter 0.3s ease;
animation:inputHighlighter 0.3s ease;
}
form .button button {
right: 0;
position: absolute;
border: 0;
width: 50%;
padding: 10px;
box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
background-color: #00bfd6;
color: #ffffff;
font-weight: bold;
border-radius: 3px;
}
form .button .group {
margin: 0;
}
@-webkit-keyframes inputHighlighter {
from { background:#ffffff; }
to { width:0; background:transparent; }
}
@-moz-keyframes inputHighlighter {
from { background:#ffffff; }
to { width:0; background:transparent; }
}
@keyframes inputHighlighter {
from { background:#ffffff; }
to { width:0; background:transparent; }
}
</style>
</head>
<body>
<main>
<div id="login">
<div class="logotipo">
<img src="../assets/logo.webp" alt="Logotipo">
</div>
<div class="form">
<div>Registro estación Platzi</div>
<form>
<div class="group">
<input type="text" required>
<span class="highlight"></span>
<span class="bar"></span>
<label>Nombre</label>
</div>
<div class="group">
<input type="text" required>
<span class="highlight"></span>
<span class="bar"></span>
<label>Apellido</label>
</div>
<div class="group">
<input type="text" required>
<span class="highlight"></span>
<span class="bar"></span>
<label>Cargo</label>
</div>
<div class="button">
<div class="group">
<button>ENVIAR</button>
</div>
</div>
</form>
</div>
</div>
</main>
</body>
</html>
