Skip to content

Commit

Permalink
ログを出力するようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
bem130 committed Jul 7, 2024
1 parent dff181e commit 2a0410e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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")])},
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

</style>

0 comments on commit 2a0410e

Please sign in to comment.