File size: 16,269 Bytes
9e3c379 |
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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>System Zgłaszania Błędów</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/lucide@latest/dist/umd/lucide.js"></script>
<style>
.dragging {
opacity: 0.5;
transform: rotate(5deg);
}
.drop-zone {
background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
border: 2px dashed #0ea5e9;
}
.priority-high {
border-left: 4px solid #ef4444;
background: linear-gradient(90deg, #fef2f2 0%, #ffffff 100%);
}
.priority-medium {
border-left: 4px solid #f59e0b;
background: linear-gradient(90deg, #fffbeb 0%, #ffffff 100%);
}
.priority-low {
border-left: 4px solid #10b981;
background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 100%);
}
.vote-btn {
transition: all 0.2s ease;
}
.vote-btn:hover {
transform: scale(1.1);
}
.vote-btn:active {
transform: scale(0.9);
}
.kanban-card {
transition: all 0.3s ease;
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.badge-pulse {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
opacity: 1;
}
50% {
opacity: 0.5;
}
100% {
opacity: 1;
}
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<div class="container mx-auto px-4 py-8">
<header class="mb-8">
<h1 class="text-4xl font-bold text-gray-800 mb-2">System Zgłaszania Błędów</h1>
<p class="text-gray-600">Zarządzaj zgłoszeniami w formie tablicy Kanban</p>
<button onclick="showAddForm()" class="mt-4 bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition-colors flex items-center gap-2">
<i data-lucide="plus-circle"></i>
Dodaj nowe zgłoszenie
</button>
</header>
<!-- Formularz dodawania zgłoszenia -->
<div id="addFormModal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
<div class="bg-white rounded-lg p-8 max-w-md w-full mx-4 transform transition-all">
<h2 class="text-2xl font-bold mb-4">Nowe zgłoszenie błędu</h2>
<form id="bugForm" onsubmit="addBug(event)" class="space-y-4">
<div>
<label class="block text-sm font-medium mb-2">Tytuł zgłoszenia</label>
<input type="text" id="bugTitle" required class="w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium mb-2">Opis</label>
<textarea id="bugDescription" required class="w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" rows="3"></textarea>
</div>
<div>
<label class="block text-sm font-medium mb-2">Kategoria</label>
<select id="bugCategory" required class="w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">Wybierz kategorię</option>
<option value="frontend">Frontend</option>
<option value="backend">Backend</option>
<option value="baza-danych">Baza danych</option>
<option value="ui-ux">UI/UX</option>
<option value="bezpieczenstwo">Bezpieczeństwo</option>
</select>
</div>
<div>
<label class="block text-sm font-medium mb-2">Priorytet</label>
<select id="bugPriority" required class="w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="low">Niski</option>
<option value="medium">Średni</option>
<option value="high">Wysoki</option>
</select>
</div>
<div class="flex gap-2">
<button type="submit" class="flex-1 bg-green-600 text-white py-2 rounded-lg hover:bg-green-700 transition-colors">
Zapisz zgłoszenie
</button>
<button type="button" onclick="hideAddForm()" class="flex-1 bg-gray-600 text-white py-2 rounded-lg hover:bg-gray-700 transition-colors">
Anuluj
</button>
</div>
</form>
</div>
</div>
<!-- Tablica Kanban -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div class="bg-gray-100 rounded-lg p-4">
<h3 class="font-bold text-lg mb-4 flex items-center gap-2">
<i data-lucide="circle" class="text-gray-500"></i>
Nowe
<span id="newCount" class="bg-gray-500 text-white px-2 py-1 rounded-full text-sm">0</span>
</h3>
<div id="newColumn" class="space-y-3 min-h-96" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
</div>
<div class="bg-blue-100 rounded-lg p-4">
<h3 class="font-bold text-lg mb-4 flex items-center gap-2">
<i data-lucide="loader" class="text-blue-500"></i>
W trakcie
<span id="progressCount" class="bg-blue-500 text-white px-2 py-1 rounded-full text-sm">0</span>
</h3>
<div id="progressColumn" class="space-y-3 min-h-96" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
</div>
<div class="bg-yellow-100 rounded-lg p-4">
<h3 class="font-bold text-lg mb-4 flex items-center gap-2">
<i data-lucide="check-circle-2" class="text-yellow-500"></i>
Do weryfikacji
<span id="reviewCount" class="bg-yellow-500 text-white px-2 py-1 rounded-full text-sm">0</span>
</h3>
<div id="reviewColumn" class="space-y-3 min-h-96" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
</div>
<div class="bg-green-100 rounded-lg p-4">
<h3 class="font-bold text-lg mb-4 flex items-center gap-2">
<i data-lucide="check" class="text-green-500"></i>
Zakończone
<span id="doneCount" class="bg-green-500 text-white px-2 py-1 rounded-full text-sm">0</span>
</h3>
<div id="doneColumn" class="space-y-3 min-h-96" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
</div>
</div>
</div>
<script>
let bugs = [];
let draggedElement = null;
// Inicjalizacja
document.addEventListener('DOMContentLoaded', () => {
lucide.createIcons();
loadSampleData();
renderBugs();
updateCounts();
});
function loadSampleData() {
bugs = [
{
id: 1,
title: "Przycisk wylogowania nie działa",
description: "Po kliknięciu przycisku 'Wyloguj' nic się nie dzieje",
category: "frontend",
priority: "high",
status: "new",
votes: 5,
date: new Date()
},
{
id: 2,
title: "Błąd w zapytaniu SQL",
description: "Niepoprawne łączenie tabel w raporcie sprzedaży",
category: "baza-danych",
priority: "medium",
status: "progress",
votes: 2,
date: new Date()
},
{
id: 3,
title: "Logo nie wyświetla się poprawnie na Safari",
description: "Na przeglądarce Safari logo jest rozciągnięte",
category: "ui-ux",
priority: "low",
status: "review",
votes: 1,
date: new Date()
}
];
}
function renderBugs() {
// Wyczyść kolumny
['new', 'progress', 'review', 'done'].forEach(status => {
const column = document.getElementById(`${status}Column`);
column.innerHTML = '';
});
// Renderuj zgłoszenia
bugs.forEach(bug => {
const card = createBugCard(bug);
const column = document.getElementById(`${bug.status}Column`);
column.appendChild(card);
});
updateCounts();
lucide.createIcons();
}
function createBugCard(bug) {
const card = document.createElement('div');
card.className = `kanban-card bg-white p-4 rounded-lg shadow-md cursor-move priority-${bug.priority}`;
card.draggable = true;
card.dataset.id = bug.id;
const categoryMap = {
'frontend': 'Frontend',
'backend': 'Backend',
'baza-danych': 'Baza danych',
'ui-ux': 'UI/UX',
'bezpieczenstwo': 'Bezpieczeństwo'
};
const priorityMap = {
'high': { text: 'Wysoki', color: 'red' },
'medium': { text: 'Średni', color: 'yellow' },
'low': { text: 'Niski', color: 'green' }
};
const priority = priorityMap[bug.priority];
card.innerHTML = `
<div class="flex justify-between items-start mb-2">
<h4 class="font-semibold text-gray-800">${bug.title}</h4>
<div class="flex items-center gap-1">
<button onclick="voteUp(${bug.id})" class="vote-btn text-gray-500 hover:text-blue-600">
<i data-lucide="thumbs-up" class="w-4 h-4"></i>
</button>
<span class="text-sm text-gray-600">${bug.votes}</span>
</div>
</div>
<p class="text-sm text-gray-600 mb-3">${bug.description}</p>
<div class="flex items-center justify-between">
<span class="text-xs bg-gray-200 px-2 py-1 rounded">${categoryMap[bug.category]}</span>
<span class="text-xs bg-${priority.color}-100 text-${priority.color}-700 px-2 py-1 rounded">${priority.text}</span>
</div>
<div class="mt-2 text-xs text-gray-500">
${bug.date.toLocaleDateString('pl-PL')}
</div>
`;
// Event listeners dla drag & drop
card.addEventListener('dragstart', dragStart);
card.addEventListener('dragend', dragEnd);
return card;
}
function addBug(event) {
event.preventDefault();
const newBug = {
id: Date.now(),
title: document.getElementById('bugTitle').value,
description: document.getElementById('bugDescription').value,
category: document.getElementById('bugCategory').value,
priority: document.getElementById('bugPriority').value,
status: 'new',
votes: 0,
date: new Date()
};
bugs.push(newBug);
renderBugs();
hideAddForm();
document.getElementById('bugForm').reset();
}
function voteUp(bugId) {
const bug = bugs.find(b => b.id === bugId);
if (bug) {
bug.votes++;
// Animacja głosu
const card = document.querySelector(`[data-id="${bugId}"]`);
const voteBtn = card.querySelector('.vote-btn');
voteBtn.style.color = '#3b82f6';
setTimeout(() => {
voteBtn.style.color = '';
}, 300);
renderBugs();
}
}
function showAddForm() {
document.getElementById('addFormModal').classList.remove('hidden');
document.getElementById('addFormModal').classList.add('flex');
}
function hideAddForm() {
document.getElementById('addFormModal').classList.add('hidden');
document.getElementById('addFormModal').classList.remove('flex');
}
function updateCounts() {
const counts = {
new: bugs.filter(b => b.status === 'new').length,
progress: bugs.filter(b => b.status === 'progress').length,
review: bugs.filter(b => b.status === 'review').length,
done: bugs.filter(b => b.status === 'done').length
};
Object.keys(counts).forEach(status => {
const countElement = document.getElementById(`${status}Count`);
countElement.textContent = counts[status];
// Pulsująca animacja gdy pojawi się nowe zgłoszenie
if (counts[status] > 0) {
countElement.classList.add('badge-pulse');
}
});
}
// Drag & Drop functions
function dragStart(e) {
draggedElement = e.target;
e.target.classList.add('dragging');
}
function dragEnd(e) {
e.target.classList.remove('dragging');
}
function allowDrop(e) {
e.preventDefault();
e.currentTarget.classList.add('drop-zone');
}
function drop(e) {
e.preventDefault();
e.currentTarget.classList.remove('drop-zone');
if (draggedElement) {
const bugId = parseInt(draggedElement.dataset.id);
const newStatus = e.currentTarget.id.replace('Column', '');
const bug = bugs.find(b => b.id === bugId);
if (bug && bug.status !== newStatus) {
bug.status = newStatus;
renderBugs();
}
draggedElement = null;
}
}
</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=magikx/test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |