diff --git a/app/globals.css b/app/globals.css index 112faeb..4eb58a8 100644 --- a/app/globals.css +++ b/app/globals.css @@ -111,3 +111,32 @@ body.app-body { border-color: var(--gold-500); box-shadow: 0 16px 24px rgba(7, 70, 43, 0.14), 0 0 0 1px rgba(183, 146, 44, 0.22) inset; } + +/* Custom scrollbar matching app theme */ +.styled-scrollbar { + scrollbar-width: thin; + scrollbar-color: var(--gold-300) transparent; +} + +.styled-scrollbar::-webkit-scrollbar { + height: 6px; + width: 6px; + background-color: transparent; +} + +.styled-scrollbar::-webkit-scrollbar-thumb { + background-color: var(--gold-300); + border-radius: 99px; +} + +.styled-scrollbar::-webkit-scrollbar-thumb:hover { + background-color: var(--gold-500); +} + +.styled-scrollbar::-webkit-scrollbar-track { + background-color: var(--line-soft); + border-radius: 99px; + background-clip: content-box; + border: 1px solid transparent; /* Gives a little buffer visually if needed */ +} + diff --git a/app/pictogram/page.tsx b/app/pictogram/page.tsx index 96429e8..91da4b9 100644 --- a/app/pictogram/page.tsx +++ b/app/pictogram/page.tsx @@ -11,17 +11,9 @@ import { WordPictogram, } from "@/lib/resolveArasaacImages"; -function IconChevronSmall() { - return ( - - - - ); -} - function IconCheck() { return ( - + ); @@ -100,40 +92,6 @@ function PictogramImage({ keyword, size = 56 }: { keyword: string; size?: number ); } -// ─── Breadcrumb ─────────────────────────────────────────────────────────────── - -function Breadcrumb({ - trail, - onTap, -}: { - trail: PictogramNode[]; - onTap: (index: number) => void; -}) { - if (trail.length === 0) { - return ; - } - - return ( - - {trail.map((node, i) => ( - - {i > 0 && } - onTap(i)} - className="shrink-0 cursor-pointer rounded-full border border-(--line-soft) bg-white/90 px-1.5 py-0.5 transition-all hover:-translate-y-0.5 hover:border-(--gold-500)" - aria-label={`Go to ${node.label}`} - > - - - {node.label} - - - - ))} - - ); -} - // ─── Tile grid ──────────────────────────────────────────────────────────────── function PictogramTile({ @@ -178,16 +136,28 @@ function TileGrid({ // ─── Trail chips ────────────────────────────────────────────────────────────── -function TrailChips({ trail }: { trail: PictogramNode[] }) { +function TrailChips({ + trail, + size = "default", +}: { + trail: PictogramNode[]; + size?: "default" | "large"; +}) { + const isLarge = size === "large"; + return ( - + {trail.map((node) => ( - - {node.label} + + + {node.label} + ))} @@ -573,10 +543,6 @@ function OutputScreen({ return ( - - {}} /> - - {loading ? ( @@ -610,6 +576,7 @@ function OutputScreen({ + { - setTrail(trail.slice(0, index + 1)); - }; - const handleGoBack = () => { if (trail.length > 0) { setTrail(trail.slice(0, -1)); @@ -672,26 +635,21 @@ export default function PictogramPage() { - - - - - {trail.length > 0 && ( - - - - )} + + + {isLeaf ? ( - - + + - + ) : ( @@ -699,18 +657,17 @@ export default function PictogramPage() { )} - {canGenerate && ( - - - setShowOutput(true)} - className="mt-2.5 flex w-full cursor-pointer items-center justify-center gap-2 rounded-[14px] border border-(--gold-500) bg-[linear-gradient(145deg,#1a9a68,#14714f)] px-4 py-3 text-[13px] font-semibold text-white shadow-[0_10px_20px_rgba(7,70,43,0.2)] transition-all hover:-translate-y-0.5" - > - - Speak - - - )} + + {trail.length > 0 && !isLeaf ? : trail.length === 0 ? : null} + setShowOutput(true)} + disabled={!canGenerate} + className="mt-2.5 flex w-full items-center justify-center gap-2 rounded-[14px] border border-(--gold-500) bg-[linear-gradient(145deg,#1a9a68,#14714f)] px-4 py-3 text-[13px] font-semibold text-white shadow-[0_10px_20px_rgba(7,70,43,0.2)] transition-all hover:-translate-y-0.5 disabled:cursor-default disabled:border-slate-300 disabled:bg-slate-100 disabled:text-slate-700 disabled:shadow-none disabled:hover:translate-y-0 disabled:hover:border-slate-300" + > + + Speak + + );