Skip to content
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

[feat] 유니버설 아일랜드 인터랙션 추가 (resolve #21) #42

Merged
merged 21 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f7d3f0a
[feat] 고속충전 인터랙션 뼈대 추가(WIP)
lybell-art Jul 27, 2024
fa7d4fa
[design] 현대 산스가 영문에만 적용되는 스타일 오류 수정
lybell-art Jul 27, 2024
3e841d9
[design] 고속충전 인터랙션 배터리 부분, 하단 부분 반응형에 맞게 스타일링
lybell-art Jul 27, 2024
ae40b88
[design] 배터리바 스타일 추가
lybell-art Jul 27, 2024
fbfa7d3
[design] 고속충전 인터랙션 하단 텍스트 스타일 추가
lybell-art Jul 27, 2024
f76a0c1
[feat] 다이얼 드래그 인터랙션 추가
lybell-art Jul 27, 2024
bf4e3b4
[chore] 린트 수정
lybell-art Jul 27, 2024
64029bb
[fix] 모바일 환경에서 드래그 액션이 동작하지 않는 버그 수정
lybell-art Jul 27, 2024
6bf19b1
[docs] Readme 백엔드 측과 동기화
lybell-art Jul 27, 2024
235cf52
[feat] 유니버설 아일랜드 인터랙션 제목설명 추가
lybell-art Jul 28, 2024
d1981d0
[design] 시트 위치 결정 (반응형으로)
lybell-art Jul 28, 2024
a9e87f0
[design] 각각의 이미지 width, height 고정하도록 수정
lybell-art Jul 28, 2024
951b81b
[feat] 유니버설 아일랜드 드래그 기능 구현
lybell-art Jul 28, 2024
120d9f8
[fix] 유니버설 아일랜드를 드래그할 때 커서가 🚫표시로 바뀌는 버그 수정
lybell-art Jul 28, 2024
754cfb7
[refactor] useDialDrag에 useMountDragEvent 훅 적용
lybell-art Jul 28, 2024
4907e5b
[feat] 휴대폰 드래그 기능 추가 (디버깅용으로 흰색 사각형으로 표시됨)
lybell-art Jul 28, 2024
6963983
[feat] 휴대폰 스냅 기능 추가
lybell-art Jul 28, 2024
1bece7a
[feat] 휴대폰 스냅시 충전 트랜지션 애니메이션 추가
lybell-art Jul 28, 2024
ca8b226
[fix] 간혹 dragend 이후 dragging 함수가 호출되는 버그 수정
lybell-art Jul 28, 2024
5cc492a
[chore] 누락된 커밋 추가
lybell-art Jul 28, 2024
047ca76
[chore] 린트 적용 및 프리티어 적용
lybell-art Jul 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 39 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Team6-AwesomeOrange

> 백엔드 레포는 여기로! => [백엔드 레포](https://github.com/softeerbootcamp4th/Team6-AwesomeOrange-BE)

## Contributors
| [@lybell-art](https://github.com/lybell-art) | [@darkdulgi](https://github.com/darkdulgi) | [@ahra1221](https://github.com/blaxsior) | [@win-luck](https://github.com/win-luck) |
| [@lybell-art](https://github.com/lybell-art) | [@darkdulgi](https://github.com/darkdulgi) | [@blaxsior](https://github.com/blaxsior) | [@win-luck](https://github.com/win-luck) |
|:---------------------------------------------------------:|:-------------------------------------------------------:|:-------------------------------------------------------:|:-----------------------------------------------------------------:|
| <img width="400" src="https://github.com/lybell-art.png"> | <img width="400" src="https://github.com/darkdulgi.png"> | <img width="400" src="https://github.com/blaxsior.png"> | <img width="400" src="https://github.com/win-luck.png"> |
| **Front-End** | **Front-End** | **Back-End** | **Back-End** |
Expand All @@ -14,21 +16,45 @@
[Convention](https://github.com/softeerbootcamp4th/Team6-AwesomeOrange-BE/wiki/%08%5BTeam-Convention%5D)

## Plan & Design Link
[Plan & Design Link(Figma)](https://www.figma.com/design/XieJv765qFmU9dFuQAG7tQ/%EC%96%B4%EC%8D%B8%EC%98%A4%EB%A0%8C%EC%A7%80_Hand-off_%EC%B5%9C%EC%A2%85(07%2F24)?node-id=33-1157)

## Schedule
**Front-End**

| 1주차 | 공통 커스텀 훅 및 인터랙션 인터페이스 추가, 메인 페이지의 인트로, 헤더, 차량 기본정보, QnA, 푸터 구현 |
| --- | --- |
| 2주차 | 인터랙션 페이지, 인터랙션 모달, 각각의 인터랙션 구현 |
| 3주차 | 각각의 인터랙션 구현, 기대평 구현 |
| 4주차 | 선착순 이벤트 구현, 시간 남을 시 어드민 페이지(로그인, 이벤트목록) 구현 |
| 5주차 | 어드민 페이지(이벤트 등록수정, 이벤트 관리, 기대평 관리) 구현 및 리팩토링, 발표자료 제작 |

**Back-End**

| 1주차 | JPA Entity 구축, 배포 등 인프라 설정, 유저 로그인, 선착순 이벤트 프로토타입 구현 |
| --- | --- |
| 2주차 | 기대평, 어드민 시스템, 가중치 반영 추첨 구현 (+단위 테스트) |
| 3주차 | 선착순 이벤트 최적화, 서비스 확장성 개선, 테스트코드 작성 |
| 4주차 | 버그 수정, 부하 테스트 기반 서비스 최적화 |

## Backlog
### Front-End
![image](https://github.com/user-attachments/assets/3fec291d-4aed-4f04-895b-7b2686aecc59)

### Back-End
![image](https://github.com/user-attachments/assets/d7444775-cbad-48a2-a278-fd73368a1b6e)

## ERD
<img width="686" alt="image" src="https://github.com/user-attachments/assets/eece7379-ad7b-4b29-b0bb-ae4bc20a7104">

## Tech Stack

### Front-End
- Javascript ES2020+
- React
- Tailwindcss
- Vite
- Zustand
<img src="https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=JavaScript&logoColor=black"><img src="https://img.shields.io/badge/React-61DAFB?style=for-the-badge&logo=React&logoColor=black"><img src="https://img.shields.io/badge/TailwindCSS-06B6D4?style=for-the-badge&logo=Tailwind CSS&logoColor=white"><img src="https://img.shields.io/badge/Vite-646CFF?style=for-the-badge&logo=Vite&logoColor=purple"><img src="https://img.shields.io/badge/Zustand-DDA0DD?style=for-the-badge&logo=Zustand&logoColor=purple">

### Back-End
- Spring Boot 3.2.2
- Java 17
- MySQL 8.0
- Redis
- AWS EC2
- AssertJ
- Docker
<img src="https://img.shields.io/badge/Spring Boot-6DB33F?style=for-the-badge&logo=Spring Boot&logoColor=black"><img src="https://img.shields.io/badge/MySQL-4479A1?style=for-the-badge&logo=MySQL&logoColor=black"><img src="https://img.shields.io/badge/Redis-FF4438?style=for-the-badge&logo=Redis&logoColor=black"><img src="https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=Docker&logoColor=black"><img src="https://img.shields.io/badge/Grafana-F46800?style=for-the-badge&logo=Grafana&logoColor=black"><img src="https://img.shields.io/badge/Apache JMeter-D22128?style=for-the-badge&logo=Apache JMeter&logoColor=black">

## Issue & TroubleShooting
[Issue & TroubleShooting](https://github.com/softeerbootcamp4th/Team6-AwesomeOrange-BE/wiki/%5BIssue-&-TroubleShooting%5D)

## Project Archeitecture
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --host",
"build": "vite build && npm run build:server && node prerender.js",
"build:client": "vite build",
"build:server": "vite build --ssr src/main-server.jsx --outDir dist-ssg",
Expand Down
Binary file added public/font/HyundaiSansTextKROTFBold.otf
Binary file not shown.
Binary file added public/font/HyundaiSansTextKROTFMedium.otf
Binary file not shown.
Binary file removed public/font/HyundaiSansTextOffice-Medium.ttf
Binary file not shown.
Binary file removed public/font/HyundaiSansTextOffice-Medium.woff
Binary file not shown.
10 changes: 10 additions & 0 deletions src/assets/property1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/property2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/property3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/property4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/property5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/assets/react.svg

This file was deleted.

32 changes: 32 additions & 0 deletions src/common/useMountDragEvent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useEffect } from "react";
import throttleRaf from "@/common/throttleRaf.js";

function useMountDragEvent(dragging, dragEnd) {
useEffect(() => {
const onPointerMove = throttleRaf((e) => {
const { clientX, clientY } = e;
dragging({ x: clientX, y: clientY });
});
const onTouchMove = throttleRaf((e) => {
const { clientX, clientY } = e.touches[0];
dragging({ x: clientX, y: clientY });
});

window.addEventListener("pointermove", onPointerMove);
window.addEventListener("pointerup", dragEnd);
window.addEventListener("pointercancel", dragEnd);
window.addEventListener("touchmove", onTouchMove);
window.addEventListener("touchend", dragEnd);
window.addEventListener("touchcancel", dragEnd);
return () => {
window.removeEventListener("pointermove", onPointerMove);
window.removeEventListener("pointerup", dragEnd);
window.removeEventListener("pointercancel", dragEnd);
window.removeEventListener("touchmove", onTouchMove);
window.removeEventListener("touchend", dragEnd);
window.removeEventListener("touchcancel", dragEnd);
};
}, [dragging, dragEnd]);
}

export default useMountDragEvent;
16 changes: 12 additions & 4 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@
@font-face {
font-family: "ds-digital";
src: url("/font/DS-DIGI.TTF") format("truetype");
font-display: swap;
}

@font-face {
font-family: "hdsans";
src:
url("/font/HyundaiSansTextOffice-Medium.woff") format("woff"),
url("/font/HyundaiSansTextOffice-Medium.ttf") format("truetype");
src: url("/font/HyundaiSansTextKROTFBold.otf") format("opentype");
font-weight: bold;
font-display: swap;
}

@font-face {
font-family: "hdsans";
src: url("/font/HyundaiSansTextKROTFMedium.otf") format("opentype");
font-weight: medium;
font-display: swap;
}

@layer base {
Expand All @@ -24,4 +32,4 @@
.graphic-gradient {
@apply bg-gradient-to-r from-[#3ED7BE] to-[#069AF8];
}
}
}
30 changes: 30 additions & 0 deletions src/interactions/fastCharge/BatteryProgressBar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import style from "./batteryStyle.module.css";

function getBatteryColor(progress) {
if (progress <= 50 / 330) return "bg-red-500";
if (progress <= 190 / 330) return "bg-yellow-400";
return "bg-blue-400";
}

function BatteryProgressBar({ progress }) {
const batteryColor = getBatteryColor(progress);
const batteryDynamicStyle = {
"--progress": progress,
};

return (
<div className="w-full h-full relative flex" style={batteryDynamicStyle}>
<div
className={`${batteryColor} ${style.left} h-full shrink-0 rounded-l-[20px]`}
></div>
<div
className={`${batteryColor} ${style.bar} h-full shrink-0 relative -left-1`}
></div>
<div
className={`${batteryColor} ${style.right} h-full shrink-0 relative -left-2 rounded-r-[20px]`}
></div>
</div>
);
}

export default BatteryProgressBar;
Loading