From 515f47528549fb01636f287d82ced873ef341bfe Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 24 May 2024 13:46:02 +0200 Subject: centered headers --- play.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 5ef6ab6..b4da448 100644 --- a/play.js +++ b/play.js @@ -564,6 +564,8 @@ function on_init() { update_favicon() } +on_init() + /* SHOW PATH FOR MOVES */ function on_focus_city(evt) { @@ -964,14 +966,14 @@ function on_log(text) { text = text.replace(/C(\d+)/g, sub_tc) text = text.replace(/P(\d+)/g, sub_piece) - if (text.match(/^# /)) { - p.className = "h" - text = text.substring(2) - } - else if (text.match(/^\$(\d+)/)) { + if (text.match(/^\$(\d+)/)) { let fx = parseInt(text.substring(1)) text = `

${fate_flavor_text[fx]}

${fate_effect_text[fx]}` } + else if (text.match(/^# /)) { + p.className = "h fate" + text = text.substring(2) + } else if (text.match(/^=\d/)) { p.className = "h " + power_class[text[1]] text = power_name[text[1]] @@ -981,9 +983,7 @@ function on_log(text) { return p } -on_init() - -// === COMMON LIBRARY === +/* COMMON LIBRARY */ function array_insert(array, index, item) { for (let i = array.length; i > index; --i) -- cgit v1.2.3