teste / index.html
Gabrielsv1's picture
Add 1 files
1c3b3f2 verified
Raw History Blame Contribute Delete
65.6 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>TimeTrack Pro - Tasks</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> @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); body { font-family: 'Inter', sans-serif; background-color: #f8fafc; } .sidebar-item:hover .sidebar-tooltip { opacity: 1; transform: translateX(0); } .sidebar-tooltip { opacity: 0; transform: translateX(-10px); transition: all 0.3s ease; } .task-item:hover .task-actions { opacity: 1; } .task-actions { opacity: 0; transition: opacity 0.2s ease; } .fade-in { animation: fadeIn 0.3s ease-in; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .checkbox-container input:checked ~ .checkmark { background-color: #4f46e5; border-color: #4f46e5; } .checkbox-container input:checked ~ .checkmark:after { display: block; } .checkbox-container .checkmark:after { content: ""; position: absolute; display: none; left: 5px; top: 1px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); } .priority-high { background-color: #fee2e2; color: #dc2626; } .priority-medium { background-color: #fef3c7; color: #d97706; } .priority-low { background-color: #ecfdf5; color: #059669; } .status-not-started { background-color: #e5e7eb; color: #4b5563; } .status-in-progress { background-color: #dbeafe; color: #1d4ed8; } .status-completed { background-color: #dcfce7; color: #166534; } .bulk-actions-bar { transform: translateY(-100%); transition: transform 0.3s ease; } .bulk-actions-bar.active { transform: translateY(0); } .tag-input-container { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 0.375rem; min-height: 2.5rem; } .tag { display: inline-flex; align-items: center; background-color: #e0e7ff; color: #4f46e5; padding: 0.25rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; line-height: 1rem; } .tag-remove { display: inline-flex; margin-left: 0.25rem; cursor: pointer; color: #818cf8; } .tag-input { flex-grow: 1; border: none; outline: none; min-width: 100px; } .bulk-textarea { min-height: 200px; resize: vertical; } .slide-in { animation: slideIn 0.3s ease-out; } @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } } </style> </head> <body class="flex h-screen overflow-hidden"> <!-- Sidebar --> <div class="hidden md:flex md:flex-shrink-0"> <div class="flex flex-col w-16 bg-indigo-700 text-white"> <div class="flex items-center justify-center h-16 flex-shrink-0"> <i class="fas fa-stopwatch text-2xl"></i> </div> <div class="flex flex-col items-center space-y-6 mt-8"> <div class="sidebar-item relative group"> <a href="#" class="flex items-center justify-center h-12 w-12 rounded-lg hover:bg-indigo-800 text-white"> <i class="fas fa-play"></i> </a> <div class="sidebar-tooltip absolute left-full ml-2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap"> Timer </div> </div> <div class="sidebar-item relative group"> <a href="#" class="flex items-center justify-center h-12 w-12 rounded-lg bg-indigo-800 text-white"> <i class="fas fa-tasks"></i> </a> <div class="sidebar-tooltip absolute left-full ml-2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap"> Tasks </div> </div> <div class="sidebar-item relative group"> <a href="#" class="flex items-center justify-center h-12 w-12 rounded-lg hover:bg-indigo-800 text-white"> <i class="fas fa-chart-bar"></i> </a> <div class="sidebar-tooltip absolute left-full ml-2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap"> Reports </div> </div> <div class="sidebar-item relative group"> <a href="#" class="flex items-center justify-center h-12 w-12 rounded-lg hover:bg-indigo-800 text-white"> <i class="fas fa-users"></i> </a> <div class="sidebar-tooltip absolute left-full ml-2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap"> Team </div> </div> <div class="sidebar-item relative group"> <a href="#" class="flex items-center justify-center h-12 w-12 rounded-lg hover:bg-indigo-800 text-white"> <i class="fas fa-cog"></i> </a> <div class="sidebar-tooltip absolute left-full ml-2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap"> Settings </div> </div> </div> <div class="mt-auto mb-4 flex flex-col items-center space-y-4"> <div class="sidebar-item relative group"> <a href="#" class="flex items-center justify-center h-12 w-12 rounded-lg hover:bg-indigo-800 text-white"> <i class="fas fa-question-circle"></i> </a> <div class="sidebar-tooltip absolute left-full ml-2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap"> Help </div> </div> <div class="sidebar-item relative group"> <a href="#" class="flex items-center justify-center h-10 w-10 rounded-full bg-indigo-600 text-white"> <span class="text-sm">JD</span> </a> <div class="sidebar-tooltip absolute left-full ml-2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap"> Profile </div> </div> </div> </div> </div> <!-- Main Content --> <div class="flex flex-col flex-1 overflow-hidden"> <!-- Bulk Actions Bar (Hidden by default) --> <div id="bulk-actions-bar" class="bulk-actions-bar bg-indigo-50 border-b border-indigo-100 px-4 py-3 flex items-center justify-between"> <div class="flex items-center space-x-4"> <span id="selected-count" class="text-sm font-medium text-indigo-800">0 tasks selected</span> <button id="bulk-delete-btn" class="text-sm text-red-600 hover:text-red-800 flex items-center"> <i class="fas fa-trash-alt mr-1"></i> Delete </button> <button id="bulk-complete-btn" class="text-sm text-green-600 hover:text-green-800 flex items-center"> <i class="fas fa-check-circle mr-1"></i> Mark Complete </button> <button id="bulk-priority-btn" class="text-sm text-yellow-600 hover:text-yellow-800 flex items-center"> <i class="fas fa-exclamation-circle mr-1"></i> Set Priority </button> </div> <button id="clear-selection-btn" class="text-sm text-gray-600 hover:text-gray-800"> <i class="fas fa-times"></i> Clear </button> </div> <!-- Top Navigation --> <div class="flex items-center justify-between h-16 px-4 bg-white border-b border-gray-200"> <div class="flex items-center"> <button class="md:hidden p-2 rounded-md text-gray-500 hover:text-gray-600 hover:bg-gray-100"> <i class="fas fa-bars"></i> </button> <h1 class="ml-4 text-xl font-semibold text-gray-800">Tasks</h1> </div> <div class="flex items-center space-x-4"> <div class="relative"> <button class="p-2 rounded-full hover:bg-gray-100"> <i class="fas fa-bell text-gray-500"></i> <span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span> </button> </div> <div class="relative"> <button id="workspace-dropdown" class="flex items-center space-x-2 px-3 py-2 rounded-lg hover:bg-gray-100"> <div class="h-8 w-8 rounded-full bg-indigo-100 flex items-center justify-center"> <span class="text-indigo-600 font-medium">WS</span> </div> <span class="text-sm font-medium hidden md:inline">Workspace</span> <i class="fas fa-chevron-down text-xs text-gray-500"></i> </button> <div id="workspace-menu" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-10"> <div class="py-1"> <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Create Workspace</a> <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Workspace Settings</a> <div class="border-t border-gray-100"></div> <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Logout</a> </div> </div> </div> </div> </div> <!-- Main Content Area --> <div class="flex-1 overflow-auto p-4 md:p-6 bg-gray-50"> <div class="max-w-6xl mx-auto"> <!-- Tasks Header --> <div class="flex flex-col md:flex-row items-start md:items-center justify-between mb-6"> <div class="mb-4 md:mb-0"> <h2 class="text-2xl font-bold text-gray-800">My Tasks</h2> <p class="text-sm text-gray-500">Manage and track your work</p> </div> <div class="flex space-x-3"> <div class="relative"> <button id="filter-btn" class="flex items-center space-x-2 px-4 py-2 bg-white border border-gray-300 rounded-lg hover:bg-gray-50"> <i class="fas fa-filter text-gray-500"></i> <span class="text-sm font-medium">Filter</span> <i class="fas fa-chevron-down text-xs text-gray-500"></i> </button> <div id="filter-dropdown" class="hidden absolute right-0 mt-2 w-64 bg-white rounded-md shadow-lg z-10 border border-gray-200"> <div class="p-4"> <div class="mb-4"> <label class="block text-sm font-medium text-gray-700 mb-1">Status</label> <select id="status-filter" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 text-sm"> <option value="">All Statuses</option> <option value="not-started">Not Started</option> <option value="in-progress">In Progress</option> <option value="completed">Completed</option> </select> </div> <div class="mb-4"> <label class="block text-sm font-medium text-gray-700 mb-1">Priority</label> <select id="priority-filter" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 text-sm"> <option value="">All Priorities</option> <option value="high">High</option> <option value="medium">Medium</option> <option value="low">Low</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Project</label> <select id="project-filter" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 text-sm"> <option value="">All Projects</option> <option>Website Redesign</option> <option>Mobile App</option> <option>Marketing Campaign</option> <option>Client Support</option> </select> </div> </div> </div> </div> <div class="relative"> <button id="add-task-dropdown" class="flex items-center space-x-2 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700"> <i class="fas fa-plus"></i> <span class="text-sm font-medium">New Task</span> <i class="fas fa-chevron-down text-xs text-indigo-200"></i> </button> <div id="add-task-menu" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-10 border border-gray-200"> <div class="py-1"> <a href="#" id="single-task-btn" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100"> <i class="fas fa-plus mr-2 text-gray-500"></i> Single Task </a> <a href="#" id="bulk-task-btn" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100"> <i class="fas fa-tasks mr-2 text-gray-500"></i> Bulk Add </a> </div> </div> </div> </div> </div> <!-- New Task Form (Hidden by default) --> <div id="new-task-form" class="hidden bg-white rounded-xl shadow-sm p-6 mb-6 fade-in"> <h3 class="text-lg font-medium text-gray-900 mb-4">Create New Task</h3> <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Task Name*</label> <input type="text" id="task-name" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="Enter task name"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Project</label> <select id="task-project" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> <option value="">Select project</option> <option>Website Redesign</option> <option>Mobile App</option> <option>Marketing Campaign</option> <option>Client Support</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Due Date</label> <input type="date" id="task-due-date" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Priority</label> <select id="task-priority" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> <option value="">Select priority</option> <option value="high">High</option> <option value="medium">Medium</option> <option value="low">Low</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Status</label> <select id="task-status" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> <option value="not-started">Not Started</option> <option value="in-progress">In Progress</option> <option value="completed">Completed</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Estimated Time (hours)</label> <input type="number" id="task-time" min="0" step="0.5" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="0.5"> </div> <div class="md:col-span-2"> <label class="block text-sm font-medium text-gray-700 mb-1">Description</label> <textarea id="task-description" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="Enter task description"></textarea> </div> <div class="md:col-span-2"> <label class="block text-sm font-medium text-gray-700 mb-1">Tags</label> <div class="tag-input-container"> <span class="tag"> Design <span class="tag-remove">&times;</span> </span> <span class="tag"> UI <span class="tag-remove">&times;</span> </span> <input type="text" class="tag-input" placeholder="Add tags..."> </div> </div> </div> <div class="flex justify-end space-x-3 mt-6"> <button id="cancel-task-btn" type="button" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50"> Cancel </button> <button id="create-task-btn" type="button" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700"> Create Task </button> </div> </div> <!-- Bulk Task Form (Hidden by default) --> <div id="bulk-task-form" class="hidden bg-white rounded-xl shadow-sm p-6 mb-6 fade-in"> <h3 class="text-lg font-medium text-gray-900 mb-4">Bulk Add Tasks</h3> <div class="mb-4"> <label class="block text-sm font-medium text-gray-700 mb-1">Enter tasks (one per line or comma separated)</label> <textarea id="bulk-tasks-input" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 bulk-textarea" placeholder="Task 1, Task 2, Task 3&#10;Or one task per line"></textarea> </div> <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Project</label> <select id="bulk-project" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> <option value="">Select project</option> <option>Website Redesign</option> <option>Mobile App</option> <option>Marketing Campaign</option> <option>Client Support</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Priority</label> <select id="bulk-priority" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> <option value="">Select priority</option> <option value="high">High</option> <option value="medium">Medium</option> <option value="low">Low</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Status</label> <select id="bulk-status" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> <option value="not-started">Not Started</option> <option value="in-progress">In Progress</option> <option value="completed">Completed</option> </select> </div> </div> <div class="flex justify-end space-x-3 mt-6"> <button id="cancel-bulk-btn" type="button" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50"> Cancel </button> <button id="create-bulk-btn" type="button" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700"> Add Tasks </button> </div> </div> <!-- Tasks List --> <div class="bg-white rounded-xl shadow-sm overflow-hidden"> <!-- Tasks Table Header --> <div class="grid grid-cols-12 gap-4 px-6 py-3 bg-gray-50 border-b border-gray-200"> <div class="col-span-5 md:col-span-6 flex items-center"> <label class="checkbox-container flex items-center"> <input type="checkbox" id="select-all-tasks" class="opacity-0 absolute"> <span class="checkmark h-5 w-5 border-2 border-gray-300 rounded flex-shrink-0"></span> </label> <span class="ml-3 text-xs font-medium text-gray-500 uppercase tracking-wider">Task</span> </div> <div class="col-span-2 md:col-span-1 flex items-center"> <span class="text-xs font-medium text-gray-500 uppercase tracking-wider">Priority</span> </div> <div class="hidden md:flex md:col-span-1 items-center"> <span class="text-xs font-medium text-gray-500 uppercase tracking-wider">Status</span> </div> <div class="hidden md:flex md:col-span-1 items-center"> <span class="text-xs font-medium text-gray-500 uppercase tracking-wider">Due Date</span> </div> <div class="hidden md:flex md:col-span-1 items-center"> <span class="text-xs font-medium text-gray-500 uppercase tracking-wider">Time</span> </div> <div class="col-span-5 md:col-span-2 flex items-center justify-end"> <span class="text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</span> </div> </div> <!-- Tasks List --> <div class="divide-y divide-gray-200" id="tasks-container"> <!-- Task items will be added here dynamically --> </div> </div> <!-- Pagination --> <div class="flex items-center justify-between px-4 py-3 bg-white border-t border-gray-200 rounded-b-lg"> <div class="flex-1 flex justify-between sm:hidden"> <a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Previous </a> <a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Next </a> </div> <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"> <div> <p class="text-sm text-gray-700"> Showing <span class="font-medium">1</span> to <span class="font-medium">5</span> of <span class="font-medium">12</span> tasks </p> </div> <div> <nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination"> <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"> <span class="sr-only">Previous</span> <i class="fas fa-chevron-left"></i> </a> <a href="#" aria-current="page" class="z-10 bg-indigo-50 border-indigo-500 text-indigo-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 1 </a> <a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 2 </a> <a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 3 </a> <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"> <span class="sr-only">Next</span> <i class="fas fa-chevron-right"></i> </a> </nav> </div> </div> </div> </div> </div> </div> <!-- Mobile Bottom Navigation --> <div class="md:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200"> <div class="flex justify-around"> <a href="#" class="flex flex-col items-center justify-center p-3 text-gray-500"> <i class="fas fa-play"></i> <span class="text-xs mt-1">Timer</span> </a> <a href="#" class="flex flex-col items-center justify-center p-3 text-indigo-600"> <i class="fas fa-tasks"></i> <span class="text-xs mt-1">Tasks</span> </a> <a href="#" class="flex flex-col items-center justify-center p-3 text-gray-500"> <i class="fas fa-chart-bar"></i> <span class="text-xs mt-1">Reports</span> </a> <a href="#" class="flex flex-col items-center justify-center p-3 text-gray-500"> <i class="fas fa-user"></i> <span class="text-xs mt-1">Profile</span> </a> </div> </div> <!-- Task Detail Sidebar (Hidden by default) --> <div id="task-detail-sidebar" class="hidden fixed inset-y-0 right-0 w-full md:w-1/3 bg-white shadow-lg z-20 overflow-y-auto"> <div class="p-6"> <div class="flex justify-between items-center mb-6"> <h3 class="text-xl font-bold text-gray-800">Task Details</h3> <button id="close-detail-btn" class="text-gray-500 hover:text-gray-700"> <i class="fas fa-times"></i> </button> </div> <div class="mb-6"> <div class="flex items-center mb-4"> <label class="checkbox-container flex items-center mr-4"> <input type="checkbox" id="detail-completed" class="opacity-0 absolute"> <span class="checkmark h-6 w-6 border-2 border-gray-300 rounded flex-shrink-0"></span> </label> <h2 id="detail-title" class="text-lg font-medium text-gray-900">Task Title</h2> </div> <p id="detail-project" class="text-sm text-gray-500 ml-10">Project Name</p> </div> <div class="space-y-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Description</label> <div id="detail-description" class="text-sm text-gray-600 p-3 bg-gray-50 rounded"> No description provided </div> </div> <div class="grid grid-cols-2 gap-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Status</label> <div id="detail-status" class="px-2 py-1 text-xs font-medium rounded-full">Not Started</div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Priority</label> <div id="detail-priority" class="px-2 py-1 text-xs font-medium rounded-full">Medium</div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Due Date</label> <div id="detail-due-date" class="text-sm text-gray-600">No due date</div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Time Estimate</label> <div id="detail-time" class="text-sm text-gray-600">Not specified</div> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Tags</label> <div id="detail-tags" class="flex flex-wrap gap-2"> <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800"> No tags </span> </div> </div> <div class="pt-4 border-t border-gray-200"> <label class="block text-sm font-medium text-gray-700 mb-2">Time Tracking</label> <div class="flex items-center justify-between mb-2"> <span class="text-sm text-gray-600">Logged Time:</span> <span id="detail-logged-time" class="text-sm font-medium">0h 0m</span> </div> <div class="flex items-center justify-between"> <span class="text-sm text-gray-600">Remaining:</span> <span id="detail-remaining-time" class="text-sm font-medium">-</span> </div> <div class="mt-4 flex space-x-2"> <button class="flex-1 px-3 py-2 bg-indigo-600 text-white text-sm rounded hover:bg-indigo-700"> <i class="fas fa-play mr-1"></i> Start Timer </button> <button class="px-3 py-2 bg-white border border-gray-300 text-sm rounded hover:bg-gray-50"> <i class="fas fa-stopwatch mr-1"></i> Log Time </button> </div> </div> </div> <div class="mt-6 pt-4 border-t border-gray-200 flex justify-between"> <button id="delete-task-btn" class="px-4 py-2 bg-red-600 text-white text-sm rounded hover:bg-red-700"> <i class="fas fa-trash-alt mr-1"></i> Delete Task </button> <button id="edit-task-btn" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded hover:bg-indigo-700"> <i class="fas fa-pencil-alt mr-1"></i> Edit Task </button> </div> </div> </div> <script> // Sample tasks data const tasks = [ { id: 1, title: "Design homepage layout", project: "Website Redesign", priority: "high", status: "in-progress", dueDate: "2023-06-15", timeEstimate: 2.5, description: "Create wireframes and mockups for the new homepage design", tags: ["design", "ui"], completed: false }, { id: 2, title: "Write blog post about productivity", project: "Marketing", priority: "medium", status: "not-started", dueDate: "2023-06-18", timeEstimate: 3, description: "Research and write a 1500-word blog post on productivity tips", tags: ["content", "seo"], completed: false }, { id: 3, title: "Fix login page bug", project: "Mobile App", priority: "low", status: "completed", dueDate: "2023-06-10", timeEstimate: 1, description: "Users are experiencing issues when logging in from Android devices", tags: ["bug", "mobile"], completed: true }, { id: 4, title: "Prepare client presentation", project: "Client Support", priority: "high", status: "in-progress", dueDate: "2023-06-20", timeEstimate: 4, description: "Create slides and talking points for quarterly client review", tags: ["presentation", "client"], completed: false }, { id: 5, title: "Review analytics dashboard", project: "Marketing", priority: "medium", status: "not-started", dueDate: "2023-06-22", timeEstimate: 2, description: "Analyze metrics and prepare report for marketing team", tags: ["analytics", "reporting"], completed: false } ]; // DOM elements const tasksContainer = document.getElementById('tasks-container'); const newTaskForm = document.getElementById('new-task-form'); const bulkTaskForm = document.getElementById('bulk-task-form'); const bulkTasksInput = document.getElementById('bulk-tasks-input'); const taskDetailSidebar = document.getElementById('task-detail-sidebar'); const bulkActionsBar = document.getElementById('bulk-actions-bar'); const selectedCount = document.getElementById('selected-count'); const selectAllCheckbox = document.getElementById('select-all-tasks'); let selectedTasks = []; // Initialize the app function init() { renderTasks(); setupEventListeners(); } // Render tasks to the DOM function renderTasks(filteredTasks = null) { const tasksToRender = filteredTasks || tasks; tasksContainer.innerHTML = ''; tasksToRender.forEach(task => { const taskElement = createTaskElement(task); tasksContainer.appendChild(taskElement); }); } // Create a task element function createTaskElement(task) { const taskElement = document.createElement('div'); taskElement.className = 'grid grid-cols-12 gap-4 px-6 py-4 hover:bg-gray-50 task-item'; taskElement.dataset.id = task.id; // Format due date const dueDate = task.dueDate ? new Date(task.dueDate).toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) : ''; taskElement.innerHTML = ` <div class="col-span-5 md:col-span-6 flex items-center"> <label class="checkbox-container flex items-center"> <input type="checkbox" class="task-checkbox opacity-0 absolute" data-id="${task.id}"> <span class="checkmark h-5 w-5 border-2 border-gray-300 rounded flex-shrink-0 mr-3"></span> <div> <h3 class="text-sm font-medium text-gray-900 ${task.completed ? 'line-through' : ''}">${task.title}</h3> <p class="text-xs text-gray-500">${task.project}</p> </div> </label> </div> <div class="col-span-2 md:col-span-1 flex items-center"> <span class="px-2 py-1 text-xs font-medium rounded-full priority-${task.priority}">${capitalizeFirstLetter(task.priority)}</span> </div> <div class="hidden md:flex md:col-span-1 items-center"> <span class="px-2 py-1 text-xs font-medium rounded-full status-${task.status}">${formatStatus(task.status)}</span> </div> <div class="hidden md:flex md:col-span-1 items-center"> <span class="text-sm text-gray-500">${dueDate}</span> </div> <div class="hidden md:flex md:col-span-1 items-center"> <span class="text-sm font-mono text-gray-500">${task.timeEstimate}h</span> </div> <div class="col-span-5 md:col-span-2 flex items-center justify-end space-x-2 task-actions"> <button class="task-start h-8 w-8 rounded-full flex items-center justify-center text-gray-500 hover:bg-gray-100" data-id="${task.id}"> <i class="fas fa-play text-xs"></i> </button> <button class="task-edit h-8 w-8 rounded-full flex items-center justify-center text-gray-500 hover:bg-gray-100" data-id="${task.id}"> <i class="fas fa-pencil-alt text-xs"></i> </button> <button class="task-view h-8 w-8 rounded-full flex items-center justify-center text-gray-500 hover:bg-gray-100" data-id="${task.id}"> <i class="fas fa-ellipsis-h text-xs"></i> </button> </div> `; // Mark checkbox as checked if task is completed if (task.completed) { const checkbox = taskElement.querySelector('.task-checkbox'); checkbox.checked = true; } return taskElement; } // Setup event listeners function setupEventListeners() { // Toggle workspace dropdown document.getElementById('workspace-dropdown').addEventListener('click', function() { document.getElementById('workspace-menu').classList.toggle('hidden'); }); // Close dropdown when clicking outside document.addEventListener('click', function(event) { const dropdown = document.getElementById('workspace-dropdown'); const menu = document.getElementById('workspace-menu'); if (!dropdown.contains(event.target) && !menu.contains(event.target)) { menu.classList.add('hidden'); } }); // Toggle filter dropdown document.getElementById('filter-btn').addEventListener('click', function(e) { e.stopPropagation(); document.getElementById('filter-dropdown').classList.toggle('hidden'); }); // Close filter dropdown when clicking outside document.addEventListener('click', function(event) { const filterBtn = document.getElementById('filter-btn'); const filterDropdown = document.getElementById('filter-dropdown'); if (!filterBtn.contains(event.target) && !filterDropdown.contains(event.target)) { filterDropdown.classList.add('hidden'); } }); // Apply filters document.getElementById('status-filter').addEventListener('change', applyFilters); document.getElementById('priority-filter').addEventListener('change', applyFilters); document.getElementById('project-filter').addEventListener('change', applyFilters); // Toggle add task dropdown document.getElementById('add-task-dropdown').addEventListener('click', function(e) { e.stopPropagation(); document.getElementById('add-task-menu').classList.toggle('hidden'); }); // Close add task dropdown when clicking outside document.addEventListener('click', function(event) { const addTaskBtn = document.getElementById('add-task-dropdown'); const addTaskMenu = document.getElementById('add-task-menu'); if (!addTaskBtn.contains(event.target) && !addTaskMenu.contains(event.target)) { addTaskMenu.classList.add('hidden'); } }); // Show single task form document.getElementById('single-task-btn').addEventListener('click', function(e) { e.preventDefault(); document.getElementById('add-task-menu').classList.add('hidden'); showNewTaskForm(); }); // Show bulk task form document.getElementById('bulk-task-btn').addEventListener('click', function(e) { e.preventDefault(); document.getElementById('add-task-menu').classList.add('hidden'); showBulkTaskForm(); }); // Toggle new task form document.getElementById('new-task-btn').addEventListener('click', showNewTaskForm); document.getElementById('cancel-task-btn').addEventListener('click', hideNewTaskForm); document.getElementById('create-task-btn').addEventListener('click', createNewTask); // Toggle bulk task form document.getElementById('cancel-bulk-btn').addEventListener('click', hideBulkTaskForm); document.getElementById('create-bulk-btn').addEventListener('click', createBulkTasks); // Task selection tasksContainer.addEventListener('change', function(e) { if (e.target.classList.contains('task-checkbox')) { toggleTaskSelection(e.target.dataset.id, e.target.checked); } }); // Select all tasks selectAllCheckbox.addEventListener('change', function(e) { const checkboxes = document.querySelectorAll('.task-checkbox'); checkboxes.forEach(checkbox => { checkbox.checked = e.target.checked; toggleTaskSelection(checkbox.dataset.id, e.target.checked); }); }); // Bulk actions document.getElementById('bulk-delete-btn').addEventListener('click', deleteSelectedTasks); document.getElementById('bulk-complete-btn').addEventListener('click', completeSelectedTasks); document.getElementById('bulk-priority-btn').addEventListener('click', setPriorityForSelectedTasks); document.getElementById('clear-selection-btn').addEventListener('click', clearSelection); // Task actions tasksContainer.addEventListener('click', function(e) { const taskId = e.target.closest('[data-id]')?.dataset.id; if (!taskId) return; if (e.target.closest('.task-start')) { startTaskTimer(taskId); } else if (e.target.closest('.task-edit')) { editTask(taskId); } else if (e.target.closest('.task-view')) { viewTaskDetails(taskId); } }); // Task detail sidebar document.getElementById('close-detail-btn').addEventListener('click', closeTaskDetails); document.getElementById('delete-task-btn').addEventListener('click', deleteTaskFromDetail); document.getElementById('edit-task-btn').addEventListener('click', editTaskFromDetail); document.getElementById('detail-completed').addEventListener('change', toggleTaskCompletionFromDetail); } // Show new task form function showNewTaskForm() { hideBulkTaskForm(); newTaskForm.classList.remove('hidden'); newTaskForm.classList.add('fade-in'); document.getElementById('task-name').focus(); } // Hide new task form function hideNewTaskForm() { newTaskForm.classList.add('hidden'); // Reset form document.getElementById('new-task-form').reset(); } // Show bulk task form function showBulkTaskForm() { hideNewTaskForm(); bulkTaskForm.classList.remove('hidden'); bulkTaskForm.classList.add('fade-in'); bulkTasksInput.focus(); } // Hide bulk task form function hideBulkTaskForm() { bulkTaskForm.classList.add('hidden'); // Reset form document.getElementById('bulk-task-form').reset(); } // Create a new task function createNewTask() { const name = document.getElementById('task-name').value.trim(); if (!name) { alert('Task name is required'); return; } const newTask = { id: Date.now(), // Simple ID generation title: name, project: document.getElementById('task-project').value, priority: document.getElementById('task-priority').value, status: document.getElementById('task-status').value, dueDate: document.getElementById('task-due-date').value, timeEstimate: parseFloat(document.getElementById('task-time').value) || 0, description: document.getElementById('task-description').value, tags: ['design', 'ui'], // Hardcoded for now completed: false }; tasks.unshift(newTask); // Add to beginning of array renderTasks(); hideNewTaskForm(); showNotification('Task created successfully!'); } // Create multiple tasks from bulk input function createBulkTasks() { const input = bulkTasksInput.value.trim(); if (!input) { alert('Please enter at least one task'); return; } // Split by newlines or commas const taskTitles = input.split(/[\n,]/).map(title => title.trim()).filter(title => title); const project = document.getElementById('bulk-project').value; const priority = document.getElementById('bulk-priority').value; const status = document.getElementById('bulk-status').value; taskTitles.forEach(title => { const newTask = { id: Date.now() + Math.floor(Math.random() * 1000), // Simple ID generation title: title, project: project, priority: priority, status: status, dueDate: '', timeEstimate: 0, description: '', tags: [], completed: false }; tasks.unshift(newTask); // Add to beginning of array }); renderTasks(); hideBulkTaskForm(); showNotification(`${taskTitles.length} tasks created successfully!`); } // Toggle task selection function toggleTaskSelection(taskId, isSelected) { if (isSelected) { if (!selectedTasks.includes(taskId)) { selectedTasks.push(taskId); } } else { selectedTasks = selectedTasks.filter(id => id !== taskId); selectAllCheckbox.checked = false; } updateBulkActionsBar(); } // Update bulk actions bar function updateBulkActionsBar() { if (selectedTasks.length > 0) { bulkActionsBar.classList.add('active'); selectedCount.textContent = `${selectedTasks.length} ${selectedTasks.length === 1 ? 'task' : 'tasks'} selected`; } else { bulkActionsBar.classList.remove('active'); } } // Delete selected tasks function deleteSelectedTasks() { if (confirm(`Are you sure you want to delete ${selectedTasks.length} tasks?`)) { selectedTasks.forEach(taskId => { const index = tasks.findIndex(task => task.id == taskId); if (index !== -1) { tasks.splice(index, 1); } }); renderTasks(); clearSelection(); showNotification('Tasks deleted successfully!'); } } // Mark selected tasks as complete function completeSelectedTasks() { selectedTasks.forEach(taskId => { const task = tasks.find(task => task.id == taskId); if (task) { task.completed = true; task.status = 'completed'; } }); renderTasks(); clearSelection(); showNotification('Tasks marked as complete!'); } // Set priority for selected tasks function setPriorityForSelectedTasks() { const priority = prompt('Enter priority (high, medium, low):'); if (priority && ['high', 'medium', 'low'].includes(priority.toLowerCase())) { selectedTasks.forEach(taskId => { const task = tasks.find(task => task.id == taskId); if (task) { task.priority = priority.toLowerCase(); } }); renderTasks(); clearSelection(); showNotification('Priority updated for selected tasks!'); } else if (priority) { alert('Please enter a valid priority (high, medium, low)'); } } // Clear selection function clearSelection() { selectedTasks = []; const checkboxes = document.querySelectorAll('.task-checkbox'); checkboxes.forEach(checkbox => { checkbox.checked = false; }); selectAllCheckbox.checked = false; updateBulkActionsBar(); } // Start timer for a task function startTaskTimer(taskId) { const task = tasks.find(task => task.id == taskId); if (task) { showNotification(`Timer started for: ${task.title}`); // In a real app, you would start an actual timer here } } // Edit a task function editTask(taskId) { const task = tasks.find(task => task.id == taskId); if (task) { // In a real app, you would populate the edit form with task data showNewTaskForm(); document.getElementById('task-name').value = task.title; document.getElementById('task-project').value = task.project; document.getElementById('task-priority').value = task.priority; document.getElementById('task-status').value = task.status; document.getElementById('task-due-date').value = task.dueDate; document.getElementById('task-time').value = task.timeEstimate; document.getElementById('task-description').value = task.description; // Change button text document.getElementById('create-task-btn').textContent = 'Update Task'; // Store the task ID in the form document.getElementById('new-task-form').dataset.editingTaskId = taskId; // Change the event listener temporarily const createBtn = document.getElementById('create-task-btn'); createBtn.replaceWith(createBtn.cloneNode(true)); document.getElementById('create-task-btn').addEventListener('click', updateTask); } } // Update a task function updateTask() { const taskId = document.getElementById('new-task-form').dataset.editingTaskId; const task = tasks.find(task => task.id == taskId); if (task) { task.title = document.getElementById('task-name').value.trim(); task.project = document.getElementById('task-project').value; task.priority = document.getElementById('task-priority').value; task.status = document.getElementById('task-status').value; task.dueDate = document.getElementById('task-due-date').value; task.timeEstimate = parseFloat(document.getElementById('task-time').value) || 0; task.description = document.getElementById('task-description').value; renderTasks(); hideNewTaskForm(); showNotification('Task updated successfully!'); // Restore the original event listener const createBtn = document.getElementById('create-task-btn'); createBtn.replaceWith(createBtn.cloneNode(true)); document.getElementById('create-task-btn').addEventListener('click', createNewTask); } } // View task details function viewTaskDetails(taskId) { const task = tasks.find(task => task.id == taskId); if (task) { // Populate the detail view document.getElementById('detail-title').textContent = task.title; document.getElementById('detail-project').textContent = task.project; document.getElementById('detail-description').textContent = task.description || 'No description provided'; document.getElementById('detail-status').textContent = formatStatus(task.status); document.getElementById('detail-status').className = `px-2 py-1 text-xs font-medium rounded-full status-${task.status}`; document.getElementById('detail-priority').textContent = capitalizeFirstLetter(task.priority); document.getElementById('detail-priority').className = `px-2 py-1 text-xs font-medium rounded-full priority-${task.priority}`; document.getElementById('detail-due-date').textContent = task.dueDate ? new Date(task.dueDate).toLocaleDateString() : 'No due date'; document.getElementById('detail-time').textContent = task.timeEstimate ? `${task.timeEstimate}h` : 'Not specified'; document.getElementById('detail-completed').checked = task.completed; // Populate tags const tagsContainer = document.getElementById('detail-tags'); tagsContainer.innerHTML = ''; if (task.tags && task.tags.length > 0) { task.tags.forEach(tag => { const tagElement = document.createElement('span'); tagElement.className = 'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800'; tagElement.textContent = tag; tagsContainer.appendChild(tagElement); }); } else { const noTags = document.createElement('span'); noTags.className = 'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800'; noTags.textContent = 'No tags'; tagsContainer.appendChild(noTags); } // Store the task ID in the sidebar taskDetailSidebar.dataset.taskId = taskId; // Show the sidebar taskDetailSidebar.classList.remove('hidden'); taskDetailSidebar.classList.add('slide-in'); } } // Close task details function closeTaskDetails() { taskDetailSidebar.classList.add('hidden'); taskDetailSidebar.classList.remove('slide-in'); } // Delete task from detail view function deleteTaskFromDetail() { const taskId = taskDetailSidebar.dataset.taskId; if (confirm('Are you sure you want to delete this task?')) { const index = tasks.findIndex(task => task.id == taskId); if (index !== -1) { tasks.splice(index, 1); renderTasks(); closeTaskDetails(); showNotification('Task deleted successfully!'); } } } // Edit task from detail view function editTaskFromDetail() { const taskId = taskDetailSidebar.dataset.taskId; closeTaskDetails(); editTask(taskId); } // Toggle task completion from detail view function toggleTaskCompletionFromDetail(e) { const taskId = taskDetailSidebar.dataset.taskId; const task = tasks.find(task => task.id == taskId); if (task) { task.completed = e.target.checked; task.status = e.target.checked ? 'completed' : 'not-started'; renderTasks(); viewTaskDetails(taskId); // Refresh the detail view } } // Apply filters function applyFilters() { const statusFilter = document.getElementById('status-filter').value; const priorityFilter = document.getElementById('priority-filter').value; const projectFilter = document.getElementById('project-filter').value; let filteredTasks = tasks; if (statusFilter) { filteredTasks = filteredTasks.filter(task => task.status === statusFilter); } if (priorityFilter) { filteredTasks = filteredTasks.filter(task => task.priority === priorityFilter); } if (projectFilter) { filteredTasks = filteredTasks.filter(task => task.project === projectFilter); } renderTasks(filteredTasks); } // Helper function to capitalize first letter function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } // Helper function to format status function formatStatus(status) { return status.split('-').map(word => capitalizeFirstLetter(word)).join(' '); } // Show notification function showNotification(message) { // In a real app, you would use a proper notification system alert(message); } // Initialize the app document.addEventListener('DOMContentLoaded', init); </script> <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Gabrielsv1/teste" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> </html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TimeTrack Pro - Tasks</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>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
background-color: #f8fafc;
}
.sidebar-item:hover .sidebar-tooltip {
opacity: 1;
transform: translateX(0);
}
.sidebar-tooltip {
opacity: 0;
transform: translateX(-10px);
transition: all 0.3s ease;
}
.task-item:hover .task-actions {
opacity: 1;
}
.task-actions {
opacity: 0;
transition: opacity 0.2s ease;
}
.fade-in {
animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.checkbox-container input:checked ~ .checkmark {
background-color: #4f46e5;
border-color: #4f46e5;
}
.checkbox-container input:checked ~ .checkmark:after {
display: block;
}
.checkbox-container .checkmark:after {
content: "";
position: absolute;
display: none;
left: 5px;
top: 1px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
.priority-high {
background-color: #fee2e2;
color: #dc2626;
}
.priority-medium {
background-color: #fef3c7;
color: #d97706;
}
.priority-low {
background-color: #ecfdf5;
color: #059669;
}
.status-not-started {
background-color: #e5e7eb;
color: #4b5563;
}
.status-in-progress {
background-color: #dbeafe;
color: #1d4ed8;
}
.status-completed {
background-color: #dcfce7;
color: #166534;
}
.bulk-actions-bar {
transform: translateY(-100%);
transition: transform 0.3s ease;