The content on this website, including videos and code examples, is for educational purposes only. All demonstrations and designs are fictional and created to illustrate coding techniques. Any resemblance to existing websites or brands is purely coincidental.
The creators and administrators of this website do not claim ownership or affiliation with any existing websites or companies. Users are encouraged to use the information responsibly for learning purposes. Liability for any misuse of the content provided is not accepted.
Below is the html code for this video.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Signup form transition</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="form sign-in">
<h2>Welcome back!</h2>
<form action="" method="post">
<label>
<span>Email</span>
<input type="email" name="sign-in-email" id="sign-in-email" required autocomplete="off">
</label>
<label>
<span>Password</span>
<input type="password" name="sign-in-password" id="sign-in-password" required autocomplete="off"
minlength="8">
</label>
<label>
<span>Seek Password</span>
<input type="checkbox" name="check-sign-in-password" onclick="showPassword('sign-in-password')">
</label>
<button type="submit" class="submit">Sign In</button>
</form>
</div>
<div class="sub-container">
<div class="img">
<div class="img-text m-up">
<h2>Don't have an account?</h2>
</div>
<div class="img-text m-in">
<h2>Already have an account?</h2>
</div>
<div class="img-btn">
<span class="m-up">Sign Up</span>
<span class="m-in">Sign In</span>
</div>
</div>
<div class="form sign-up">
<h2>Join Us Today!</h2>
<form action="" method="post">
<label>
<span>Name</span>
<input type="text" name="sign-up-name" id="sign-up-name" required autocomplete="off">
</label>
<label>
<span>Email</span>
<input type="email" name="sign-up-email" id="sign-up-email" required autocomplete="off">
</label>
<label>
<span>Password</span>
<input type="password" name="sign-up-password" id="sign-up-password" required autocomplete="off"
minlength="8">
</label>
<label>
<span>Seek Password</span>
<input type="checkbox" name="check-sign-up-password" onclick="showPassword('sign-up-password')">
</label>
<button type="submit" class="submit">Sign Up</button>
</form>
</div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
Below is the css code for this video.
style.css
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:ital@1&display=swap');
*, *::after, *::before {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
height: 100vh;
width: 100%;
background-image: url(https://images.unsplash.com/photo-1638965789478-1fc29ced8f16?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2831&q=80);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
font-family: 'Ubuntu Mono', monospace;
align-items: center;
justify-content: center;
backdrop-filter: blur(4px);
overflow: hidden;
}
input, button {
background: none;
font-family: 'Ubuntu Mono', monospace;
border: none;
outline: none;
}
.container {
position: relative;
height: 550px;
width: 580px;
background: #ffffff;
overflow: hidden;
}
.form {
position: relative;
display: flex;
height: 100%;
width: max-content;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 0 30px;
transition: transform 1s ease-in-out;
}
.sub-container {
position: absolute;
top: 0;
left: 320px;
height: 100%;
width: 580px;
background: #ffffff;
padding-left: 260px;
transition: transform 1s ease-in-out;
overflow: hidden;
}
.container.s-sign-up .sub-container {
transform: translate3d(-320px, 0, 0);
}
button {
display: block;
height: 36px;
width: 260px;
color: #ffffff;
font-size: 16px;
border-radius: 32px;
margin: 0 auto;
cursor: pointer;
}
.img {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 260px;
padding-top: 360px;
z-index: 2;
overflow: hidden;
}
.img::before {
content: "";
position: absolute;
top: 0;
right: 0;
height: 100%;
width: 580px;
background-image: url(https://images.unsplash.com/photo-1690046793146-dd1cc08ea17d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2940&q=80);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
transition: transform 1s ease-in-out;
}
.img::after {
content: "";
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
height: 100%;
width: 100%;
background: #00000080;
}
.container.s-sign-up .img::before {
transform: translate3d(320px, 0, 0);
}
.img-text {
position: absolute;
top: 50px;
left: 0;
width: 100%;
color: #ffffff;
padding: 0 20px;
text-align: center;
z-index: 2;
transition: transform 1s ease-in-out;
}
.container.s-sign-up .img-text.m-up {
transform: translateX(520px);
}
.img-text.m-in {
transform: translateX(-520px);
}
.container.s-sign-up .img-text.m-in {
transform: translateX(0);
}
.img-btn {
position: relative;
height: 36px;
width: 100px;
background: transparent;
color: #ffffff;
margin: 0 auto;
text-transform: uppercase;
font-size: 16px;
cursor: pointer;
z-index: 2;
overflow: hidden;
}
.img-btn::after {
content: "";
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
border: 2px solid #ffffff;
border-radius: 32px;
z-index: 2;
}
.img-btn span {
position: absolute;
top: 0;
left: 0;
display: flex;
height: 100%;
width: 100%;
align-items: center;
justify-content: center;
transition: transform 1s ease;
}
.img-btn span.m-in {
transform: translateY(-72px);
}
.container.s-sign-up .img-btn span.m-in {
transform: translateY(0);
}
.container.s-sign-up .img-btn span.m-up {
transform: translateY(72px);
}
h2 {
width: 100%;
font-size: 28px;
text-align: center;
margin: 20% 0;
}
label {
display: block;
width: 260px;
text-align: center;
margin: 10% 0;
}
label span {
font-size: 12px;
color: #808080;
text-transform: uppercase;
}
input {
display: block;
width: 100%;
font-size: 16px;
text-align: center;
border-bottom: 1px solid #00000080;
margin: 10px 0;
}
input[type=checkbox] {
display: inline-block;
width: max-content;
}
.submit {
background: #012d65;
text-transform: uppercase;
margin: 15% 0;
}
.sign-in {
transition-timing-function: ease-out;
}
.container.s-sign-up .sign-in {
transform: translate3d(580px, 0, 0);
transition-duration: 1s;
transition-timing-function: ease-in-out;
}
.sign-up {
transform: translate3d(-580px, 0, 0);
}
.container.s-sign-up .sign-up {
transform: translate3d(0, 0, 0);
}
Below is the javascript code for this video.
index.js
function showPassword(id) {
const passwordElement = document.getElementById(id);
passwordElement.type = passwordElement.type === "password" ? "text" : "password";
}
document.querySelector('.img-btn').addEventListener("click", function () { document.querySelector('.container').classList.toggle('s-sign-up'); });
Thanks for visiting