Added simple scorekeeper project.
This commit is contained in:
parent
cad9df9ead
commit
12c3980f92
53
scorekeeper/scorekeep.html
Normal file
53
scorekeeper/scorekeep.html
Normal file
@ -0,0 +1,53 @@
|
||||
<!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>
|
Loading…
x
Reference in New Issue
Block a user