From 2a0410e34b1cd2a7771787d0a3c83748c3f09a74 Mon Sep 17 00:00:00 2001 From: bem130 Date: Sun, 7 Jul 2024 16:27:27 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=92=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index fffc84c..f344f74 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@ updatePeriodicTable(); }), ])}, - history: ()=>{return elm("h1",{},[textelm("history")])}, + history: ()=>{return elm("textarea",{id:"history",readonly:true},[])}, score: ()=>{return elm("h1",{},[textelm("score")])}, result: ()=>{return elm("h1",{},[textelm("result")])}, empty: ()=>{return elm("h1",{},[textelm("empty")])}, @@ -105,6 +105,11 @@ } else if (e.key=="Enter"||e.key==" ") { const res = checkInput(state.inputtext); + const elm = document.querySelector("#history"); + elm.value += `${state.inputtext} ${res!=false} ${Date.now()}\n` + if (elm.scrollHeight-(elm.scrollTop+elm.offsetHeight)<30) { + elm.scrollTop = elm.scrollHeight; + } if (res!=false) { state.flag[res[0]][res[1]] = true; } @@ -265,4 +270,15 @@ 50% {opacity:1;} 100% {opacity:0;} } + +#history { + overflow: scroll; + height: 100%; + width: 100%; + margin: 0; + outline: none; + border: none; + resize: none; +} + \ No newline at end of file