From 07282a5d7f355351337ea984662793c55ed5dfee Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 15 May 2024 00:35:49 +0200 Subject: card tooltips --- play.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'play.js') diff --git a/play.js b/play.js index e7a684d..5b75f51 100644 --- a/play.js +++ b/play.js @@ -17,13 +17,32 @@ let ui = { cu: [], } +function on_focus_card_tip(card_number) { + document.getElementById("tooltip").className = "card show card_" + card_number +} + +function on_blur_card_tip() { + document.getElementById("tooltip").classList = "card" +} + +function on_focus_last_card() { + if (typeof view.last_card === 'number') { + document.getElementById("tooltip").className = "card show card_" + view.last_card + } +} + +function on_blur_last_card() { + document.getElementById("tooltip").classList = "card" +} + function on_log(text) { let p = document.createElement("div") text = text.replace(/&/g, "&") text = text.replace(//g, ">") - text = text.replace(/\[(\d+)([^\]]*)\]/, '$1$2') + text = text.replace(/#(\d+)/g, + '$&') if (text.match(/^\.h1 /)) { p.className = "h1" -- cgit v1.2.3