From 27d7f3755efd3128585d72ccfe0e66ee7636107e Mon Sep 17 00:00:00 2001 From: dvelo <52332868+DeveloLongScript@users.noreply.github.com> Date: Sat, 17 Aug 2024 18:11:38 -0500 Subject: [PATCH] fix: all issues with the MOTD engine are gone --- package.json | 1 + src/lib/motdEngine.ts | 30 +++++++++++++++--------------- yarn.lock | 5 +++++ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index ec257d5..1e7a01e 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "prettier": "^3.3.1", "react": "^18", "react-dom": "^18", + "react-fade-in": "^2.0.1", "remark-gfm": "^4.0.0", "tailwind-merge": "^2.3.0", "tailwindcss-animate": "^1.0.7", diff --git a/src/lib/motdEngine.ts b/src/lib/motdEngine.ts index d8ee07d..7f0cd17 100644 --- a/src/lib/motdEngine.ts +++ b/src/lib/motdEngine.ts @@ -1,20 +1,20 @@ // rendering engine for MOTDs (aka Minehut) const divList: any = { - black: "000000", - dark_blue: "002bff", - dark_green: "text-green-800", - dark_red: "text-red-800", - dark_purple: "text-purple-800", - gold: "text-yellow-400", - gray: "text-gray-600", - dark_gray: "text-gray-800", - blue: "text-blue-400", - green: "text-green-400", - aqua: "text-cyan-400", - red: "text-red-400", - light_purple: "text-purple-300", - yellow: "text-yellow-400", + black: "black", + dark_blue: "text-[#1D4ED8]", + dark_green: "text-[#166634]", + dark_red: "text-[#991b1b]", + dark_purple: "text-[#6b21a8]", + gold: "text-[#facc15]", + gray: "text-[#4b5563]", + dark_gray: "text-[#1f2937]", + blue: "text-[#60a5fa]", + green: "text-[#4ade80]", + aqua: "text-[#22d3ee]", + red: "text-[#f87171]", + light_purple: "text-[#d8b4fe]", + yellow: "text-[#facc15]", white: "text-white", strikethrough: "line-through", st: "line-through", @@ -188,7 +188,7 @@ function colorConvert(className: string) { const classes = className.split(" "); let result = ""; classes.forEach((classUnique) => { - if (classUnique.startsWith("text-")) { + if (classUnique.startsWith("text-") && classUnique != "text-white") { if (classUnique.startsWith("text-[")) { result += "color: " + classUnique.substring(6, classUnique.length - 1) + "; "; diff --git a/yarn.lock b/yarn.lock index feaa35e..6de325d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4859,6 +4859,11 @@ react-dom@^18: loose-envify "^1.1.0" scheduler "^0.23.2" +react-fade-in@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/react-fade-in/-/react-fade-in-2.0.1.tgz#b4bcd7dac63d6857ebcd68facbff2f5f9616278f" + integrity sha512-oqS/WT4znaXEHmL+yo0IDUDY7uC9K4RP35j1SdRUEBspR09B2iIC0i8oJ28tPOr6Ez/L2aktF9p89j+DbsTVNw== + react-hook-form@^7.52.2: version "7.52.2" resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.52.2.tgz#ff40f4776250b86ddfcde6be68d34aa82b1c60fe"