Spaces:
Running
Running
File size: 8,323 Bytes
2abd282 830a4f4 2abd282 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | <!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FlowState - Tasks</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: {
50: '#ecfdf5',
100: '#d1fae5',
500: '#10b981',
600: '#059669',
700: '#047857',
},
secondary: {
50: '#f5f3ff',
100: '#ede9fe',
500: '#8b5cf6',
600: '#7c3aed',
700: '#6d28d9',
}
}
}
}
}
</script>
</head>
<body class="bg-gray-50 dark:bg-gray-900 text-gray-800 dark:text-gray-100 transition-colors duration-300">
<flow-navbar></flow-navbar>
<main class="pt-28 pb-12 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto">
<!-- Header Controls -->
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8 gap-4">
<div>
<h1 class="text-3xl font-bold mb-2">My Tasks</h1>
<p class="text-gray-600 dark:text-gray-400">Manage your daily goals and stay productive</p>
</div>
<button onclick="openModal()" class="w-full sm:w-auto px-6 py-3 bg-primary-600 hover:bg-primary-700 text-white rounded-xl font-semibold transition-all transform hover:scale-105 flex items-center justify-center shadow-lg hover:shadow-primary-500/30">
<i data-feather="plus" class="w-5 h-5 mr-2"></i>
New Task
</button>
</div>
<!-- Filter Bar -->
<div class="bg-white dark:bg-gray-800 rounded-2xl p-4 mb-8 shadow-md border border-gray-200 dark:border-gray-700 flex flex-wrap gap-4 items-center justify-between">
<div class="flex gap-2 overflow-x-auto pb-2 sm:pb-0">
<button onclick="filterTasks('all')" class="filter-btn active px-4 py-2 rounded-lg text-sm font-medium transition-all bg-primary-100 text-primary-700 dark:bg-primary-900 dark:text-primary-300" data-filter="all">
All Tasks
</button>
<button onclick="filterTasks('pending')" class="filter-btn px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400" data-filter="pending">
Pending
</button>
<button onclick="filterTasks('completed')" class="filter-btn px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400" data-filter="completed">
Completed
</button>
</div>
<div class="flex items-center gap-2">
<i data-feather="search" class="w-5 h-5 text-gray-400"></i>
<input type="text" id="search-input" placeholder="Search tasks..." class="bg-transparent border-none outline-none text-sm w-48" oninput="searchTasks(this.value)">
</div>
</div>
<!-- Tasks Grid -->
<div id="tasks-container" class="grid grid-cols-1 gap-4">
<!-- Tasks will be injected here -->
</div>
<!-- Empty State -->
<div id="empty-state" class="hidden text-center py-16">
<div class="w-24 h-24 mx-auto mb-6 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center">
<i data-feather="clipboard" class="w-12 h-12 text-gray-400"></i>
</div>
<h3 class="text-xl font-semibold mb-2">No tasks found</h3>
<p class="text-gray-500 mb-6">Create your first task to get started</p>
<button onclick="openModal()" class="px-6 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors">
Create Task
</button>
</div>
</main>
<!-- Add/Edit Task Modal -->
<div id="task-modal" class="fixed inset-0 bg-black/50 backdrop-blur-sm hidden items-center justify-center z-50 p-4">
<div class="bg-white dark:bg-gray-800 rounded-2xl w-full max-w-md p-6 shadow-2xl transform transition-all scale-95 opacity-0" id="modal-content">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold" id="modal-title">New Task</h2>
<button onclick="closeModal()" class="p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full transition-colors">
<i data-feather="x" class="w-5 h-5"></i>
</button>
</div>
<form id="task-form" onsubmit="handleTaskSubmit(event)">
<input type="hidden" id="task-id">
<div class="mb-4">
<label class="block text-sm font-medium mb-2">Task Title</label>
<input type="text" id="task-title" required class="w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all" placeholder="What needs to be done?">
</div>
<div class="mb-4">
<label class="block text-sm font-medium mb-2">Description</label>
<textarea id="task-desc" rows="3" class="w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all resize-none" placeholder="Add details..."></textarea>
</div>
<div class="grid grid-cols-2 gap-4 mb-6">
<div>
<label class="block text-sm font-medium mb-2">Category</label>
<select id="task-category" class="w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 focus:ring-2 focus:ring-primary-500 outline-none">
<option value="work">Work</option>
<option value="personal">Personal</option>
<option value="learning">Learning</option>
<option value="health">Health</option>
</select>
</div>
<div>
<label class="block text-sm font-medium mb-2">Priority</label>
<select id="task-priority" class="w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 focus:ring-2 focus:ring-primary-500 outline-none">
<option value="low">Low</option>
<option value="medium">Medium</option>
<option value="high">High</option>
</select>
</div>
</div>
<div class="flex gap-3">
<button type="button" onclick="closeModal()" class="flex-1 px-4 py-3 border border-gray-300 dark:border-gray-600 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">Cancel</button>
<button type="submit" class="flex-1 px-4 py-3 bg-primary-600 text-white rounded-xl hover:bg-primary-700 transition-colors font-medium">Save Task</button>
</div>
</form>
</div>
</div>
<flow-footer></flow-footer>
<script src="components/navbar.js"></script>
<script src="components/footer.js"></script>
<script src="script.js"></script>
<script>
feather.replace();
// Tasks page specific
document.addEventListener('DOMContentLoaded', () => {
renderTasks();
});
</script>
</body>
</html> |