eaglelandsonce commited on
Commit
a77f23e
·
verified ·
1 Parent(s): 358edfe

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +14 -9
index.html CHANGED
@@ -84,7 +84,7 @@
84
  const cardId = e.dataTransfer.getData('text');
85
  const card = document.getElementById(cardId);
86
  e.target.appendChild(card);
87
- checkCompletion(columnElement);
88
  });
89
 
90
  column.cards.forEach(card => {
@@ -106,17 +106,22 @@
106
  });
107
  }
108
 
109
- function checkCompletion(columnElement) {
110
- const cards = columnElement.querySelectorAll('.card');
111
- const totalCards = cards.length;
112
- if (totalCards === config[0].cards.length + config[1].cards.length + config[2].cards.length) {
113
- columnElement.classList.add('complete');
114
- alert('Congratulations! All tasks have been moved to this column.');
115
- }
 
 
 
 
 
 
116
  }
117
 
118
  createKanbanBoard(config);
119
  </script>
120
  </body>
121
  </html>
122
-
 
84
  const cardId = e.dataTransfer.getData('text');
85
  const card = document.getElementById(cardId);
86
  e.target.appendChild(card);
87
+ checkCompletion();
88
  });
89
 
90
  column.cards.forEach(card => {
 
106
  });
107
  }
108
 
109
+ function checkCompletion() {
110
+ const columns = document.querySelectorAll('.column');
111
+
112
+ columns.forEach(column => {
113
+ const cards = column.querySelectorAll('.card');
114
+ const cardContainer = column.querySelector('.card-container');
115
+
116
+ if (cards.length === 0) {
117
+ cardContainer.classList.add('active');
118
+ } else {
119
+ cardContainer.classList.remove('active');
120
+ }
121
+ });
122
  }
123
 
124
  createKanbanBoard(config);
125
  </script>
126
  </body>
127
  </html>