added version...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-04-23 15:56:29 +03:00
parent 0074e84d96
commit 53766f8466
4 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,5 @@
CACHE MANIFEST
# Timestamp: 20170423154247
# Timestamp: 20170423155617
CACHE:
simplesnake.html

View File

@ -85,6 +85,10 @@ body.hints:after {
font-weight: bolder;
text-shadow: 3pt 3pt 15pt rgba(0,0,0,0.2);
}
.title h1 sup {
font-weight: normal;
font-size: 5vh;
}

View File

@ -12,7 +12,7 @@
</head>
<body onload="setup()" onclick="clearHints()" class="hints">
<div class="title"> <h1>SimpleSnake</h1> </div>
<div class="title"> <h1>SimpleSnake<sup class="version">X</sup></h1> </div>
<div class="simplesnake"> </div>

View File

@ -59,6 +59,11 @@
*
**********************************************************************/
var VERSION = '2.0'
/*********************************************************************/
function makeEvent(handler_attr){
return function(func){
if(func === null){
@ -473,6 +478,9 @@ function setup(snake, timer, size){
// setup event handlers (only once)...
if(!__HANDLER_SET){
document.querySelectorAll('.version')
.forEach(function(e){ e.innerHTML = VERSION })
// control handlers...
document.addEventListener('keydown', makeKeyboardHandler(snake))
document.addEventListener('touchstart', makeTapHandler(snake))