diff options
Diffstat (limited to 'web/static')
-rw-r--r-- | web/static/dartboat.js | 18 | ||||
-rw-r--r-- | web/static/style.css | 5 |
2 files changed, 21 insertions, 2 deletions
diff --git a/web/static/dartboat.js b/web/static/dartboat.js index 6740381..7324ad0 100644 --- a/web/static/dartboat.js +++ b/web/static/dartboat.js @@ -125,8 +125,24 @@ let prompt_handlers = { }, init: { + append(val) { + let e = document.getElementById('prompt-input'); + if (e.textContent.length < 1) + e.textContent += val; + }, + + backspace() { + _promptDeleteLast(); + }, + + clear() { + _promptClear(); + }, + submit() { - Module.ccall('start_match'); + let v = _promptGetAndClear(); + if (v) + Module.ccall('start_match', null, ['number'], [v]); }, pre(action) { diff --git a/web/static/style.css b/web/static/style.css index 397d5f8..8da0cbc 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -32,7 +32,7 @@ div#keypad { display: grid; grid-template-columns: repeat(3, 1fr); - grid-template-rows: 1.2fr; + grid-template-rows: minmax(5em, auto); grid-auto-rows: 1fr; } @@ -98,6 +98,8 @@ div#p1-sugg, div#p2-sugg { font-size: 0.8em; } +div#p1-name:after, div#p2-name:after, +div#p1-rem:after, div#p2-rem:after, div#p1-sugg:after, div#p2-sugg:after { content: '\200b'; } @@ -126,6 +128,7 @@ div#prompt-container { div#prompt-msg-l, div#prompt-input, div#prompt-msg-r { font-size: 1.5em; + white-space: pre-line; display: grid; align-items: center; |