diff --git a/src/app/globals.css b/src/app/globals.css index 3f4af2f..8fe13d1 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -107,12 +107,25 @@ body { text-decoration: none; } */ -a { - color: var(--main_1); -} - /* @media (prefers-color-scheme: dark) { html { color-scheme: dark; } } */ + +a { + color: var(--main_1); +} + +table { + overflow: auto; + border-collapse: collapse; + /* border: 1px solid var(--light_1); */ +} + +th, +td { + padding: 0.25rem 1rem; + text-align: left; + vertical-align: top; +} diff --git a/src/app/page.module.css b/src/app/page.module.css index 15900f6..3cae7e0 100644 --- a/src/app/page.module.css +++ b/src/app/page.module.css @@ -34,7 +34,6 @@ transition: border-color 0.1s linear; font-size: 1rem; font-family: inherit; - } .text_field:hover { @@ -46,3 +45,15 @@ padding: 0 3rem; color: var(--text_light); } + +.table_container { + overflow-x: scroll; +} + +#output_table tbody td:nth-child(1) { + text-align: center; +} + +#output_table thead th:nth-child(2) { + min-width: 10em; +} diff --git a/src/components/inspector.tsx b/src/components/inspector.tsx index 2a31ae9..cd0d542 100644 --- a/src/components/inspector.tsx +++ b/src/components/inspector.tsx @@ -37,16 +37,51 @@ export function Inspector(props: InspectorProps) { function Out(props: { currentString: string }) { const ctx = useContext(UtfdumpContext); + + let rows = []; - if (!ctx.utfdump) { - return ( -
Loading WASM...
- ); + if (ctx.utfdump) { + for (const codepointStr of props.currentString) { + const codepoint = codepointStr.codePointAt(0); + + if (codepoint !== undefined) { + const charData = ctx.utfdump.codepoint_char_data(codepoint); + + rows.push(( +{ctx.utfdump.spongebob_case(props.currentString)}
+| Char | +Name | +Codepoint | +UTF-8 | +UTF-16 | +Category | +Combining | +Bidirectional | +Numeric value | +
|---|