-
Notifications
You must be signed in to change notification settings - Fork 26
[이은서] sprint4 #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "Basic-\uC774\uC740\uC11C-sprint4"
[이은서] sprint4 #88
Changes from all commits
e6dc011
89c3870
889eb66
4d33add
c0799fb
3205c59
69b3fda
efc4ca4
4498f08
82e72f6
6a84d28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ header, | |
| align-items: flex-end; | ||
| width: 100%; | ||
| height: 540px; | ||
| background-color: #CFE5FF; | ||
| background-color: #cfe5ff; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
|
|
@@ -34,14 +34,14 @@ main { | |
| margin-bottom: 120px; | ||
| } | ||
|
|
||
|
|
||
| footer { | ||
| width: 100%; | ||
| background-color: #111827; | ||
| padding: 32px 0 108px; | ||
| padding: 32px 0 108px; | ||
| } | ||
|
|
||
| .login-btn { | ||
| .login-btn, | ||
| .signup-btn { | ||
| display: inline-flex; | ||
| padding: 12px 23px; | ||
| background-color: var(--blue); | ||
|
|
@@ -56,42 +56,59 @@ footer { | |
| text-decoration: none; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| .header-btn { | ||
| display: inline-flex; | ||
| width: 357px; | ||
| height: 56px; | ||
| height: 56px; | ||
| background-color: var(--blue); | ||
| border-radius: 40px; | ||
| border-style: none; | ||
| border-style: none; | ||
| text-decoration: none; | ||
| color: var(--white); | ||
| font-size: 20px; | ||
| font-weight: 600; | ||
| font-weight: 600; | ||
| justify-content: center; | ||
| align-items: center; | ||
| min-width: 240px; | ||
| min-height: 48px; | ||
|
Comment on lines
72
to
73
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분도 이미 뷰포트에 맞게 고정 너비와 높이가 있어서, 제거해도 될 것 같아요. 일반적으로 버튼 UI는 범용적인 버튼 스타일일 경우에 패딩으로 조절하면 콘텐츠에 맞게 크기가 달라지고, 반응형에 좀 더 유연하다는 장점이 있습니다. 현재는 고정 너비로 잘 처리해 주셨지만, 예기치 못한 상황에서 레이아웃이 깨질 수도 있어요. |
||
| } | ||
| } | ||
|
|
||
| .title:hover ,.logo:hover{ | ||
| .eye { | ||
| position: absolute; | ||
| width: 24px; | ||
| height: 24px; | ||
| right: 16px; | ||
| top: 50%; | ||
| transform: translateY(-50%); | ||
| cursor: pointer; | ||
| } | ||
|
Comment on lines
+76
to
84
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| .login-btn:hover , .header-btn:hover { | ||
| .title:hover, | ||
| .logo:hover { | ||
| cursor: pointer; | ||
| background-color: #1967D6; | ||
| } | ||
|
|
||
| .login-btn:focus, .header-btn:focus { | ||
| background-color: #1251AA; | ||
| .login-btn:hover, | ||
| .header-btn:hover, | ||
| .signup-btn:hover { | ||
| cursor: pointer; | ||
| background-color: #1967d6; | ||
| } | ||
|
|
||
| .login-btn:disabled, .header-btn:disabled { | ||
| background-color: var(--gray400); | ||
| .login-btn:focus, | ||
| .header-btn:focus, | ||
| .signup-btn:focus { | ||
| background-color: #1251aa; | ||
| } | ||
|
|
||
| .login-btn:disabled, | ||
| .header-btn:disabled, | ||
| .signup-btn:disabled { | ||
| background-color: var(--gray400); | ||
| color: var(--white); | ||
| cursor: not-allowed; | ||
| pointer-events: none; | ||
|
Comment on lines
+109
to
+110
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
Comment on lines
+91
to
+111
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 하나의 클래스로 공통 속성을 적용해 보는 것은 어떨까요? .primary-btn:hover {
cursor: pointer;
background-color: #1967d6;
}이렇게 만들고, 해당 버튼만의 스타일과 공통 버튼 스타일을 적용해 보면 좋을 것 같아요. <!-- 로그인 버튼 예시 -->
<button class="login-btn primary-btn" type="submit" disabled>
로그인
</button> |
||
|
|
||
| @media (min-width: 768px) and (max-width: 1199px) { | ||
| nav { | ||
|
|
@@ -107,20 +124,17 @@ footer { | |
| } | ||
|
|
||
| main { | ||
| margin: 52px 0 82px; | ||
| margin: 52px 0 82px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding: 0 20px; | ||
| } | ||
| padding: 0 20px; | ||
| } | ||
|
|
||
|
|
||
| footer { | ||
| footer { | ||
| width: 100%; | ||
| height: 160px; | ||
| padding: 32px 104px 108px 104px; | ||
| padding: 32px 104px 108px 104px; | ||
| } | ||
|
|
||
|
|
||
| } | ||
|
|
||
| @media (max-width: 767px) { | ||
|
|
@@ -132,22 +146,20 @@ footer { | |
| padding: var(--login-btn-padding); | ||
| } | ||
|
|
||
|
|
||
| header { | ||
| height: 540px; | ||
| height: 540px; | ||
| } | ||
|
|
||
| main { | ||
| margin: 52px 0 82px; | ||
| margin: 52px 0 82px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding: 0 20px; | ||
| padding: 0 20px; | ||
| } | ||
| footer { | ||
|
|
||
| footer { | ||
| width: 100%; | ||
| height: 160px; | ||
| padding: 32px 32px 30px 32px; | ||
| padding: 32px 32px 30px 32px; | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,27 @@ | ||
| :root { | ||
| --gray900: #11827; | ||
| --gray800: #1F2937; | ||
| --gray800: #1f2937; | ||
| --gray700: #374151; | ||
| --gray600: #4B5563; | ||
| --gray500: #6B7280; | ||
| --gray400: #9CA3AF; | ||
| --gray200: #E5E7EB; | ||
| --gray100: #F3F4F6; | ||
| --blue :#3692FF; | ||
| --white: #FFFFFF; | ||
| --gray600: #4b5563; | ||
| --gray500: #6b7280; | ||
| --gray400: #9ca3af; | ||
| --gray200: #e5e7eb; | ||
| --gray100: #f3f4f6; | ||
| --blue: #3692ff; | ||
| --red: #f74747; | ||
| --white: #ffffff; | ||
|
|
||
| --font-size-14 : 0.875rem; | ||
| --font-size-16 : 1rem; | ||
| --font-size-18 : 1.125rem; | ||
| --font-size-20 : 1.25rem; | ||
| --font-size-24 : 1.5rem; | ||
| --font-size-32 : 2rem; | ||
| --font-size-40 : 2.5rem; | ||
| --font-size-14: 0.875rem; | ||
| --font-size-16: 1rem; | ||
| --font-size-18: 1.125rem; | ||
| --font-size-20: 1.25rem; | ||
| --font-size-24: 1.5rem; | ||
| --font-size-32: 2rem; | ||
| --font-size-40: 2.5rem; | ||
|
|
||
| --clamp-24: clamp(1rem, 2.5vw, 1.5rem); | ||
| --clamp-40: clamp(1.8rem, 3.5vw, 2.5rem); | ||
|
|
||
|
|
||
|
|
||
| --nav-title: 25.63px; | ||
| --login-btn-padding: 11px 43px; | ||
| --login-btn-padding: 11px 43px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,50 +1,76 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="ko"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Login</title> | ||
| <link rel="shortcut icon" href="/images/pandaicon.png" type="image/x-icon"> | ||
| <link rel="stylesheet" href="/common/reset.css"> | ||
| <link rel="stylesheet" href="/common/variables.css"> | ||
| <link rel="stylesheet" href="/common/common.css" > | ||
| <link rel="stylesheet" href="/login/style.css" > | ||
| </head> | ||
| <body> | ||
| <div class="content"> | ||
| <div class="title"> | ||
| <img class="logo" src="/images/pandaicon.png" alt="판다마켓로고"> | ||
| <a href="/"><h1>판다마켓</h1></a> | ||
| </div> | ||
| <form> | ||
| <div class="email"> | ||
| <label for="email">이메일</label> | ||
| <input class="email-input" name="email" type="email" placeholder="이메일을 입력해 주세요."> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Login</title> | ||
| <link | ||
| rel="shortcut icon" | ||
| href="/images/pandaicon.png" | ||
| type="image/x-icon" | ||
| /> | ||
| <link rel="stylesheet" href="/common/reset.css" /> | ||
| <link rel="stylesheet" href="/common/variables.css" /> | ||
| <link rel="stylesheet" href="/common/common.css" /> | ||
| <link rel="stylesheet" href="/login/style.css" /> | ||
| </head> | ||
| <body> | ||
| <div class="content"> | ||
| <div class="title"> | ||
| <img class="logo" src="/images/pandaicon.png" alt="판다마켓로고" /> | ||
| <a href="/"><h1>판다마켓</h1></a> | ||
| </div> | ||
|
Comment on lines
+18
to
22
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <div class="pwd"> | ||
| <label for="password">비밀번호</label> | ||
| <div class="pwd-content"> | ||
| <input class="pwd-input" name="password" type="password" placeholder="비밀번호를 입력해 주세요." > | ||
| <img class="eye" src="/images/btn_visibility_off.png"> | ||
| <form id="LoginForm"> | ||
| <div class="email"> | ||
| <label for="email">이메일</label> | ||
| <input | ||
| id="email" | ||
| class="email-input" | ||
| name="email" | ||
| type="email" | ||
| placeholder="이메일을 입력해 주세요." | ||
| /> | ||
| <div id="email-error" class="error-message"></div> | ||
| </div> | ||
| <div class="pwd"> | ||
| <label for="password">비밀번호</label> | ||
| <div class="pwd-content"> | ||
| <input | ||
| id="password" | ||
| class="pwd-input" | ||
| name="password" | ||
| type="password" | ||
| placeholder="비밀번호를 입력해 주세요." | ||
| /> | ||
| <img | ||
| class="eye" | ||
| id="eyeIcon" | ||
| src="/images/btn_visibility_off.png" | ||
| /> | ||
| </div> | ||
| <div id="password-error" class="error-message"></div> | ||
| </div> | ||
| <button class="login-btn" type="submit" disabled>로그인</button> | ||
| </form> | ||
| <div class="section"> | ||
| <div class="simple-login"> | ||
| <h3>간편 로그인 하기</h3> | ||
| </div> | ||
| <div class="sns"> | ||
| <a href="https://www.google.com/" | ||
| ><img src="/images/google.png" alt="google" | ||
| /></a> | ||
| <a href="https://www.kakaocorp.com/page/" | ||
| ><img src="/images/kakao.png" alt="kakao" | ||
| /></a> | ||
| </div> | ||
| </div> | ||
| <button class="login-btn" type="submit">로그인</button> | ||
| </form> | ||
| <div class="section"> | ||
| <div class="simple-login"> | ||
| <h3>간편 로그인 하기</h3> | ||
| </div> | ||
| <div class="sns"> | ||
| <a href="https://www.google.com/"><img src="/images/google.png" alt="google"></a> | ||
| <a href="https://www.kakaocorp.com/page/"><img src="/images/kakao.png" alt="kakao"></a> | ||
| </div> | ||
| </div> | ||
| <div class="sign-up-message"> | ||
| <div class="message"> | ||
| 판다 마켓이 처음이신가요? <a href="/signup/">회원가입</a> | ||
| <div class="sign-up-message"> | ||
| <div class="message"> | ||
| 판다 마켓이 처음이신가요? <a href="/signup/">회원가입</a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| </div> | ||
| </body> | ||
| </html> | ||
| <script type="module" src="/login/index.js"></script> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,71 @@ | ||||||||||||||||||||||
| import { | ||||||||||||||||||||||
| preventPasswordSpaces, | ||||||||||||||||||||||
| updateButtonState, | ||||||||||||||||||||||
| validateEmailInput, | ||||||||||||||||||||||
| validatePasswordInput, | ||||||||||||||||||||||
| togglePasswordVisiblity, | ||||||||||||||||||||||
| } from "../shared/form-utils.js"; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const emailInput = document.getElementById("email"); | ||||||||||||||||||||||
| const emailError = document.getElementById("email-error"); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const passwordInput = document.getElementById("password"); | ||||||||||||||||||||||
| const passwordError = document.getElementById("password-error"); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const loginBtn = document.querySelector(".login-btn"); | ||||||||||||||||||||||
| const loginForm = document.getElementById("LoginForm"); | ||||||||||||||||||||||
| const eyeIcon = document.getElementById("eyeIcon"); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| function validateEmail() { | ||||||||||||||||||||||
| return validateEmailInput(emailInput, emailError); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| function validatePassword() { | ||||||||||||||||||||||
| return validatePasswordInput(passwordInput, passwordError); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| function eyeIconClickHandler() { | ||||||||||||||||||||||
| togglePasswordVisiblity(passwordInput, eyeIcon); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| function updateLoginBtnState() { | ||||||||||||||||||||||
| return updateButtonState({ | ||||||||||||||||||||||
| inputs: [emailInput, passwordInput], | ||||||||||||||||||||||
| errors: [emailError, passwordError], | ||||||||||||||||||||||
| button: loginBtn, | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| emailInput.addEventListener("blur", () => { | ||||||||||||||||||||||
| validateEmail(); | ||||||||||||||||||||||
| updateLoginBtnState(); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| passwordInput.addEventListener("blur", () => { | ||||||||||||||||||||||
| validatePassword(); | ||||||||||||||||||||||
| updateLoginBtnState(); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| emailInput.addEventListener("input", () => { | ||||||||||||||||||||||
| validateEmail(); | ||||||||||||||||||||||
| updateLoginBtnState(); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| passwordInput.addEventListener("input", () => { | ||||||||||||||||||||||
| validatePassword(); | ||||||||||||||||||||||
| updateLoginBtnState(); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| eyeIcon.addEventListener("click", () => { | ||||||||||||||||||||||
| eyeIconClickHandler(); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
Comment on lines
+59
to
+61
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
또는, 래핑 함수를 따로 만들지 않고, 리스너의 콜백에서 처리하는 방법도 있겠네요.
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| loginForm.addEventListener("submit", (e) => { | ||||||||||||||||||||||
| e.preventDefault(); | ||||||||||||||||||||||
| if (!loginBtn.disabled) { | ||||||||||||||||||||||
| window.location.href = "/items"; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| preventPasswordSpaces(passwordInput); | ||||||||||||||||||||||
| updateLoginBtnState(); // 초기 상태 업데이트 | ||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이미 |
||||||||||||||||||||||



There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
불필요한 속성은 최대한 줄여주시는 게 좋아요! 🙂
현재 클래스네임에는 해당 속성이 필요하지 않아요. 사용한 태그에는 보더 스타일이 적용되어 있지 않고,
text-decoration: none;은 이미 common.css 파일에 적용되어 있어요.