From b3947909a0df0bb03fa426362b1abc3f6a13b56c Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Thu, 26 Sep 2024 23:54:13 -0600 Subject: [PATCH] Omnibox styling... --- src/pages/[lang]/index.astro | 50 +++++++++++++++++++++---------- src/pages/catalog/pagnation.astro | 2 +- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/pages/[lang]/index.astro b/src/pages/[lang]/index.astro index 8efb9f3..6e2061c 100644 --- a/src/pages/[lang]/index.astro +++ b/src/pages/[lang]/index.astro @@ -17,22 +17,29 @@ const t = useTranslations(lang);
-
-
- -
-

- nebula. -

+ > +
+
+
+ +
+

+ nebula. +

+
+ +
-
@@ -48,6 +55,7 @@ const t = useTranslations(lang); try { const input = document.getElementById("nebula-input") as HTMLInputElement; const iframe = document.getElementById("neb-iframe") as HTMLIFrameElement; + const omnibox = document.getElementById("omnibox") as HTMLDivElement; input?.addEventListener("keypress", function (event: any) { if (event.key === "Enter") { initSw().then(() => { @@ -56,6 +64,18 @@ const t = useTranslations(lang); }) } }) + input?.addEventListener("input", async function() { + const value = input?.value; + input.classList.remove("rounded-b-2xl"); + omnibox.classList.remove("hidden"); + if (value.length === 0) { + input.classList.add("rounded-b-2xl"); + omnibox.classList.add("hidden"); + } + if (value >= 3) { + //handle shit here :D + } + }); } catch (_) { //we purposely don't return anything diff --git a/src/pages/catalog/pagnation.astro b/src/pages/catalog/pagnation.astro index 236d9e2..a5ce261 100644 --- a/src/pages/catalog/pagnation.astro +++ b/src/pages/catalog/pagnation.astro @@ -1,5 +1,5 @@