changed default behavior of arrows in game
+ small css improvments in game
This commit is contained in:
@@ -13,6 +13,8 @@ body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
/* tmp? */
|
||||
background: bisque;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
@@ -348,11 +348,16 @@
|
||||
}
|
||||
#game_page {
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
background-color: #222425;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
}
|
||||
#game_option {
|
||||
margin-top: 20px;
|
||||
}
|
||||
#canvas_container {
|
||||
margin-top: 20px;
|
||||
|
||||
@@ -59,14 +59,20 @@ function start_after_countdown()
|
||||
abortControllerKeydown = new AbortController();
|
||||
window.addEventListener(
|
||||
'keydown',
|
||||
(e) => { pong.addKey(e.key); },
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
pong.addKey(e.key);
|
||||
},
|
||||
{signal: abortControllerKeydown.signal}
|
||||
);
|
||||
|
||||
abortControllerKeyup = new AbortController();
|
||||
window.addEventListener(
|
||||
'keyup',
|
||||
(e) => { pong.deleteKey(e.key); },
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
pong.deleteKey(e.key);
|
||||
},
|
||||
{signal: abortControllerKeyup.signal}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user