@@ -649,7 +649,7 @@ SNAKE.Board = SNAKE.Board || (function() {
649649
650650 elmAboutPanel = document . createElement ( "div" ) ;
651651 elmAboutPanel . className = "snake-panel-component" ;
652- elmAboutPanel . innerHTML = "<a href='http://patorjk.com/blog/software/' class='snake-link'>more patorjk.com apps</a> - <a href='https://github.com/patorjk/JavaScript-Snake' class='snake-link'>source code</a>" ;
652+ elmAboutPanel . innerHTML = "<a href='http://patorjk.com/blog/software/' class='snake-link'>more patorjk.com apps</a> - <a href='https://github.com/patorjk/JavaScript-Snake' class='snake-link'>source code</a> - <a href='https://www.instagram.com/patorjk/' class='snake-link'>pat's instagram</a> " ;
653653
654654 elmLengthPanel = document . createElement ( "div" ) ;
655655 elmLengthPanel . className = "snake-panel-component" ;
@@ -1025,3 +1025,35 @@ SNAKE.Board = SNAKE.Board || (function() {
10251025
10261026 } ; // end return function
10271027} ) ( ) ;
1028+
1029+ function getTheme ( ) {
1030+ function changeTheme ( Theme ) {
1031+ document . getElementById ( 'style' ) . setAttribute ( 'href' , Theme ) ;
1032+ }
1033+ var index = document . getElementById ( "select" ) . selectedIndex ;
1034+ switch ( index ) {
1035+ case 0 :
1036+ changeTheme ( 'css/light-snake.css?' + Math . random ( ) ) ;
1037+ break ;
1038+ case 1 :
1039+ changeTheme ( 'css/main-snake.css?' + Math . random ( ) ) ;
1040+ break ;
1041+ case 2 :
1042+ changeTheme ( 'css/dark-snake.css?' + Math . random ( ) ) ;
1043+ break ;
1044+ case 3 :
1045+ changeTheme ( 'css/green-snake.css?' + Math . random ( ) ) ;
1046+ break ;
1047+ default :
1048+ changeTheme ( 'css/main-snake.css?' + Math . random ( ) ) ;
1049+ break ;
1050+ }
1051+ setTimeout ( function ( ) {
1052+ document . getElementById ( 'game-area' ) . focus ( ) ;
1053+ } , 10 ) ;
1054+ }
1055+
1056+ var mySnakeBoard = new SNAKE . Board ( {
1057+ boardContainer : "game-area" ,
1058+ fullScreen : true
1059+ } ) ;
0 commit comments