games.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. $(document).ready(function() {
  2. // Init fancybox
  3. $('.fancybox').fancybox();
  4. var exampleName = [
  5. 'sample_arkanoid',
  6. 'sample_missile_commander',
  7. 'sample_gorilas',
  8. 'sample_snake',
  9. 'sample_asteroids',
  10. 'sample_asteroids_survival',
  11. 'sample_pang',
  12. 'sample_space_invaders',
  13. 'sample_floppy',
  14. 'sample_tetris',
  15. 'game_drturtle',
  16. 'game_just_do',
  17. 'game_skully_escape',
  18. 'game_koala_seasons',
  19. 'game_light_my_ritual',
  20. 'game_wave_collector',
  21. 'user_raymario',
  22. 'user_crazyball',
  23. 'user_tictactoe',
  24. 'user_super_red_rope',
  25. 'user_taptojamp',
  26. 'user_funwithsat'];
  27. var exampleDesc = [
  28. 'arkanoid',
  29. 'missile commander',
  30. 'gorilas',
  31. 'snake',
  32. 'asteroids',
  33. 'asteroids survival',
  34. 'pang',
  35. 'space invaders',
  36. 'floppy',
  37. 'tetris',
  38. 'Dr Turtle & Mr Gamera',
  39. 'JUST DO',
  40. 'Skully Escape',
  41. 'Koala Seasons',
  42. 'LIGHT MY RITUAL',
  43. 'Wave Collector',
  44. 'RayMario (Victor Fisac)',
  45. 'CrazyBall (Victor Fisac)',
  46. 'Tic-Tac-Toe (LelixSuper)',
  47. 'Super Red Rope Puzzles (Kurnic)',
  48. 'TapToJAmp (MarcMDE)',
  49. 'FunWithSATCollisions (MarcMDE)'];
  50. for (var i = 0; i < exampleName.length; i++)
  51. {
  52. var filterType = exampleName[i].substring(0, exampleName[i].indexOf("_"));
  53. var linkTag;
  54. if (filterType == 'sample') linkTag = '<a class="fancybox fancybox.iframe" href="games/loader.html?name=' + exampleName[i] + '" title="' + exampleDesc[i] + '">';
  55. else if (filterType == 'game') linkTag = '<a target="_blank" href="games/' + exampleName[i].substring(5) + '.html" title="' + exampleDesc[i] + '">';
  56. else if (filterType == 'user')
  57. {
  58. switch (exampleName[i])
  59. {
  60. case 'user_raymario': linkTag = '<a target="_blank" href="https://github.com/victorfisac/RayMario" title="' + exampleDesc[i] + '">'; break;
  61. case 'user_crazyball': linkTag = '<a target="_blank" href="https://github.com/victorfisac/CrazyBall" title="' + exampleDesc[i] + '">'; break;
  62. case 'user_tictactoe': linkTag = '<a target="_blank" href="https://github.com/LelixSuper/TicTacToe" title="' + exampleDesc[i] + '">'; break;
  63. case 'user_super_red_rope': linkTag = '<a target="_blank" href="https://kurnic.itch.io/super-red-rope-puzzles" title="' + exampleDesc[i] + '">'; break;
  64. case 'user_taptojamp': linkTag = '<a target="_blank" href="http://marcmde.github.io/TapToJAmp_v2_0/" title="' + exampleDesc[i] + '">'; break;
  65. case 'user_funwithsat': linkTag = '<a target="_blank" href="http://marcmde.github.io/FunWithSATCollisions_v_1_0_Browser/" title="' + exampleDesc[i] + '">'; break;
  66. default: break;
  67. }
  68. /*
  69. https://github.com/MarcMDE/TapToJump //http://marcmde.github.io/TapToJump_v1_0_Browser/
  70. https://github.com/MarcMDE/TapToJAmp //http://marcmde.github.io/TapToJAmp_v2_0/
  71. https://github.com/MarcMDE/FunWithSATCollisions //http://marcmde.github.io/FunWithSATCollisions_v_1_0_Browser/
  72. https://kurnic.wordpress.com/portfolio/flappy-jetpack/
  73. */
  74. }
  75. $('#container').append(
  76. '<div class="mix f' + filterType + '">' + linkTag +
  77. '<img width="400" height="225" src="../games/img/' + exampleName[i] + '.png"><div class="extext"><p>' + exampleDesc[i] + '</p></div></a>' +
  78. '</div>');
  79. $('#container a .extext').hide();
  80. }
  81. // Instantiate MixItUp:
  82. $('#container').mixItUp();
  83. $("#container a").hover(
  84. function(){ $(this).find(".extext").show(); },
  85. function(){ $(this).find(".extext").hide(); });
  86. /*
  87. $("#container a img").hover(
  88. function() { $(this).stop().animate({ opacity:0.6 }, 200, "easeOutQuad" ); },
  89. function() { $(this).stop().animate({ opacity:0 }, 200, "easeOutQuad" ); }
  90. )
  91. */
  92. });