364 Form / Codepen

Форма авторизации в стиле неоморфизм

Верстка формы авторизации и регистрации в стиле неоморфизм. При клике на вторую кнопку происходит плавная slide анимация смены полей формы с авторизации на регистрацию и наоборот.


HTML

<!DOCTYPE html>
<html lang="es" dir="ltr">
  <head>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="main.css"><link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800&display=swap" rel="stylesheet">
  </head>
  <body>
    <div class="main">
      <div class="container a-container" id="a-container">
        <form class="form" id="a-form" method="" action="">
          <h2 class="form_title title">Create Account</h2>
          <div class="form__icons"><img class="form__icon" src="dаta:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSI1MHB4IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48dGl0bGUvPjxkZWZzLz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIj48ZyBmaWxsPSIjMDAwMDAwIiBpZD0iRmFjZWJvb2siPjxwYXRoIGQ9Ik0yNSw1MCBDMzguODA3MTE5NCw1MCA1MCwzOC44MDcxMTk0IDUwLDI1IEM1MCwxMS4xOTI4ODA2IDM4LjgwNzExOTQsMCAyNSwwIEMxMS4xOTI4ODA2LDAgMCwxMS4xOTI4ODA2IDAsMjUgQzAsMzguODA3MTE5NCAxMS4xOTI4ODA2LDUwIDI1LDUw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uNjgyMjU1NCwyMC41NTQyOTc1IDI0LjUzOTE4OTQsMTguNDI0MzE2OCAyNC42ODIyNTU0LDIwLjU1NDI5NzUgWiBNMjQuNjgyMjU1NCwyMC41NTQyOTc1IiBpZD0iT3ZhbC0xIi8+PC9nPjwvZz48L3N2Zz4="></div><span class="form__span">or use email for registration</span>
          <input class="form__input" type="text" placeholder="Name">
          <input class="form__input" type="text" placeholder="Email">
          <input class="form__input" type="password" placeholder="Password">
          <button class="form__button button submit">SIGN UP</button>
        </form>
      </div>
      <div class="container b-container" id="b-container">
        <form class="form" id="b-form" method="" action="">
          <h2 class="form_title title">Sign in to Website</h2>
          <div class="form__icons"><img class="form__icon" src="dаta:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSI1MHB4IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48dGl0bGUvPjxkZWZzLz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIj48ZyBmaWxsPSIjMDAwMDAwIiBpZD0iRmFjZWJvb2siPjxwYXRoIGQ9Ik0yNSw1MCBDMzguODA3MTE5NCw1MCA1MCwzOC44MDcxMTk0IDUwLDI1IEM1MCwxMS4xOTI4ODA2IDM4LjgwNzExOTQsMCAyNSwwIEMxMS4xOTI4ODA2LDAgMCwxMS4xOTI4ODA2IDAsMjUgQzAsMzguODA3MTE5NCAxMS4xOTI4ODA2LDUwIDI1LDUwIFogTT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MjU1NCwyMC41NTQyOTc1IDI0LjUzOTE4OTQsMTguNDI0MzE2OCAyNC42ODIyNTU0LDIwLjU1NDI5NzUgWiBNMjQuNjgyMjU1NCwyMC41NTQyOTc1IiBpZD0iT3ZhbC0xIi8+PC9nPjwvZz48L3N2Zz4="></div><span class="form__span">or use your email account</span>
          <input class="form__input" type="text" placeholder="Email">
          <input class="form__input" type="password" placeholder="Password"><a class="form__link">Forgot your password?</a>
          <button class="form__button button submit">SIGN IN</button>
        </form>
      </div>
      <div class="switch" id="switch-cnt">
        <div class="switch__circle"></div>
        <div class="switch__circle switch__circle--t"></div>
        <div class="switch__container" id="switch-c1">
          <h2 class="switch__title title">Welcome Back !</h2>
          <p class="switch__description description">To keep connected with us please login with your personal info</p>
          <button class="switch__button button switch-btn">SIGN IN</button>
        </div>
        <div class="switch__container is-hidden" id="switch-c2">
          <h2 class="switch__title title">Hello Friend !</h2>
          <p class="switch__description description">Enter your personal details and start journey with us</p>
          <button class="switch__button button switch-btn">SIGN UP</button>
        </div>
      </div>
    </div>
    <script src="main.js"></script>
  </body>
</html>

SCSS

$bg: #EDF2F0;

$neu-1: #ecf0f3;
$neu-2: #d1d9e6;

$white: #f9f9f9;
$gray: #a0a5a8;
$black: #181818;

$purple: #4B70E2;


$transition: 1.25s;

*, *::after, *::before {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}
/* Generic */
body{
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    background-color: $neu-1;
    color: $gray;
}
/**/
.main{
    position: relative;
    width: 1000px;
    min-width: 1000px;
    min-height: 600px;
    height: 600px;
    padding: 25px;
    background-color: $neu-1;
    box-shadow:
        10px 10px 10px $neu-2,
        -10px -10px 10px $white;
    border-radius: 12px;
    overflow: hidden;
}
.container{
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;

    top: 0;
    width: 600px;
    height: 100%;
    padding: 25px;

    background-color: $neu-1;
    transition: $transition;
}
.form{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100%;

    &__icon{
        object-fit: contain;
        width: 30px;
        margin: 0 5px;
        opacity: .5;
        transition: .15s;

        &:hover{
            opacity: 1;
            transition: .15s;
            cursor: pointer;

        }
    }
    &__input{
        width: 350px;
        height: 40px;
        margin: 4px 0;

        padding-left: 25px;
        font-size: 13px;
        letter-spacing: .15px;
        border: none;
        outline: none;

        font-family: 'Montserrat', sans-serif;
        background-color: $neu-1;
        transition: .25s ease;
        border-radius: 8px;

        box-shadow:
            inset 2px 2px 4px $neu-2,
            inset -2px -2px 4px $white;

        &:focus{
            box-shadow:
                inset 4px 4px 4px $neu-2,
                inset -4px -4px 4px $white;
        }
    }
    &__span{
        margin-top: 30px;
        margin-bottom: 12px;
    }
    &__link{
        color: $black;
        font-size: 15px;
        margin-top: 25px;
        border-bottom: 1px solid $gray;
        line-height: 2;
    }
}
.title{
    font-size: 34px;
    font-weight: 700;
    line-height: 3;
    color: $black;
}
.description{
    font-size: 14px;
    letter-spacing: .25px;
    text-align: center;
    line-height: 1.6;
}
.button{
    width: 180px;
    height: 50px;
    border-radius: 25px;
    margin-top: 50px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1.15px;

    background-color: $purple;
    color: $white;
    box-shadow:
        8px 8px 16px $neu-2,
        -8px -8px 16px $white;

    border: none;
    outline: none;
}
/**/

.a-container{
    z-index: 100;
    left: calc(100% - 600px );
}
.b-container{
    left: calc(100% - 600px );
    z-index: 0;
}

.switch{
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 400px;

    padding: 50px;
    z-index: 200;
    transition: $transition;

    background-color: $neu-1;
    overflow: hidden;


    box-shadow:
        4px 4px 10px $neu-2,
        -4px -4px 10px $white;

    &__circle{
        position: absolute;
        width: 500px;
        height: 500px;
        border-radius: 50%;
        background-color: $neu-1;
        box-shadow:
            inset 8px 8px 12px $neu-2,
            inset -8px -8px 12px $white;

        bottom: -60%;
        left: -60%;
        transition: $transition;

        &--t{
            top: -30%;
            left: 60%;
            width: 300px;
            height: 300px;
        }
    }

    &__container{
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        position: absolute;
        width: 400px;
        padding: 50px 55px;

        transition: $transition ;

    }

    &__button{
        cursor: pointer;
        &:hover{
            box-shadow:
                6px 6px 10px $neu-2,
                -6px -6px 10px $white;
            transform: scale(.985);
            transition: .25s;
        }
        &:active,
        &:focus{
            box-shadow:
                2px 2px 6px $neu-2,
                -2px -2px 6px $white;
            transform: scale(.97);
            transition: .25s;
        }
    }
}
/**/
.is-txr{
    left: calc(100% - 400px );
    transition: $transition;
    transform-origin: left;
}
.is-txl{
    left: 0;
    transition: $transition;
    transform-origin: right;
}
.is-z200{
    z-index: 200;
    transition: $transition;
}
.is-hidden{
    visibility: hidden;
    opacity: 0;
    position: absolute;
    transition: $transition;
}
.is-gx{
    animation: is-gx $transition;
}
@keyframes is-gx {
    0%, 10%, 100%{ width: 400px; }
    30%, 50%{ width: 500px;}
}

JS

let switchCtn = document.querySelector("#switch-cnt");
let switchC1 = document.querySelector("#switch-c1");
let switchC2 = document.querySelector("#switch-c2");
let switchCircle = document.querySelectorAll(".switch__circle");
let switchBtn = document.querySelectorAll(".switch-btn");
let aContainer = document.querySelector("#a-container");
let bContainer = document.querySelector("#b-container");
let allButtons = document.querySelectorAll(".submit");

let getButtons = (e) => e.preventDefault()

let changeForm = (e) => {

    switchCtn.classList.add("is-gx");
    setTimeout(function(){
        switchCtn.classList.remove("is-gx");
    }, 1500)

    switchCtn.classList.toggle("is-txr");
    switchCircle[0].classList.toggle("is-txr");
    switchCircle[1].classList.toggle("is-txr");

    switchC1.classList.toggle("is-hidden");
    switchC2.classList.toggle("is-hidden");
    aContainer.classList.toggle("is-txl");
    bContainer.classList.toggle("is-txl");
    bContainer.classList.toggle("is-z200");
}

let mainF = (e) => {
    for (var i = 0; i < allButtons.length; i++)
        allButtons[i].addEventListener("click", getButtons );
    for (var i = 0; i < switchBtn.length; i++)
        switchBtn[i].addEventListener("click", changeForm)
}

window.addEventListener("load", mainF);

Комментарии

  • Facebook
  • Вконтакте

Похожие статьи