From 3034705b6679bff1802c4180b7b4711b94fed7f9 Mon Sep 17 00:00:00 2001 From: Doan Luu Duc Tai Date: Fri, 30 Oct 2026 21:51:23 -0500 Subject: Match private chat to the site's ASCII style Reuse the historical Message Me form's ASCII frames, red logo, green prompts, bracketed actions, and the homepage light/dark palette. Preserve readable controls on small screens, align the license page and footer, and run browser fixtures beside the active local preview. --- crates/chat-server/tests/browser.mjs | 4 +- crates/chat-server/web/index.html | 59 ++++++++++------ crates/chat-server/web/javascript.html | 6 +- crates/chat-server/web/style.css | 123 +++++++++++++++++++++++++-------- 4 files changed, 137 insertions(+), 55 deletions(-) (limited to 'crates/chat-server') diff --git a/crates/chat-server/tests/browser.mjs b/crates/chat-server/tests/browser.mjs index a56c7cc..08c5c88 100644 --- a/crates/chat-server/tests/browser.mjs +++ b/crates/chat-server/tests/browser.mjs @@ -24,7 +24,7 @@ import { chromium, firefox } from '../../../.tools/browser/node_modules/playwrig const root = await mkdtemp(join(tmpdir(), 'stack-chat-e2e-')); const token = randomBytes(32).toString('hex'); -const origin = 'http://127.0.0.1:9080'; +const origin = `http://127.0.0.1:${process.env.CHAT_TEST_PORT || '9081'}`; const password = 'browser-test-only-unique-passphrase'; await writeFile(join(root, '.env'), `CHAT_ORIGIN=${origin}\nCHAT_SETUP_TOKEN=${token}\n`, {mode:0o600}); for (const path of ['crates','target','docs','web','LICENSE']) await symlink(resolve(path), join(root,path)); @@ -32,7 +32,7 @@ await mkdir(join(root,'var/build'), {recursive:true}); let server; let serverErrors = ''; async function launchServer() { - server = spawn(resolve('target/debug/stack-chat-server'), ['--root',root], {stdio:['ignore','pipe','pipe']}); + server = spawn(resolve('target/debug/stack-chat-server'), ['--root',root,'--bind',new URL(origin).host], {stdio:['ignore','pipe','pipe']}); server.stderr.on('data', bytes => { serverErrors += bytes.toString(); }); await Promise.race([ new Promise((ready, reject) => { server.stdout.once('data', ready); server.once('exit', () => reject(new Error(serverErrors || 'Server exited'))); }), diff --git a/crates/chat-server/web/index.html b/crates/chat-server/web/index.html index 9783789..c240b85 100644 --- a/crates/chat-server/web/index.html +++ b/crates/chat-server/web/index.html @@ -25,32 +25,49 @@ along with this program. If not, see .
-
~doan / message me EXPERIMENTAL / LOCAL TEST
-

[ private chat ]

-

Text only. A dedicated identity file. Encrypted for you and Doan.

-

This is an experimental application, not an audited messenger. Read its limitations before use. Keep your file and password safe: there is no account recovery.

+
[ GNU LibreJS-compliantLibreJS compliance concerns software freedom, not a guarantee of privacy or security. Review the source code, dependencies, and scripts delivered to your browser. Server-delivered code can change between visits; free software can still track users or behave maliciously. ]
+
+
+ +
+
+ +
+

MESSAGE ME

+

Private text conversations between you and Doan.

+

EXPERIMENTAL / LOCAL TEST

+

Keep your file and password. There is no account recovery.
Read the limitations before using this experimental messenger.

+
+ +

Loading cryptographic module...

- -
diff --git a/crates/chat-server/web/javascript.html b/crates/chat-server/web/javascript.html index 927a678..205a103 100644 --- a/crates/chat-server/web/javascript.html +++ b/crates/chat-server/web/javascript.html @@ -15,14 +15,14 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -JavaScript licenses
+JavaScript licenses

JavaScript licenses and source

All first-party scripts are available under the GNU Affero General Public License, version 3 or, at your option, any later version. The table uses the license identifiers recognized by GNU LibreJS.

- +
Script / raw fileLicenseCorresponding source
-
Script / raw fileLicenseCorresponding source
app.jsGNU-AGPL-3.0Complete corresponding source
worker.jsGNU-AGPL-3.0Complete corresponding source
wasi.mjsGNU-AGPL-3.0Complete corresponding source
+

The WebAssembly module is compiled from the Rust workspace and unmodified OpenSSL 3.6.5, under their respective free software licenses. The source archive includes first-party sources, Cargo dependencies, the OpenSSL source archive, build scripts, and notices. General-purpose Rust and WASI SDK tools are documented with verified download locations in CHAT-OPENSSL-MIGRATION.txt.

Third-party licenses / Source archive / Return

diff --git a/crates/chat-server/web/style.css b/crates/chat-server/web/style.css index 0983b2e..80b07a6 100644 --- a/crates/chat-server/web/style.css +++ b/crates/chat-server/web/style.css @@ -14,36 +14,101 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + +:root { + color-scheme: light dark; + --background: #fff; + --foreground: #000; + --link: #06c; + --logo: #a00; + --good: #090; + --warning: #806000; + --license: #923900; + --third-party: #355b3c; + --muted: #555; +} + * { box-sizing: border-box; } -:root { color-scheme: dark; font-family: "Courier New", monospace; background: #131715; color: #d4d8cd; line-height: 1.6; } -body { margin: 0; } -main { max-width: 58rem; margin: 2rem auto; padding: 0 1.25rem; } -header, footer { border-top: 1px solid #667367; padding-top: 1rem; } -header { display: flex; flex-wrap: wrap; gap: .6rem; } -h1 { font-size: 1.8rem; color: #e3e3ce; } -h2, h3 { font-size: 1.05rem; } -a { color: #aec2a5; text-underline-offset: .2rem; } -.status, .badge { color: #e0c46d; } -.status { margin-left: auto; } -.notice { border-left: 2px solid #c5ad68; padding-left: 1rem; } -button, input, textarea { font: inherit; color: inherit; background: #1c231e; border: 1px solid #667367; border-radius: 0; padding: .55rem .7rem; } -button { cursor: pointer; margin: .4rem .6rem .4rem 0; } -button:hover, button:focus-visible { border-color: #d7c884; color: #f0e5b0; } +body { overflow-y: scroll; font: 16px/1.5 monospace, monospace; margin: 0; background: var(--background); color: var(--foreground); } +main { width: 80ch; max-width: calc(100% - 32px); margin: 16px auto; position: relative; } +a { color: var(--link); text-decoration: none; } +a:hover { text-decoration: underline; } +a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; } +.logo-art { font: inherit; line-height: 1.2; margin: 0 0 2em; overflow-x: auto; } +.logo { color: var(--logo); display: inline-block; } +.logo:hover { text-decoration: none; } +.site-nav { display: flex; flex-wrap: wrap; gap: 2ch; margin: 0 0 2em; } +.site-nav [aria-current] { color: inherit; } +h1, h2, h3 { font: inherit; font-weight: bold; } +h1 { margin: 0; } +h2, h3 { margin: 0 0 1em; } +p { margin: 0 0 1em; } +.introduction { text-align: center; } +.introduction p:last-child { margin-bottom: 0; } +.build-status, .notice { color: var(--warning); } +.ascii-bar { display: flex; white-space: pre; line-height: 1.5; user-select: none; } +.ascii-rule { flex: 1; min-width: 0; overflow: hidden; } +.panel-body { padding: 1em 2ch; background-image: repeating-linear-gradient(to bottom, currentColor 0 1em, transparent 1em 1.5em), repeating-linear-gradient(to bottom, currentColor 0 1em, transparent 1em 1.5em); background-size: 1px 100%; background-position: .5ch 0, calc(100% - .5ch) 0; background-repeat: no-repeat; } +.ascii-panel { margin: 1.5em 0; } +.ascii-field { margin: 1.5em 0; } +.field-heading { white-space: nowrap; font-weight: normal; margin: 0; } +.field-row { background-image: repeating-linear-gradient(to bottom, currentColor 0 1em, transparent 1em 1.5em), repeating-linear-gradient(to bottom, currentColor 0 1em, transparent 1em 1.5em); background-size: 1px 100%; background-position: .5ch 0, calc(100% - .5ch) 0; background-repeat: no-repeat; padding: .25em 2ch; display: flex; gap: 1ch; align-items: baseline; } +.field-row::before { content: '>'; color: var(--good); font-weight: bold; } +.field-end { height: 1.5em; } +button, input, textarea { font: inherit; color: inherit; background: transparent; border-radius: 0; } +button { appearance: none; border: 0; padding: 0; margin: .5em 2ch .5em 0; color: var(--link); font-weight: bold; cursor: pointer; } +button::before { content: '[ < '; } +button::after { content: ' > ]'; } +button:hover { text-decoration: underline; } button:disabled { opacity: .5; cursor: wait; } -input, textarea { display: block; width: 100%; margin: .35rem 0 1rem; } -input[type=number] { width: 8rem; } +#create-choice, #create-form button, #unlock-form button, #send-form button { color: var(--good); } +#lock { color: var(--logo); } +#retry { color: var(--warning); } +input, textarea { appearance: none; border: 0; padding: 0; margin: 0; min-width: 0; width: 100%; line-height: 1.5; } +input[type=file] { font-size: .875em; } +input[type=file]::file-selector-button { font: inherit; color: var(--link); background: transparent; border: 1px dashed currentColor; margin-right: 1ch; padding: .2em 1ch; cursor: pointer; } +input[type=number] { width: 7ch; } +textarea { resize: vertical; min-height: 7.5em; } label { display: block; } -section { margin: 1.5rem 0; } +section { margin: 2em 0; } [hidden] { display: none !important; } -.chat-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; } -#fingerprint, #conversation-fingerprint { overflow-wrap: anywhere; font-size: .8rem; } -#messages { padding: 0; list-style: none; } -#messages li { border-top: 1px dashed #48564a; padding: 1rem 0; } -#messages p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .4rem 0; } -#messages small { color: #a8b39e; } -#status { min-height: 1.6rem; color: #e0c46d; } -footer { margin-top: 3rem; padding-bottom: 2rem; } -footer > a { display: block; width: fit-content; } -footer p { position: relative; } -#js-warning { display: none; max-width: 48rem; border: 1px solid #c5ad68; background: #1c231e; padding: 1rem; margin: .8rem 0; } -.badge:hover + #js-warning, .badge:focus-visible + #js-warning { display: block; } +.actions { display: flex; flex-wrap: wrap; gap: 0 2ch; } +.actions button { margin-right: 0; } +.chat-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1ch; } +.chat-heading h2 { margin-bottom: 0; } +#fingerprint, #conversation-fingerprint { overflow-wrap: anywhere; font-size: .875em; color: var(--muted); margin-top: 1em; } +#thread { margin-top: 3em; } +#counts { color: var(--good); } +#history-form { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1ch 2ch; } +#history-form .ascii-field { flex: 0 1 31ch; min-width: 24ch; margin: .5em 0; } +#messages { padding: 0; list-style: none; margin: 2em 0; } +#messages li::before { content: '--------------------------------------------------------------------------------'; display: block; overflow: hidden; white-space: pre; margin: 1em 0; } +#messages p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .5em 0 1em; } +#messages small { color: var(--link); font: inherit; } +#status { min-height: 1.5em; color: var(--link); margin: 2em 0 1em; padding-left: 2ch; position: relative; } +#status::before { content: '>'; color: var(--good); position: absolute; left: 0; font-weight: bold; } +.libre-badge { position: absolute; top: 0; right: 0; color: var(--warning); font-weight: bold; } +.libre-badge > a { color: inherit; text-decoration: underline wavy; text-underline-offset: .2em; } +#js-warning { display: none; position: absolute; top: 2em; right: 0; width: 48ch; max-width: calc(100vw - 32px); padding: 1em 2ch; background: var(--background); color: var(--foreground); border: 1px dashed var(--warning); z-index: 1; font-weight: normal; } +.libre-badge > a:hover + #js-warning, .libre-badge > a:focus-visible + #js-warning { display: block; } +.source-footer { display: flex; flex-direction: column; align-items: flex-end; gap: .5em; text-align: right; margin: 3em 0 1em; font-weight: bold; } +.source-footer::before { content: '________________________________________________________________________________'; display: block; width: 100%; overflow: hidden; white-space: pre; margin-bottom: 1em; font-weight: normal; } +.project-license { color: var(--license); } +.dependency-licenses { color: var(--third-party); } +.license-page h1 { margin: 2em 0 1em; } +.license-table { overflow-x: auto; } +table { border-collapse: collapse; width: 100%; font: inherit; } +th, td { padding: .75em 1ch; text-align: left; border-bottom: 1px dashed currentColor; vertical-align: top; } + +@media (prefers-color-scheme: dark) { + :root { --background: #000; --foreground: #fff; --link: #6cf; --logo: #f33; --good: #0f0; --warning: #fc3; --license: #efb366; --third-party: #a3c7a8; --muted: #aaa; } +} + +@media (max-width: 600px) { + .libre-badge { position: relative; width: fit-content; margin: 0 0 2em auto; } + .logo-art { font-size: clamp(10px, 2.4vw, 16px); } + .field-heading { font-size: .875em; } + .panel-body { padding-inline: 2ch; } + .source-footer { align-items: flex-start; text-align: left; } + .actions { flex-direction: column; align-items: flex-start; } +} -- cgit v1.2.3