비전공자 개발일기

Liquid Drop Login page 본문

HTML _CSS

Liquid Drop Login page

HiroDaegu 2022. 11. 26. 12:45
728x90
SMALL

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LIQUID DROP LOGIN PAGE</title>
    <link rel="stylesheet" href="style.css">
    <script defer src="main.js"></script>
</head>
<body>
    <div class="container">
        <div class="drop">
            <div class="content">
                <h2>Sign in</h2>
                <form>
                    <div class="inputBox">
                        <input type="text" placeholder="Username" class="username">
                    </div>
                    <div class="inputBox">
                        <input type="password" placeholder="Password">
                    </div>
                    <div class="inputBox">
                        <input type="submit" class="loginBTN" value="Login">
                    </div>
                </form>
            </div>
        </div>
        <a href="#" class="btns forgetpw">Forget Password</a>
        <a href="#" class="btns signup">Sign up</a>
    </div>
</body>
</html>
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #EFF0F4;
}

.container {
    position: relative;
    left: -80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container .drop {
    position: relative;
    width: 350px;
    height: 350px;
    box-shadow: inset 20px 20px 20px rgba(0, 0, 0, .05), 
    25px 35px 20px rgba(0, 0, 0, .05),
    25px 30px 30px rgba(0, 0, 0, .05),
    inset -20px -20px 25px rgba(255, 255, 255, .9);
    transition: .5s;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 52% 48% 33% 67% / 38% 45% 55% 62%;
}

.container .drop:hover {
    border-radius: 50%;
}

.container .drop::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 85px;
    width: 35px;
    height: 35px;
    background-color: #FFF;
    border-radius: 50%;
    opacity: .9;
}

.container .drop::after {
    content: '';
    position: absolute;
    top: 90px;
    left: 110px;
    width: 15px;
    height: 15px;
    background-color: #FFF;
    border-radius: 50%;
    opacity: .9;
}

.container .drop .content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 40px;
    gap: 15px;
}

.container .drop .content h2 {
    position: relative;
    color: #333;
    font-size: 1.5em;
}

.container .drop .content form {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.container .drop .content form .inputBox {
    position: relative;
    width: 225px;
    box-shadow: inset 2px 5px 10px rgba(0, 0, 0, .1),
    inset -2px -5px 10px  rgba(255, 255, 255, 1),
    15px 15px 10px rgba(0, 0, 0, .05),
    15px 10px 15px rgba(0, 0, 0, .025);
    border-radius: 25px;
}

.container .drop .content form .inputBox::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 65%;
    height: 5px;
    background-color: rgba(255, 255, 255, .5);
    border-radius: 5px;
}

.container .drop .content form .inputBox input {
    border: none;
    outline: none;
    background-color: transparent;
    width: 100%;
    font-size: 1em;
    padding: 10px 15px;
}

.container .drop .content form .inputBox input[type='submit'] {
    color: #FFF;
    text-transform: uppercase;
    font-size: 1em;
    cursor: pointer;
    letter-spacing: .1em;
    font-weight: 500;
}

.container .drop .content form .inputBox:last-child {
    width: 120px;
    background-color: #FF0F5B;
    box-shadow: inset 2px 5px 10px rgba(0, 0, 0, .1),
    15px 15px 10px rgba(0, 0, 0, .05),
    15px 10px 15px rgba(0, 0, 0, .025);
    transition: .5s;
}

.container .drop .content form .inputBox:last-child:hover {
    width: 150px;
}

.container .btns {
    position: absolute;
    right: -120px;
    bottom: 0;
    width: 120px;
    height: 120px;
    background-color: #C61DFF;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: #FFF;
    line-height: 1.2em;
    letter-spacing: .1em;
    font-size: .8em;
    transition: .25s;
    text-align: center;
    box-shadow: inset 10px 10px 10px rgba(190, 1, 254, .05), 
    15px 25px 10px rgba(190, 1, 254, .1),
    15px 20px 20px rgba(190, 1, 254, .1),
    inset -10px -10px 15px rgba(255, 255, 255, .5);
    border-radius: 44% 56% 65% 35% / 57% 58% 42% 43%;
}

.container .btns::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 30px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #FFF;
    opacity: .45;
}

.container .btns:hover {
    border-radius: 50%;
}

.container .signup {
    bottom: 150px;
    right: -120px;
    width: 80px;
    height: 80px;
    border-radius: 49% 51% 52% 48% / 63% 59% 41% 37%;
    background-color: #01B4FF;
    box-shadow: inset 10px 10px 10px rgba(1, 180, 255, .05), 
    15px 25px 10px rgba(1, 180, 255, .1),
    15px 20px 20px rgba(1, 180, 255, .1),
    inset -10px -10px 15px rgba(255, 255, 255, .5);
}

.container .signup::before {
    left: 20px;
    width: 15px;
    height: 15px;
}
let loginBTN = document.querySelector(".loginBTN");
let username = document.querySelector(".username");

loginBTN.addEventListener("click", () => {
  alert(`${username.value}님 환영합니다`);
});

let signUP = document.querySelector(".signup");
signUP.addEventListener("click", () => {
  alert(`${signUP.innerHTML}`);
});

let forgetPW = document.querySelector(".forgetpw");
forgetPW.addEventListener("click", () => {
  alert(`${forgetPW.innerHTML}`);
});
728x90
LIST

'HTML _CSS' 카테고리의 다른 글

Input Label Animation  (0) 2022.11.28
Aspect Ratio Calculator  (0) 2022.11.27
Rotating border  (0) 2022.11.23
Postage Stamp Cutout  (0) 2022.11.22
Plus Neon BTN  (0) 2022.11.21