Spaces:
Paused
Paused
Malina Claude Opus 4.8 commited on
Commit ·
6bb7936
1
Parent(s): 84c5d94
aria(mobile): keep keyboard open on Send; collapse top bar while typing; drop the input-area divider line (tighter, more messages visible); css v15 / js v15
Browse files
cloudflare/pages-integration/aria.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
<title>ARIA · NNL</title>
|
| 7 |
<link rel="icon" href="favicon.png" />
|
| 8 |
<link rel="stylesheet" href="css/styles.css" />
|
| 9 |
-
<link rel="stylesheet" href="css/aria.css?v=
|
| 10 |
</head>
|
| 11 |
<body class="app-body aria-page" data-theme="default">
|
| 12 |
|
|
@@ -128,6 +128,6 @@
|
|
| 128 |
|
| 129 |
<div class="aria-toast" id="ariaToast" hidden></div>
|
| 130 |
|
| 131 |
-
<script type="module" src="js/aria-chat.js?v=
|
| 132 |
</body>
|
| 133 |
</html>
|
|
|
|
| 6 |
<title>ARIA · NNL</title>
|
| 7 |
<link rel="icon" href="favicon.png" />
|
| 8 |
<link rel="stylesheet" href="css/styles.css" />
|
| 9 |
+
<link rel="stylesheet" href="css/aria.css?v=15" />
|
| 10 |
</head>
|
| 11 |
<body class="app-body aria-page" data-theme="default">
|
| 12 |
|
|
|
|
| 128 |
|
| 129 |
<div class="aria-toast" id="ariaToast" hidden></div>
|
| 130 |
|
| 131 |
+
<script type="module" src="js/aria-chat.js?v=15"></script>
|
| 132 |
</body>
|
| 133 |
</html>
|
cloudflare/pages-integration/css/aria.css
CHANGED
|
@@ -81,7 +81,11 @@ body.aria-page { position: fixed; inset: 0; width: 100%; height: 100%; display:
|
|
| 81 |
@media (min-width: 640px) {
|
| 82 |
.aria-main { max-width: 430px; border-inline: 1px solid var(--line, #ffffff14); }
|
| 83 |
}
|
| 84 |
-
.aria-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; backdrop-filter: blur(12px); background: var(--aria-bar); border-bottom: 1px solid var(--line, #ffffff14); }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
.aria-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
|
| 86 |
.aria-avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--grad, linear-gradient(110deg,#5e9bff,#a78bfa,#22d3ee)); color: #07080c; font-weight: 700; }
|
| 87 |
.aria-avatar.sm { width: 26px; height: 26px; font-size: 13px; }
|
|
@@ -99,7 +103,7 @@ body.aria-page { position: fixed; inset: 0; width: 100%; height: 100%; display:
|
|
| 99 |
.spacer { flex: 1; }
|
| 100 |
|
| 101 |
/* ---- messages ---- */
|
| 102 |
-
.aria-messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; padding:
|
| 103 |
.aria-empty { margin: auto; text-align: center; color: var(--text-dim, #7c808d); display: flex; flex-direction: column; align-items: center; gap: 14px; }
|
| 104 |
|
| 105 |
.aria-row { display: flex; align-items: flex-end; gap: 8px; max-width: min(680px, 86%); }
|
|
@@ -189,7 +193,7 @@ body.aria-page { position: fixed; inset: 0; width: 100%; height: 100%; display:
|
|
| 189 |
.aria-typing.me i { background: var(--aria-me-fg); }
|
| 190 |
|
| 191 |
/* ---- input ---- */
|
| 192 |
-
.aria-inputbar { display: flex; align-items: flex-end; gap: 8px; padding:
|
| 193 |
.aria-inputbar textarea { flex: 1; resize: none; max-height: 140px; padding: 11px 14px; border-radius: 20px; border: 1px solid var(--line-strong, #ffffff29); background: var(--surface, #ffffff08); color: var(--text, #fff); font: inherit; }
|
| 194 |
.aria-inputbar textarea:focus { outline: none; border-color: var(--aria-me); }
|
| 195 |
.aria-send { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--aria-me); color: var(--aria-me-fg); font-size: 16px; cursor: pointer; }
|
|
|
|
| 81 |
@media (min-width: 640px) {
|
| 82 |
.aria-main { max-width: 430px; border-inline: 1px solid var(--line, #ffffff14); }
|
| 83 |
}
|
| 84 |
+
.aria-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; backdrop-filter: blur(12px); background: var(--aria-bar); border-bottom: 1px solid var(--line, #ffffff14); max-height: 64px; overflow: hidden; transition: max-height .25s var(--ease, ease), padding .25s var(--ease, ease), opacity .2s var(--ease, ease); }
|
| 85 |
+
/* phones: while the keyboard is open, collapse the top bar upward for more chat room */
|
| 86 |
+
@media (max-width: 639px) {
|
| 87 |
+
body.kb-open .aria-bar { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; border-bottom-color: transparent; }
|
| 88 |
+
}
|
| 89 |
.aria-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
|
| 90 |
.aria-avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--grad, linear-gradient(110deg,#5e9bff,#a78bfa,#22d3ee)); color: #07080c; font-weight: 700; }
|
| 91 |
.aria-avatar.sm { width: 26px; height: 26px; font-size: 13px; }
|
|
|
|
| 103 |
.spacer { flex: 1; }
|
| 104 |
|
| 105 |
/* ---- messages ---- */
|
| 106 |
+
.aria-messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; padding: 12px 16px 6px; display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth; }
|
| 107 |
.aria-empty { margin: auto; text-align: center; color: var(--text-dim, #7c808d); display: flex; flex-direction: column; align-items: center; gap: 14px; }
|
| 108 |
|
| 109 |
.aria-row { display: flex; align-items: flex-end; gap: 8px; max-width: min(680px, 86%); }
|
|
|
|
| 193 |
.aria-typing.me i { background: var(--aria-me-fg); }
|
| 194 |
|
| 195 |
/* ---- input ---- */
|
| 196 |
+
.aria-inputbar { display: flex; align-items: flex-end; gap: 8px; padding: 8px 16px 12px; background: var(--aria-bar); }
|
| 197 |
.aria-inputbar textarea { flex: 1; resize: none; max-height: 140px; padding: 11px 14px; border-radius: 20px; border: 1px solid var(--line-strong, #ffffff29); background: var(--surface, #ffffff08); color: var(--text, #fff); font: inherit; }
|
| 198 |
.aria-inputbar textarea:focus { outline: none; border-color: var(--aria-me); }
|
| 199 |
.aria-send { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--aria-me); color: var(--aria-me-fg); font-size: 16px; cursor: pointer; }
|
cloudflare/pages-integration/js/aria-chat.js
CHANGED
|
@@ -83,9 +83,13 @@ function wireUi() {
|
|
| 83 |
});
|
| 84 |
$("ariaReplyCancel")?.addEventListener("click", clearReply);
|
| 85 |
// keyboard open/close → recompute layout through the animation (fixes the
|
| 86 |
-
// "layout jumps up and doesn't settle until I tap" bug on mobile)
|
| 87 |
-
|
| 88 |
-
$("ariaInput").addEventListener("
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
wireHold();
|
| 90 |
}
|
| 91 |
|
|
@@ -365,6 +369,7 @@ async function onSend(e) {
|
|
| 365 |
queueEvent(ev);
|
| 366 |
}
|
| 367 |
clearReply();
|
|
|
|
| 368 |
}
|
| 369 |
function makeEvent(type, payload, replyTo) {
|
| 370 |
const ev = { id: "evt_" + Date.now().toString(36) + Math.random().toString(36).slice(2, 6), ts: Date.now(), type, payload };
|
|
|
|
| 83 |
});
|
| 84 |
$("ariaReplyCancel")?.addEventListener("click", clearReply);
|
| 85 |
// keyboard open/close → recompute layout through the animation (fixes the
|
| 86 |
+
// "layout jumps up and doesn't settle until I tap" bug on mobile). The kb-open
|
| 87 |
+
// class collapses the top bar (phones only, see CSS) for more chat room.
|
| 88 |
+
$("ariaInput").addEventListener("focus", () => { document.body.classList.add("kb-open"); settleViewport(); });
|
| 89 |
+
$("ariaInput").addEventListener("blur", () => { document.body.classList.remove("kb-open"); settleViewport(); });
|
| 90 |
+
// tapping Send must NOT move focus off the textarea (that closes the mobile keyboard).
|
| 91 |
+
// preventDefault on the (simulated) mousedown keeps focus; the click still submits.
|
| 92 |
+
$("ariaSend").addEventListener("mousedown", (e) => e.preventDefault());
|
| 93 |
wireHold();
|
| 94 |
}
|
| 95 |
|
|
|
|
| 369 |
queueEvent(ev);
|
| 370 |
}
|
| 371 |
clearReply();
|
| 372 |
+
$("ariaInput").focus(); // keep the keyboard open after sending (mobile)
|
| 373 |
}
|
| 374 |
function makeEvent(type, payload, replyTo) {
|
| 375 |
const ev = { id: "evt_" + Date.now().toString(36) + Math.random().toString(36).slice(2, 6), ts: Date.now(), type, payload };
|