Spaces:
Running
Running
Update index.html
Browse files- index.html +106 -18
index.html
CHANGED
@@ -1,19 +1,107 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Kanban Board</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
display: flex;
|
11 |
+
justify-content: center;
|
12 |
+
margin: 0;
|
13 |
+
padding: 0;
|
14 |
+
}
|
15 |
+
.kanban-board {
|
16 |
+
display: flex;
|
17 |
+
gap: 20px;
|
18 |
+
}
|
19 |
+
.column {
|
20 |
+
width: 300px;
|
21 |
+
background-color: #f4f4f4;
|
22 |
+
border: 1px solid #ccc;
|
23 |
+
border-radius: 5px;
|
24 |
+
padding: 10px;
|
25 |
+
}
|
26 |
+
.column h3 {
|
27 |
+
text-align: center;
|
28 |
+
}
|
29 |
+
.card {
|
30 |
+
background-color: #fff;
|
31 |
+
border: 1px solid #ddd;
|
32 |
+
border-radius: 3px;
|
33 |
+
padding: 10px;
|
34 |
+
margin: 10px 0;
|
35 |
+
cursor: move;
|
36 |
+
}
|
37 |
+
</style>
|
38 |
+
</head>
|
39 |
+
<body>
|
40 |
+
<div class="kanban-board" id="kanban-board"></div>
|
41 |
+
|
42 |
+
<script>
|
43 |
+
const config = [
|
44 |
+
{
|
45 |
+
title: "To Do",
|
46 |
+
cards: [
|
47 |
+
{ id: 118, title: "Publish the blog post announcing the new app" },
|
48 |
+
{ id: 116, title: "Update our marketing website about the new app" }
|
49 |
+
]
|
50 |
+
},
|
51 |
+
{
|
52 |
+
title: "Doing",
|
53 |
+
cards: [
|
54 |
+
{ id: 115, title: "Prepare the app for public launch" }
|
55 |
+
]
|
56 |
+
},
|
57 |
+
{
|
58 |
+
title: "Done",
|
59 |
+
cards: [
|
60 |
+
{ id: 117, title: "Release the app in private preview with early adopters" }
|
61 |
+
]
|
62 |
+
}
|
63 |
+
];
|
64 |
+
|
65 |
+
function createKanbanBoard(config) {
|
66 |
+
const board = document.getElementById('kanban-board');
|
67 |
+
config.forEach(column => {
|
68 |
+
const columnElement = document.createElement('div');
|
69 |
+
columnElement.classList.add('column');
|
70 |
+
|
71 |
+
const titleElement = document.createElement('h3');
|
72 |
+
titleElement.textContent = column.title;
|
73 |
+
columnElement.appendChild(titleElement);
|
74 |
+
|
75 |
+
const cardContainer = document.createElement('div');
|
76 |
+
cardContainer.classList.add('card-container');
|
77 |
+
cardContainer.addEventListener('dragover', (e) => e.preventDefault());
|
78 |
+
cardContainer.addEventListener('drop', (e) => {
|
79 |
+
const cardId = e.dataTransfer.getData('text');
|
80 |
+
const card = document.getElementById(cardId);
|
81 |
+
e.target.appendChild(card);
|
82 |
+
});
|
83 |
+
|
84 |
+
column.cards.forEach(card => {
|
85 |
+
const cardElement = document.createElement('div');
|
86 |
+
cardElement.classList.add('card');
|
87 |
+
cardElement.id = `card-${card.id}`;
|
88 |
+
cardElement.textContent = card.title;
|
89 |
+
cardElement.draggable = true;
|
90 |
+
|
91 |
+
cardElement.addEventListener('dragstart', (e) => {
|
92 |
+
e.dataTransfer.setData('text', cardElement.id);
|
93 |
+
});
|
94 |
+
|
95 |
+
cardContainer.appendChild(cardElement);
|
96 |
+
});
|
97 |
+
|
98 |
+
columnElement.appendChild(cardContainer);
|
99 |
+
board.appendChild(columnElement);
|
100 |
+
});
|
101 |
+
}
|
102 |
+
|
103 |
+
createKanbanBoard(config);
|
104 |
+
</script>
|
105 |
+
</body>
|
106 |
</html>
|
107 |
+
|