Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions README.md

This file was deleted.

62 changes: 62 additions & 0 deletions css/common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* Reset CSS */
body {
margin: unset;
}
ul {
padding: unset;
margin: unset;
list-style: none;
}
h1,
p {
margin: unset;
font: unset;
}
a {
color: unset;
text-decoration: unset;
outline: unset;
}
input {
padding: unset;
}
button {
font: inherit;
border: none;
background: none;
padding: unset;
cursor: pointer;
}

img {
vertical-align: top;
}

fieldset {
margin: unset;
border: unset;
padding: unset;
}

/* CSS */
@font-face {
font-family: "SpoqaHanSansNeo-Regular";
src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/SpoqaHanSansNeo-Regular.woff")
format("woff");
font-weight: normal;
font-style: normal;
}

body {
background: #f2f2f2;
font-family: "SpoqaHanSansNeo-Regular";
}

.a11y-hidden {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
clip-path: polygon(0 0, 0 0, 0 0);
}
40 changes: 40 additions & 0 deletions css/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* CSS */

.container {
min-width: 0;
max-width: 500px;
padding: 30px;
margin: 280px auto 0;
border: 1px solid #c4c4c4;
border-radius: 5px;

background: #fff;

text-align: center;
}

.header {
margin-bottom: 28px;
}
.text {
margin-bottom: 32px;
}

.login-button {
display: block;

padding: 17px 0 15px;

border-radius: 5px;
background: #2f80ed;

color: #fff;
font-size: 22px;
font-weight: 700;
}

.login-button:hover,
.login-button:focus-visible {
outline: 3px solid #2668be;
outline-offset: 1px;
}
246 changes: 246 additions & 0 deletions css/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
body {
display: flex;
height: 100vh;
}

.login-container {
position: relative;

min-width: 0;
width: 520px;
margin: auto;

border: 1px solid #c4c4c4;
border-radius: 10px;

background: #fff;
}

/* 로그인 헤더 */
.login-header {
padding: 20px 0 18px;
border-bottom: 1px solid #c4c4c4;

text-align: center;
font-weight: 500;
}

/* 로그인 메인 */
.login-main {
padding: 26px 24px 30px;
}
.login-main > p {
font-size: 20px;
font-weight: 500;
margin-bottom: 24px;
}

/* 아이디,비밀번호 input */
.login-input-group {
margin: 10px 0 16px;
}
.login-input {
width: 100%;
padding: 15px 16px;

border: 1px solid #c4c4c4;
border-radius: 5px;

font-size: 16px;

box-sizing: border-box;
}

/* 아이디,비밀번호 경고 */
[class^="warnning"] {
display: none;

color: #f4492e;
font-size: 14px;
font-weight: 400;
}
.warnning-id {
margin: 6px 0 0 4px;
}
.warnning-user {
margin: 10px 0 0 4px;
}

/* 로그인 상태 유지 */
.login-state {
margin: 0 0 20px 4px;

color: #767676;
font-weight: 500;
}

/* 로그인 상태 유지 체크박스 */
.login-state label {
cursor: pointer;
}
.login-state input[type="checkbox"] + label::before,
.login-state input[type="checkbox"]:checked + label:before {
content: "";

display: inline-block;

width: 22px;
height: 22px;
margin-right: 8px;

background-repeat: no-repeat;
background-position: 50%;

vertical-align: bottom;
}
.login-state input[type="checkbox"] + label:before {
background-image: url("../imgs/login-checkbox.svg");
}
.login-state input[type="checkbox"]:checked + label:before {
background-image: url("../imgs/login-checked.svg");
}
Comment on lines +96 to +101
Copy link
Copy Markdown
Collaborator

@merrybmc merrybmc Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이미지 2개를 사용하여 커스텀 체크박스를 구현하셨네요.
이미지 크기가 작기도 하고 성능 상으로는 지금 당장 눈에 보이는 차이가 없겠지만
이미지를 로드하고 렌더링이 늦어지는 이슈는 있습니다.

저는 체크가 안된 이미지 하나를 svg로 추출하여 class를 주고 체크가 되었을 때
fill과 stroke를 통해서 색상에 변화를 주었어요.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

멘토링 받은 내용,
체크박스는 흔히 이미지로 커스텀해서 사용하고 용량이 작아서 큰 문제는 없을것 같다고 하시네요👍

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 맞아요.
체크박스는 용량이 작아서 이미지로 커스텀해서 사용해도 성능 이슈는 거의 없을 것 같아요. 👍


/* focus-visible */
.login-state input[type="checkbox"]:focus-visible + label::before {
border-radius: 50%;
box-shadow: 0 0 0 2px #2668be;
}
.login-state input[type="checkbox"]:focus-visible:checked + label:before {
border-radius: 50%;
box-shadow: 0 0 0 2px #10315c;
}

/* 로그인 버튼 */
.login-button {
width: 100%;
padding: 14px 0;
margin-bottom: 20px;

border-radius: 5px;
background: #2f80ed;

color: #fff;
font-size: 18px;
font-weight: 700;
}
.login-button:hover,
.login-button:focus-visible {
outline: 3px solid #2668be;
outline-offset: 1px;
}

/* 회원가입,아이디/비밀번호 찾기 */
.find-user-button-box {
text-align: center;
}
.find-user-button-box a {
color: #767676;
font-size: 14px;
}
.find-user-button-box span {
display: inline-block;
color: #767676;
margin: 0 12px;
}
.find-user-button-box a:hover {
text-decoration: underline;
text-underline-offset: 3px;
}
.find-user-button-box a:focus-visible {
outline: 2px solid #767676;
outline-offset: 2px;
}

/* 또는 */
.br {
display: flex;
gap: 13px;
align-items: center;
justify-content: center;
color: #767676;
font-size: 14px;
}
.br::before,
.br::after {
content: "";
display: inline-block;
background-color: #c4c4c4;
width: 210px;
height: 1px;
}

/* social login */
.social-login-container {
padding: 19px 24px 25px;
}

.social-login-group li:not(:last-of-type) {
margin-bottom: 10px;
}

.social-login-button {
display: block;

padding: 15px 0;
border-radius: 5px;

color: #767676;
text-align: center;

background-repeat: no-repeat;
background-size: 28px;
background-position: 12px center;
}
.google {
border: 1px solid #767676;
background-image: url(../imgs/google.svg);
}
.facebook {
border: 1px solid #2d9cdb;
background-image: url(../imgs/facebook.svg);
}
.naver {
border: 1px solid #00bf18;
background-image: url(../imgs/naver.svg);
}
.kakao {
border: 1px solid #f2c94c;
background-image: url(../imgs/kakao.svg);
}

.google:hover,
.google:focus-visible {
outline: 3px solid #767676;
outline-offset: 1px;
}
.facebook:hover,
.facebook:focus-visible {
outline: 3px solid #2d9cdb;
outline-offset: 1px;
}
.naver:hover,
.naver:focus-visible {
outline: 3px solid #00bf18;
outline-offset: 1px;
}
.kakao:hover,
.kakao:focus-visible {
outline: 3px solid #f2c94c;
outline-offset: 1px;
}

/* 로그인 닫기 버튼 위치 */
.login-close-button {
position: absolute;
top: 6px;
right: 8px;

padding: 12px 14px;
}
.login-close-button:focus-visible {
outline: 2px solid gray;
outline-offset: 2px;
}
.login-close-button img {
vertical-align: middle;
}
3 changes: 3 additions & 0 deletions imgs/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions imgs/google.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions imgs/kakao.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading