From 9ba02003dfcaf36b588bb45dfdd1b88150068454 Mon Sep 17 00:00:00 2001 From: Juan Cruz Fortunatti Date: Sun, 31 May 2026 02:13:39 +0200 Subject: [PATCH 1/2] fix(website): make /wordart responsive with gallery-style mobile tabs --- .../WordArtWorkbench/WordArtWorkbench.tsx | 47 ++++++++++-- .../components/WordArtWorkbench/wordart.css | 72 +++++++++++++++++-- 2 files changed, 109 insertions(+), 10 deletions(-) diff --git a/website/src/components/WordArtWorkbench/WordArtWorkbench.tsx b/website/src/components/WordArtWorkbench/WordArtWorkbench.tsx index 229c9cf7..4367711c 100644 --- a/website/src/components/WordArtWorkbench/WordArtWorkbench.tsx +++ b/website/src/components/WordArtWorkbench/WordArtWorkbench.tsx @@ -157,6 +157,8 @@ export function WordArtWorkbench() { const [lightEl, setLightEl] = useState(() => qn("lel", 45)); const [activePreset, setActivePreset] = useState(null); const [exporting, setExporting] = useState(false); + // Mobile: only one floating panel is open at a time, toggled by the bottom tabs. + const [mobilePanel, setMobilePanel] = useState<"style" | "controls" | null>(null); const handleCodePen = async () => { const el = document.querySelector(".wa-stage .polycss-camera") @@ -173,6 +175,13 @@ export function WordArtWorkbench() { } }; + useEffect(() => { + if (!mobilePanel) return; + const onKey = (e: KeyboardEvent) => { if (e.key === "Escape") setMobilePanel(null); }; + window.addEventListener("keydown", onKey); + return () => window.removeEventListener("keydown", onKey); + }, [mobilePanel]); + // Default bundled font + Google catalog. If the URL named a font, select it // once the catalog is in. useEffect(() => { @@ -366,7 +375,11 @@ export function WordArtWorkbench() { status={status} /> -