원티드 X 코드스테이츠 프리온보딩 프론트엔드 과정 기업과제 1번
담당했던 부분 : Header / Search Bar 컴포넌트 작성
✨ 주요 기능
사용자가 입력한 설문조사 결과값을 그래프로 보여줍니다.
검색결과에 따라 해당 기업이 존재할 시 해당기업과의 비교 그래프를 띄워줍니다.
탭 선택에 따른 바 그래프의 변화가 보여집니다.
사용자 데이터는 보라색으로 표시, 기업데이터는 노란색으로 표시됩니다.
펜타곤 그래프의 영역 표시는 반투명입니다.
첫 프로젝트여서 많이 긴장했는데 무려... vue를 써야만 했다...
엄청 복잡하게까지는 사용하지 않아도 됐지만 확실히 익숙하던 react가 아니어서 꽤나 많이 헤맸지만 그래도 팀원들이 많이 도와줘서 잘 해낼 수 있었다.
react-icons 같은 라이브러리를 사용할 수 없다보니 헤더 부분의 뒤로 가기 아이콘을 만들 때 벡터 이미지로 그리는 걸 참고해서 만들어봤는데 미세조정 부분에 있어서 꽤나 까다로웠다.
그래도 이번에 한 번 해봐서 많은 경험이 된 것 같다.
vue를 사용하는 부분에 있어서도 모두 처음에는 부담스러워 했었지만 서로서로 강의도 추천해주고 하며 팀원들끼리 많이 북돋아줘서 좋은 팀을 만난 것 같아 다행이라는 생각이 들었다.
// Header
<template>
<div class="header">
<div class="header-inner">
<div class="arr">
<div class="circle">
<span>
<p class="arrow"></p>
</span>
</div>
</div>
<span class="result">진단결과</span>
</div>
<button class="rediag" @click="reloadPage">다시 진단하기</button>
</div>
</template>
<script>
export default {
methods: {
reloadPage() {
window.location.reload();
}
}
};
</script>
<style>
.header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 360px;
height: 72px;
padding: 16px;
background-color: white;
border-bottom: 1px solid rgb(238, 237, 237);
}
.header-inner {
display: flex;
align-items: center;
}
/* 화살표 스타일링 */
.arr span {
position: relative;
}
.arr span::after {
content: '';
width: 6px;
height: 6px;
border-top: 2px solid #121212;
border-right: 2px solid #121212;
display: inline-block;
transform: rotate(225deg);
position: absolute;
top: 8px;
left: 7px;
}
.circle{
width: 28px;
height: 28px;
left: 0%;
right: 0%;
top: 0%;
bottom: 0%;
border: 2px solid #121212;
box-sizing: border-box;
border-radius: 80px;
margin-right: 15px;
}
.arrow{
width: 9px;
height: 10px;
position: absolute;
left: 7.5px;
right: 32.14%;
top: 2.5px;
bottom: 50%;
border-bottom: 2px solid #121212;
}
/* 진단결과 */
.result {
font-size: 24px;
font-weight: 700;
}
/* 다시 진단하기 */
.rediag {
font-size: 16px;
font-weight: 400;
color: #6E3CF9;
background-color: white;
border: none;
cursor: pointer;
}
</style>
// Search
<template>
<div class="search">
<div class="search-header">
<div class="search-result">
<span>검색 결과</span>
<span>></span>
</div>
<div class="remove-container">
<div class="company">{{ searchValue }}</div>
<button class="button-x" type="button" @click="deleteCompany"></button>
</div>
</div>
<input
type="text"
@keyup.enter="submit"
placeholder="기업명을 검색하세요"
/>
</div>
</template>
<script>
export default {
props: {
searchValue: String,
setSearchValue: Function,
deleteSearchvalue: Function,
},
methods: {
deleteCompany() {
this.deleteSearchvalue();
},
submit(e) {
this.setSearchValue(e.target.value);
},
},
};
</script>
<style>
.search {
display: flex;
flex-direction: column;
align-items: center;
}
.search-header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 360px;
height: 62px;
background-color: white;
}
.search-result {
margin-left: 6px;
}
/* 검색 결과 */
.search .search-header span:nth-child(1) {
color: #727272;
font-size: 16px;
font-weight: 700;
flex: none;
order: 0;
flex-grow: 0;
margin: 0px 8px;
}
/* > */
.search .search-header span:nth-child(2) {
color: #727272;
font-size: 16px;
font-weight: 700;
flex: none;
order: 1;
flex-grow: 0;
margin: 0px 8px;
}
.remove-container {
display: flex;
flex-direction: row;
margin-right: 16px;
}
/* 검색박스 */
input {
padding: 12px 16px;
width: 328px;
height: 48px;
left: 16px;
top: 134px;
background: #f8f8f8;
border: 1px solid #f2f2f2;
box-sizing: border-box;
border-radius: 4px;
}
/* 회사 이름 뜨는 곳 */
.company {
color: rgb(161, 159, 159);
margin-right: 10px;
margin-top: 8px;
}
/* x 버튼 */
.button-x {
margin-top: 11px;
padding: 8px;
width: 6px;
height: 6px;
position: relative;
background: #d2d2d2;
border-radius: 50%;
border: none;
cursor: pointer;
}
.button-x:before,
.button-x:after {
content: "";
width: 11px;
height: 2px;
position: absolute;
top: 48%;
border-radius: 5px;
background: white;
}
.button-x:before {
left: 2px;
transform: rotate(45deg);
}
.button-x:after {
right: 3px;
transform: rotate(-45deg);
}
</style>