Skip to content

Basic 강동우 sprint4 #289

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

Open
wants to merge 12 commits into
base: Basic-강동우
Choose a base branch
from
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
12-Sprint-Mission/pandamarket/node_modules/.cache/default-development/index.pack
.DS_Store
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[submodule "12-Sprint-Mission"]
path = 12-Sprint-Mission
url = https://github.com/codeit-bootcamp-frontend/12-Sprint-Mission.git


3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5502
}
Empty file added FETCH_HEAD
Empty file.
40 changes: 40 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@media (max-width:1200px) {
body .Pc-size{
display: flex;
};





@media (min-width:768px) and (max-width:1199px) {
.Tablet-size.pandalogo{
margin-left:24px;
margin-left: 16px;
}
};

@media (min-width:375px) and (max-width:767px) {
.Moblet-size .loginbutton{
margin-left:24px;
margin-right:16px;
}
}

footer{
display: flex;
justify-content: space-between;
}


#footerMenu ,#socialMedia{

margin-left:100px;


}
#socialMedia img {
width: 20px;
height: 20px;
}
}
11 changes: 9 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,29 @@
<body>


<div class="Tabletsize">

<a href="/"
><img
src="images/logo/panda-market-logo.png"
alt="판다마켓 홈"
width="153"
/></a>
</div>

<!--
id 이름은 camelCase(단어 연결 시 맨 처음 단어를 제외한 단어들의 첫 글자를 대문자로 표기)로,
class 이름은 kebab-case(단어를 하이픈(-)으로 구분)를 사용하는 것을 권장합니다.
하지만 팀마다 선호하는 스타일이 다르기 때문에 naming convention 등 정해진 규칙에 따라 통일성 있게 사용하는 것이 더 중요합니다.
-->
<!-- 클릭 시 로그인 페이지로 이동. login.html 파일을 생성해 임시 페이지를 만들어 주세요. -->


<div class="Tabletsize">
<a href="login.html" id="loginLinkButton" class="button">로그인</a>
<div class="loginbutto">
<a href="login.html" id="loginLinkButton" class="button">로그인</a>
</div>
</div>

</header>
</div>
<!--
Expand Down
68 changes: 68 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
const form = document.getElementById("form");

form.addEventListener("focusin", (event) => {
event.target.style.background = "pink";
});
form.addEventListener("focusout", (event) => {
event.target.style.background = "";
});

$(document).ready(function () {
// 공통 오류 메시지 함수
function showErrorMessage(elementId, message) {
$("#" + elementId)
.text(message)
.css({
"color": "red",
"font-size": "12px",
"visibility": "visible"
});
}

function hideErrorMessage(elementId) {
$("#" + elementId).css("visibility", "hidden");
}

// 이메일 검증
$("#email").on("focusout", function () {
var email = $(this).val();
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;

if (email == "" || !emailPattern.test(email)) {
$(this).addClass("error");
showErrorMessage("error-message1", "잘못된 형식의 이메일입니다.");
} else {
$(this).removeClass("error");
hideErrorMessage("error-message1");
}
});

// 비밀번호 검증
$("#password").on("focusout", function () {
var password = $(this).val();
var passwordPattern = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/;

if (password === "" || !passwordPattern.test(password)) {
$(this).addClass("error");
showErrorMessage("error-message3", "비밀번호는 8자리 입력해주세요.");
} else {
$(this).removeClass("error");
hideErrorMessage("error-message3");
}
});

// 비밀번호 확인 검증
$("#confirm-password").on("focusout", function () {
var confirmPassword = $(this).val();
var password = $("#password").val();

if (confirmPassword === "") {
$(this).addClass("error");
showErrorMessage("error-message4", "비밀번호가 일치하지 않습니다.");

} else {
$(this).removeClass("error");
hideErrorMessage("error-message4");
}
});
});
Loading