mirror of
				https://github.com/flynx/Course-JavaScript.git
				synced 2025-10-30 19:40:09 +00:00 
			
		
		
		
	added version...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									0074e84d96
								
							
						
					
					
						commit
						53766f8466
					
				| @ -1,5 +1,5 @@ | |||||||
| CACHE MANIFEST | CACHE MANIFEST | ||||||
| # Timestamp: 20170423154247 | # Timestamp: 20170423155617 | ||||||
| 
 | 
 | ||||||
| CACHE: | CACHE: | ||||||
| simplesnake.html | simplesnake.html | ||||||
|  | |||||||
| @ -85,6 +85,10 @@ body.hints:after { | |||||||
| 	font-weight: bolder; | 	font-weight: bolder; | ||||||
| 	text-shadow: 3pt 3pt 15pt rgba(0,0,0,0.2); | 	text-shadow: 3pt 3pt 15pt rgba(0,0,0,0.2); | ||||||
| } | } | ||||||
|  | .title h1 sup { | ||||||
|  | 	font-weight: normal; | ||||||
|  | 	font-size: 5vh; | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -12,7 +12,7 @@ | |||||||
| </head> | </head> | ||||||
| <body onload="setup()" onclick="clearHints()" class="hints"> | <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> | <div class="simplesnake"> </div> | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -59,6 +59,11 @@ | |||||||
| * | * | ||||||
| **********************************************************************/ | **********************************************************************/ | ||||||
| 
 | 
 | ||||||
|  | var VERSION = '2.0' | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /*********************************************************************/ | ||||||
|  | 
 | ||||||
| function makeEvent(handler_attr){ | function makeEvent(handler_attr){ | ||||||
| 	return function(func){ | 	return function(func){ | ||||||
| 		if(func === null){ | 		if(func === null){ | ||||||
| @ -473,6 +478,9 @@ function setup(snake, timer, size){ | |||||||
| 
 | 
 | ||||||
| 	// setup event handlers (only once)...
 | 	// setup event handlers (only once)...
 | ||||||
| 	if(!__HANDLER_SET){ | 	if(!__HANDLER_SET){ | ||||||
|  | 		document.querySelectorAll('.version') | ||||||
|  | 			.forEach(function(e){ e.innerHTML = VERSION }) | ||||||
|  | 
 | ||||||
| 		// control handlers...
 | 		// control handlers...
 | ||||||
| 		document.addEventListener('keydown', makeKeyboardHandler(snake)) | 		document.addEventListener('keydown', makeKeyboardHandler(snake)) | ||||||
| 		document.addEventListener('touchstart', makeTapHandler(snake)) | 		document.addEventListener('touchstart', makeTapHandler(snake)) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user