Spaces:
Running
Running
Update index.html
Browse files- index.html +30 -31
index.html
CHANGED
@@ -214,6 +214,12 @@
|
|
214 |
position: relative;
|
215 |
overflow: hidden;
|
216 |
user-select: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
.option-card.selected {
|
@@ -1217,32 +1223,24 @@
|
|
1217 |
let currentPeriod = 3;
|
1218 |
|
1219 |
// ํ์ด์ง ๋ก๋ ์ ์ด๋ฒคํธ ๋ฆฌ์ค๋ ๋ฑ๋ก
|
1220 |
-
window.
|
1221 |
-
console.log('
|
1222 |
|
1223 |
-
//
|
1224 |
-
document.
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
handleCardClick(parent);
|
1234 |
-
break;
|
1235 |
-
}
|
1236 |
-
parent = parent.parentElement;
|
1237 |
-
}
|
1238 |
-
}
|
1239 |
-
});
|
1240 |
-
});
|
1241 |
|
1242 |
// ์นด๋ ํด๋ฆญ ์ฒ๋ฆฌ ํจ์
|
1243 |
function handleCardClick(card) {
|
1244 |
-
const category = card.
|
1245 |
-
const id = card.
|
1246 |
|
1247 |
console.log('Card clicked:', category, id); // ๋๋ฒ๊น
์ฉ
|
1248 |
|
@@ -1253,24 +1251,25 @@
|
|
1253 |
|
1254 |
if (category === 'service' || category === 'additional') {
|
1255 |
// ๋ณต์ ์ ํ ๊ฐ๋ฅ
|
1256 |
-
card.classList.toggle('selected');
|
1257 |
-
|
1258 |
if (card.classList.contains('selected')) {
|
1259 |
-
|
1260 |
-
selectedComponents[category].push(id);
|
1261 |
-
}
|
1262 |
-
} else {
|
1263 |
const index = selectedComponents[category].indexOf(id);
|
1264 |
if (index > -1) {
|
1265 |
selectedComponents[category].splice(index, 1);
|
1266 |
}
|
|
|
|
|
|
|
|
|
|
|
1267 |
}
|
1268 |
} else {
|
1269 |
// ๋จ์ผ ์ ํ
|
1270 |
// ๊ฐ์ ์นดํ
๊ณ ๋ฆฌ์ ๋ค๋ฅธ ์นด๋๋ค์ ์ ํ ํด์
|
1271 |
-
document.querySelectorAll(`[data-category="${category}"]`)
|
1272 |
-
|
1273 |
-
|
|
|
1274 |
|
1275 |
// ํ์ฌ ์นด๋ ์ ํ
|
1276 |
card.classList.add('selected');
|
|
|
214 |
position: relative;
|
215 |
overflow: hidden;
|
216 |
user-select: none;
|
217 |
+
z-index: 1;
|
218 |
+
}
|
219 |
+
|
220 |
+
.option-card * {
|
221 |
+
pointer-events: none;
|
222 |
+
user-select: none;
|
223 |
}
|
224 |
|
225 |
.option-card.selected {
|
|
|
1223 |
let currentPeriod = 3;
|
1224 |
|
1225 |
// ํ์ด์ง ๋ก๋ ์ ์ด๋ฒคํธ ๋ฆฌ์ค๋ ๋ฑ๋ก
|
1226 |
+
window.onload = function() {
|
1227 |
+
console.log('Window loaded, setting up click handlers...'); // ๋๋ฒ๊น
์ฉ
|
1228 |
|
1229 |
+
// ๋ชจ๋ option-card์ onclick ์ง์ ์ค์
|
1230 |
+
const cards = document.getElementsByClassName('option-card');
|
1231 |
+
console.log('Found cards:', cards.length); // ๋๋ฒ๊น
์ฉ
|
1232 |
+
|
1233 |
+
for (let i = 0; i < cards.length; i++) {
|
1234 |
+
cards[i].onclick = function() {
|
1235 |
+
handleCardClick(this);
|
1236 |
+
};
|
1237 |
+
}
|
1238 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1239 |
|
1240 |
// ์นด๋ ํด๋ฆญ ์ฒ๋ฆฌ ํจ์
|
1241 |
function handleCardClick(card) {
|
1242 |
+
const category = card.getAttribute('data-category');
|
1243 |
+
const id = card.getAttribute('data-id');
|
1244 |
|
1245 |
console.log('Card clicked:', category, id); // ๋๋ฒ๊น
์ฉ
|
1246 |
|
|
|
1251 |
|
1252 |
if (category === 'service' || category === 'additional') {
|
1253 |
// ๋ณต์ ์ ํ ๊ฐ๋ฅ
|
|
|
|
|
1254 |
if (card.classList.contains('selected')) {
|
1255 |
+
card.classList.remove('selected');
|
|
|
|
|
|
|
1256 |
const index = selectedComponents[category].indexOf(id);
|
1257 |
if (index > -1) {
|
1258 |
selectedComponents[category].splice(index, 1);
|
1259 |
}
|
1260 |
+
} else {
|
1261 |
+
card.classList.add('selected');
|
1262 |
+
if (!selectedComponents[category].includes(id)) {
|
1263 |
+
selectedComponents[category].push(id);
|
1264 |
+
}
|
1265 |
}
|
1266 |
} else {
|
1267 |
// ๋จ์ผ ์ ํ
|
1268 |
// ๊ฐ์ ์นดํ
๊ณ ๋ฆฌ์ ๋ค๋ฅธ ์นด๋๋ค์ ์ ํ ํด์
|
1269 |
+
const sameCategory = document.querySelectorAll(`[data-category="${category}"]`);
|
1270 |
+
for (let i = 0; i < sameCategory.length; i++) {
|
1271 |
+
sameCategory[i].classList.remove('selected');
|
1272 |
+
}
|
1273 |
|
1274 |
// ํ์ฌ ์นด๋ ์ ํ
|
1275 |
card.classList.add('selected');
|