feat: grey out long activities when a short activity is selected
This commit is contained in:
@@ -74,6 +74,15 @@
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.activity-card.is-disabled,
|
||||||
|
.activity-card:disabled {
|
||||||
|
opacity: 0.4;
|
||||||
|
cursor: not-allowed;
|
||||||
|
filter: grayscale(0.4);
|
||||||
|
box-shadow: none;
|
||||||
|
background: #f7e8ec;
|
||||||
|
}
|
||||||
|
|
||||||
.time-notice {
|
.time-notice {
|
||||||
background: var(--color-white);
|
background: var(--color-white);
|
||||||
border: 2px solid var(--color-peach);
|
border: 2px solid var(--color-peach);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
function renderActivities() {
|
function renderActivities() {
|
||||||
activityGrid.innerHTML = "";
|
activityGrid.innerHTML = "";
|
||||||
|
const hasShortSelected = selectedList.some((a) => a.type === "short");
|
||||||
|
|
||||||
availableActivities.forEach((activity) => {
|
availableActivities.forEach((activity) => {
|
||||||
const card = document.createElement("button");
|
const card = document.createElement("button");
|
||||||
@@ -55,6 +56,12 @@
|
|||||||
card.classList.add("selected");
|
card.classList.add("selected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isLongDisabled = hasShortSelected && activity.type === "long";
|
||||||
|
if (isLongDisabled) {
|
||||||
|
card.classList.add("is-disabled");
|
||||||
|
card.disabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
const icon = document.createElement("span");
|
const icon = document.createElement("span");
|
||||||
icon.className = "icon";
|
icon.className = "icon";
|
||||||
icon.setAttribute("aria-hidden", "true");
|
icon.setAttribute("aria-hidden", "true");
|
||||||
|
|||||||
Reference in New Issue
Block a user