-
Notifications
You must be signed in to change notification settings - Fork 1
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
[2주차 기본/심화 과제] 웨비들의 냠냠 🍰 창업🏠 손님을 모셔오자!🌈 #4
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
d680b98
docs : week2 1번과제 초기 세팅
simeunseo 118ad51
refactor : 1주차 과제 코드리뷰 반영
simeunseo dd3201e
refactor : js파일 연결, 디렉토리 구조 변경
simeunseo e3bd44d
refactor : ul 태그 삭제
simeunseo bef3c52
feat : template 태그 사용 샘플 테스트
simeunseo c66cce2
feat : 상수값으로 저장된 데이터로 card 동적 생성
simeunseo 00da546
docs : 상수값으로 저장된 데이터 사용 관련 주석 작성
simeunseo db96001
feat : 체크박스 필터링 - 항목 추가
simeunseo b58b25a
feat : 체크박스 필터링 - 항목 제거
simeunseo 7614451
refactor : 체크박스 필터링 모듈화
simeunseo 7e25f3f
feat: 체크박스 필터링 - 전체 체크(체크 해제 기능 제외)
simeunseo 04e79e2
feat,refactor : 체크박스 필터링 완료
simeunseo dc34286
docs : 카테고리 태그 템플릿 제작
simeunseo 9c68e7b
feat : 카테고리 태그 생성 및 삭제 기능
simeunseo d62dcf9
refactor : listToCard()에서 map을 forEach로
simeunseo 8723c14
style : cursor관련 css 수정
simeunseo 4a36bd8
style : nav 카테고리 메뉴 css 수정
simeunseo f83bd69
docs, style : tag modal 추가
simeunseo 6141332
feat : 브라우저 처음 실행시 전체 카테고리가 디폴트 선택
simeunseo b25f4cb
refactor : '전체' 카테고리 객체를 변수에 할당하여 사용
simeunseo d4ff5ed
style : header z-index 수정, 우측 nav 그림자 추가
simeunseo b6f0204
style : tag modal css
simeunseo 0ad4d7a
feat : modal 완료
simeunseo cd3af87
feat : modal overlay 클릭시 모달 close
simeunseo 3d38655
docs : addCard 페이지 기본 세팅
simeunseo d643760
feat : form 생성 및 입력값 저장(이미지 제외)
simeunseo 4de1ad9
style : 이미지 미리보기 및 form css 완료
simeunseo 35e2c8c
feat : 아이템 추가 기능 완료
simeunseo 2517278
style : 아이템 추가 페이지 썸네일 크기, 마진 수정
simeunseo a016b37
style : 카드 애니메이션
simeunseo 2aa2362
rename : 폴더 구조 정리
simeunseo 2c17434
fix : addCard 후 redirect url 수정
simeunseo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!DOCTYPE html> | ||
<html lang="ko"> | ||
<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>✠ 마라명가 ✠ : 새 상품 추가</title> | ||
<link rel="stylesheet" href="./style.css" /> | ||
</head> | ||
<body> | ||
<header> | ||
<a href="../home"><h1>✠ 마라명가 ✠</h1></a> | ||
<button type="button" id="header__button"> | ||
<i class="fa-solid fa-bars"></i> | ||
</button> | ||
<nav id="header__menu"> | ||
<h1>메뉴</h1> | ||
<div id="header__menu__list"> | ||
<a href="../home">홈</a> | ||
<a href="./">새 상품 추가</a> | ||
<a href="#">찜 목록</a> | ||
</div> | ||
</nav> | ||
</header> | ||
<main> | ||
<section class="heading"> | ||
<h1>당신이 원하는 그 어떤 재료도</h1> | ||
<h1>마라명가에서는 가능합니다.</h1> | ||
</section> | ||
<section class="form-container"> | ||
<form id="add-card-form" method="post" enctype="multipart/form-data"> | ||
<span> | ||
<label for="name"><h4>재료 이름</h4></label> | ||
<input required type="text" name="name" id="name" /> | ||
</span> | ||
<hr /> | ||
<span> | ||
<label for="hashtag"><h4>해시태그</h4></label> | ||
<input | ||
required | ||
placeholder="쉼표(,)로 구분" | ||
type="text" | ||
name="hashtag" | ||
id="hashtag" | ||
/> | ||
</span> | ||
<hr /> | ||
<span> | ||
<div class="button"> | ||
<label for="image"><h4>이미지 선택</h4></label> | ||
</div> | ||
<input | ||
required | ||
type="file" | ||
id="image" | ||
name="image" | ||
accept="image/*" | ||
/> | ||
</span> | ||
<hr /> | ||
<span> | ||
<label><h4>이미지 미리보기</h4></label> | ||
<img | ||
src="https://skg1891.cafe24.com/wp-content/uploads/2013/11/dummy-image-portrait.jpg" | ||
id="image-thumbnail" | ||
/> | ||
</span> | ||
<hr /> | ||
<span> | ||
<label for="cateogry"><h4>카테고리</h4></label> | ||
<select required name="category"> | ||
<option value="">=== 선택 ===</option> | ||
<option value="veg">채소</option> | ||
<option value="mush">버섯</option> | ||
<option value="tofu">두부</option> | ||
<option value="etc">기타</option> | ||
</select> | ||
</span> | ||
<button type="submit"><h2>재료 추가</h2></button> | ||
</form> | ||
</section> | ||
</main> | ||
<script | ||
src="https://kit.fontawesome.com/6fbcf91afd.js" | ||
crossorigin="anonymous" | ||
></script> | ||
<script defer type="module" src="./script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//select option의 vlaue를 카테고리명으로 변환하기 위한 객체 | ||
const CATEGORY_NAME = { | ||
veg: "채소", | ||
mush: "버섯", | ||
tofu: "두부", | ||
etc: "기타", | ||
}; | ||
|
||
const imageInput = document.getElementById("image"); | ||
const imageThumbNail = document.getElementById("image-thumbnail"); | ||
imageInput.addEventListener("input", () => { | ||
const reader = new FileReader(); | ||
reader.addEventListener("load", () => { | ||
imageThumbNail.src = reader.result; | ||
}); | ||
reader.readAsDataURL(imageInput.files[0]); | ||
}); | ||
|
||
const form = document.getElementById("add-card-form"); | ||
form.addEventListener("submit", (e) => { | ||
e.preventDefault(); | ||
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. 꼼꼼하다! |
||
const name = e.target.name.value; | ||
const hashTags = e.target.hashtag.value.replace(/ /g, "").split(","); | ||
const category = CATEGORY_NAME[e.target.category.value]; | ||
|
||
let localStorageData = JSON.parse(localStorage.getItem("item_data")); | ||
localStorageData.push({ | ||
category: category, | ||
name: name, | ||
tags: hashTags, | ||
img: imageThumbNail.src, | ||
}); | ||
|
||
localStorage.setItem("item_data", JSON.stringify(localStorageData)); | ||
|
||
location.replace("../home"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,231 @@ | ||
@import url("../common/reset.css"); | ||
|
||
/* CSS 전역 변수 선언 */ | ||
:root { | ||
--main-color: rgb(141, 19, 19); | ||
--shadow-color: rgba(0, 0, 0, 0.3); | ||
} | ||
|
||
/* animation */ | ||
@keyframes fadeInUp { | ||
0% { | ||
opacity: 0.2; | ||
transform: translateY(20%); | ||
} | ||
to { | ||
opacity: 1; | ||
transform: translateY(0%); | ||
} | ||
} | ||
|
||
@keyframes fadeInRight { | ||
0% { | ||
opacity: 0.2; | ||
transform: translateX(20%); | ||
} | ||
to { | ||
opacity: 1; | ||
transform: translateX(0%); | ||
} | ||
} | ||
|
||
/* font setting */ | ||
@font-face { | ||
font-family: "Pretendard-Regular"; | ||
src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff") | ||
format("woff"); | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: "EBSHunminjeongeumSBA"; | ||
src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_one@1.0/EBSHunminjeongeum.woff") | ||
format("woff"); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
|
||
body { | ||
font-family: "Pretendard-Regular", sans-serif; | ||
} | ||
|
||
h1 { | ||
font-family: EBSHunminjeongeumSBA; | ||
font-size: 2rem; | ||
} | ||
h2 { | ||
font-family: EBSHunminjeongeumSBA; | ||
font-size: 1.8rem; | ||
} | ||
h3, | ||
nav > a { | ||
font-size: 1.3rem; | ||
} | ||
small { | ||
font-size: 0.8rem; | ||
} | ||
|
||
/* header */ | ||
header > a { | ||
color: white; | ||
} | ||
header { | ||
padding: 2rem; | ||
width: -webkit-fill-available; | ||
|
||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
position: fixed; | ||
z-index: 2; | ||
|
||
background-color: var(--main-color); | ||
color: white; | ||
} | ||
|
||
#header__menu { | ||
display: none; | ||
box-shadow: -1rem 0 1rem var(--shadow-color); | ||
animation: fadeInRight 0.7s; | ||
} | ||
|
||
#header__button { | ||
width: 2rem; | ||
height: 2rem; | ||
} | ||
|
||
#header__button i { | ||
color: white; | ||
font-size: 1.2rem; | ||
} | ||
|
||
#header__button:hover + #header__menu, | ||
#header__menu:hover { | ||
display: block; | ||
} | ||
|
||
#header__menu { | ||
background-color: white; | ||
color: black; | ||
height: 100vh; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
padding: 2rem; | ||
width: 10rem; | ||
} | ||
|
||
#header__menu > h1 { | ||
padding-bottom: 2rem; | ||
font-weight: bold; | ||
} | ||
|
||
#header__menu__list { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
#header__menu a { | ||
color: black; | ||
padding-bottom: 1.5rem; | ||
cursor: pointer; | ||
} | ||
|
||
#header__menu a:hover { | ||
text-decoration-line: underline; | ||
text-decoration-style: wavy; | ||
text-decoration-color: var(--main-color); | ||
text-underline-offset: 0.3rem; | ||
} | ||
|
||
/* main */ | ||
|
||
main { | ||
padding-top: 8rem; | ||
text-align: center; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.heading { | ||
padding: 1rem 0; | ||
} | ||
|
||
/* form */ | ||
|
||
.form-container { | ||
background-color: white; | ||
color: black; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
|
||
padding: 3rem; | ||
margin: 2rem 6rem; | ||
|
||
border-radius: 1rem; | ||
|
||
animation: fadeInUp 1s; | ||
} | ||
|
||
form { | ||
width: 35vw; | ||
} | ||
|
||
form > span { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
width: 100%; | ||
} | ||
|
||
span > label { | ||
margin-right: 1rem; | ||
} | ||
|
||
form input[type="file"] { | ||
width: 10rem; | ||
} | ||
|
||
form > button { | ||
background-color: var(--main-color); | ||
color: white; | ||
|
||
border-radius: 1rem; | ||
|
||
padding: 1rem 0; | ||
margin-top: 2rem; | ||
|
||
width: 100%; | ||
} | ||
|
||
form > button > h2 { | ||
font-size: 1.3rem; | ||
} | ||
|
||
form > button:hover { | ||
background-color: black; | ||
transition-duration: 0.3s; | ||
} | ||
|
||
form > hr { | ||
margin: 1rem 0; | ||
border: 0.01rem solid var(--shadow-color); | ||
} | ||
|
||
#image-thumbnail { | ||
width: 14rem; | ||
} | ||
|
||
input, | ||
select { | ||
padding: 0.5rem; | ||
border-radius: 0.5rem; | ||
border: 0.1rem solid var(--shadow-color); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
시맨틱 태그 넘 좋다 !