index.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!DOCTYPE HTML>
  2. <html lang="en-US">
  3. <head>
  4. <!--
  5. Copyright (C) 2012 id Software LLC, a ZeniMax Media company.
  6. This file is part of the WOLF3D Browser Version GPL Source Code.
  7. -->
  8. <meta charset="UTF-8">
  9. <title>Test Page</title>
  10. <style>
  11. body {
  12. background-color : black;
  13. text-align : center;
  14. }
  15. #wolf3d {
  16. margin-top : 100px;
  17. border : none;
  18. width : 640px;
  19. height : 400px;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <iframe id="wolf3d" src="wolf3d.html" mozallowfullscreen="true" webkitallowfullscreen="true">
  25. </iframe>
  26. <script>
  27. window.onfocus = function() {
  28. var game = window.frames[0];
  29. if (game) {
  30. game.focus();
  31. }
  32. };
  33. window.oncontextmenu = function(e) {
  34. if (e.preventDefault) {
  35. e.preventDefault();
  36. }
  37. var game = window.frames[0];
  38. if (game && game.Wolf && game.Wolf.Input) {
  39. if (game.Wolf.Input.rightMouseDown()) {
  40. game.Wolf.Input.resetMouse();
  41. }
  42. }
  43. return false;
  44. }
  45. window.onmouseup = function(e) {
  46. var game = window.frames[0];
  47. if (game && game.Wolf && game.Wolf.Input) {
  48. if (game.Wolf.Input.rightMouseDown() || game.Wolf.Input.leftMouseDown()) {
  49. game.Wolf.Input.resetMouse();
  50. if (e.preventDefault) {
  51. e.preventDefault();
  52. }
  53. return false;
  54. }
  55. }
  56. }
  57. </script>
  58. </body>
  59. </html>