From 61b3e760a7be3f66d9206deb39b73dfb343b90b5 Mon Sep 17 00:00:00 2001 From: bignutty <3515180-bignutty@users.noreply.gitlab.com> Date: Wed, 28 Aug 2024 20:14:28 +0200 Subject: [PATCH] update extreme conditions icons --- labscore/constants.js | 17 +++++++++++++++-- labscore/utils/markdown.js | 12 ++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/labscore/constants.js b/labscore/constants.js index 0b89a59..725f7e6 100644 --- a/labscore/constants.js +++ b/labscore/constants.js @@ -158,6 +158,19 @@ module.exports.ICONS = Object.freeze({ "exclaim_4": "<:ico_exclaim_4:1263588879307640883>", "question_large": "<:ico_question_large:1263589058999750787>", + // Used by weds + "air_quality_0": "<:ic_quality_0:1278416585739997184>", + "air_quality_1": "<:ic_quality_1:1278416596506906664>", + "air_quality_2": "<:ic_quality_2:1278416607055708251>", + "air_quality_3": "<:ic_quality_3:1278416621215420506>", + "air_quality_4": "<:ic_quality_4:1278416629973254175>", + + "uv_level_0": "<:ic_uv_0:1278416641633550336>", + "uv_level_1": "<:ic_uv_1:1278416651569856522>", + "uv_level_2": "<:ic_uv_2:1278416662974038118>", + "uv_level_3": "<:ic_uv_3:1278416673761919006>", + "uv_level_4": "<:ic_uv_4:1278416684763451485>", + // These icon names (weather_:conditionId) have to be synced with the server. "weather_blizzard": "<:ico_w_blizzard:1263583584850022460>", "weather_blowing_snow": "<:ico_w_blowing_snow:1263583671726903377>", @@ -191,8 +204,8 @@ module.exports.ICONS = Object.freeze({ "weather_strong_thunderstorms": "<:ico_w_strong_tstorms:1263585008589869056>", "weather_tornado": "<:ico_w_tornado:1263585022552707154>", "weather_tropical_storm_hurricane": "<:ico_w_tropical_storm_hurricane:1263585036058366003>", - "weather_very_cold": "<:ico_w_very_cold:1263588188513898582>", - "weather_very_hot": "<:very_hot:1263588713838018652>", + "weather_very_cold": "<:very_cold:1278416835661926495>", + "weather_very_hot": "<:very_hot:1278416845560348732>", "weather_windy": "<:ico_w_windy_breezy:1263585171849084968>", "weather_warning_generic": "<:ico_weather_warning:1269684384966119444>", diff --git a/labscore/utils/markdown.js b/labscore/utils/markdown.js index 96a6123..eed0d14 100644 --- a/labscore/utils/markdown.js +++ b/labscore/utils/markdown.js @@ -41,33 +41,33 @@ module.exports.stringwrap = function(content = "", length, newlines = true){ } module.exports.pill = function(content = ""){ - return " **` " + content.toString().replace(/\`/g, 'ˋ') + " `**" + return " **` " + content.toString().replace(/\`/g, 'ˋ') + "  `**" } module.exports.smallPill = function(content = ""){ - return " ` " + content.toString().replace(/\`/g, 'ˋ') + " `" + return " ` " + content.toString().replace(/\`/g, 'ˋ') + " `" } module.exports.iconPill = function(icon, content = ""){ if(!ICONS[icon]) icon = "question" - return ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " **` " + content.toString().replace(/\`/g, 'ˋ') + " `**" + return ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + "  **` " + content.toString().replace(/\`/g, 'ˋ') + "  `**" } module.exports.smallIconPill = function(icon, content = ""){ if(!ICONS[icon]) icon = "question" - return ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " ` " + content.toString().replace(/\`/g, 'ˋ') + " `" + return ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + "  ` " + content.toString().replace(/\`/g, 'ˋ') + "  `" } module.exports.iconLinkPill = function(icon, url, content = "", tooltip = ""){ if(!ICONS[icon]) icon = "question" if(tooltip.length) tooltip = ` '${tooltip}'` - if(content) return `${ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')} [**\` ${content.toString().replace(/\`/g, 'ˋ')} \`**](${url.replace(/\)/g, '\\)')}${tooltip})` + if(content) return `${ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')} [**\` ${content.toString().replace(/\`/g, 'ˋ')}  \`**](${url.replace(/\)/g, '\\)')}${tooltip})` return url } module.exports.linkPill = function(url, content = "", tooltip = ""){ if(tooltip.length) tooltip = ` '${tooltip}'` - if(content) return `[**\` ${content.toString().replace(/\`/g, 'ˋ')} \`**](${url.replace(/\)/g, '\\)')}${tooltip})` + if(content) return `[**\` ${content.toString().replace(/\`/g, 'ˋ')} \`**](${url.replace(/\)/g, '\\)')}${tooltip})` return url }