diff --git a/src/app/monitoring/page.tsx b/src/app/monitoring/page.tsx index f666430..bb5cfc8 100644 --- a/src/app/monitoring/page.tsx +++ b/src/app/monitoring/page.tsx @@ -426,7 +426,7 @@ export default function MonitoringPage() { .map(pos => ({ lat: pos.currentLocation.latitude, lng: pos.currentLocation.longitude, - label: pos.carId, + label: '', color: pos.color, isSelected: selectedCars.includes(pos.carId), vehicleId: pos.carId, diff --git a/src/components/common/EmployeeList.tsx b/src/components/common/EmployeeList.tsx index bf4c29e..9c32a9a 100644 --- a/src/components/common/EmployeeList.tsx +++ b/src/components/common/EmployeeList.tsx @@ -44,7 +44,11 @@ export default function EmployeeList(props: EmployeeListProps) { department: "", // API에서 부서 정보가 없음 email: user.email, phone: user.phone, - joinDate: user.createdAt ? new Date(user.createdAt).toLocaleDateString('ko-KR') : "", // createdAt을 가입일로 표시 + joinDate: user.createdAt ? new Date(user.createdAt).toLocaleDateString('ko-KR', { + year: 'numeric', + month: 'long', + day: 'numeric' + }) : "", // createdAt을 가입일로 표시 (년월일만) permissions: [] // API에서 권한 정보가 없음 }; }; diff --git a/src/components/map/CarMap.tsx b/src/components/map/CarMap.tsx index c0c16d1..3f87e19 100644 --- a/src/components/map/CarMap.tsx +++ b/src/components/map/CarMap.tsx @@ -221,8 +221,17 @@ export default function CarMap({ const newMarkers = markers.map(markerData => { // 마커 스타일 설정 const markerColor = markerData.color || '#3B82F6'; - const borderColor = markerData.isSelected ? '#000000' : '#FFFFFF'; + const selectedGradient = `linear-gradient(135deg, ${markerColor}, ${lightenColor(markerColor, 20)})`; + const normalGradient = `linear-gradient(135deg, ${darkenColor(markerColor, 10)}, ${markerColor})`; + const borderGlow = markerData.isSelected ? `0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 4px ${markerColor}80` : 'none'; + const boxShadow = markerData.isSelected + ? `0 2px 8px rgba(0,0,0,0.3), 0 0 16px ${markerColor}60, inset 0 1px 3px rgba(255,255,255,0.6)` + : '0 2px 4px rgba(0,0,0,0.3)'; + const transform = markerData.isSelected ? 'translateY(-2px)' : 'none'; + const borderColor = markerData.isSelected ? 'rgba(255,255,255,0.9)' : 'rgba(255,255,255,0.6)'; const borderWidth = markerData.isSelected ? 3 : 2; + const circleSize = markerData.isSelected ? 28 : 25; + const animation = markerData.isSelected ? 'pulse 2s infinite' : 'none'; const marker = new window.naver.maps.Marker({ position: new window.naver.maps.LatLng(markerData.lat, markerData.lng), @@ -230,25 +239,77 @@ export default function CarMap({ title: markerData.label, icon: { content: ` -
- ${markerData.label || ''} + font-size: ${markerData.isSelected ? '12px' : '10px'}; + font-weight: bold; + color: white; + text-shadow: 0 1px 2px rgba(0,0,0,0.5); + transform: ${transform}; + animation: ${animation}; + " + onmouseover="this.style.transform='scale(1.1) ${markerData.isSelected ? 'translateY(-2px)' : ''}'; + document.getElementById('tooltip-${markerData.vehicleId}').style.opacity='1'; + document.getElementById('tooltip-${markerData.vehicleId}').style.visibility='visible';" + onmouseout="this.style.transform='${markerData.isSelected ? 'translateY(-2px)' : 'scale(1)'}'; + document.getElementById('tooltip-${markerData.vehicleId}').style.opacity='0'; + document.getElementById('tooltip-${markerData.vehicleId}').style.visibility='hidden';" + > + ${markerData.vehicleId ? markerData.vehicleId.substring(0, 2) : ''} +
+ ${markerData.vehicleId} +
+
`, - anchor: new window.naver.maps.Point(15, 15) + anchor: new window.naver.maps.Point(circleSize/2, circleSize/2) } }); @@ -298,4 +359,35 @@ export default function CarMap({ ); +} + +// 색상 조정 유틸리티 함수 +function lightenColor(color: string, percent: number): string { + if (color.startsWith('#')) { + let r = parseInt(color.substring(1, 3), 16); + let g = parseInt(color.substring(3, 5), 16); + let b = parseInt(color.substring(5, 7), 16); + + r = Math.min(255, Math.floor(r * (1 + percent / 100))); + g = Math.min(255, Math.floor(g * (1 + percent / 100))); + b = Math.min(255, Math.floor(b * (1 + percent / 100))); + + return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`; + } + return color; +} + +function darkenColor(color: string, percent: number): string { + if (color.startsWith('#')) { + let r = parseInt(color.substring(1, 3), 16); + let g = parseInt(color.substring(3, 5), 16); + let b = parseInt(color.substring(5, 7), 16); + + r = Math.max(0, Math.floor(r * (1 - percent / 100))); + g = Math.max(0, Math.floor(g * (1 - percent / 100))); + b = Math.max(0, Math.floor(b * (1 - percent / 100))); + + return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`; + } + return color; } \ No newline at end of file