galaxy/Inputs/Minka1902_neat-bear-54.html

79 lines
1.5 KiB
HTML

<div class="input-container">
<input type="text" name="text" class="input">
<label class="label">Input title</label>
<div class="top-line"></div>
<div class="under-line"></div>
</div>
<style>
/* From Uiverse.io by Minka1902 - Tags: input, code, click, border, html, css, css effect */
.input-container {
position: relative;
width: clamp(100px, 100%, 200px);
}
.input {
padding: 10px;
height: 40px;
width: clamp(100px, 100%, 200px);
border: 2px solid #0B2447;
border-top: none;
font-size: 16px;
background: transparent;
outline: none;
box-shadow: 7px 7px 0px 0px #0B2447;
transition: all 0.5s;
}
.input:focus {
box-shadow: none;
transition: all 0.5s;
}
.label {
position: absolute;
top: 10px;
left: 10px;
color: #0B2447;
transition: all 0.5s;
transform: scale(0);
z-index: -1;
}
.input-container .top-line {
position: absolute;
content: "";
background-color: #0B2447;
width: 100%;
height: 2px;
right: 0;
top: 0;
transition: all 0.5s;
}
.input-container input[type="text"]:focus~.top-line {
width: 35%;
transition: all 0.5s;
}
.input-container .under-line {
position: absolute;
content: "";
background-color: #0B2447;
width: 0%;
height: 2px;
right: 0;
bottom: 0;
transition: all 0.5s;
}
.input-container input[type="text"]:focus~.under-line {
width: 100%;
transition: all 0.5s;
}
.input-container input[type="text"]:focus~.label {
top: -10px;
transform: scale(1);
transition: all 0.5s;
}
</style>