Sign-in form 01
Plain HTML and CSS, so it works in any site, Webflow and Framer embeds included.
How to use
- Copy the code below.
- Paste the HTML where you want it, and the <style> part into your CSS, or keep it as it is.
- In Webflow or Framer, paste the whole thing into an Embed block.
- Change the colours and words to yours. Keep the licence note at the foot.
The code
forms-empty-pug-43.htmlHTML
<div class="form-container">
<form class="form">
<svg
xmlns="http://www.w3.org/2000/svg"
class="lock-icon"
width="1em"
height="1em"
viewBox="0 0 24 24"
stroke-width="0"
fill="currentColor"
stroke="currentColor"
>
<path
d="M12 2C9.243 2 7 4.243 7 7v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7c0-2.757-2.243-5-5-5zM9 7c0-1.654 1.346-3 3-3s3 1.346 3 3v3H9V7zm4 10.723V20h-2v-2.277a1.993 1.993 0 0 1 .567-3.677A2.001 2.001 0 0 1 14 16a1.99 1.99 0 0 1-1 1.723z"
></path>
</svg>
<input class="toggle-input" id="toggle-checkbox" type="checkbox" />
<p class="form-title">Welcome back</p>
<p class="form-sub-title">
Glad to see you again Login to your account below.
</p>
<div class="login-card">
<div class="field-container">
<input placeholder="" class="input" type="email" />
<span class="placeholder">Email</span>
</div>
<button class="btn" type="button">
<label class="btn-label" for="toggle-checkbox">Continue</label>
</button>
</div>
<div class="password-card">
<div class="field-container">
<input placeholder="" class="input" type="password" />
<span class="placeholder">Password</span>
</div>
<button class="btn" type="button">
<label class="btn-label" for="toggle-checkbox">Login</label>
</button>
</div>
</form>
</div>
<style>
.form-container {
width: 400px;
height: 254px;
background: #fff;
border-radius: 8px;
box-shadow: rgba(69, 47, 96, 0.25) 0px 6px 12px -2px,
rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
box-sizing: border-box;
position: relative;
overflow: hidden;
}
.lock-icon {
font-size: 20px;
color: #1d3945;
}
.form {
width: 100%;
height: 100%;
padding: 20px 15px;
font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
"Lucida Sans", Arial, sans-serif;
box-sizing: border-box;
color: #1d3945;
position: relative;
}
.toggle-input {
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
.form-title {
margin-top: 10px;
margin-bottom: 5px;
font-size: 25px;
font-weight: 700;
font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
"Lucida Sans", Arial, sans-serif;
}
.form-sub-title {
margin: 0;
font-size: 15px;
font-weight: 500;
font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
"Lucida Sans", Arial, sans-serif;
}
.login-card,
.password-card {
display: flex;
flex-direction: column;
box-sizing: border-box;
padding-top: 25px;
gap: 20px;
align-items: flex-end;
position: absolute;
width: calc(100% - 30px);
transition: all 0.3s ease-in-out;
bottom: 20px;
}
.login-card {
left: 15px;
}
.password-card {
left: 100%;
}
.field-container {
border: 1px solid #a7a7a7;
border-radius: 8px;
width: 100%;
height: 45px;
position: relative;
box-sizing: border-box;
overflow: hidden;
display: flex;
align-items: flex-end;
justify-content: flex-start;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.input {
width: 100%;
height: 100%;
padding: 5px 10px;
box-sizing: border-box;
border: none;
outline: none;
background: transparent;
position: relative;
z-index: 11;
}
.placeholder {
position: absolute;
top: 50%;
left: 10px;
transform: translateY(-50%);
color: #a7a7a7;
transition: all 0.3s ease;
font-size: 16px;
}
.input:focus ~ .placeholder,
.input:not(:placeholder-shown) ~ .placeholder {
top: 5px;
transform: none;
font-size: 12px;
}
.input:focus,
.input:not(:placeholder-shown) {
height: 68%;
}
.btn {
width: 100px;
height: 40px;
border-radius: 8px;
box-shadow: rgba(100, 100, 111, 0.5) 0px 7px 29px 0px;
background: #1d3945;
border: none;
outline: none;
}
.btn:focus {
box-shadow: none;
}
.btn-label {
font-size: 15px;
font-weight: 600;
color: #fff;
cursor: pointer;
}
.toggle-input:checked ~ .login-card {
left: -100%;
}
.toggle-input:checked ~ .password-card {
left: 15px;
}
</style>
<!--
MIT License
Copyright (c) 2023 Uiverse.io
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->