summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-04-17 22:02:55 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-04-17 22:02:55 +0800
commit0e9c878103db48ce342ab26d26d9ba9d424d7d2b (patch)
tree4b471fd82af9a2d1a900ed910e8eebfe9c6c4d73
parent158e778c84a9c640ae351cc218c059705963869e (diff)
Show hint
-rw-r--r--index.css5
-rw-r--r--index.js15
2 files changed, 20 insertions, 0 deletions
diff --git a/index.css b/index.css
index 7299a8e..e958e81 100644
--- a/index.css
+++ b/index.css
@@ -42,8 +42,13 @@ h1 {
padding: 1em;
}
+#candidate-list {
+ width: 100%;
+}
+
.candidate {
text-align: left;
+ cursor: pointer;
}
.album-cover {
diff --git a/index.js b/index.js
index 38db23d..9b72125 100644
--- a/index.js
+++ b/index.js
@@ -43,6 +43,11 @@ function newWord() {
}
function acronymOf(track) {
+ // special case
+ if (track.toLowerCase() === "heavydirtysoul") {
+ return "hds";
+ }
+
let acronym = "";
for (let word of track.split(" ")) {
acronym += word[0].toLowerCase();
@@ -132,5 +137,15 @@ function pickSong(event) {
reportElem.hidden = false;
}
+function hint() {
+ if (!hintTaken) {
+ answerElem.hidden = false;
+ hintTaken = true;
+ albumElem.innerHTML = currentWord.album;
+ hintElem.disabled = true;
+ }
+}
+
window.onload = newWord;
nextElem.onclick = newWord;
+hintElem.onclick = hint;