Creating a Kanban-Style Work Offer Management Website
Here's a comprehensive guide to building a Kanban board website to track your work offers and their progress.
Basic Structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Work Offers Kanban</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background-color: #f5f5f5;
}
.kanban-board {
display: flex;
gap: 20px;
overflow-x: auto;
padding-bottom: 20px;
}
.kanban-column {
background-color: #e3e3e3;
border-radius: 5px;
min-width: 300px;
padding: 15px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.column-header {
font-weight: bold;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid #ccc;
display: flex;
justify-content: space-between;
align-items: center;
}
.kanban-item {
background-color: white;
border-radius: 5px;
padding: 15px;
margin-bottom: 15px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
cursor: move;
}
.kanban-item h3 {
margin-top: 0;
color: #333;
}
.kanban-item p {
margin-bottom: 0;
color: #666;
}
.add-item {
color: #666;
cursor: pointer;
text-align: center;
padding: 10px;
border-radius: 5px;
margin-top: 10px;
}
.add-item:hover {
background-color: #ddd;
}
.status-indicator {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 5px;
}
.status-new { background-color: #4CAF50; }
.status-considering { background-color: #2196F3; }
.status-negotiating { background-color: #FFC107; }
.status-accepted { background-color: #9C27B0; }
.status-rejected { background-color: #F44336; }
.item-footer {
display: flex;
justify-content: space-between;
margin-top: 10px;
font-size: 0.8em;
color: #999;
}
.item-actions {
display: flex;
gap: 5px;
}
.item-actions button {
background: none;
border: none;
cursor: pointer;
color: #666;
}
</style>
</head>
<body>
<h1>Work Offers Kanban</h1>
<div class="kanban-board" id="kanbanBoard">
<!-- Columns will be added here by JavaScript -->
</div>
<script>
// Sample data structure
const offers = [
{
id: 1,
title: "Senior Developer at TechCorp",
company: "TechCorp Inc.",
salary: "$120,000",
status: "new",
date: "2023-05-15",
notes: "Great benefits package"
},
{
id: 2,
title: "Team Lead at WebSolutions",
company: "WebSolutions LLC",
salary: "$110,000 + bonus",
status: "considering",
date: "2023-05-10",
notes: "Would need to relocate"
},
{
id: 3,
title: "CTO at StartupX",
company: "StartupX",
salary: "$95,000 + equity",
status: "negotiating",
date: "2023-05-05",
notes: "Exciting opportunity but risky"
},
{
id: 4,
title: "Software Architect at BigSoft",
company: "BigSoft Corporation",
salary: "$130,000",
status: "accepted",
date: "2023-04-28",
notes: "Signed contract, starting June 1"
},
{
id: 5,
title: "DevOps Engineer at CloudNet",
company: "CloudNet",
salary: "$105,000",
status: "rejected",
date: "2023-04-20",
notes: "Not the right cultural fit"
}
];
const statuses = [
{ id: "new", name: "New Offers", color: "status-new" },
{ id: "considering", name: "Considering", color: "status-considering" },
{ id: "negotiating", name: "Negotiating", color: "status-negotiating" },
{ id: "accepted", name: "Accepted", color: "status-accepted" },
{ id: "rejected", name: "Rejected", color: "status-rejected" }
];
// Initialize the board
function initKanban() {
const board = document.getElementById('kanbanBoard');
statuses.forEach(status => {
const column = document.createElement('div');
column.className = 'kanban-column';
column.dataset.status = status.id;
const header = document.createElement('div');
header.className = 'column-header';
const statusIndicator = document.createElement('span');
statusIndicator.className = `status-indicator ${status.color}`;
const headerText = document.createElement('span');
headerText.textContent = status.name;
const count = document.createElement('span');
count.className = 'count';
header.appendChild(statusIndicator);
header.appendChild(headerText);
header.appendChild(count);
column.appendChild(header);
const itemsContainer = document.createElement('div');
itemsContainer.className = 'items-container';
column.appendChild(itemsContainer);
board.appendChild(column);
});
renderOffers();
}
// Render offers into columns
function renderOffers() {
// Clear all columns first
document.querySelectorAll('.items-container').forEach(container => {
container.innerHTML = '';
});
// Add offers to their respective columns
offers.forEach(offer => {
const column = document.querySelector(`.kanban-column[data-status="${offer.status}"] .items-container`);
if (column) {
column.appendChild(createOfferCard(offer));
}
});
// Update counts
statuses.forEach(status => {
const count = offers.filter(o => o.status === status.id).length;
document.querySelector(`.kanban-column[data-status="${status.id}"] .count`).textContent = `(${count})`;
});
}
// Create an offer card element
function createOfferCard(offer) {
const card = document.createElement('div');
card.className = 'kanban-item';
card.draggable = true;
card.dataset.id = offer.id;
card.innerHTML = `
<h3>${offer.title}</h3>
<p><strong>Company:</strong> ${offer.company}</p>
<p><strong>Salary:</strong> ${offer.salary}</p>
${offer.notes ? `<p><strong>Notes:</strong> ${offer.notes}</p>` : ''}
<div class="item-footer">
<span>${offer.date}</span>
<div class="item-actions">
<button class="edit-btn" data-id="${offer.id}">✏️</button>
<button class="delete-btn" data-id="${offer.id}">🗑️</button>
</div>
</div>
`;
// Add drag event listeners
card.addEventListener('dragstart', dragStart);
// Add edit and delete event listeners
card.querySelector('.edit-btn').addEventListener('click', () => editOffer(offer.id));
card.querySelector('.delete-btn').addEventListener('click', () => deleteOffer(offer.id));
return card;
}
// Drag and drop functionality
function dragStart(e) {
e.dataTransfer.setData('text/plain', e.target.dataset.id);
}
function allowDrop(e) {
e.preventDefault();
}
function drop(e) {
e.preventDefault();
const offerId = e.dataTransfer.getData('text/plain');
const newStatus = e.target.closest('.kanban-column').dataset.status;
// Update the offer status
const offer = offers.find(o => o.id == offerId);
if (offer) {
offer.status = newStatus;
renderOffers();
// In a real app, you would save to localStorage or a database here
}
}
// Add event listeners for drag and drop
document.addEventListener