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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="de">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Fokus & Flow - Aufgabenliste</title>
|
| 7 |
+
|
| 8 |
+
<!-- Google Fonts -->
|
| 9 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 10 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 11 |
+
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap" rel="stylesheet">
|
| 12 |
+
|
| 13 |
+
<!-- Font Awesome -->
|
| 14 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 15 |
+
|
| 16 |
+
<style>
|
| 17 |
+
:root {
|
| 18 |
+
/* Light Theme Variables */
|
| 19 |
+
--bg-color: #f3f4f6;
|
| 20 |
+
--text-color: #1f2937;
|
| 21 |
+
--card-bg: #ffffff;
|
| 22 |
+
--primary-color: #6366f1; /* Indigo */
|
| 23 |
+
--secondary-color: #a855f7; /* Purple */
|
| 24 |
+
--accent-color: #10b981; /* Emerald */
|
| 25 |
+
--danger-color: #ef4444;
|
| 26 |
+
--border-color: #e5e7eb;
|
| 27 |
+
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
| 28 |
+
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
| 29 |
+
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
| 30 |
+
--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 31 |
+
--font-main: 'Outfit', sans-serif;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
[data-theme="dark"] {
|
| 35 |
+
/* Dark Theme Variables */
|
| 36 |
+
--bg-color: #0f172a;
|
| 37 |
+
--text-color: #f3f4f6;
|
| 38 |
+
--card-bg: #1e293b;
|
| 39 |
+
--primary-color: #818cf8;
|
| 40 |
+
--secondary-color: #c084fc;
|
| 41 |
+
--accent-color: #34d399;
|
| 42 |
+
--danger-color: #f87171;
|
| 43 |
+
--border-color: #334155;
|
| 44 |
+
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
|
| 45 |
+
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
|
| 46 |
+
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
* {
|
| 50 |
+
margin: 0;
|
| 51 |
+
padding: 0;
|
| 52 |
+
box-sizing: border-box;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
body {
|
| 56 |
+
font-family: var(--font-main);
|
| 57 |
+
background-color: var(--bg-color);
|
| 58 |
+
color: var(--text-color);
|
| 59 |
+
transition: var(--transition);
|
| 60 |
+
min-height: 100vh;
|
| 61 |
+
display: flex;
|
| 62 |
+
flex-direction: column;
|
| 63 |
+
overflow-x: hidden;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
/* --- Header --- */
|
| 67 |
+
header {
|
| 68 |
+
background: rgba(255, 255, 255, 0.0);
|
| 69 |
+
backdrop-filter: blur(10px);
|
| 70 |
+
padding: 1rem 2rem;
|
| 71 |
+
display: flex;
|
| 72 |
+
justify-content: space-between;
|
| 73 |
+
align-items: center;
|
| 74 |
+
position: sticky;
|
| 75 |
+
top: 0;
|
| 76 |
+
z-index: 100;
|
| 77 |
+
border-bottom: 1px solid var(--border-color);
|
| 78 |
+
background-color: var(--card-bg);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.logo {
|
| 82 |
+
font-size: 1.5rem;
|
| 83 |
+
font-weight: 700;
|
| 84 |
+
background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
|
| 85 |
+
-webkit-background-clip: text;
|
| 86 |
+
background-clip: text;
|
| 87 |
+
color: transparent;
|
| 88 |
+
display: flex;
|
| 89 |
+
align-items: center;
|
| 90 |
+
gap: 0.5rem;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.anycoder-link {
|
| 94 |
+
font-size: 0.9rem;
|
| 95 |
+
font-weight: 600;
|
| 96 |
+
color: var(--text-color);
|
| 97 |
+
text-decoration: none;
|
| 98 |
+
padding: 0.5rem 1rem;
|
| 99 |
+
border-radius: 2rem;
|
| 100 |
+
background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
|
| 101 |
+
border: 1px solid var(--border-color);
|
| 102 |
+
transition: var(--transition);
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.anycoder-link:hover {
|
| 106 |
+
transform: translateY(-2px);
|
| 107 |
+
box-shadow: var(--shadow-md);
|
| 108 |
+
background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
.theme-toggle {
|
| 112 |
+
background: none;
|
| 113 |
+
border: none;
|
| 114 |
+
color: var(--text-color);
|
| 115 |
+
font-size: 1.2rem;
|
| 116 |
+
cursor: pointer;
|
| 117 |
+
padding: 0.5rem;
|
| 118 |
+
border-radius: 50%;
|
| 119 |
+
transition: var(--transition);
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.theme-toggle:hover {
|
| 123 |
+
background-color: rgba(128, 128, 128, 0.1);
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
/* --- Main Layout --- */
|
| 127 |
+
main {
|
| 128 |
+
flex: 1;
|
| 129 |
+
padding: 2rem;
|
| 130 |
+
width: 100%;
|
| 131 |
+
display: flex;
|
| 132 |
+
justify-content: center;
|
| 133 |
+
align-items: flex-start;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
.card {
|
| 137 |
+
background-color: var(--card-bg);
|
| 138 |
+
border-radius: 1.5rem;
|
| 139 |
+
padding: 2rem;
|
| 140 |
+
box-shadow: var(--shadow-md);
|
| 141 |
+
border: 1px solid var(--border-color);
|
| 142 |
+
transition: var(--transition);
|
| 143 |
+
display: flex;
|
| 144 |
+
flex-direction: column;
|
| 145 |
+
width: 100%;
|
| 146 |
+
max-width: 700px; /* Centered width */
|
| 147 |
+
min-height: 600px;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
.card:hover {
|
| 151 |
+
box-shadow: var(--shadow-lg);
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
h2 {
|
| 155 |
+
font-size: 1.5rem;
|
| 156 |
+
margin-bottom: 2rem;
|
| 157 |
+
font-weight: 700;
|
| 158 |
+
display: flex;
|
| 159 |
+
align-items: center;
|
| 160 |
+
gap: 0.75rem;
|
| 161 |
+
color: var(--text-color);
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
.btn {
|
| 165 |
+
padding: 0.75rem 1.5rem;
|
| 166 |
+
border-radius: 0.75rem;
|
| 167 |
+
border: none;
|
| 168 |
+
font-weight: 600;
|
| 169 |
+
cursor: pointer;
|
| 170 |
+
transition: var(--transition);
|
| 171 |
+
font-family: var(--font-main);
|
| 172 |
+
display: flex;
|
| 173 |
+
align-items: center;
|
| 174 |
+
gap: 0.5rem;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
.btn-primary {
|
| 178 |
+
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
|
| 179 |
+
color: white;
|
| 180 |
+
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
.btn-primary:hover {
|
| 184 |
+
filter: brightness(1.1);
|
| 185 |
+
box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
/* --- Tasks Section --- */
|
| 189 |
+
.task-input-group {
|
| 190 |
+
display: flex;
|
| 191 |
+
gap: 0.75rem;
|
| 192 |
+
margin-bottom: 2rem;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.task-input {
|
| 196 |
+
flex: 1;
|
| 197 |
+
padding: 1rem;
|
| 198 |
+
border-radius: 0.75rem;
|
| 199 |
+
border: 1px solid var(--border-color);
|
| 200 |
+
background-color: var(--bg-color);
|
| 201 |
+
color: var(--text-color);
|
| 202 |
+
outline: none;
|
| 203 |
+
font-family: var(--font-main);
|
| 204 |
+
font-size: 1rem;
|
| 205 |
+
transition: var(--transition);
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
.task-input:focus {
|
| 209 |
+
border-color: var(--primary-color);
|
| 210 |
+
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
.task-list {
|
| 214 |
+
list-style: none;
|
| 215 |
+
overflow-y: auto;
|
| 216 |
+
flex: 1; /* Fill remaining space */
|
| 217 |
+
padding-right: 0.5rem;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
/* Custom Scrollbar */
|
| 221 |
+
.task-list::-webkit-scrollbar {
|
| 222 |
+
width: 6px;
|
| 223 |
+
}
|
| 224 |
+
.task-list::-webkit-scrollbar-track {
|
| 225 |
+
background: transparent;
|
| 226 |
+
}
|
| 227 |
+
.task-list::-webkit-scrollbar-thumb {
|
| 228 |
+
background-color: var(--border-color);
|
| 229 |
+
border-radius: 20px;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
.task-item {
|
| 233 |
+
display: flex;
|
| 234 |
+
align-items: center;
|
| 235 |
+
justify-content: space-between;
|
| 236 |
+
padding: 1rem;
|
| 237 |
+
background-color: var(--bg-color);
|
| 238 |
+
border-radius: 1rem;
|
| 239 |
+
margin-bottom: 0.75rem;
|
| 240 |
+
border: 1px solid transparent;
|
| 241 |
+
transition: var(--transition);
|
| 242 |
+
animation: slideIn 0.3s ease;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
@keyframes slideIn {
|
| 246 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 247 |
+
to { opacity: 1; transform: translateY(0); }
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
.task-item:hover {
|
| 251 |
+
border-color: var(--primary-color);
|
| 252 |
+
transform: translateX(4px);
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
.task-content {
|
| 256 |
+
display: flex;
|
| 257 |
+
align-items: center;
|
| 258 |
+
gap: 1rem;
|
| 259 |
+
flex: 1;
|
| 260 |
+
cursor: pointer;
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
.custom-checkbox {
|
| 264 |
+
width: 24px;
|
| 265 |
+
height: 24px;
|
| 266 |
+
border: 2px solid var(--primary-color);
|
| 267 |
+
border-radius: 8px;
|
| 268 |
+
display: flex;
|
| 269 |
+
align-items: center;
|
| 270 |
+
justify-content: center;
|
| 271 |
+
transition: var(--transition);
|
| 272 |
+
flex-shrink: 0;
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
.task-item.completed .custom-checkbox {
|
| 276 |
+
background-color: var(--primary-color);
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
.custom-checkbox i {
|
| 280 |
+
color: white;
|
| 281 |
+
font-size: 0.8rem;
|
| 282 |
+
opacity: 0;
|
| 283 |
+
transform: scale(0);
|
| 284 |
+
transition: var(--transition);
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
.task-item.completed .custom-checkbox i {
|
| 288 |
+
opacity: 1;
|
| 289 |
+
transform: scale(1);
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
.task-text {
|
| 293 |
+
transition: var(--transition);
|
| 294 |
+
font-size: 1.05rem;
|
| 295 |
+
word-break: break-word;
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
.task-item.completed .task-text {
|
| 299 |
+
text-decoration: line-through;
|
| 300 |
+
color: #9ca3af;
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
.delete-btn {
|
| 304 |
+
background: none;
|
| 305 |
+
border: none;
|
| 306 |
+
color: #9ca3af;
|
| 307 |
+
cursor: pointer;
|
| 308 |
+
padding: 0.5rem;
|
| 309 |
+
margin-left: 0.5rem;
|
| 310 |
+
transition: var(--transition);
|
| 311 |
+
border-radius: 0.5rem;
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
.delete-btn:hover {
|
| 315 |
+
color: var(--danger-color);
|
| 316 |
+
background-color: rgba(239, 68, 68, 0.1);
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
.empty-state {
|
| 320 |
+
text-align: center;
|
| 321 |
+
color: #9ca3af;
|
| 322 |
+
margin-top: 4rem;
|
| 323 |
+
display: none;
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
.empty-state i {
|
| 327 |
+
font-size: 3rem;
|
| 328 |
+
margin-bottom: 1rem;
|
| 329 |
+
opacity: 0.5;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
/* Footer */
|
| 333 |
+
footer {
|
| 334 |
+
text-align: center;
|
| 335 |
+
padding: 2rem;
|
| 336 |
+
color: #6b7280;
|
| 337 |
+
font-size: 0.9rem;
|
| 338 |
+
margin-top: auto;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
/* Mobile Responsiveness */
|
| 342 |
+
@media (max-width: 640px) {
|
| 343 |
+
header {
|
| 344 |
+
flex-direction: column;
|
| 345 |
+
gap: 1rem;
|
| 346 |
+
}
|
| 347 |
+
main {
|
| 348 |
+
padding: 1rem;
|
| 349 |
+
}
|
| 350 |
+
.card {
|
| 351 |
+
min-height: auto;
|
| 352 |
+
padding: 1.5rem;
|
| 353 |
+
}
|
| 354 |
+
}
|
| 355 |
+
</style>
|
| 356 |
+
</head>
|
| 357 |
+
<body>
|
| 358 |
+
|
| 359 |
+
<header>
|
| 360 |
+
<div class="logo">
|
| 361 |
+
<i class="fa-solid fa-check-double"></i> Fokus & Flow
|
| 362 |
+
</div>
|
| 363 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">Built with anycoder</a>
|
| 364 |
+
<button class="theme-toggle" id="themeToggle" aria-label="Thema wechseln">
|
| 365 |
+
<i class="fa-solid fa-moon"></i>
|
| 366 |
+
</button>
|
| 367 |
+
</header>
|
| 368 |
+
|
| 369 |
+
<main>
|
| 370 |
+
<!-- Tasks Section (Sole Focus) -->
|
| 371 |
+
<section class="card tasks-section">
|
| 372 |
+
<h2><i class="fa-solid fa-list-check" style="color: var(--secondary-color)"></i> Deine Aufgaben</h2>
|
| 373 |
+
|
| 374 |
+
<div class="task-input-group">
|
| 375 |
+
<input type="text" class="task-input" id="taskInput" placeholder="Was möchtest du erledigen?">
|
| 376 |
+
<button class="btn btn-primary" id="addTaskBtn">
|
| 377 |
+
<i class="fa-solid fa-plus"></i> Hinzufügen
|
| 378 |
+
</button>
|
| 379 |
+
</div>
|
| 380 |
+
|
| 381 |
+
<div class="empty-state" id="emptyState">
|
| 382 |
+
<i class="fa-solid fa-clipboard-list"></i>
|
| 383 |
+
<p>Keine Aufgaben vorhanden. <br>Füge eine neue Aufgabe hinzu!</p>
|
| 384 |
+
</div>
|
| 385 |
+
|
| 386 |
+
<ul class="task-list" id="taskList">
|
| 387 |
+
<!-- Tasks will be added here -->
|
| 388 |
+
</ul>
|
| 389 |
+
</section>
|
| 390 |
+
</main>
|
| 391 |
+
|
| 392 |
+
<footer>
|
| 393 |
+
© 2023 Fokus & Flow. Alle Rechte vorbehalten.
|
| 394 |
+
</footer>
|
| 395 |
+
|
| 396 |
+
<script>
|
| 397 |
+
// --- Theme Logic ---
|
| 398 |
+
const themeToggle = document.getElementById('themeToggle');
|
| 399 |
+
const body = document.body;
|
| 400 |
+
const icon = themeToggle.querySelector('i');
|
| 401 |
+
|
| 402 |
+
// Check local storage
|
| 403 |
+
if (localStorage.getItem('theme') === 'dark') {
|
| 404 |
+
body.setAttribute('data-theme', 'dark');
|
| 405 |
+
icon.classList.replace('fa-moon', 'fa-sun');
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
themeToggle.addEventListener('click', () => {
|
| 409 |
+
if (body.getAttribute('data-theme') === 'dark') {
|
| 410 |
+
body.removeAttribute('data-theme');
|
| 411 |
+
localStorage.setItem('theme', 'light');
|
| 412 |
+
icon.classList.replace('fa-sun', 'fa-moon');
|
| 413 |
+
} else {
|
| 414 |
+
body.setAttribute('data-theme', 'dark');
|
| 415 |
+
localStorage.setItem('theme', 'dark');
|
| 416 |
+
icon.classList.replace('fa-moon', 'fa-sun');
|
| 417 |
+
}
|
| 418 |
+
});
|
| 419 |
+
|
| 420 |
+
// --- Task Logic ---
|
| 421 |
+
const taskInput = document.getElementById('taskInput');
|
| 422 |
+
const addTaskBtn = document.getElementById('addTaskBtn');
|
| 423 |
+
const taskList = document.getElementById('taskList');
|
| 424 |
+
const emptyState = document.getElementById('emptyState');
|
| 425 |
+
|
| 426 |
+
let tasks = JSON.parse(localStorage.getItem('tasks')) || [];
|
| 427 |
+
|
| 428 |
+
function renderTasks() {
|
| 429 |
+
taskList.innerHTML = '';
|
| 430 |
+
|
| 431 |
+
if (tasks.length === 0) {
|
| 432 |
+
emptyState.style.display = 'block';
|
| 433 |
+
} else {
|
| 434 |
+
emptyState.style.display = 'none';
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
tasks.forEach((task, index) => {
|
| 438 |
+
const li = document.createElement('li');
|
| 439 |
+
li.className = `task-item ${task.completed ? 'completed' : ''}`;
|
| 440 |
+
|
| 441 |
+
li.innerHTML = `
|
| 442 |
+
<div class="task-content" onclick="toggleTask(${index})">
|
| 443 |
+
<div class="custom-checkbox">
|
| 444 |
+
<i class="fa-solid fa-check"></i>
|
| 445 |
+
</div>
|
| 446 |
+
<span class="task-text">${escapeHtml(task.text)}</span>
|
| 447 |
+
</div>
|
| 448 |
+
<button class="delete-btn" onclick="deleteTask(${index})" aria-label="Löschen">
|
| 449 |
+
<i class="fa-solid fa-trash"></i>
|
| 450 |
+
</button>
|
| 451 |
+
`;
|
| 452 |
+
taskList.appendChild(li);
|
| 453 |
+
});
|
| 454 |
+
|
| 455 |
+
localStorage.setItem('tasks', JSON.stringify(tasks));
|
| 456 |
+
}
|
| 457 |
+
|
| 458 |
+
function addTask() {
|
| 459 |
+
const text = taskInput.value.trim();
|
| 460 |
+
if (text) {
|
| 461 |
+
tasks.push({ text, completed: false });
|
| 462 |
+
taskInput.value = '';
|
| 463 |
+
renderTasks();
|
| 464 |
+
taskInput.focus();
|
| 465 |
+
}
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
// Helper to prevent XSS
|
| 469 |
+
function escapeHtml(text) {
|
| 470 |
+
const map = {
|
| 471 |
+
'&': '&',
|
| 472 |
+
'<': '<',
|
| 473 |
+
'>': '>',
|
| 474 |
+
'"': '"',
|
| 475 |
+
"'": '''
|
| 476 |
+
};
|
| 477 |
+
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
window.toggleTask = (index) => {
|
| 481 |
+
tasks[index].completed = !tasks[index].completed;
|
| 482 |
+
renderTasks();
|
| 483 |
+
};
|
| 484 |
+
|
| 485 |
+
window.deleteTask = (index) => {
|
| 486 |
+
// Optional: Add confirmation
|
| 487 |
+
// if(confirm('Aufgabe wirklich löschen?')) {
|
| 488 |
+
tasks.splice(index, 1);
|
| 489 |
+
renderTasks();
|
| 490 |
+
// }
|
| 491 |
+
};
|
| 492 |
+
|
| 493 |
+
addTaskBtn.addEventListener('click', addTask);
|
| 494 |
+
taskInput.addEventListener('keypress', (e) => {
|
| 495 |
+
if (e.key === 'Enter') addTask();
|
| 496 |
+
});
|
| 497 |
+
|
| 498 |
+
// Initialize
|
| 499 |
+
renderTasks();
|
| 500 |
+
</script>
|
| 501 |
+
</body>
|
| 502 |
+
</html>
|