Spaces:
Running
You are a master AI coding agent tasked with creating a **stunning, elegant, smooth, and user-friendly front-end** for a **full-stack agent environment** similar to Lovable. Your goal is to generate a **fully functional MVP front-end** using only **HTML, CSS, and JavaScript**, prioritizing a polished user experience, visual delight, and intuitive interactions.
Browse files---
## Guidelines for the Agent
### File Structure
* `index.html` β contains the main layout, linking `styles.css` and `app.js`.
* `styles.css` β modern, clean, well-commented CSS, using Flexbox/Grid, CSS variables, and responsive design.
* `app.js` β modular, readable JS for handling UI interactions, mock backend logic, localStorage, and simulated responses.
* Optional `assets/` folder for icons, images, and placeholder media.
### Design Principles
1. **Visual Elegance:** Smooth transitions, rounded corners, soft shadows, modern typography, and harmonious color palette.
2. **Intuitive UI/UX:** Easy navigation, clear visual hierarchy, responsive layout (mobile-first), and accessible design (ARIA, keyboard navigation).
3. **Interactive Elements:** Chat panel, code editor panel (simple textarea), task manager panel, file preview mock, and status bar.
4. **Animations & Transitions:** Subtle hover/focus effects, smooth scrolling, and message fade-in animations.
5. **Responsive Design:** Adaptive sidebar, flexible content panels, works perfectly on <640px screens.
### Functional MVP Requirements
* **Chat Panel:** Send messages, display mock AI responses with delay, support text, images, and file previews.
* **Code Editor Panel:** Simple editable textarea, placeholder syntax highlighting, ability to send code to chat panel.
* **Task Manager Panel:** Add/edit/check/delete tasks with localStorage persistence.
* **Status Bar:** Show system messages, online/offline mock status.
* **Optional Features:** Tabs for multiple agents/projects, theme switcher (light/dark), drag & drop file uploads (front-only).
### Development Rules
* Vanilla JS, no external frameworks unless justified with comments.
* Clean, readable, modular code with meaningful naming.
* Comment critical logic sections.
* Mock backend functions clearly marked (`// TODO: integrate backend here`).
* Include **sample demo data** for all panels.
### Acceptance Criteria
* Fully functional by opening `index.html` in a browser, no server required.
* Chat messages update immediately with smooth animations.
* Tasks persist using localStorage.
* Mobile-first responsive layout.
* Pleasant and smooth interactions.
### Output Format
When producing output, strictly use the following format:
```
--- FILE: index.html ---
<full HTML content>
--- FILE: styles.css ---
<full CSS content>
--- FILE: app.js ---
<full JS content>
--- README (short) ---
Instructions to open and test the project.
--- MERMAID DIAGRAM ---
flowchart LR
A[User] -->|Interacts| UI[Frontend (HTML/CSS/JS)]
UI --> ChatPanel[Chat Panel]
UI --> Editor[Code Editor Panel]
UI --> Tasks[Tasks Panel]
ChatPanel -->|sendMessage| API{API / Stubs}
Editor -->|sendCode| API
Tasks -->|update| LocalStorage[(localStorage)]
API -->|mockResponse| ChatPanel
API -->|socket events| UI
```
- README.md +7 -4
- index.html +400 -18
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji: π
|
| 4 |
colorFrom: yellow
|
| 5 |
-
colorTo:
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: AgentFlow Nexus π
|
|
|
|
| 3 |
colorFrom: yellow
|
| 4 |
+
colorTo: green
|
| 5 |
+
emoji: π³
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
|
@@ -1,19 +1,401 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="h-full">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>AgentFlow Nexus</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<style>
|
| 12 |
+
/* Custom scrollbar */
|
| 13 |
+
::-webkit-scrollbar {
|
| 14 |
+
width: 8px;
|
| 15 |
+
height: 8px;
|
| 16 |
+
}
|
| 17 |
+
::-webkit-scrollbar-track {
|
| 18 |
+
background: rgba(255, 255, 255, 0.1);
|
| 19 |
+
border-radius: 4px;
|
| 20 |
+
}
|
| 21 |
+
::-webkit-scrollbar-thumb {
|
| 22 |
+
background: rgba(255, 255, 255, 0.2);
|
| 23 |
+
border-radius: 4px;
|
| 24 |
+
}
|
| 25 |
+
::-webkit-scrollbar-thumb:hover {
|
| 26 |
+
background: rgba(255, 255, 255, 0.3);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
/* Message animation */
|
| 30 |
+
@keyframes fadeIn {
|
| 31 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 32 |
+
to { opacity: 1; transform: translateY(0); }
|
| 33 |
+
}
|
| 34 |
+
.message-animate {
|
| 35 |
+
animation: fadeIn 0.3s ease-out forwards;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
/* Syntax highlight placeholder */
|
| 39 |
+
.code-block {
|
| 40 |
+
font-family: 'Courier New', monospace;
|
| 41 |
+
background: rgba(0, 0, 0, 0.1);
|
| 42 |
+
border-left: 3px solid #4F46E5;
|
| 43 |
+
padding: 0.5rem 1rem;
|
| 44 |
+
border-radius: 0 4px 4px 0;
|
| 45 |
+
}
|
| 46 |
+
</style>
|
| 47 |
+
</head>
|
| 48 |
+
<body class="h-full bg-gray-900 text-gray-100 flex flex-col overflow-hidden">
|
| 49 |
+
<div class="flex flex-1 overflow-hidden">
|
| 50 |
+
<!-- Sidebar -->
|
| 51 |
+
<div class="w-64 bg-gray-800 flex flex-col border-r border-gray-700 hidden md:flex">
|
| 52 |
+
<div class="p-4 border-b border-gray-700 flex items-center space-x-3">
|
| 53 |
+
<div class="w-10 h-10 rounded-full bg-indigo-500 flex items-center justify-center">
|
| 54 |
+
<i data-feather="cpu" class="text-white"></i>
|
| 55 |
+
</div>
|
| 56 |
+
<div>
|
| 57 |
+
<h2 class="font-bold">AgentFlow</h2>
|
| 58 |
+
<p class="text-xs text-gray-400">Active</p>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
| 61 |
+
<div class="flex-1 overflow-y-auto p-4 space-y-4">
|
| 62 |
+
<div>
|
| 63 |
+
<h3 class="text-xs uppercase tracking-wider text-gray-400 mb-2">Agents</h3>
|
| 64 |
+
<div class="space-y-1">
|
| 65 |
+
<button class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-left">
|
| 66 |
+
<i data-feather="message-square" class="w-4 h-4"></i>
|
| 67 |
+
<span>Chat Agent</span>
|
| 68 |
+
</button>
|
| 69 |
+
<button class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-left">
|
| 70 |
+
<i data-feather="code" class="w-4 h-4"></i>
|
| 71 |
+
<span>Code Agent</span>
|
| 72 |
+
</button>
|
| 73 |
+
<button class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-left">
|
| 74 |
+
<i data-feather="database" class="w-4 h-4"></i>
|
| 75 |
+
<span>Data Agent</span>
|
| 76 |
+
</button>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
<div>
|
| 80 |
+
<h3 class="text-xs uppercase tracking-wider text-gray-400 mb-2">Projects</h3>
|
| 81 |
+
<div class="space-y-1">
|
| 82 |
+
<button class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-left">
|
| 83 |
+
<div class="w-2 h-2 rounded-full bg-green-400"></div>
|
| 84 |
+
<span>AgentFlow Core</span>
|
| 85 |
+
</button>
|
| 86 |
+
<button class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-left">
|
| 87 |
+
<div class="w-2 h-2 rounded-full bg-blue-400"></div>
|
| 88 |
+
<span>UI Components</span>
|
| 89 |
+
</button>
|
| 90 |
+
<button class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-left">
|
| 91 |
+
<div class="w-2 h-2 rounded-full bg-yellow-400"></div>
|
| 92 |
+
<span>API Integration</span>
|
| 93 |
+
</button>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
<div class="p-4 border-t border-gray-700">
|
| 98 |
+
<button class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-700">
|
| 99 |
+
<i data-feather="settings" class="w-4 h-4"></i>
|
| 100 |
+
<span>Settings</span>
|
| 101 |
+
</button>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
<!-- Main Content -->
|
| 106 |
+
<div class="flex-1 flex flex-col overflow-hidden">
|
| 107 |
+
<!-- Top Bar -->
|
| 108 |
+
<div class="p-4 border-b border-gray-700 flex items-center justify-between">
|
| 109 |
+
<div class="flex items-center space-x-4">
|
| 110 |
+
<button class="md:hidden">
|
| 111 |
+
<i data-feather="menu"></i>
|
| 112 |
+
</button>
|
| 113 |
+
<h1 class="text-xl font-bold">AgentFlow Nexus</h1>
|
| 114 |
+
</div>
|
| 115 |
+
<div class="flex items-center space-x-4">
|
| 116 |
+
<button class="p-2 rounded-full hover:bg-gray-700">
|
| 117 |
+
<i data-feather="search" class="w-4 h-4"></i>
|
| 118 |
+
</button>
|
| 119 |
+
<button class="p-2 rounded-full hover:bg-gray-700">
|
| 120 |
+
<i data-feather="bell" class="w-4 h-4"></i>
|
| 121 |
+
</button>
|
| 122 |
+
<div class="w-8 h-8 rounded-full bg-indigo-500 flex items-center justify-center">
|
| 123 |
+
<i data-feather="user" class="text-white w-4 h-4"></i>
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
|
| 128 |
+
<!-- Content Area -->
|
| 129 |
+
<div class="flex-1 flex flex-col md:flex-row overflow-hidden">
|
| 130 |
+
<!-- Chat Panel -->
|
| 131 |
+
<div class="flex-1 flex flex-col border-r border-gray-700 overflow-hidden">
|
| 132 |
+
<div class="p-4 border-b border-gray-700">
|
| 133 |
+
<h2 class="font-bold">Agent Chat</h2>
|
| 134 |
+
</div>
|
| 135 |
+
<div class="flex-1 overflow-y-auto p-4 space-y-4" id="chat-messages">
|
| 136 |
+
<!-- Messages will be inserted here by JavaScript -->
|
| 137 |
+
</div>
|
| 138 |
+
<div class="p-4 border-t border-gray-700">
|
| 139 |
+
<div class="flex items-center space-x-2">
|
| 140 |
+
<input type="text" id="message-input" placeholder="Type your message..." class="flex-1 bg-gray-700 rounded py-2 px-4 focus:outline-none focus:ring-1 focus:ring-indigo-500">
|
| 141 |
+
<button id="send-button" class="bg-indigo-600 hover:bg-indigo-700 text-white rounded p-2">
|
| 142 |
+
<i data-feather="send" class="w-4 h-4"></i>
|
| 143 |
+
</button>
|
| 144 |
+
</div>
|
| 145 |
+
</div>
|
| 146 |
+
</div>
|
| 147 |
+
|
| 148 |
+
<!-- Side Panels -->
|
| 149 |
+
<div class="w-full md:w-96 flex flex-col border-t md:border-t-0 border-gray-700">
|
| 150 |
+
<!-- Tabs -->
|
| 151 |
+
<div class="flex border-b border-gray-700">
|
| 152 |
+
<button data-tab="editor" class="tab-button flex-1 py-3 px-4 font-medium text-center border-b-2 border-indigo-500">Editor</button>
|
| 153 |
+
<button data-tab="tasks" class="tab-button flex-1 py-3 px-4 font-medium text-center border-b-2 border-transparent">Tasks</button>
|
| 154 |
+
<button data-tab="files" class="tab-button flex-1 py-3 px-4 font-medium text-center border-b-2 border-transparent">Files</button>
|
| 155 |
+
</div>
|
| 156 |
+
|
| 157 |
+
<!-- Tab Content -->
|
| 158 |
+
<div class="flex-1 overflow-y-auto">
|
| 159 |
+
<!-- Editor Panel -->
|
| 160 |
+
<div id="editor-panel" class="p-4 h-full">
|
| 161 |
+
<div class="flex items-center justify-between mb-2">
|
| 162 |
+
<h3 class="font-medium">Code Editor</h3>
|
| 163 |
+
<button class="text-xs text-indigo-400 hover:text-indigo-300">Send to Chat</button>
|
| 164 |
+
</div>
|
| 165 |
+
<textarea id="code-editor" class="w-full h-64 bg-gray-800 text-gray-100 font-mono text-sm p-3 rounded border border-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-500" placeholder="Write your code here..."></textarea>
|
| 166 |
+
<div class="mt-2 flex justify-between">
|
| 167 |
+
<select class="bg-gray-700 text-sm rounded px-2 py-1">
|
| 168 |
+
<option>JavaScript</option>
|
| 169 |
+
<option>Python</option>
|
| 170 |
+
<option>HTML</option>
|
| 171 |
+
<option>CSS</option>
|
| 172 |
+
</select>
|
| 173 |
+
<button class="bg-gray-700 hover:bg-gray-600 text-sm rounded px-3 py-1">Run</button>
|
| 174 |
+
</div>
|
| 175 |
+
</div>
|
| 176 |
+
|
| 177 |
+
<!-- Tasks Panel -->
|
| 178 |
+
<div id="tasks-panel" class="p-4 h-full hidden">
|
| 179 |
+
<div class="flex items-center justify-between mb-2">
|
| 180 |
+
<h3 class="font-medium">Tasks</h3>
|
| 181 |
+
<button id="add-task-button" class="text-xs text-indigo-400 hover:text-indigo-300">Add Task</button>
|
| 182 |
+
</div>
|
| 183 |
+
<div class="space-y-2" id="task-list">
|
| 184 |
+
<!-- Tasks will be inserted here by JavaScript -->
|
| 185 |
+
</div>
|
| 186 |
+
</div>
|
| 187 |
+
|
| 188 |
+
<!-- Files Panel -->
|
| 189 |
+
<div id="files-panel" class="p-4 h-full hidden">
|
| 190 |
+
<div class="flex items-center justify-between mb-2">
|
| 191 |
+
<h3 class="font-medium">Files</h3>
|
| 192 |
+
<button class="text-xs text-indigo-400 hover:text-indigo-300">Upload</button>
|
| 193 |
+
</div>
|
| 194 |
+
<div class="space-y-2">
|
| 195 |
+
<div class="flex items-center p-2 rounded hover:bg-gray-700">
|
| 196 |
+
<i data-feather="file-text" class="w-4 h-4 mr-2 text-gray-400"></i>
|
| 197 |
+
<span class="text-sm">project_spec.md</span>
|
| 198 |
+
</div>
|
| 199 |
+
<div class="flex items-center p-2 rounded hover:bg-gray-700">
|
| 200 |
+
<i data-feather="file-text" class="w-4 h-4 mr-2 text-gray-400"></i>
|
| 201 |
+
<span class="text-sm">api_endpoints.json</span>
|
| 202 |
+
</div>
|
| 203 |
+
<div class="flex items-center p-2 rounded hover:bg-gray-700">
|
| 204 |
+
<i data-feather="image" class="w-4 h-4 mr-2 text-gray-400"></i>
|
| 205 |
+
<span class="text-sm">design_mockup.png</span>
|
| 206 |
+
</div>
|
| 207 |
+
</div>
|
| 208 |
+
</div>
|
| 209 |
+
</div>
|
| 210 |
+
</div>
|
| 211 |
+
</div>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
|
| 215 |
+
<!-- Status Bar -->
|
| 216 |
+
<div class="bg-gray-800 text-xs text-gray-400 px-4 py-2 flex justify-between items-center border-t border-gray-700">
|
| 217 |
+
<div class="flex items-center space-x-4">
|
| 218 |
+
<span class="flex items-center">
|
| 219 |
+
<span class="w-2 h-2 rounded-full bg-green-400 mr-1"></span>
|
| 220 |
+
<span>Connected</span>
|
| 221 |
+
</span>
|
| 222 |
+
<span>Agent: Chat</span>
|
| 223 |
+
<span>Project: AgentFlow Core</span>
|
| 224 |
+
</div>
|
| 225 |
+
<div>
|
| 226 |
+
<span>Last updated: <span id="last-updated">Just now</span></span>
|
| 227 |
+
</div>
|
| 228 |
+
</div>
|
| 229 |
+
|
| 230 |
+
<script>
|
| 231 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 232 |
+
// Initialize Feather Icons
|
| 233 |
+
feather.replace();
|
| 234 |
+
|
| 235 |
+
// Tab switching functionality
|
| 236 |
+
const tabButtons = document.querySelectorAll('.tab-button');
|
| 237 |
+
const panels = {
|
| 238 |
+
'editor': document.getElementById('editor-panel'),
|
| 239 |
+
'tasks': document.getElementById('tasks-panel'),
|
| 240 |
+
'files': document.getElementById('files-panel')
|
| 241 |
+
};
|
| 242 |
+
|
| 243 |
+
tabButtons.forEach(button => {
|
| 244 |
+
button.addEventListener('click', () => {
|
| 245 |
+
// Reset all tabs
|
| 246 |
+
tabButtons.forEach(btn => btn.classList.remove('border-indigo-500'));
|
| 247 |
+
Object.values(panels).forEach(panel => panel.classList.add('hidden'));
|
| 248 |
+
|
| 249 |
+
// Activate selected tab
|
| 250 |
+
const tabName = button.getAttribute('data-tab');
|
| 251 |
+
button.classList.add('border-indigo-500');
|
| 252 |
+
panels[tabName].classList.remove('hidden');
|
| 253 |
+
});
|
| 254 |
+
});
|
| 255 |
+
|
| 256 |
+
// Chat functionality
|
| 257 |
+
const messageInput = document.getElementById('message-input');
|
| 258 |
+
const sendButton = document.getElementById('send-button');
|
| 259 |
+
const chatMessages = document.getElementById('chat-messages');
|
| 260 |
+
|
| 261 |
+
function addMessage(content, isUser = false) {
|
| 262 |
+
const messageDiv = document.createElement('div');
|
| 263 |
+
messageDiv.className = `flex ${isUser ? 'justify-end' : 'justify-start'}`;
|
| 264 |
+
|
| 265 |
+
const bubble = document.createElement('div');
|
| 266 |
+
bubble.className = `max-w-xs md:max-w-md lg:max-w-lg rounded-lg px-4 py-2 message-animate ${isUser ? 'bg-indigo-600 text-white' : 'bg-gray-700'}`;
|
| 267 |
+
bubble.innerHTML = content;
|
| 268 |
+
|
| 269 |
+
messageDiv.appendChild(bubble);
|
| 270 |
+
chatMessages.appendChild(messageDiv);
|
| 271 |
+
chatMessages.scrollTop = chatMessages.scrollHeight;
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
function sendMessage() {
|
| 275 |
+
const message = messageInput.value.trim();
|
| 276 |
+
if (message) {
|
| 277 |
+
addMessage(message, true);
|
| 278 |
+
messageInput.value = '';
|
| 279 |
+
|
| 280 |
+
// Simulate AI response
|
| 281 |
+
setTimeout(() => {
|
| 282 |
+
addMessage(getRandomResponse());
|
| 283 |
+
}, 1000);
|
| 284 |
+
}
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
// Sample responses
|
| 288 |
+
function getRandomResponse() {
|
| 289 |
+
const responses = [
|
| 290 |
+
"I've processed your request. Here are the results...",
|
| 291 |
+
"I'm analyzing that now. One moment please.",
|
| 292 |
+
"Based on my analysis, I recommend the following approach...",
|
| 293 |
+
"Let me check my knowledge base for that information.",
|
| 294 |
+
"I found some relevant data for you.",
|
| 295 |
+
"Here's what I can tell you about that topic...",
|
| 296 |
+
"I've updated the task list with your request.",
|
| 297 |
+
"Would you like me to elaborate on any particular aspect?"
|
| 298 |
+
];
|
| 299 |
+
return responses[Math.floor(Math.random() * responses.length)];
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
sendButton.addEventListener('click', sendMessage);
|
| 303 |
+
messageInput.addEventListener('keypress', (e) => {
|
| 304 |
+
if (e.key === 'Enter') {
|
| 305 |
+
sendMessage();
|
| 306 |
+
}
|
| 307 |
+
});
|
| 308 |
+
|
| 309 |
+
// Initialize with welcome messages
|
| 310 |
+
setTimeout(() => {
|
| 311 |
+
addMessage("Welcome to AgentFlow Nexus! How can I assist you today?");
|
| 312 |
+
}, 500);
|
| 313 |
+
|
| 314 |
+
setTimeout(() => {
|
| 315 |
+
addMessage("I can help with coding, task management, and file organization. Try asking me anything!");
|
| 316 |
+
}, 1200);
|
| 317 |
+
|
| 318 |
+
// Task functionality
|
| 319 |
+
const addTaskButton = document.getElementById('add-task-button');
|
| 320 |
+
const taskList = document.getElementById('task-list');
|
| 321 |
+
|
| 322 |
+
// Sample tasks
|
| 323 |
+
const sampleTasks = [
|
| 324 |
+
{ id: 1, text: "Integrate OpenAI API", completed: false },
|
| 325 |
+
{ id: 2, text: "Design landing page", completed: true },
|
| 326 |
+
{ id: 3, text: "Fix authentication bug", completed: false }
|
| 327 |
+
];
|
| 328 |
+
|
| 329 |
+
function renderTasks() {
|
| 330 |
+
taskList.innerHTML = '';
|
| 331 |
+
const tasks = JSON.parse(localStorage.getItem('tasks')) || sampleTasks;
|
| 332 |
+
|
| 333 |
+
tasks.forEach(task => {
|
| 334 |
+
const taskDiv = document.createElement('div');
|
| 335 |
+
taskDiv.className = `flex items-center p-2 rounded ${task.completed ? 'bg-gray-800 text-gray-500' : 'bg-gray-700 hover:bg-gray-600'}`;
|
| 336 |
+
|
| 337 |
+
const checkbox = document.createElement('input');
|
| 338 |
+
checkbox.type = 'checkbox';
|
| 339 |
+
checkbox.className = 'mr-2';
|
| 340 |
+
checkbox.checked = task.completed;
|
| 341 |
+
checkbox.addEventListener('change', () => {
|
| 342 |
+
task.completed = checkbox.checked;
|
| 343 |
+
saveTasks(tasks);
|
| 344 |
+
renderTasks();
|
| 345 |
+
});
|
| 346 |
+
|
| 347 |
+
const text = document.createElement('span');
|
| 348 |
+
text.className = `flex-1 ${task.completed ? 'line-through' : ''}`;
|
| 349 |
+
text.textContent = task.text;
|
| 350 |
+
|
| 351 |
+
const deleteButton = document.createElement('button');
|
| 352 |
+
deleteButton.innerHTML = '<i data-feather="trash-2" class="w-4 h-4 text-gray-400 hover:text-red-400"></i>';
|
| 353 |
+
deleteButton.addEventListener('click', () => {
|
| 354 |
+
const index = tasks.findIndex(t => t.id === task.id);
|
| 355 |
+
if (index !== -1) {
|
| 356 |
+
tasks.splice(index, 1);
|
| 357 |
+
saveTasks(tasks);
|
| 358 |
+
renderTasks();
|
| 359 |
+
}
|
| 360 |
+
});
|
| 361 |
+
|
| 362 |
+
taskDiv.appendChild(checkbox);
|
| 363 |
+
taskDiv.appendChild(text);
|
| 364 |
+
taskDiv.appendChild(deleteButton);
|
| 365 |
+
taskList.appendChild(taskDiv);
|
| 366 |
+
});
|
| 367 |
+
|
| 368 |
+
feather.replace();
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
function saveTasks(tasks) {
|
| 372 |
+
localStorage.setItem('tasks', JSON.stringify(tasks));
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
addTaskButton.addEventListener('click', () => {
|
| 376 |
+
const tasks = JSON.parse(localStorage.getItem('tasks')) || sampleTasks;
|
| 377 |
+
const newId = tasks.length > 0 ? Math.max(...tasks.map(t => t.id)) + 1 : 1;
|
| 378 |
+
const newTask = {
|
| 379 |
+
id: newId,
|
| 380 |
+
text: "New Task",
|
| 381 |
+
completed: false
|
| 382 |
+
};
|
| 383 |
+
tasks.push(newTask);
|
| 384 |
+
saveTasks(tasks);
|
| 385 |
+
renderTasks();
|
| 386 |
+
});
|
| 387 |
+
|
| 388 |
+
// Initialize tasks
|
| 389 |
+
renderTasks();
|
| 390 |
+
|
| 391 |
+
// Update last updated time
|
| 392 |
+
function updateLastUpdated() {
|
| 393 |
+
document.getElementById('last-updated').textContent = new Date().toLocaleTimeString();
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
setInterval(updateLastUpdated, 60000);
|
| 397 |
+
updateLastUpdated();
|
| 398 |
+
});
|
| 399 |
+
</script>
|
| 400 |
+
</body>
|
| 401 |
</html>
|