From 649b1d4328a7ffc31cb5e9d47e2b3ddefcc66f16 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 24 Jul 2023 20:27:10 -0400 Subject: Initial rewrite to astro --- src/components/PSA.astro | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/components/PSA.astro (limited to 'src/components/PSA.astro') diff --git a/src/components/PSA.astro b/src/components/PSA.astro new file mode 100644 index 0000000..ad2bcdf --- /dev/null +++ b/src/components/PSA.astro @@ -0,0 +1,40 @@ +--- +import psaMessage from "./psa.json"; +let defaultStyle = "flex flex-row md:px-40 sm:px-30 sm:py-0.5 p-3 space-x-2"; +let styleImportant; +let important; +switch (psaMessage.important) { + case 0: + styleImportant = "hidden" + defaultStyle += ' ' + styleImportant + break; + case 1: + important = "Latest News:" + styleImportant = "bg-zinc-700" + defaultStyle += ' ' + styleImportant + break; + case 2: + important = "WARNING!" + styleImportant = "bg-yellow-700" + defaultStyle += ' ' + styleImportant + break; + case 3: + important = "EMERGENCY!" + styleImportant = "bg-red-800" + defaultStyle += ' ' + styleImportant + break; +} +--- + +
+

{important}

+
+

{psaMessage.announcement}

+

+ {psaMessage.link && ( + + Learn more ↗ + + )}

+
+
-- cgit v1.2.3