Form #1
- 5.97 KB
- CSS, HTML
- Form
- sign in
- MIT License
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500&display=swap" rel="stylesheet" />
<div class="container-form-1">
<form class="form-1">
<p>Welcome</p>
<input type="email" placeholder="Email" /><br />
<input type="password" placeholder="Password" /><br />
<input type="button" value="Sign in" /><br />
<a href="#">Forgot Password?</a>
</form>
<div class="drops">
<div class="drop-form-1 drop-1-form-1"></div>
<div class="drop-form-1 drop-2-form-1"></div>
<div class="drop-form-1 drop-3-form-1"></div>
<div class="drop-form-1 drop-4-form-1"></div>
<div class="drop-form-1 drop-5-form-1"></div>
</div>
</div>
body {
/*
* background: linear-gradient(45deg, #FC466B, #3F5EFB);
* height: 100vh;
*/
font-family: "Montserrat", sans-serif;
}
.container-form-1 {
position: absolute;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
}
form.form-1 {
background: rgba(255, 255, 255, 0.3);
padding: 3em;
height: 320px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
border-left: 1px solid rgba(255, 255, 255, 0.3);
border-top: 1px solid rgba(255, 255, 255, 0.3);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
-webkit-box-shadow: 20px 20px 40px -6px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 20px 20px 40px -6px rgba(0, 0, 0, 0.2);
box-shadow: 20px 20px 40px -6px rgba(0, 0, 0, 0.2);
text-align: center;
position: relative;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
form.form-1 p {
font-weight: 500;
color: #fff;
opacity: 0.7;
font-size: 1.4rem;
margin-top: 0;
margin-bottom: 60px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
form.form-1 a {
text-decoration: none;
color: #ddd;
font-size: 12px;
}
form.form-1 a:hover {
text-shadow: 2px 2px 6px #00000040;
}
form a:active {
text-shadow: none;
}
form.form-1 input {
background: transparent;
width: 200px;
padding: 1em;
margin-bottom: 2em;
border: none;
border-left: 1px solid rgba(255, 255, 255, 0.3);
border-top: 1px solid rgba(255, 255, 255, 0.3);
-webkit-border-radius: 5000px;
-moz-border-radius: 5000px;
border-radius: 5000px;
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
-webkit-box-shadow: 4px 4px 60px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 4px 4px 60px rgba(0, 0, 0, 0.2);
box-shadow: 4px 4px 60px rgba(0, 0, 0, 0.2);
color: #fff;
font-family: Montserrat, sans-serif;
font-weight: 500;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
form.form-1 input:hover {
background: rgba(255, 255, 255, 0.1);
-webkit-box-shadow: 4px 4px 60px 8px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 4px 4px 60px 8px rgba(0, 0, 0, 0.2);
box-shadow: 4px 4px 60px 8px rgba(0, 0, 0, 0.2);
}
form.form-1 input[type="email"]:focus,
form.form-1 input[type="password"]:focus {
background: rgba(255, 255, 255, 0.1);
-webkit-box-shadow: 4px 4px 60px 8px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 4px 4px 60px 8px rgba(0, 0, 0, 0.2);
box-shadow: 4px 4px 60px 8px rgba(0, 0, 0, 0.2);
}
form.form-1 input[type="button"] {
margin-top: 10px;
width: 150px;
font-size: 1rem;
}
form.form-1 input[type="button"]:hover {
cursor: pointer;
}
form.form-1 input[type="button"]:active {
background: rgba(255, 255, 255, 0.2);
}
form.form-1:hover {
margin: 4px;
}
form.form-1:-moz-placeholder {
font-family: Montserrat, sans-serif;
font-weight: 400;
color: #fff;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}
form.form-1:-ms-input-placeholder {
font-family: Montserrat, sans-serif;
font-weight: 400;
color: #fff;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}
form.form-1:placeholder {
font-family: Montserrat, sans-serif;
font-weight: 400;
color: #fff;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}
.drop-form-1 {
background: rgba(255, 255, 255, 0.3);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border-left: 1px solid rgba(255, 255, 255, 0.3);
border-top: 1px solid rgba(255, 255, 255, 0.3);
-webkit-box-shadow: 10px 10px 60px -8px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 10px 10px 60px -8px rgba(0, 0, 0, 0.2);
box-shadow: 10px 10px 60px -8px rgba(0, 0, 0, 0.2);
position: absolute;
-webkit-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
transition: all 0.2s ease;
}
.drop-1-form-1 {
height: 80px;
width: 80px;
top: -20px;
left: -40px;
z-index: -1;
}
.drop-2-form-1 {
height: 80px;
width: 80px;
bottom: -30px;
right: -10px;
}
.drop-3-form-1 {
height: 100px;
width: 100px;
bottom: 120px;
right: -50px;
z-index: -1;
}
.drop-4-form-1 {
height: 120px;
width: 120px;
top: -60px;
right: -60px;
}
.drop-5-form-1 {
height: 60px;
width: 60px;
bottom: 170px;
left: 90px;
z-index: -1;
}
/*
* This property greatly increases the minimum supported versions of browsers.
*/
form.form-1 a,
form.form-1 input:focus,
form.form-1 select:focus,
form.form-1 textarea:focus,
form.form-1 button:focus {
outline: none;
}
This code snippet is all about creating a sleek, modern sign-in form with some stylish web design elements. Imagine walking into a minimalist, futuristic lobby – that’s the vibe this form is aiming for. It starts by setting up a nice font from Google Fonts, ensuring the text looks clean and modern. Then, we dive into the heart of the form, where users are greeted with a “Welcome” message and asked to enter their email and password. There’s also a handy “Forgot Password?” link, just in case.
But it’s not just about functionality; it’s about style too. The form is designed to float right in the middle of the screen, thanks to some clever positioning and transformation CSS tricks. It’s got a semi-transparent background, rounded corners, and a subtle blur effect that makes it feel like it’s gently floating above a vibrant background (which is commented out, but you can imagine the cool gradient it suggests).
Inputs and buttons are styled to blend seamlessly into the form, with a focus on making everything look smooth and inviting. Hovering over these elements gives them a slight visual pop, encouraging interaction.
And then, there are these “drops” – decorative elements that add a bit of whimsy and depth, floating around the form to create a sense of dynamism and space. It’s like the form is not just a form but a piece of interactive art on your screen.
In summary, this code combines HTML and CSS to craft a sign-in form that’s not just functional but visually captivating, offering users a pleasant experience right from the login screen.