پیشنمایش زنده
کد HTML
<form class="form">
<div id="circleform"></div>
<div id="introform">
<p>Welcome back!</p>
<div id="introformbehind">
<p>||||||||||||||||||||||||||||||||||||</p>
</div>
</div>
<div id="middleform">
<p>Username</p>
<input class="input" type="text" />
<p>Password</p>
<input class="input" type="password" />
</div>
<div id="endform">
<button>Submit</button>
</div>
<div id="endform2">
<button>Create account</button>
<button id="passbutton">Reset Password</button>
</div>
</form>
کد CSS
.form {
--background: #006aaaff;
--color1: #ffbf6a;
--color2: #ff7c90ff;
display: flex;
flex-direction: column;
width: 16em;
height: 20em;
background-color: var(--background);
border: 5px solid var(--color1);
position: relative;
overflow: hidden;
box-shadow: -0.5em 0em var(--color2);
transition: all 1s ease;
}
.form input {
position: relative;
z-index: 2;
}
.form:hover {
width: 16.5em;
margin-bottom: 1em;
}
#circleform {
width: 4.5em;
height: 4.5em;
border-bottom-right-radius: 50%;
background-color: var(--color1);
position: absolute;
top: -2.5em;
left: -2.5em;
z-index: 1;
box-shadow:
0.25em 0.25em 0em 1em var(--background),
0.25em 0.25em 0em 1.5em var(--color2);
}
#introform {
width: 100%;
height: 4em;
background-color: var(--color1);
color: blue;
font-size: 20px;
display: flex;
justify-content: flex-end;
align-items: center;
position: relative;
z-index: 0;
}
#introformbehind {
width: 100%;
height: 3em;
color: blue;
font-size: 20px;
top: -1em;
position: absolute;
z-index: -1;
color: var(--color2);
animation: translateform 4s infinite linear;
}
@keyframes translateform {
0% {
transform: translateX(-2%);
top: -1.5em;
}
5% {
top: -1em;
}
95% {
top: -1em;
}
100% {
top: -1.5em;
transform: translateX(25%);
}
}
#introformbehind p {
color: var(--color2);
text-shadow: 0px 0px;
}
.form p {
color: white;
font-weight: bold;
font-family: "Times New Roman", serif;
padding-right: 0.25em;
text-shadow: 0em 0.1em 0em var(--color2);
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Oxygen,
Ubuntu,
Cantarell,
"Open Sans",
"Helvetica Neue",
sans-serif;
font-size: 1.15em;
}
.form input {
background-color: var(--background);
border: none;
border-right: 5px solid var(--color2);
border-bottom: 5px solid var(--color2);
border-bottom-right-radius: 25em;
height: 2em;
width: 90%;
transition: all 0.5s ease;
color: var(--color2);
font-weight: bold;
padding-left: 0.5em;
font-size: 1.05em;
box-shadow: 1em 0em 0em;
outline: none;
transition: all 0.25s ease;
}
.form input:hover {
width: 100%;
background-color: white;
box-shadow: 0em 0em 0em;
}
#middleform {
width: 100%;
height: 8em;
background-color: var(--color1);
display: flex;
flex-direction: column;
justify-content: center;
padding-right: 0.25em;
}
.form button {
background-color: var(--color2);
border: none;
border-bottom-right-radius: 25em;
height: 2em;
width: 90%;
transition: all 0.25s ease;
color: white;
font-weight: bold;
font-size: 1.05em;
display: flex;
align-items: center;
padding-left: 0.5em;
box-shadow: 1em 0em 0em white;
}
#endform {
background-color: var(--color1);
width: 100%;
height: 5em;
display: flex;
justify-content: center;
flex-direction: column;
}
#endform button {
width: 87.5%;
border-right: 5px solid white;
border-bottom: 5px solid white;
transition: all 0.25s ease;
}
#endform button:hover {
width: 98%;
border-right: 5px solid var(--color2);
border-bottom: 5px solid var(--color2);
box-shadow: 0em 0em 0em;
}
#endform button:active {
color: white;
background-color: var(--color2);
}
#endform2 {
background-color: var(--color1);
width: 100%;
height: 3.2em;
display: flex;
align-items: flex-start;
}
.form button:hover {
color: var(--color2);
width: 100%;
background-color: white;
}
#endform2 button {
font-size: 0.76em;
height: 2.5em;
box-shadow: 4em 0em 0em white;
}
#endform2 button:active {
color: white;
background-color: var(--color2);
}
#passbutton {
border-right: 0px;
border-bottom-right-radius: 0em;
border-bottom-left-radius: 25em;
display: flex;
justify-content: flex-end;
padding-left: 0em;
padding-right: 0.5em;
}