index.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="viewport" content="width=480,user-scalable=no,uc-user-scalable=no,target-densitydpi=high-dpi"/>
  6. <script>
  7. function play68_init() {
  8. updateShare(0);
  9. }
  10. function goHome() {
  11. window.location.href = HOME_PATH;
  12. }
  13. function play68_submitScore(score) {
  14. updateShareScore(score);
  15. setTimeout( function() { show_share(); }, 500 );
  16. }
  17. function updateShare(bestScore) {
  18. imgUrl ="http://game.ikongzhong.cn/icon/mishi.png";
  19. lineLink ="http://game.ikongzhong.cn/games/mishi/index.html";
  20. descContent = "你觉得你反应很快吗?试试就知道!";
  21. updateShareScore(bestScore);
  22. appid = '';
  23. }
  24. function updateShareScore(bestScore) {
  25. if(bestScore > 0) {
  26. shareTitle = "考反应游戏《密室逃脱》我过了" + bestScore + "关,实在是太变态了!";
  27. }
  28. else{
  29. shareTitle = "变态考反应游戏《密室逃脱》能通关你就能闪子弹了!";
  30. }
  31. }
  32. </script>
  33. <script type="text/javascript" src="jsgamemin.js"></script>
  34. <script type="text/javascript" src="spaceman.min.js"></script>
  35. <title>密室逃脱</title>
  36. <style>
  37. body{margin:0px; background-color:#434243; color:#6A6A6A;}
  38. .bandiv{float:left; width:100%; background-color:#DBD1BB;}
  39. .bandiv div{padding:10px; text-align:left;}
  40. body{
  41. oncontextmenu: return false;
  42. onselectstart: return false;
  43. }
  44. #play68box{
  45. width: 190px;
  46. font-size: 12px;
  47. line-height: 15px;
  48. right: -172px;
  49. top: 35%;
  50. position: fixed;
  51. z-index: 100;
  52. }
  53. #tab{
  54. float: left;
  55. list-style: none outside none;
  56. padding: 0;
  57. position: relative;
  58. z-index: 99;
  59. margin-top: 10px;
  60. margin-right: 0;
  61. margin-bottom: 0;
  62. margin-left: 0;
  63. }
  64. #tab li span{
  65. display: block;
  66. padding: 0 5px;
  67. position: relative;
  68. }
  69. #links{
  70. width: 100px;
  71. padding: 1px;
  72. float: left;
  73. background-color: #f6bb42;
  74. border-radius: 8px;
  75. }
  76. .show, .hide{
  77. transition: margin-right .4s ease-in;
  78. -webkit-transition: margin-right .4s ease-in;
  79. }
  80. .hide{
  81. margin-right:0px;
  82. }
  83. .show{
  84. margin-right:95px;
  85. }
  86. #arrow, .bt{
  87. cursor: pointer;
  88. }
  89. .bt{
  90. width: 95px;
  91. height: 41px;
  92. margin: 2px;
  93. text-align:center;
  94. font: bold 15px Arial, Helvetica, "Microsoft Yahei", "微软雅黑", STXihei, "华文细黑", sans-serif;
  95. background-color: #da4453;
  96. border-radius: 6px;
  97. }
  98. .bt a{
  99. line-height: 40px;
  100. color: #fff;
  101. display: block;
  102. text-decoration:none;
  103. }
  104. .bt:hover{
  105. transition: background .3s linear -o-transition: background .3s linear;
  106. -moz-transition: background .3s linear;
  107. -webkit-transition: background .3s linear;
  108. background-color: #37bc9b;
  109. }
  110. #deco{
  111. width: 90px;
  112. float: left;
  113. }
  114. #share-wx{
  115. background:rgba(0,0,0,0.8);
  116. position:absolute;top:0px;
  117. left:0px;
  118. width:100%;
  119. height:100%;
  120. z-index:10000;
  121. display:none;
  122. }
  123. #wx-qr{
  124. background:rgba(0,0,0,0.8);
  125. position:absolute;top:0px;
  126. left:0px;
  127. width:100%;
  128. height:100%;
  129. z-index:10000;
  130. display:none;
  131. }
  132. </style>
  133. <script>
  134. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  135. WeixinJSBridge.call('showOptionMenu');
  136. });
  137. new Image().src = 'http://game.ikongzhong.cn/';
  138. </script>
  139. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=34915524" charset="UTF-8"></script>
  140. </head>
  141. <body onLoad="main()" id="0">
  142. <div style="text-align:center;">
  143. <canvas id="jsGameScreen"></canvas>
  144. </div>
  145. <script type="text/javascript">
  146. var mebtnopenurl = 'http://mp.weixin.qq.com/s?__biz=MzI4MjA2MjE0MQ==&mid=246005295&idx=1&sn=490f8141976d607ba079d48f52a3fcd7#rd';
  147. function shareFriend() {
  148. WeixinJSBridge.invoke("sendAppMessage", {
  149. appid: appid,
  150. img_url: imgUrl,
  151. img_width: "200",
  152. img_height: "200",
  153. link: lineLink,
  154. desc: descContent,
  155. title: shareTitle
  156. },
  157. function(e) {
  158. document.location.href = mebtnopenurl;
  159. })
  160. }
  161. function shareTimeline() {
  162. WeixinJSBridge.invoke("shareTimeline", {
  163. img_url: imgUrl,
  164. img_width: "200",
  165. img_height: "200",
  166. link: lineLink,
  167. desc: descContent,
  168. title: shareTitle
  169. },
  170. function(e) {
  171. document.location.href = mebtnopenurl;
  172. })
  173. }
  174. function shareWeibo() {
  175. WeixinJSBridge.invoke("shareWeibo", {
  176. img_url: imgUrl,
  177. content: shareTitle + " " + descContent,
  178. url: lineLink
  179. },
  180. function(e) {
  181. document.location.href = mebtnopenurl;
  182. })
  183. }
  184. function isWeixin() {
  185. var e = navigator.userAgent.toLowerCase();
  186. if (e.match(/MicroMessenger/i) == "micromessenger") {
  187. return true
  188. } else {
  189. return false
  190. }
  191. }
  192. function toggle(e) {
  193. var t = document.getElementById(e);
  194. var n = document.getElementById("arrow");
  195. var r = t.getAttribute("class");
  196. if (r == "hide") {
  197. t.setAttribute("class", "show");
  198. delay(n, RESOURCE_IMG_PATH + "arrowright.png", 400)
  199. } else {
  200. t.setAttribute("class", "hide");
  201. delay(n, RESOURCE_IMG_PATH + "arrowleft.png", 400)
  202. }
  203. }
  204. function delay(e, t, n) {
  205. window.setTimeout(function() {
  206. e.setAttribute("src", t)
  207. },
  208. n)
  209. }
  210. function show_share() {
  211. document.getElementById("share-wx").style.display = "block"
  212. }
  213. function closeshare() {
  214. document.getElementById("share-wx").style.display = "none"
  215. }
  216. function closewx() {
  217. document.getElementById("wx-qr").style.display = "none"
  218. }
  219. function addShareWX() {
  220. var e = document.createElement("div");
  221. e.id = "share-wx";
  222. e.onclick = closeshare;
  223. document.body.appendChild(e);
  224. var t = document.createElement("p");
  225. t.style.cssText = "text-align:right;padding-left:10px;";
  226. e.appendChild(t);
  227. var n = document.createElement("img");
  228. n.src = "2.png";
  229. n.id = "share-wx-img";
  230. n.style.cssText = "max-width:280px;padding-right:25px;";
  231. t.appendChild(n);
  232. }
  233. if (getCookie("num")) {
  234. var nn = parseInt(getCookie("num"));
  235. setCookie("num", ++nn);
  236. } else {
  237. setCookie("num", 1);
  238. }
  239. function getCookie(name)
  240. {
  241. var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
  242. if(arr=document.cookie.match(reg)) return unescape(arr[2]);
  243. else return null;
  244. }
  245. function setCookie(name, value) {
  246. var Days = 30;
  247. var exp = new Date();
  248. exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
  249. document.cookie = name + "=" + escape(value) + ";expires" + exp.toGMTString();
  250. }
  251. function isMobile() {
  252. return navigator.userAgent.match(/android|iphone|ipod|blackberry|meego|symbianos|windowsphone|ucbrowser/i)
  253. }
  254. function isIOS() {
  255. return navigator.userAgent.match(/iphone|ipod|ios/i)
  256. }
  257. var HOME_PATH = HOME_PATH || "http://game.ikongzhong.cn/",
  258. RESOURCE_IMG_PATH = RESOURCE_IMG_PATH || "/game/",
  259. HORIZONTAL = HORIZONTAL || false,
  260. COVER_SHOW_TIME = COVER_SHOW_TIME || 2e3;
  261. var imgUrl ="http://game.ikongzhong.cn/icon.mishi.png/";
  262. var lineLink ="http://game.ikongzhong.cn/games/mishi/index.html";
  263. var descContent = "快来跟我一起玩!";
  264. var shareTitle = "最好玩的小游戏就在游戏排行榜!";
  265. var appid = "";
  266. document.addEventListener("WeixinJSBridgeReady",
  267. function() {
  268. WeixinJSBridge.on("menu:share:appmessage",
  269. function(e) {
  270. shareFriend()
  271. });
  272. WeixinJSBridge.on("menu:share:timeline",
  273. function(e) {
  274. shareTimeline()
  275. });
  276. WeixinJSBridge.on("menu:share:weibo",
  277. function(e) {
  278. shareWeibo()
  279. });
  280. if (HORIZONTAL == true) {
  281. WeixinJSBridge.call("hideToolbar")
  282. }
  283. },
  284. false); (function() {
  285. function n() {
  286. window.scroll(0, 0);
  287. var e;
  288. if (window.orientation == 0 || window.orientation == 180) {
  289. e = false
  290. } else if (window.orientation == -90 || window.orientation == 90) {
  291. e = true
  292. }
  293. if (e == HORIZONTAL) {
  294. t.style.display = "none"
  295. } else {
  296. setTimeout(function() {
  297. r();
  298. t.style.width = window.innerWidth + "px";
  299. t.style.display = "block"
  300. },
  301. isIOS() ? 0 : 600)
  302. }
  303. if (HORIZONTAL == true && isWeixin() && !isIOS()) {
  304. WeixinJSBridge.call("hideToolbar")
  305. }
  306. }
  307. function r() {
  308. e.style.height = window.innerHeight + "px";
  309. e.style.width = window.innerWidth + "px";
  310. t.style.height = window.innerHeight + "px"
  311. }
  312. if (typeof play68_init == "function") {
  313. play68_init()
  314. }
  315. if (!isMobile()) return;
  316. var e = document.createElement("div");
  317. e.style.cssText = "position:absolute;z-index:1000000;left:0;top:0;background-size: 50%;width:" + window.innerWidth + "px;height:" + Math.max(window.innerHeight, window.document.documentElement.offsetHeight) + "px";
  318. e.className = "common_cover";
  319. document.body.appendChild(e);
  320. setTimeout(function() {
  321. e.parentNode.removeChild(e)
  322. },
  323. COVER_SHOW_TIME);
  324. document.addEventListener("touchmove",
  325. function(e) {
  326. e.preventDefault()
  327. },
  328. false);
  329. var t = document.createElement("div");
  330. t.className = "common_notice";
  331. t.style.cssText = "position:absolute;z-index:999999;left:0;top:0;background-size: 50%;";
  332. document.body.appendChild(t);
  333. window.addEventListener("orientationchange", n);
  334. window.addEventListener("load", n);
  335. window.addEventListener("scroll", r)
  336. })();
  337. addShareWX();
  338. </script>
  339. </body>
  340. </html>