-
Notifications
You must be signed in to change notification settings - Fork 21
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
[모수진] Sprint4 #69
The head ref may contain hidden characters: "Basic-\uBAA8\uC218\uC9C4-sprint4"
[모수진] Sprint4 #69
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const emailForm = document.getElementById("email"); | ||
const pwdForm = document.getElementById("password"); | ||
|
||
|
||
|
||
emailForm.addEventListener("focusout", (event) => { | ||
var emailValue=emailForm.value; | ||
if(emailValue == '') { | ||
event.target.style.border='1px solid var(--red)'; | ||
//todo: print error message | ||
} | ||
else { | ||
event.target.style.border='0'; | ||
} | ||
}) | ||
pwdForm.addEventListener("focusout",(event) => { | ||
var pwdValue=pwdForm.value; | ||
if(pwdValue == '') { | ||
event.target.style.border='1px solid var(--red)'; | ||
// todo: print error message | ||
} | ||
else if(pwdValue.length < 8 ) { | ||
event.target.style.border='1px solid var(--red)'; //todo: print error message | ||
} | ||
else { | ||
event.target.style.border='0'; | ||
} | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,12 @@ | |
</head> | ||
<body> | ||
<main> | ||
<div class="main-con"> | ||
<div class="main-container"> | ||
<div class="logo"> | ||
<img src="./image/lg.png"> | ||
</div> | ||
<form method="post"> | ||
<div class="input-con"> | ||
<div class="input-container"> | ||
<div class="input-item"> | ||
<label for="email">이메일</label> | ||
<input | ||
|
@@ -49,11 +49,11 @@ | |
</div> | ||
</div> | ||
<div class="input-item"> | ||
<label for="passwordConfirmation">비밀번호 확인</label> | ||
<label for="passwordConfirm">비밀번호 확인</label> | ||
<div class="input-wrapper"> | ||
<input | ||
id="passwordConfirmation" | ||
name="passwordConfirmation" | ||
id="passwordConfirm" | ||
name="passwordConfirm" | ||
type="password" | ||
placeholder="비밀번호를 다시 한 번 입력해 주세요" | ||
/> | ||
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. validate 구현 2) |
||
|
@@ -77,5 +77,6 @@ | |
<div class="login">이미 회원이신가요? <a href="./login.html">로그인</a></div> | ||
</div> | ||
</main> | ||
<script src="./signup.js"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const emailForm = document.getElementById("email"); | ||
const nickForm = document.getElementById("nickname"); | ||
const pwdForm = document.getElementById("password"); | ||
const pwdConfirmForm = document.getElementById("passwordConfirm"); | ||
|
||
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. 여기에서 button 도 불러와서 button 의 disabled 속성을 validate 에 따라 변경해주면 button 도 금방 disable 처리 할 수 있겠죠? |
||
|
||
emailForm.addEventListener("focusout", (event) => { | ||
var emailValue=emailForm.value; | ||
if(emailValue == '') { | ||
event.target.style.border='1px solid var(--red)'; | ||
//todo: print error message | ||
} | ||
else { | ||
event.target.style.border='0'; | ||
} | ||
}) | ||
nickForm.addEventListener("focusout",(event) => { | ||
var nickValue=nickForm.value; | ||
if(nickValue == '') { | ||
event.target.style.border='1px solid var(--red)'; | ||
//todo: print error message | ||
} | ||
else { | ||
event.target.style.border='0'; | ||
} | ||
}) | ||
pwdForm.addEventListener("focusout",(event) => { | ||
var pwdValue=pwdForm.value; | ||
if(pwdValue == '') { | ||
event.target.style.border='1px solid var(--red)'; | ||
// todo: print error message | ||
} | ||
else if(pwdValue.length < 8 ) { | ||
event.target.style.border='1px solid var(--red)'; //todo: print error message | ||
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. validate 구현 1) 이렇게 validate 가 실패했을때 보통 하단에 보이지 않는 div 등을 추가해주었다가, error 가 생기면 그때 diaplay 를 보여지도록 변경하고 에러 메시지를 content 를 넣어주고! 그런형태로 해보시면 됩니다 :) 안되면 멘토링시간에 한 번 더 질문해주세요! |
||
} | ||
else { | ||
event.target.style.border='0'; | ||
} | ||
}) | ||
pwdConfirmForm.addEventListener("focusout",(event) => { | ||
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. focus out 보다는 blur 를 더 많이 사용하는것 같아요! |
||
var pwdValue=pwdForm.value; | ||
var pwdConfirmValue=pwdConfirmForm.value; | ||
if(pwdValue!=pwdConfirmValue) { | ||
event.target.style.border='1px solid var(--red)'; | ||
//todo: print error message | ||
} | ||
else { | ||
event.target.style.border='0'; | ||
} | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ header { | |
height:70px; | ||
padding:0; | ||
} | ||
.header-con { | ||
.header-container { | ||
float:left; | ||
height:100%; | ||
width:50%; | ||
|
@@ -60,7 +60,7 @@ header { | |
display: flex; | ||
justify-content: center; | ||
} | ||
.top-con{ | ||
.top-container { | ||
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. 적절하게 네이밍을 잘 변경해주셨군요 :) 좋습니다. |
||
width:1110px; | ||
height:340px; | ||
position: absolute; | ||
|
@@ -83,7 +83,7 @@ header { | |
float:left; | ||
width:746px; | ||
} | ||
#goitems { | ||
#go-items { | ||
width:357px; | ||
padding:16px 124px; | ||
border-radius: 40px; | ||
|
@@ -100,7 +100,7 @@ header { | |
display:flex; | ||
justify-content: center; | ||
} | ||
.show-con { | ||
.show-container { | ||
width:955px; | ||
height:444px; | ||
margin:0px auto; | ||
|
@@ -134,7 +134,7 @@ header { | |
font-weight: 700; | ||
line-height: 56px; | ||
} | ||
#show-des { | ||
#show-descript { | ||
font-size: 22px; | ||
font-weight: 500; | ||
line-height: 32px; | ||
|
@@ -147,7 +147,7 @@ header { | |
display: flex; | ||
justify-content: center; | ||
} | ||
.bottom-con{ | ||
.bottom-container { | ||
width:1110px; | ||
height:397px; | ||
position: absolute; | ||
|
@@ -176,16 +176,16 @@ header { | |
background-color: var(--gray900); | ||
padding-top: 32px; | ||
} | ||
.footer-con { | ||
.footer-container { | ||
width:1120px; | ||
margin:0px auto; | ||
display:flex; | ||
justify-content: space-between; | ||
} | ||
.footer-con .footer-text { | ||
.footer-container .footer-text { | ||
color:var(--gray400); | ||
} | ||
.footer-con .footer-text a { | ||
.footer-container .footer-text a { | ||
color:var(--gray200); | ||
} | ||
|
||
|
@@ -200,7 +200,7 @@ header { | |
#top-info { | ||
text-align: center; | ||
} | ||
.footer-con { | ||
.footer-container { | ||
width:90%; | ||
} | ||
} | ||
|
@@ -228,7 +228,7 @@ header { | |
display: flex; | ||
justify-content: center; | ||
} | ||
.top-con { | ||
.top-container { | ||
width:400px; | ||
height:100%; | ||
justify-content: center; | ||
|
@@ -240,7 +240,7 @@ header { | |
justify-content: center; | ||
top:50px; | ||
} | ||
#goitems { | ||
#go-items { | ||
display: block; | ||
margin:0 auto; | ||
} | ||
|
@@ -267,7 +267,7 @@ header { | |
display: flex; | ||
justify-content: center; | ||
} | ||
.bottom-con { | ||
.bottom-container { | ||
width:400px; | ||
height:100%; | ||
justify-content: center; | ||
|
@@ -284,7 +284,7 @@ header { | |
position:absolute; | ||
bottom:0px; | ||
} | ||
.footer-con { | ||
.footer-container { | ||
width:90%; | ||
} | ||
} |
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.
login, signup 둘 다 focus out 일때 로직을 잘 작성해주셨어요!
하지만 항상 우리 form 의 꽃은 submit 입니다! 다음번에는 submit event 를 핸들링하는 함수를 꼭 작성해봅시다 :)