From 23a266d212c0fba839ea9c132ea3469f8dbf3882 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 11 Mar 2018 12:40:32 -0400 Subject: [PATCH] Disabled exits are now clearly indicated --- feast.css | 10 ++++++++++ feast.js | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/feast.css b/feast.css index 400dd86..f82def0 100644 --- a/feast.css +++ b/feast.css @@ -35,6 +35,16 @@ button { background: #111; } +.disabled-button { + background: repeating-linear-gradient( + 45deg, + #111, + #111 10px, + #622 10px, + #622 20px + ); +} + .compass-button { width: 100px; height: 100px; diff --git a/feast.js b/feast.js index d9a54d0..da75103 100644 --- a/feast.js +++ b/feast.js @@ -27,21 +27,21 @@ function round(number, digits) { function updateExploreCompass() { for (let i = 0; i < dirButtons.length; i++) { let button = dirButtons[i]; + button.classList.remove("active-button"); + button.classList.remove("inactive-button"); + button.classList.remove("disabled-button"); if (currentRoom.exits[i] == null) { button.disabled = true; - button.classList.remove("active-compass-button"); button.classList.add("inactive-button"); button.innerHTML = ""; } else { if (currentRoom.exits[i].conditions.reduce((result, test) => result && test(prefs), true)) { button.disabled = false; - button.classList.remove("inactive-button"); - button.classList.add("active-compass-button"); + button.classList.add("active-button"); button.innerHTML = currentRoom.exits[i].name; } else { button.disabled = true; - button.classList.add("inactive-button"); - button.classList.remove("active-compass-button"); + button.classList.add("disabled-button"); button.innerHTML = currentRoom.exits[i].name; } }