Text...(kozakura)

HTML
<span class="input input--kozakura"> <input class="input__field input__field--kozakura" type="text" id="input-7" /> <label class="input__label input__label--kozakura" for="input-7"> <span class="input__label-content input__label-content--kozakura" data-content="Name">Text...</span> </label> <svg class="graphic graphic--kozakura" width="300%" height="100%" viewBox="0 0 1200 60" preserveAspectRatio="none"> <path d="M1200,9c0,0-305.005,0-401.001,0C733,9,675.327,4.969,598,4.969C514.994,4.969,449.336,9,400.333,9C299.666,9,0,9,0,9v43c0,0,299.666,0,400.333,0c49.002,0,114.66,3.484,197.667,3.484c77.327,0,135-3.484,200.999-3.484C894.995,52,1200,52,1200,52V9z"/> </svg> </span> <span class="input input--kozakura"> <input class="input__field input__field--kozakura" type="text" id="input-8" /> <label class="input__label input__label--kozakura" for="input-8"> <span class="input__label-content input__label-content--kozakura" data-content="Email">Text...</span> </label> <svg class="graphic graphic--kozakura" width="300%" height="100%" viewBox="0 0 1200 60" preserveAspectRatio="none"> <path d="M1200,9c0,0-305.005,0-401.001,0C733,9,675.327,4.969,598,4.969C514.994,4.969,449.336,9,400.333,9C299.666,9,0,9,0,9v43c0,0,299.666,0,400.333,0c49.002,0,114.66,3.484,197.667,3.484c77.327,0,135-3.484,200.999-3.484C894.995,52,1200,52,1200,52V9z"/> </svg> </span> <span class="input input--kozakura"> <input class="input__field input__field--kozakura" type="text" id="input-9" /> <label class="input__label input__label--kozakura" for="input-9"> <span class="input__label-content input__label-content--kozakura" data-content="Website">Text...</span> </label> <svg class="graphic graphic--kozakura" width="300%" height="100%" viewBox="0 0 1200 60" preserveAspectRatio="none"> <path d="M1200,9c0,0-305.005,0-401.001,0C733,9,675.327,4.969,598,4.969C514.994,4.969,449.336,9,400.333,9C299.666,9,0,9,0,9v43c0,0,299.666,0,400.333,0c49.002,0,114.66,3.484,197.667,3.484c77.327,0,135-3.484,200.999-3.484C894.995,52,1200,52,1200,52V9z"/> </svg> </span>
CSS
body { background: #2196F3; color: #fff; font-size: 150%; padding: 3em 0; font-family: Arial; } .input { position: relative; z-index: 1; display: block; left: 50%; margin-left: -175px; max-width: 350px; width: calc(100% - 2em); vertical-align: top; } .input__field { position: relative; display: block; float: right; padding: 0.8em; width: 60%; border: none; border-radius: 0; background: #fff; color: #aaa; font-weight: 400; font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-appearance: none; } .input__field:focus { outline: none; } .input--kozakura { overflow: hidden; padding-bottom: 1em; } .input__field--kozakura { padding: 0.25em 0em; margin-top: 1.25em; width: 100%; background: transparent; color: #494E57; font-size: 1.55em; opacity: 0; } .input__label--kozakura { width: 100%; text-align: left; position: absolute; pointer-events: none; overflow: hidden; padding: 0 0.25em; -webkit-transform: translate3d(1em, 2.75em, 0); transform: translate3d(1em, 2.75em, 0); -webkit-transition: -webkit-transform 0.3s; transition: transform 0.3s; } .input__label-content--kozakura { color: #fff; padding: 0.4em 0 0.25em; -webkit-transition: -webkit-transform 0.3s; transition: transform 0.3s; } .input__label-content--kozakura::after { content: attr(data-content); position: absolute; font-weight: 800; top: 100%; left: 0; height: 100%; width: 100%; color: #fff; padding: 0.25em 0; text-transform: uppercase; letter-spacing: 1px; font-size: 0.85em; } .graphic { position: absolute; top: 0; left: 0; fill: none; } .graphic--kozakura { fill: #494E57; pointer-events: none; top: 1em; bottom: 0px; height: 4.5em; z-index: -1; -webkit-transition: -webkit-transform 0.7s, fill 0.7s; transition: transform 0.7s, fill 0.7s; -webkit-transition-timing-function: cubic-bezier(0, 0.25, 0.5, 1); transition-timing-function: cubic-bezier(0, 0.25, 0.5, 1); } .input__field--kozakura:focus, .input--filled .input__field--kozakura { -webkit-transition: opacity 0s 0.35s; transition: opacity 0s 0.35s; opacity: 1; } .input__field--kozakura:focus + .input__label--kozakura, .input--filled .input__label--kozakura { -webkit-transition-delay: 0.15s; transition-delay: 0.15s; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .input__field--kozakura:focus + .input__label--kozakura .input__label-content--kozakura, .input--filled .input__label-content--kozakura { -webkit-transition-delay: 0.15s; transition-delay: 0.15s; -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); } .input__field--kozakura:focus ~ .graphic--kozakura, .input--filled .graphic--kozakura { fill: #fff; -webkit-transform: translate3d(-66.6%, 0, 0); transform: translate3d(-66.6%, 0, 0); }
JAVASCRIPT
Expand for more options Login