<div class="form-parent">
        <div class="sign-up-img"></div>
        <div class="sign-in-img"></div>

        <div class="form-container">
            <div class="form" id="sign-in-form">
                <h1 class="title">sign in</h1>
                <div class="fields">
                    <input type="text" placeholder="username">
                    <input type="password" placeholder="password">
                </div>
                <div class="submit-container">
                    <button type="submit" class="btn">sign in</button>
                    <p class="link" onclick="switchForm('register')">new here ? sign up here</p>
                </div>
            </div>
            <div class="form" id="sign-up-form">
                <h1 class="title">sign up</h1>
                <div class="fields">
                    <input type="text" placeholder="name">
                    <input type="text" placeholder="username">
                    <input type="email" placeholder="email">
                    <input type="password" placeholder="password">
                </div>
                <div class="submit-container">
                    <button type="submit" class="btn">sign up</button>
                    <p class="link" onclick="switchForm('login')">already have an account ? sign in here</p>
                </div>
            </div>
        </div>

    </div>
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*:focus{
    outline: none;
}

body{
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    font-family: 'roboto', sans-serif;
}

.form-parent{
    width: 850px;
    height: 500px;
    background: #171717;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
}

.sign-up-img,
.sign-in-img{
    position: absolute;
    width: 50%;
    height: 100%;
    background: url(https://images.unsplash.com/photo-1621167013987-c35eb48944e7?crop=entropy&cs=srgb&fm=jpg&ixid=MnwxNDU4OXwwfDF8cmFuZG9tfHx8fHx8fHx8MTYyMTI1NTg4Mg&ixlib=rb-1.2.1&q=85);
    background-size: cover;
}

.sign-in-img{
    left: 50%;
    background: url(https://images.unsplash.com/photo-1620885309467-8a23fd78ac46?crop=entropy&cs=srgb&fm=jpg&ixid=MnwxNDU4OXwwfDF8cmFuZG9tfHx8fHx8fHx8MTYyMTI1NTgxNg&ixlib=rb-1.2.1&q=85);
    background-size: cover;
}

.form-container{
    position: relative;
    width: 50%;
    min-width: 300px;
    height: 100%;
    background: #171717;
    transition: 1s;
    left: 0;
    display: grid;
    overflow: hidden;
    grid-template-columns: repeat(2, calc(850px/2));
}

.form{
    width: 100%;
    height: 100%;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    transition: 1s;
}

.title{
    width: 100%;
    text-align: center;
    font-size: 60px;
    font-weight: 500;
    text-transform: capitalize;
    color: #fff;
}

.fields,
.submit-container{
    position: relative;
    width: 100%;
}

input{
    display: block;
    width: 100%;
    margin-bottom: 30px;
    padding: 5px 10px;
    text-transform: capitalize;
    border: none;
    border-radius: 5px;
    height: 30px;
    background: #0d0d0d;
    color: #fff;
}

::placeholder{
    color: #3f3f3f;
}

.btn{
    color: #fff;
    background: #0d0d0d;
    border: none;
    padding: 10px 40px;
    font-size: 15px;
    text-transform: capitalize;
    display: block;
    margin: auto;
    color: #3f3f3f;
    cursor: pointer;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: .5s;
}

.btn:hover,
input:focus{
    background: #000;
    color: #fff;
}

.link{
    text-align: center;
    color: #3f3f3f;
    text-transform: capitalize;
    text-decoration: underline;
    cursor: pointer;
    transition: .5s;
}

.link:hover{
    color: #fff;
}

#sign-up-form{
    margin-left: 50%;
}

#sign-up-form .title{
    margin-bottom: 30px;
}

@media screen and (max-width : 800px){
    .form-parent{
        width: 50vw;
        min-width: 300px;
        overflow: hidden;
    }
    .form-container{
        width: 100%;
        grid-template-columns: repeat(2, 100%);
    }
    .sign-up-img,
    .sign-in-img{
        display: none;
    }
}
const formContainer = document.querySelector('.form-container');
const loginForm = document.querySelector('#sign-in-form');
const registerFrom = document.querySelector('#sign-up-form');

const switchForm = (form) => {
    if(form == 'register'){
        if(window.innerWidth > 800){
            formContainer.style.left = `50%`;
        }
        loginForm.style.marginLeft = `-150%`;
        registerFrom.style.marginLeft = `-100%`;
    } else{
        if(window.innerWidth > 800){
            formContainer.style.left = `0%`;
        }
        loginForm.style.marginLeft = `0%`;
        registerFrom.style.marginLeft = `50%`;
    }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.