index.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.01, user-scalable=no, minimal-ui" />
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <meta name="apple-mobile-web-app-capable" content="yes">
  9. <meta name="apple-touch-fullscreen" content="yes">
  10. <title>汽车冲冲冲</title>
  11. <script type="text/javascript" src="./lib/soundjs.min.js"></script>
  12. <script type="text/javascript" src="game.js"></script>
  13. <script type="text/javascript" src="http://cdn.gameplayer.io/api/js/developer.js"></script>
  14. <script type="text/javascript" src="./herorush.js"></script>
  15. <script>
  16. window.addEventListener ("touchmove", function (event) { event.preventDefault (); }, false);
  17. if (typeof window.devicePixelRatio != 'undefined' && window.devicePixelRatio > 2) {
  18. var meta = document.getElementById ("viewport");
  19. meta.setAttribute ('content', 'width=device-width, initial-scale=' + (2 / window.devicePixelRatio) + ', user-scalable=no');
  20. }
  21. var height;
  22. isIOS=function(){return navigator.userAgent.toLowerCase().match(/(ipad|iphone|ipod)/g)?!0:!1};
  23. if(isIOS() == true)
  24. {
  25. window.onload = resize;
  26. window.onresize = resize;
  27. resize();
  28. window.addEventListener('scroll', function () {
  29. if (document.activeElement === document.body && window.scrollY > 0) {
  30. document.body.scrollTop = 0;
  31. }
  32. }, true);
  33. }
  34. function resize()
  35. {
  36. if(window.innerHeight < window.innerWidth)
  37. {
  38. height = window.innerHeight;
  39. document.getElementById('openfl-content').style.height = height + "px";
  40. }
  41. else
  42. {
  43. document.getElementById('openfl-content').style.height = "100%";
  44. }
  45. setTimeout(function()
  46. {
  47. window.scrollTo(0, 1);
  48. }, 50);
  49. }
  50. </script>
  51. <style>
  52. html,body{margin:0; padding:0; width:100%; height:100%; overflow:hidden; position:fixed; top:0px;}
  53. body{-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;}
  54. #openfl-content{width:100%; height:100%; position:fixed; background:#4878BA;}
  55. @font-face {
  56. font-family: 'Tw Cen MT Bold';
  57. src: url('assets/fonts/tw_cen_mt_b.eot');
  58. src: url('assets/fonts/tw_cen_mt_b.eot?#iefix') format('embedded-opentype'),
  59. url('assets/fonts/tw_cen_mt_b.svg#my-font-family') format('svg'),
  60. url('assets/fonts/tw_cen_mt_b.woff') format('woff'),
  61. url('assets/fonts/tw_cen_mt_b.ttf') format('truetype');
  62. font-weight: normal;
  63. font-style: normal;
  64. }
  65. </style>
  66. </head>
  67. <body>
  68. <div id="openfl-content"></div>
  69. <script type="text/javascript">
  70. lime.embed ("openfl-content", 640, 960, "4878BA");
  71. </script>
  72. </body>
  73. </html>