index.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <!doctype html>
  2. <html>
  3. <head><meta name="x-key" content="a39c0a4735a87896802c4e289f961f9d">
  4. <meta charset="utf-8" />
  5. <meta name="viewport" id="viewport" content="width=device-width,user-scalable=no">
  6. <title>跑酷历险记</title>
  7. <link rel="shortcut icon" href="icon.png">
  8. <link rel="icon" href="icon.png">
  9. <!-- <script type="text/javascript" src="zepto.min.js"></script> -->
  10. <meta name="apple-mobile-web-app-capable" content="yes" />
  11. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  13. <link rel='canonical' href='' />
  14. <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  15. <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  16. <script>
  17. var ua = navigator.userAgent.toLowerCase(),
  18. Mobile = {
  19. isAndroid: ua.indexOf('android') != -1,
  20. isIOS: ua.indexOf('ipad') > -1 || ua.indexOf('iphone') > -1
  21. };
  22. Mobile.getVersion = function () {
  23. return ua.match(/(iphone os|android|android)(\/| )([\d_\.]+)/)[3].split(Mobile.isAndroid ? '.' : '_');
  24. }
  25. Mobile.isHongMi = function () {
  26. return (ua.indexOf('jro03l') != -1 && ua.indexOf('xiaomi') == -1)
  27. || (ua.indexOf('hm') != -1 && ua.indexOf('xiaomi') != -1);
  28. }
  29. var setViewPort = function () {
  30. var uiWidth = 480, vp = document.getElementById("viewport");
  31. var isIOS = ua.indexOf('ipad') > -1 || ua.indexOf('iphone') > -1;
  32. var dpi = "device-dpi";
  33. if (Mobile.isAndroid) {
  34. version = Mobile.getVersion();
  35. var deviceWidth = Math.min(window.screen.width, window.outerWidth);
  36. dpi = (uiWidth / deviceWidth) * window.devicePixelRatio * 160;
  37. }
  38. //vp.content = "width="+uiWidth+",user-scalable=no,target-densitydpi=" + dpi;
  39. }
  40. setViewPort();
  41. </script>
  42. <style>
  43. html, body {
  44. height: 100%;
  45. }
  46. body {
  47. overflow: hidden;
  48. padding: 0;
  49. margin: 0;
  50. background-color: #000;
  51. -webkit-tap-highlight-color: rgba(0,0,0,0);
  52. -webkit-backface-visibility: hidden;
  53. -webkit-user-select: none;
  54. -webkit-text-size-adjust: none;
  55. font-family: "Helvetica Neue", Helvetica, STHeiTi, "微软雅黑", "黑体", sans-serif;
  56. }
  57. #stage {
  58. position: absolute;
  59. left: 0;
  60. top: 0;
  61. width: 480px;
  62. height: 100%;
  63. overflow: hidden;
  64. }
  65. .rotate-guide {
  66. width: 100%;
  67. height: 100%;
  68. background-color: #E0E0E0;
  69. position: absolute;
  70. left: 0;
  71. top: 0;
  72. z-index: 100000;
  73. display: none;
  74. }
  75. .rotate-guide .guide-wraper {
  76. position: absolute;
  77. left: 50%;
  78. top: 50%;
  79. width: 100%;
  80. height: 280;
  81. width: 280px;
  82. margin-top: -160px;
  83. margin-left: -140px;
  84. }
  85. .rotate-guide .guide-wraper span {
  86. display: block;
  87. width: 100%;
  88. height: 30px;
  89. text-align: center;
  90. font-size: 28px;
  91. color: #B0B0B0;
  92. }
  93. #ad_container {
  94. background-color: white;
  95. position: absolute;
  96. bottom: 0px;
  97. width: 100%;
  98. visibility: hidden;
  99. z-index: -1;
  100. }
  101. </style>
  102. <link rel="stylesheet" type="text/css" href="js/game2014091601.css" />
  103. <script type="text/javascript" src="js/game2014091603.js"></script>
  104. <script type="text/javascript" src="js/qqapi.js?_bid=152"></script>
  105. </head>
  106. <body>
  107. <div id="stage"></div>
  108. <div id="guide" class="rotate-guide">
  109. <div id="guide-wraper" class='guide-wraper'>
  110. <img src="assets/rotate_20140522.png" width="280px" height="175px" />
  111. <span>竖屏体验更佳</span>
  112. </div>
  113. </div>
  114. <div id="ad_container"></div>
  115. <script>
  116. function updateQQShareInfo(lv) {
  117. }
  118. function log(content, append) {
  119. if (append) document.getElementById('debug').innerHTML += content;
  120. else document.getElementById('debug').innerHTML = content;
  121. }
  122. var loader;
  123. var startScore;
  124. var _get = getRequest();
  125. var qzoneVersion = [4, 5];
  126. var startOrientation = window.orientation;
  127. isTouch = 3;
  128. var cdn = '';
  129. var resizeTime = 500;
  130. if (ua.indexOf('ucbrowser') != -1) resizeTime = 900;
  131. var isDebug = false;
  132. var showFps = false;
  133. var stage, canvas = document.getElementById('stage'), guide = document.getElementById('guide'), __w, __h, game;
  134. var App = {
  135. 'rankIndex': [0, 0],
  136. 'isMobile': document.ontouchstart === null,
  137. 'openTime': 0,
  138. 'limitTime': 500,
  139. eventClick: 'touchend',
  140. isStopEevent: function (time) {
  141. return (Date.now() - App.openTime < (time || App.limitTime)); //面板打开后500秒内不响应交互事件(触摸、单击)
  142. },
  143. setOpenTime: function () {
  144. App.openTime = Date.now(); //面板打开后500秒内不响应交互事件(触摸、单击)
  145. }
  146. }
  147. function go1() {
  148. //设定缩放比例
  149. renewIndex();
  150. game = new Game();
  151. //alert(document.getElementsByTagName('canvas')[0].width);
  152. }
  153. var isAddAD = false;
  154. var adHeight = 75;
  155. function addADFun(ad) {
  156. isAddAD = ad;
  157. renewIndexFn();
  158. }
  159. var renewIndex = renewIndexFn = function (update) {
  160. __w = App.width = document.body.clientWidth;
  161. __h = App.height = document.body.clientHeight;
  162. var ad = document.getElementById('ad_container');//
  163. adHeight = 75 * __w / 480;
  164. ad.style['height'] = adHeight + 'px';
  165. if (isAddAD) {
  166. ad.style['visibility'] = 'visible';
  167. ad.style['z-index'] = 0;
  168. __h -= adHeight;
  169. } else {
  170. ad.style['visibility'] = 'hidden';
  171. ad.style['z-index'] = -1;
  172. }
  173. var s = Config.SCALE = __w / 480;
  174. var l = Config.MARGIN_LEFT = -(480 - __w) / 2;
  175. var oldHeight = __h;
  176. canvas.style['-webkit-transform'] = 'scale(' + s + ', ' + s + ')';
  177. canvas.style['margin-left'] = l + 'px';
  178. canvas.style['height'] = (oldHeight / s) + 'px';
  179. canvas.style['margin-top'] = -((oldHeight / s) - oldHeight) / 2 + 'px';
  180. App.height = oldHeight / s;
  181. try {
  182. RankUI.getInstance().resize();
  183. game && game.resize();
  184. } catch (e) {
  185. }
  186. }
  187. function guideShow() {
  188. var ht = document.body.clientHeight;
  189. var guideScale = ht / 280;
  190. lib.g('guide-wraper').style['-webkit-transform'] = 'scale(' + guideScale + ',' + guideScale + ')';
  191. guide.style['height'] = (ht + 80) + 'px';
  192. guide.style.display = 'block';
  193. }
  194. //var startOrientation = top.window.orientation;
  195. var isOrientation = false;
  196. if (Math.abs(startOrientation) == 90) {
  197. guideShow();
  198. App.isStart = false;
  199. } else {
  200. go1();
  201. guide.style.display = 'none';
  202. }
  203. var supportsOrientationChange = ("onorientationchange" in window) && (top.location.href === location.href),
  204. orientationEvent = supportsOrientationChange ? "orientationchange" : "resize";
  205. var timer = null;
  206. function resize() {
  207. if (timer) {
  208. clearTimeout(timer);
  209. timer = null;
  210. }
  211. timer = setTimeout(function () {
  212. renewIndex(true);
  213. }, resizeTime + 50);
  214. }
  215. window.addEventListener('resize', resize, false)
  216. var timer1 = null;
  217. window.addEventListener(orientationEvent, function () {
  218. isOrientation = true;
  219. if (timer1) {
  220. clearTimeout(timer1);
  221. timer1 = null;
  222. }
  223. timer1 = setTimeout(function () {
  224. setViewPort();
  225. if (Math.abs(window.orientation) == 90) {
  226. guideShow();
  227. } else {
  228. if (App.isStart == false) {
  229. App.isStart = true;
  230. go1();
  231. }
  232. guide.style.display = 'none';
  233. }
  234. }, resizeTime);
  235. }, false);
  236. document.addEventListener('touchmove', function (event) { event.preventDefault() }, false);
  237. function callActionScript() { }
  238. </script>
  239. <script type="text/JavaScript">
  240. window.shareData={
  241. 'title':'跑酷历险记',
  242. 'link':'http://game.ikongzhong.cn/games/pklxj/',
  243. 'imgurl':'http://game.ikongzhong.cn/games/pklxj/icon.png'
  244. }
  245. window.shareFriendData={
  246. 'title':'跑酷历险记',
  247. 'content':'关注空中传媒网络科技,更多好玩的游戏等着你。',
  248. 'link':'http://game.ikongzhong.cn/games/pklxj/',
  249. 'imgurl':'http://game.ikongzhong.cn/games/pklxj/icon.png'
  250. }
  251. </script>
  252. <script type="text/JavaScript" src="http://gc.veiying.cn/code"></script>
  253. </body>
  254. </html>