Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaem03 committed Oct 3, 2024
2 parents 3258180 + f953edc commit 569c805
Show file tree
Hide file tree
Showing 23 changed files with 445 additions and 230 deletions.
13 changes: 1 addition & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>2024년 동국대학교 가을축제 부스사이트</title>
</head>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-0VZEZZB767"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag('config', import.meta.env.VITE_GA_MEASUREMENT_ID);
</script>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
Expand Down
1 change: 1 addition & 0 deletions src/apis/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import axios from "axios";
// Axios 인스턴스 생성
export const instance = axios.create({
baseURL: import.meta.env.VITE_BASE_URL,

withCredentials: true,
headers: {
"Content-Type": "application/json",
Expand Down
Binary file added src/assets/fonts/NanumSquareRoundB.ttf
Binary file not shown.
Binary file added src/assets/fonts/NanumSquareRoundEB.ttf
Binary file not shown.
Binary file added src/assets/fonts/NanumSquareRoundL.ttf
Binary file not shown.
Binary file added src/assets/fonts/NanumSquareRoundR.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions src/assets/images/X.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/searchIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/about/AboutCard/styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export const Name = styled.div`
justify-content: center;
padding-top:5px;
color: var(--, #000);
font-family: ${({ theme }) => theme.fonts.AppleSDGothicNeoR00['font-family']};
font-family: ${({ theme }) => theme.fonts.NanumSquareRoundB['font-family']};
font-size: 14px;
`
export const Department = styled.div`
display:flex;
justify-content: center;
color: var(--, #000);
font-family: ${({ theme }) => theme.fonts.AppleSDGothicNeoUL00['font-family']};
font-family: ${({ theme }) => theme.fonts.NanumSquareRoundR['font-family']};
font-size: 10px;
`

Expand Down Expand Up @@ -96,7 +96,7 @@ export const Role = styled.div`
position: relative;
display: flex;
justify-content: center;
font-family: ${({ theme }) => theme.fonts.AppleSDGothicNeoUL00['font-family']};
font-family: ${({ theme }) => theme.fonts.NanumSquareRoundR['font-family']};
font-size: 10px;
color: ${({ role }) => {
switch (role) {
Expand Down Expand Up @@ -133,7 +133,7 @@ export const Intro = styled.div`
flex-direction:row;
align-items:flex-end;
gap:5px;
font-family: ${({ theme }) => theme.fonts.AppleSDGothicNeoM00['font-family']};
font-family: ${({ theme }) => theme.fonts.NanumSquareRoundB['font-family']};
`;

export const IntroLine = styled.div`
Expand Down
8 changes: 4 additions & 4 deletions src/components/about/LikeLionLink/styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ export const Photo = styled.img`
export const MainMent = styled.div`
color: #000;
text-align: center;
font-family: ${({ theme }) => theme.fonts.AppleSDGothicNeoB00['font-family']};
font-family: ${({ theme }) => theme.fonts.NanumSquareRoundB['font-family']};
font-size: 16px;
`;

export const SubMent = styled.div`
color: #000;
font-family: ${({ theme }) => theme.fonts.AppleSDGothicNeoL00['font-family']};
font-family: ${({ theme }) => theme.fonts.NanumSquareRoundR['font-family']};
text-align: center;
font-size: 16px;
`;

export const LinkMent = styled.div`
color: #EB8F00;
font-family: ${({ theme }) => theme.fonts.AppleSDGothicNeoM00['font-family']};
font-family: ${({ theme }) => theme.fonts.NanumSquareRoundB['font-family']};
font-size: 10px;
`;

Expand Down Expand Up @@ -65,7 +65,7 @@ export const Link = styled.div`
right: -15px;
top: 22px;
color: #EB8F00;
font-family: ${({ theme }) => theme.fonts.AppleSDGothicNeoM00['font-family']};
font-family: ${({ theme }) => theme.fonts.NanumSquareRoundB['font-family']};
font-size: 16px;
&:hover ${LinkImg} {
Expand Down
37 changes: 37 additions & 0 deletions src/components/modal/Modal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as S from "./Styled";
import X from "../../assets/images/X.svg";

export const Modal = ({ onClose }) => {
const handleReviewClick = () => {
window.location.href = "https://naver.me/5mIX3maX";
};
return (
<S.ModalWrapper>
<S.ModalContent>
<S.CloseButton onClick={onClose}>
<img src={X} alt="닫기" />
</S.CloseButton>
<S.ModalHeader>
2024 동국대학교 가을축제 부스 서비스
<span className="B"> 부스끼리</span>
</S.ModalHeader>
<S.ModalLine /> {/* 선 추가 */}
<S.ModalText>
서비스 이용은 어떠셨나요?
<br />
<span className="Bold">
사이트 경험에 대한 후기를 남겨주세요!
</span>
</S.ModalText>
<S.ButtonWrapper>
<S.ReviewButton onClick={handleReviewClick}>
후기 남기러 가기
</S.ReviewButton>
<S.LaterButton onClick={onClose}>
나중에 진행하기
</S.LaterButton>
</S.ButtonWrapper>
</S.ModalContent>
</S.ModalWrapper>
);
};
114 changes: 114 additions & 0 deletions src/components/modal/Styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import styled from "styled-components";
export const ModalWrapper = styled.div`
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
`;

export const ModalContent = styled.div`
background-color: white;
border-radius: 10px;
padding: 20px;
width: 80%;
max-width: 400px; /* 모달 최대 너비 */
height: 200px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
text-align: center;
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
`;

export const ModalHeader = styled.h2`
color: var(--, #5f5f5f);
text-align: center;
font-size: 13px;
font-style: normal;
font-weight: 700;
line-height: 15px; /* 150% */
.B {
color: var(--, #5f5f5f);
font-size: 14px;
font-style: normal;
font-weight: 700;
line-height: 15px;
}
`;

export const ModalLine = styled.hr`
width: 100%;
border: none;
border-top: 1px solid #ccc;
margin: 20px 0;
`;

export const ModalText = styled.p`
font-size: 14px;
margin: 0;
line-height: 1.5;
font-weight: 400;
color: var(--, #000);
.Bold {
font-weight: 700;
}
`;

export const ButtonWrapper = styled.div`
display: flex;
justify-content: center;
margin-top: 25px;
gap: 10px;
`;

export const ReviewButton = styled.button`
display: flex;
width: 45%;
height: 26px;
padding: 4px 10px;
justify-content: center;
align-items: center;
gap: 10px;
flex-shrink: 0;
border-radius: 10px;
background: #ff9957;
color: #fff;
font-size: 12px;
`;

export const LaterButton = styled.button`
display: flex;
width: 45%;
height: 26px;
padding: 4px 10px;
justify-content: center;
align-items: center;
gap: 10px;
flex-shrink: 0;
border-radius: 10px;
background: #efefef;
color: var(--, #5f5f5f);
font-size: 12px;
`;

export const CloseButton = styled.button`
position: absolute;
top: 10px;
right: 10px;
background: none;
border: none;
cursor: pointer;
padding: 0;
img {
width: 15px;
height: 15px;
}
`;
4 changes: 3 additions & 1 deletion src/components/performanceP/starBar/StarBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export const StarBar = ({ onStarClick }) => {
strokeWidth="7"
fill="none"
strokeDasharray="346.36" /* 원의 둘레 = 2 * pi * 50 */
strokeDashoffset={selectedStar === index ? "0" : "346.36"}
strokeDashoffset={
selectedStar === index ? "0" : "346.36"
}
style={{
transition: "stroke-dashoffset 2s ease",
}}
Expand Down
64 changes: 64 additions & 0 deletions src/components/searchBar/SearchBar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React, { useState } from "react";
import axios from "axios";
import * as S from "./SearchBarStyle";
import searchIcon from "../../assets/images/searchIcon.svg";

const SearchBar = () => {
const [searchWord, setSearch] = useState("");
const [message, setMessage] = useState(""); //결과 확인 출력용 추후 삭제!!

const handleInput = (e) => {
setSearch(e.target.value);
};

const handleSearch = async () => {
try {
//우선 임시로 링크 걸어뒀습니다.
const response = await axios.get(`${import.meta.env.VITE_API_BASE_URL}/api/v1/booth/`, {
params: {
//필요하면 필터링
},
});

const data = response.data;
console.log("받아온 데이터:", data);

//검색어와 부스 name or host가 일치하는 항목 불러오기
const filteredData = data.filter((booth) =>
booth.name.includes(searchWord) || booth.host.includes(searchWord)
);

if (filteredData.length > 0) {
const boothIds = filteredData.map(booth => booth.id);
console.log("필터링된 데이터:", filteredData);
console.log("필터링된 부스 ID들:", boothIds); //부스 id 여기 있어유
setMessage(""); //검색 결과 있으면 해당 결과 출력
} else {
setMessage("검색 결과가 없습니다.");
}
} catch (err) {
console.error("데이터를 가져오는 중 오류 발생:", err);
setMessage("데이터를 가져오는 중 오류가 발생했습니다.");
}
};

return (
<>
<S.SearchContainer>
<S.SearchInput
type="text"
placeholder="전체 부스명 or 운영주체 검색"
value={searchWord}
onChange={handleInput}
/>
<S.SearchButton onClick={handleSearch}>
<S.SearchIcon src={searchIcon} alt="검색 이미지" />
</S.SearchButton>
</S.SearchContainer>
{/* {message && <p>{message}</p>} */}
</>

);
};

export default SearchBar;
32 changes: 32 additions & 0 deletions src/components/searchBar/SearchBarStyle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import styled from "styled-components";

export const SearchContainer = styled.div`
display: flex;
justify-content: center;
align-items: center;
width: 90%;
margin: 10px auto;
padding: 3px 10px;
border: 1px solid #DDDDDD;
border-radius: 10px;
`;

export const SearchInput = styled.input`
width: 100%;
padding: 10px;
border: none;
outline: none;
font-size: 12px;
color: #5F5F5F;
`;

export const SearchButton = styled.button`
cursor: pointer;
padding-top: 3px;
padding-right: 5px;
`;

export const SearchIcon = styled.img`
width: 12px;
height: 12px;
`;
6 changes: 3 additions & 3 deletions src/components/topBar/TopBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Leaf1 from "../../assets/images/leaf/leaf1.png";
import Leaf2 from "../../assets/images/leaf/leaf2.png";
import Leaf3 from "../../assets/images/leaf/leaf3.png";

export const TopBar = () => {
export const TopBar = ({ openModal }) => {
const [leaves, setLeaves] = useState([]);

// 랜덤한 Leaf 이미지를 생성하는 함수
Expand Down Expand Up @@ -42,7 +42,7 @@ export const TopBar = () => {
return (
<S.Background>
<S.MainText>동국대학교 가을축제 부스사이트</S.MainText>
<S.MainLogo src={Mainicon} />
<S.MainLogo src={Mainicon} onClick={openModal} />

{/* 랜덤으로 생성된 Leaves 출력 */}
{leaves.map((leaf) => (
Expand All @@ -57,4 +57,4 @@ export const TopBar = () => {
))}
</S.Background>
);
};
};
1 change: 0 additions & 1 deletion src/components/topBar/styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const Background = styled.div`
flex-direction: column;
width: 100%;
min-height: 120px;
height: 100%;
gap: 10px;
justify-content: center;
align-items: center;
Expand Down
Loading

0 comments on commit 569c805

Please sign in to comment.