- 📱 PWA 지원: 홈화면 추가 가능한 Progressive Web App - 🎨 M-Project 색상 스키마: 하늘색, 주황색, 회색, 흰색 일관된 디자인 - 📊 대시보드: 데스크톱 캘린더 뷰 + 모바일 일일 뷰 반응형 디자인 - 📥 분류 센터: Gmail 스타일 받은편지함으로 스마트 분류 시스템 - 🤖 AI 분류 제안: 키워드 기반 자동 분류 제안 및 일괄 처리 - 📷 업로드 모달: 데스크톱(파일 선택) + 모바일(카메라/갤러리) 최적화 - 🏷️ 3가지 분류: Todo(시작일), 캘린더(마감일), 체크리스트(무기한) - 📋 체크리스트: 진행률 표시 및 완료 토글 기능 - 🔄 시놀로지 연동 준비: 메일플러스 연동을 위한 구조 설계 - 📱 반응형 UI: 모든 페이지 모바일 최적화 완료
401 lines
17 KiB
HTML
401 lines
17 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>캘린더 - 마감 기한이 있는 일들</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<style>
|
|
:root {
|
|
--primary: #3b82f6; /* 하늘색 */
|
|
--primary-dark: #2563eb; /* 진한 하늘색 */
|
|
--success: #10b981; /* 초록색 */
|
|
--warning: #f59e0b; /* 주황색 */
|
|
--danger: #ef4444; /* 빨간색 */
|
|
--gray-50: #f9fafb; /* 연한 회색 */
|
|
--gray-100: #f3f4f6; /* 회색 */
|
|
--gray-200: #e5e7eb; /* 중간 회색 */
|
|
--gray-300: #d1d5db; /* 진한 회색 */
|
|
}
|
|
|
|
body {
|
|
background-color: var(--gray-50);
|
|
}
|
|
|
|
.btn-primary {
|
|
background-color: var(--primary);
|
|
color: white;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background-color: var(--primary-dark);
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
|
|
}
|
|
|
|
.btn-warning {
|
|
background-color: var(--warning);
|
|
color: white;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.btn-warning:hover {
|
|
background-color: #d97706;
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
|
|
}
|
|
|
|
.calendar-item {
|
|
background: white;
|
|
border-radius: 0.75rem;
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.calendar-item:hover {
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.deadline-urgent {
|
|
border-left: 4px solid #ef4444;
|
|
}
|
|
|
|
.deadline-warning {
|
|
border-left: 4px solid #f59e0b;
|
|
}
|
|
|
|
.deadline-normal {
|
|
border-left: 4px solid #3b82f6;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="min-h-screen">
|
|
<!-- 헤더 -->
|
|
<header class="bg-white shadow-sm border-b">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex justify-between items-center h-16">
|
|
<div class="flex items-center">
|
|
<button onclick="goBack()" class="mr-4 text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-arrow-left text-xl"></i>
|
|
</button>
|
|
<i class="fas fa-calendar-times text-2xl text-orange-500 mr-3"></i>
|
|
<h1 class="text-xl font-semibold text-gray-800">캘린더</h1>
|
|
<span class="ml-3 text-sm text-gray-500">마감 기한이 있는 일들</span>
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-4">
|
|
<button onclick="goToDashboard()" class="text-blue-600 hover:text-blue-800 font-medium">
|
|
<i class="fas fa-chart-line mr-1"></i>대시보드
|
|
</button>
|
|
<span class="text-sm text-gray-600" id="currentUser"></span>
|
|
<button onclick="logout()" class="text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-sign-out-alt"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- 메인 컨텐츠 -->
|
|
<main class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
|
<!-- 페이지 설명 -->
|
|
<div class="bg-orange-50 rounded-xl p-6 mb-8">
|
|
<div class="flex items-center mb-4">
|
|
<i class="fas fa-calendar-times text-2xl text-orange-600 mr-3"></i>
|
|
<h2 class="text-xl font-semibold text-orange-900">캘린더 관리</h2>
|
|
</div>
|
|
<p class="text-orange-800 mb-4">
|
|
마감 기한이 있는 일들을 관리합니다. 우선순위에 따라 계획적으로 진행해보세요.
|
|
</p>
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm">
|
|
<div class="bg-white rounded-lg p-3">
|
|
<div class="font-medium text-red-900 mb-1">🚨 긴급</div>
|
|
<div class="text-red-700">3일 이내 마감</div>
|
|
</div>
|
|
<div class="bg-white rounded-lg p-3">
|
|
<div class="font-medium text-orange-900 mb-1">⚠️ 주의</div>
|
|
<div class="text-orange-700">1주일 이내 마감</div>
|
|
</div>
|
|
<div class="bg-white rounded-lg p-3">
|
|
<div class="font-medium text-blue-900 mb-1">📅 여유</div>
|
|
<div class="text-blue-700">1주일 이상 남음</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 필터 및 정렬 -->
|
|
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
|
<div class="flex flex-col md:flex-row justify-between items-start md:items-center gap-4">
|
|
<div class="flex space-x-1 bg-gray-100 rounded-lg p-1">
|
|
<button onclick="filterCalendar('all')" class="filter-tab active px-4 py-2 rounded text-sm font-medium">전체</button>
|
|
<button onclick="filterCalendar('urgent')" class="filter-tab px-4 py-2 rounded text-sm font-medium">긴급</button>
|
|
<button onclick="filterCalendar('warning')" class="filter-tab px-4 py-2 rounded text-sm font-medium">주의</button>
|
|
<button onclick="filterCalendar('normal')" class="filter-tab px-4 py-2 rounded text-sm font-medium">여유</button>
|
|
<button onclick="filterCalendar('completed')" class="filter-tab px-4 py-2 rounded text-sm font-medium">완료</button>
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-3">
|
|
<label class="text-sm text-gray-600">정렬:</label>
|
|
<select id="sortBy" class="border border-gray-300 rounded-lg px-3 py-1 text-sm">
|
|
<option value="due_date">마감일 순</option>
|
|
<option value="priority">우선순위 순</option>
|
|
<option value="created_at">등록일 순</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 캘린더 목록 -->
|
|
<div class="bg-white rounded-xl shadow-sm">
|
|
<div class="p-6 border-b">
|
|
<h3 class="text-lg font-semibold text-gray-800">
|
|
<i class="fas fa-list text-orange-500 mr-2"></i>마감 기한별 목록
|
|
</h3>
|
|
</div>
|
|
|
|
<div id="calendarList" class="divide-y divide-gray-100">
|
|
<!-- 캘린더 항목들이 여기에 동적으로 추가됩니다 -->
|
|
</div>
|
|
|
|
<div id="emptyState" class="p-12 text-center text-gray-500">
|
|
<i class="fas fa-calendar-times text-4xl mb-4 opacity-50"></i>
|
|
<p>아직 마감 기한이 설정된 일이 없습니다.</p>
|
|
<p class="text-sm">메인 페이지에서 항목을 등록하고 마감 기한을 설정해보세요!</p>
|
|
<button onclick="goBack()" class="mt-4 btn-warning px-6 py-2 rounded-lg">
|
|
<i class="fas fa-arrow-left mr-2"></i>메인으로 돌아가기
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- JavaScript -->
|
|
<script src="static/js/auth.js"></script>
|
|
<script>
|
|
// 페이지 초기화
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
checkAuthStatus();
|
|
loadCalendarItems();
|
|
});
|
|
|
|
// 뒤로 가기
|
|
function goBack() {
|
|
window.location.href = 'index.html';
|
|
}
|
|
|
|
// 캘린더 항목 로드
|
|
function loadCalendarItems() {
|
|
// 임시 데이터 (실제로는 API에서 가져옴)
|
|
const calendarItems = [
|
|
{
|
|
id: 1,
|
|
content: '월말 보고서 제출',
|
|
photo: null,
|
|
due_date: '2024-01-25',
|
|
status: 'active',
|
|
priority: 'urgent',
|
|
created_at: '2024-01-15'
|
|
},
|
|
{
|
|
id: 2,
|
|
content: '클라이언트 미팅 자료 준비',
|
|
photo: null,
|
|
due_date: '2024-01-30',
|
|
status: 'active',
|
|
priority: 'warning',
|
|
created_at: '2024-01-16'
|
|
}
|
|
];
|
|
|
|
renderCalendarItems(calendarItems);
|
|
}
|
|
|
|
// 캘린더 항목 렌더링
|
|
function renderCalendarItems(items) {
|
|
const calendarList = document.getElementById('calendarList');
|
|
const emptyState = document.getElementById('emptyState');
|
|
|
|
if (items.length === 0) {
|
|
calendarList.innerHTML = '';
|
|
emptyState.classList.remove('hidden');
|
|
return;
|
|
}
|
|
|
|
emptyState.classList.add('hidden');
|
|
|
|
calendarList.innerHTML = items.map(item => `
|
|
<div class="calendar-item p-6 ${getDeadlineClass(item.priority)}">
|
|
<div class="flex items-start space-x-4">
|
|
<!-- 우선순위 아이콘 -->
|
|
<div class="flex-shrink-0 mt-1">
|
|
<div class="w-8 h-8 rounded-full flex items-center justify-center ${getPriorityColor(item.priority)}">
|
|
<i class="fas ${getPriorityIcon(item.priority)} text-sm"></i>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 사진 (있는 경우) -->
|
|
${item.photo ? `
|
|
<div class="flex-shrink-0">
|
|
<img src="${item.photo}" class="w-16 h-16 object-cover rounded-lg" alt="첨부 사진">
|
|
</div>
|
|
` : ''}
|
|
|
|
<!-- 내용 -->
|
|
<div class="flex-1 min-w-0">
|
|
<h4 class="text-gray-900 font-medium mb-2">${item.content}</h4>
|
|
<div class="flex items-center space-x-4 text-sm text-gray-500 mb-2">
|
|
<span class="${getDueDateColor(item.due_date)}">
|
|
<i class="fas fa-calendar-times mr-1"></i>마감: ${formatDate(item.due_date)}
|
|
</span>
|
|
<span>
|
|
<i class="fas fa-clock mr-1"></i>등록: ${formatDate(item.created_at)}
|
|
</span>
|
|
</div>
|
|
<div class="text-sm">
|
|
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${getPriorityBadgeColor(item.priority)}">
|
|
${getPriorityText(item.priority)}
|
|
</span>
|
|
<span class="ml-2 text-gray-500">
|
|
${getDaysRemaining(item.due_date)}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 액션 버튼 -->
|
|
<div class="flex-shrink-0 flex space-x-2">
|
|
${item.status !== 'completed' ? `
|
|
<button onclick="completeCalendar(${item.id})" class="text-green-500 hover:text-green-700" title="완료하기">
|
|
<i class="fas fa-check"></i>
|
|
</button>
|
|
<button onclick="extendDeadline(${item.id})" class="text-orange-500 hover:text-orange-700" title="기한 연장">
|
|
<i class="fas fa-calendar-plus"></i>
|
|
</button>
|
|
` : ''}
|
|
<button onclick="editCalendar(${item.id})" class="text-gray-400 hover:text-blue-500" title="수정하기">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`).join('');
|
|
}
|
|
|
|
// 마감 기한별 클래스
|
|
function getDeadlineClass(priority) {
|
|
const classes = {
|
|
urgent: 'deadline-urgent',
|
|
warning: 'deadline-warning',
|
|
normal: 'deadline-normal'
|
|
};
|
|
return classes[priority] || 'deadline-normal';
|
|
}
|
|
|
|
// 우선순위별 색상
|
|
function getPriorityColor(priority) {
|
|
const colors = {
|
|
urgent: 'bg-red-100 text-red-600',
|
|
warning: 'bg-orange-100 text-orange-600',
|
|
normal: 'bg-blue-100 text-blue-600'
|
|
};
|
|
return colors[priority] || 'bg-gray-100 text-gray-600';
|
|
}
|
|
|
|
// 우선순위별 아이콘
|
|
function getPriorityIcon(priority) {
|
|
const icons = {
|
|
urgent: 'fa-exclamation-triangle',
|
|
warning: 'fa-exclamation',
|
|
normal: 'fa-calendar'
|
|
};
|
|
return icons[priority] || 'fa-circle';
|
|
}
|
|
|
|
// 우선순위별 배지 색상
|
|
function getPriorityBadgeColor(priority) {
|
|
const colors = {
|
|
urgent: 'bg-red-100 text-red-800',
|
|
warning: 'bg-orange-100 text-orange-800',
|
|
normal: 'bg-blue-100 text-blue-800'
|
|
};
|
|
return colors[priority] || 'bg-gray-100 text-gray-800';
|
|
}
|
|
|
|
// 우선순위 텍스트
|
|
function getPriorityText(priority) {
|
|
const texts = {
|
|
urgent: '긴급',
|
|
warning: '주의',
|
|
normal: '여유'
|
|
};
|
|
return texts[priority] || '일반';
|
|
}
|
|
|
|
// 마감일 색상
|
|
function getDueDateColor(dueDate) {
|
|
const days = getDaysUntilDeadline(dueDate);
|
|
if (days <= 3) return 'text-red-600 font-medium';
|
|
if (days <= 7) return 'text-orange-600 font-medium';
|
|
return 'text-gray-600';
|
|
}
|
|
|
|
// 남은 일수 계산
|
|
function getDaysUntilDeadline(dueDate) {
|
|
const today = new Date();
|
|
const deadline = new Date(dueDate);
|
|
const diffTime = deadline - today;
|
|
return Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
}
|
|
|
|
// 남은 일수 텍스트
|
|
function getDaysRemaining(dueDate) {
|
|
const days = getDaysUntilDeadline(dueDate);
|
|
if (days < 0) return '기한 초과';
|
|
if (days === 0) return '오늘 마감';
|
|
if (days === 1) return '내일 마감';
|
|
return `${days}일 남음`;
|
|
}
|
|
|
|
// 날짜 포맷팅
|
|
function formatDate(dateString) {
|
|
const date = new Date(dateString);
|
|
return date.toLocaleDateString('ko-KR');
|
|
}
|
|
|
|
// 캘린더 완료
|
|
function completeCalendar(id) {
|
|
console.log('캘린더 완료:', id);
|
|
// TODO: API 호출하여 상태를 'completed'로 변경
|
|
}
|
|
|
|
// 기한 연장
|
|
function extendDeadline(id) {
|
|
console.log('기한 연장:', id);
|
|
// TODO: 기한 연장 모달 표시
|
|
}
|
|
|
|
// 캘린더 편집
|
|
function editCalendar(id) {
|
|
console.log('캘린더 편집:', id);
|
|
// TODO: 편집 모달 또는 페이지로 이동
|
|
}
|
|
|
|
// 필터링
|
|
function filterCalendar(filter) {
|
|
console.log('필터:', filter);
|
|
// TODO: 필터에 따라 목록 재로드
|
|
}
|
|
|
|
// 대시보드로 이동
|
|
function goToDashboard() {
|
|
window.location.href = 'dashboard.html';
|
|
}
|
|
|
|
// 전역 함수 등록
|
|
window.goToDashboard = goToDashboard;
|
|
</script>
|
|
</body>
|
|
</html>
|