JSFiddle - React, Tailwind, and code Playground
Click every input
by Jennifer Perrin
HTML
<div class="row">
<p>Click every input.</p>
</div>
<div class="row">
<span>
<input class="basic-slide" id="name" type="text" placeholder="Your best name" /><label for="name">Name</label>
</span>
<span>
<input class="basic-slide" id="email" type="text" placeholder="Your favorite email" /><label for="email">Email</label>
</span>
<span>
<input class="basic-slide" id="phone" type="text" placeholder="You can trust us" /><label for="phone">Phone</label>
</span>
</div>
<div class="row">
<span>
<input class="clean-slide" id="age" type="text" placeholder="Go for the high score!" /><label for="age">Age</label>
</span>
<span>
<input class="clean-slide" id="height" type="text" placeholder="Heels count" /><label for="height">Height</label>
</span>
<span>
<input class="clean-slide" id="weight" type="text" placeholder="Go ahead and lie" /><label for="weight">Weight</label>
</span>
</div>
<div class="row">
<span>
<input class="gate" id="class" type="text" placeholder="Wizard!" /><label for="class">Class</label>
</span>
<span>
<input class="gate" id="element" type="text" placeholder="Five to choose from" /><label for="element">Element</label>
</span>
<span>
<input class="gate" id="move" type="text" placeholder="Secret book attack!" /><label for="move">Move</label>
</span>
</div>
<div class="row">
<span>
<input class="skinny" id="english" type="text" placeholder="Do you speak it?" /><label for="english">English</label>
</span>
<span>
<input class="skinny" id="burger" type="text" placeholder="A Royale with cheese?" /><label for="burger">Burger</label>
</span>
<span>
<input class="skinny" id="wallet" type="text" placeholder="Bad Mother****er" /><label for="wallet">Wallet</label>
</span>
</div>
<div class="row">
<span>
<input class="slide-up" id="card" type="text" placeholder="Fund me!" /><label for="card">Credit Card</label>
</span>
<span>
<input class="slide-up"...
CSS
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);
* {
box-size: border-box;
}
html,
body {
overflow-x: hidden;
font-family: "Open Sans", sans;
font-weight: 300;
color: #fff;
background: #efefef;
}
.row {
max-width: 800px;
margin: 0 auto;
padding: 60px 30px;
background: #032429;
position: relative;
z-index: 1;
text-align: center;
}
.row:before {
position: absolute;
content: "";
display: block;
top: 0;
left: -5000px;
height: 100%;
width: 15000px;
z-index: -1;
background: inherit;
}
.row:first-child {
padding: 40px 30px;
}
.row:nth-child(2), .row:nth-child(8) {
background: #134A46;
}
.row:nth-child(3), .row:nth-child(7) {
background: #377D6A;
}
.row:nth-child(4), .row:nth-child(6) {
background: #7AB893;
}
.row:nth-child(5) {
background: #B2E3AF;
}
.row span {
position: relative;
display: inline-block;
margin: 30px 10px;
}
.basic-slide {
display: inline-block;
width: 200px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 70px;
transition: all .3s ease-in-out;
}
.basic-slide::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
.basic-slide + label {
display: inline-block;
position: absolute;
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);
background: #7AB893;
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.basic-slide:focus,
.basic-slide:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.basic-slide:focus::-webkit-input-placeholder,
.basic-slide:active::-webkit-input-placeholder {
color: #aaa;
}
.basic-slide:focus + label,
.basic-slide:active + label {
transform: translateX(-100%);
}
.clean-slide {
position:...