feat(web): polish the WASM site - UX, help, parsing, assets

- About panel (collapsible, closed by default with a pulsing "Help" badge)
  explaining the tool; the `help` command now prints a full command reference
  instead of "HELP" (benefits the CLI too).
- Live generation as you type; Store button; masked output that stays mono-width
  (gen masks only the password column, never the header); command history with
  Up/Down (persisted); console auto-scroll; Export fixed (uses `dump`); Import.
- Name field normalizes to its canonical parsed form on blur; quick-gen and Store
  resolve the real entry name, so a leading prefix like `*P0 test1` is handled
  correctly (new hel_parse / hel_parse_name wasm helpers).
- Parser: prefix-only forms now parse with defaults - `*P0 test1` ->
  `*P0 test1 R 99 <today>`, `*P0 test1 R`, `*P0 test1 20R` - via new qpname/npname
  rules mirroring qname/nname; the fully-qualified form is unchanged.
- Favicons + web app manifest + enso asset; pkg rebuilt.
This commit is contained in:
Oleksandr Kozachuk
2026-06-08 20:11:24 +02:00
parent 03c5dadccb
commit 3031105000
17 changed files with 503 additions and 98 deletions
+108 -50
View File
@@ -15,8 +15,9 @@
--disp: "Poppins", system-ui, sans-serif;
--body: "Inter", system-ui, sans-serif;
--mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
--maxw: 880px;
--radius: 14px;
--maxw: 1320px;
--gutter: clamp(16px, 3.5vw, 48px);
--radius: 16px;
}
/* Masked-secret font: dots glyphs so the real chars stay selectable/copyable.
@@ -29,7 +30,6 @@
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
@@ -44,9 +44,10 @@ body {
linear-gradient(90deg, rgba(27, 65, 97, 0.05) 1px, transparent 1px);
background-size: 48px 48px;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
/* Header */
.site {
@@ -55,92 +56,148 @@ body {
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 14px; height: 64px; }
.nav { display: flex; align-items: center; gap: 14px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.enso {
width: 34px; height: 34px; border-radius: 50%;
border: 3px solid var(--ocean); border-right-color: transparent;
transform: rotate(-20deg);
}
.wordmark { font-family: var(--disp); font-weight: 700; font-size: 21px; color: var(--ocean); letter-spacing: -0.01em; }
.enso { width: 36px; height: 36px; display: block; flex: none; object-fit: contain; }
.wordmark { font-family: var(--disp); font-weight: 700; font-size: 22px; color: var(--ocean); letter-spacing: -0.01em; }
.tagline { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.nav-spacer { flex: 1; }
.nav .ghost { font-family: var(--mono); font-size: 12px; }
/* Eyebrow label */
.eyebrow {
font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
text-transform: uppercase; color: var(--ocean);
display: inline-flex; align-items: center; gap: 9px; margin-bottom: 14px;
display: inline-flex; align-items: center; gap: 9px; margin-bottom: 12px;
}
.eyebrow::before {
content: ""; width: 7px; height: 7px; border-radius: 50%;
background: var(--seal); box-shadow: 0 0 0 3px rgba(226, 59, 46, 0.16);
}
main { padding: 30px 0 64px; display: grid; gap: 22px; }
main { padding: clamp(20px, 3vw, 34px) 0 56px; display: grid; gap: clamp(16px, 2.4vw, 24px); }
/* About / how-it-works (collapsible <details>) */
.about { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.about > summary {
list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
padding: clamp(14px, 2.2vw, 19px) clamp(16px, 2.6vw, 28px);
font-family: var(--disp); font-weight: 600; font-size: clamp(16px, 2vw, 20px); color: var(--ocean);
}
.about > summary::-webkit-details-marker { display: none; }
.about > summary:hover { color: var(--ocean-2); }
/* attention badge — draws the eye to open the help panel; hidden once open */
.about-badge {
font-family: var(--mono); font-size: 10.5px; font-weight: 500;
text-transform: uppercase; letter-spacing: 0.1em;
color: #fff; background: var(--seal); border-radius: 999px; padding: 3px 10px; flex: none;
animation: badgePulse 2.2s ease-out infinite;
}
@keyframes badgePulse {
0% { box-shadow: 0 0 0 0 rgba(226, 59, 46, 0.45); }
70% { box-shadow: 0 0 0 9px rgba(226, 59, 46, 0); }
100% { box-shadow: 0 0 0 0 rgba(226, 59, 46, 0); }
}
@media (prefers-reduced-motion: reduce) { .about-badge { animation: none; } }
.about-hint { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--muted); }
.about[open] .about-badge, .about[open] .about-hint { display: none; }
@media (max-width: 680px) { .about-hint { display: none; } }
.about .about-toggle {
margin-left: auto; width: 9px; height: 9px; flex: none;
border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
transform: rotate(45deg); transition: transform .2s;
}
.about[open] .about-toggle { transform: rotate(-135deg); }
.about-body { padding: 0 clamp(16px, 2.6vw, 28px) clamp(16px, 2.6vw, 24px); }
.about-body p { color: var(--muted); font-size: 14.5px; max-width: 76ch; }
.about-body > p:first-child { color: var(--ink); font-size: 15.5px; }
.about-body code { font-family: var(--mono); font-size: 12px; color: var(--ocean-2); background: rgba(27,65,97,.06); padding: 1px 5px; border-radius: 5px; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 18px 0 6px; }
.about-grid h4 { font-family: var(--disp); font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 5px; }
.about-grid p { font-size: 13.5px; }
.about-note { font-family: var(--mono); font-size: 12px; margin-top: 10px; }
@media (max-width: 680px) { .about-grid { grid-template-columns: 1fr; } }
/* Cards */
.card {
background: var(--paper); border: 1px solid var(--line);
border-radius: var(--radius); padding: 22px;
border-radius: var(--radius); padding: clamp(16px, 2.6vw, 28px);
}
.card h2 { font-family: var(--disp); font-weight: 600; font-size: clamp(20px, 3vw, 26px); color: var(--ink); margin-bottom: 4px; }
.card .hint { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.card h2 { font-family: var(--disp); font-weight: 600; font-size: clamp(20px, 2.6vw, 27px); color: var(--ink); margin-bottom: 4px; }
.card .hint { color: var(--muted); font-size: 14px; margin-bottom: 18px; max-width: 70ch; }
.card .hint code { font-family: var(--mono); font-size: 12.5px; color: var(--ocean-2); background: rgba(27,65,97,0.06); padding: 1px 5px; border-radius: 5px; }
/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.fields { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
input[type="text"], input[type="password"] {
font-family: var(--mono); font-size: 15px; color: var(--ink);
background: #fff; border: 1px solid var(--line); border-radius: 10px;
padding: 11px 13px; width: 100%; outline: none;
padding: 12px 14px; width: 100%; outline: none;
transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--ocean); box-shadow: 0 0 0 3px rgba(27, 65, 97, 0.12); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
/* Buttons */
.btn {
display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;
font-family: var(--disp); font-weight: 600; font-size: 14px;
background: var(--ocean); color: var(--cream);
border: 1px solid var(--ocean); border-radius: 999px; padding: 10px 20px;
transition: transform .15s, background .15s;
transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); background: var(--deep); border-color: var(--deep); }
.btn.ghost { background: transparent; color: var(--ocean); }
.btn.ghost:hover { background: rgba(27, 65, 97, 0.06); color: var(--ocean); }
.btn:active { transform: none; }
.btn.ghost { background: transparent; color: var(--ocean); }
.btn.ghost:hover { background: rgba(27, 65, 97, 0.06); color: var(--ocean); border-color: var(--ocean); }
.btn.small { padding: 7px 15px; font-size: 13px; }
/* Secret rendering: real text in the DOM, visually masked. Click toggles. */
.secret-line { margin-top: 16px; display: flex; align-items: baseline; gap: 12px; min-height: 28px; }
.secret-line .tag { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.secret {
font-family: "text-security-disc", var(--mono);
-webkit-text-security: disc;
font-size: 19px; letter-spacing: 0.06em; color: var(--ink);
cursor: pointer; word-break: break-all; user-select: text;
border-bottom: 1px dashed var(--line);
/* Quick-gen result row */
.result {
display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line);
border-radius: 12px; background: #fff; min-height: 58px;
}
.secret.revealed { font-family: var(--mono); -webkit-text-security: none; color: var(--ocean); }
.secret:empty::before { content: "—"; color: var(--muted); -webkit-text-security: none; }
.result .tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.result .actions { margin-left: auto; display: flex; gap: 8px; }
.result .len { font-family: var(--mono); font-size: 11px; color: var(--muted); }
/* Secret rendering: real text in the DOM, visually masked. Click toggles.
Mask via -webkit-text-security on the MONO font so each disc keeps the mono
advance width — gen tables stay aligned. (No letter-spacing, no disc webfont
here, both of which would break the column widths.) */
.secret {
font-family: var(--mono);
-webkit-text-security: disc;
font-size: 19px; color: var(--ink);
cursor: pointer; user-select: text; white-space: pre;
}
.secret.revealed { -webkit-text-security: none; color: var(--ocean); }
/* Firefox lacks -webkit-text-security: fall back to the disc webfont for masking
(single-line result only; the console table is a WebKit/Blink concern). */
@supports not (-webkit-text-security: disc) {
.secret { font-family: "text-security-disc", var(--mono); }
.secret.revealed { font-family: var(--mono); }
}
.secret:empty::before { content: "type a name + master"; color: var(--muted); font-size: 14px; -webkit-text-security: none; font-family: var(--body); cursor: default; }
/* Console */
.console-out {
font-family: var(--mono); font-size: 13.5px; line-height: 1.55;
background: #fff; border: 1px solid var(--line); border-radius: 10px;
padding: 14px; height: 320px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
padding: 14px; height: clamp(280px, 46vh, 560px);
overflow: auto; white-space: pre; /* no wrap — scroll left/right */
}
.console-out > div { min-width: max-content; }
.console-out .cmd { color: var(--ocean); font-weight: 500; }
.console-out .err { color: var(--seal); }
.console-out .muted { color: var(--muted); }
.console-out .secret { font-size: 13.5px; }
.console-out .secret { font-size: 13.5px; vertical-align: baseline; }
.console-in { display: flex; align-items: center; gap: 8px; margin-top: 10px;
background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; }
background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; }
.console-in:focus-within { border-color: var(--ocean); box-shadow: 0 0 0 3px rgba(27,65,97,0.12); }
.console-in .prompt { font-family: var(--mono); color: var(--ocean); font-weight: 600; }
.console-in input { border: none; box-shadow: none; padding: 8px 0; background: transparent; }
.console-in input { border: none; box-shadow: none; padding: 9px 0; background: transparent; }
.console-in input:focus { box-shadow: none; }
.toast {
@@ -157,21 +214,22 @@ input:focus { border-color: var(--ocean); box-shadow: 0 0 0 3px rgba(27, 65, 97,
display: none; align-items: center; justify-content: center; padding: 20px; z-index: 90;
}
.modal-bg.show { display: flex; }
.modal { background: var(--paper); border-radius: 16px; border: 1px solid var(--line);
width: 100%; max-width: 620px; padding: 22px; }
.modal { background: var(--paper); border-radius: 18px; border: 1px solid var(--line);
width: 100%; max-width: 680px; padding: 24px; }
.modal h3 { font-family: var(--disp); font-weight: 600; margin-bottom: 10px; }
.modal textarea {
width: 100%; height: 240px; resize: vertical; font-family: var(--mono); font-size: 13px;
border: 1px solid var(--line); border-radius: 10px; padding: 12px; outline: none;
width: 100%; height: 260px; resize: vertical; font-family: var(--mono); font-size: 13px;
border: 1px solid var(--line); border-radius: 10px; padding: 12px; outline: none; white-space: pre;
}
.modal textarea:focus { border-color: var(--ocean); }
.modal .row { display: flex; gap: 10px; margin-top: 14px; }
.foot { color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: center; padding: 8px 0 40px; }
.foot a { color: var(--ocean-2); }
@media (max-width: 620px) {
.grid2 { grid-template-columns: 1fr; }
.nav { gap: 8px; }
.console-out { height: 260px; }
@media (max-width: 680px) {
.fields { grid-template-columns: 1fr; align-items: stretch; }
.nav { gap: 9px; height: 60px; }
.tagline { display: none; }
body { font-size: 15px; }
.result .actions { margin-left: 0; }
}