diff options
author | Frederick Yin <fkfd@fkfd.me> | 2022-04-17 22:02:55 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2022-04-17 22:02:55 +0800 |
commit | 0e9c878103db48ce342ab26d26d9ba9d424d7d2b (patch) | |
tree | 4b471fd82af9a2d1a900ed910e8eebfe9c6c4d73 | |
parent | 158e778c84a9c640ae351cc218c059705963869e (diff) |
Show hint
-rw-r--r-- | index.css | 5 | ||||
-rw-r--r-- | index.js | 15 |
2 files changed, 20 insertions, 0 deletions
@@ -42,8 +42,13 @@ h1 { padding: 1em; } +#candidate-list { + width: 100%; +} + .candidate { text-align: left; + cursor: pointer; } .album-cover { @@ -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; |