54 lines
1.0 KiB
HTML
54 lines
1.0 KiB
HTML
|
<!doctype html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Scrabble Score</title>
|
||
|
<style>
|
||
|
html {
|
||
|
background-color: #eee;
|
||
|
}
|
||
|
|
||
|
div.score {
|
||
|
display: inline-block;
|
||
|
font-family: monospace, sans-serif;
|
||
|
font-size: 20vw;
|
||
|
font-weight: bold;
|
||
|
text-align: center;
|
||
|
width: 49%;
|
||
|
}
|
||
|
|
||
|
.score.elijah {
|
||
|
color: darkblue;
|
||
|
}
|
||
|
|
||
|
input {
|
||
|
border: none;
|
||
|
border-bottom: solid thin black;
|
||
|
font-family: monospace;
|
||
|
font-size: 10vw;
|
||
|
margin: 1rem 12%;
|
||
|
width: 24%
|
||
|
}
|
||
|
</style>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
console.log("Loaded");
|
||
|
function updateScore(event, player) {
|
||
|
if (event.key != 'Enter') return;
|
||
|
var sbEl = document.getElementsByClassName(player)[0];
|
||
|
sbEl.innerHTML = +(sbEl.innerHTML) + +(event.target.value);
|
||
|
event.target.value = "";
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="elijah score">
|
||
|
0
|
||
|
</div>
|
||
|
<div class="jdb score">
|
||
|
0
|
||
|
</div>
|
||
|
<input onkeypress="updateScore(event, 'elijah')" name=elijah type=number />
|
||
|
<input onkeypress="updateScore(event, 'jdb')" name=jdb type=number />
|
||
|
</body>
|
||
|
</html>
|