index.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>围住小鬼子</title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1, maximum-scale=1,user-scalable=no,target-densitydpi=device-dpi"/>
  7. <meta name="apple-mobile-web-app-capable" content="yes"/>
  8. <meta name="full-screen" content="true"/>
  9. <meta name="screen-orientation" content="portrait"/>
  10. <meta name="x5-fullscreen" content="true"/>
  11. <meta name="360-fullscreen" content="true"/>
  12. <style>
  13. body {
  14. text-align: center;
  15. background: #000000;
  16. padding: 0;
  17. border: 0;
  18. margin: 0;
  19. height: 100%;
  20. }
  21. html {
  22. -ms-touch-action: none; /* Direct all pointer events to JavaScript code. */
  23. }
  24. .shareGuide {
  25. display: none;
  26. position: fixed;
  27. top: 0;
  28. left: 0;
  29. width: 100%;
  30. height: 100%;
  31. text-align: center;
  32. color: #fff;
  33. font-size: 26px;
  34. line-height: 1.7em;
  35. background: rgba(0, 0, 0, 0.85);
  36. }
  37. .shareGuide .arrow {
  38. position: absolute;
  39. top: 8px;
  40. right: 8px;
  41. width: 100px;
  42. height: 100px;
  43. background: url(http://baby.ci123.com/yunqi/m/weixin/images/arron.png) no-repeat;
  44. background-size: 100px 100px;
  45. }
  46. #bdShareGuide .arrow {
  47. top: auto;
  48. bottom: 8px;
  49. transform: rotateX(180deg);
  50. -webkit-transform: rotateX(180deg);
  51. }
  52. .shareGuide p {
  53. position: absolute;
  54. left: 0;
  55. top: 90px;
  56. height: 140px;
  57. width: 100%;
  58. }
  59. .shareGuide .closeSG {
  60. position: absolute;
  61. top: 8px;
  62. left: 8px;
  63. font-size: 50px;
  64. color: #fff;
  65. text-decoration: none;
  66. outline: none;
  67. }
  68. #bdShareGuide p {
  69. top: auto;
  70. bottom: 90px;
  71. }
  72. </style>
  73. <script src="./js/jquery.min.js"></script>
  74. </head>
  75. <body>
  76. <div style="display:inline-block;width:100%; height:100%;margin: 0 auto; background: black; position:relative;"
  77. id="gameDiv">
  78. <canvas id="gameCanvas" width="480" height="800" style="background-color: #000000"></canvas>
  79. </div>
  80. <div id="wxShareGuide" class="shareGuide">
  81. <div class="arrow"></div>
  82. <p>请点击右上角<br/>点击【分享到朋友圈】<br/>和好朋友一起去打小鬼子吧</p>
  83. <a href="javascript:" class="closeSG">×</a>
  84. </div>
  85. <div id="bdShareGuide" class="shareGuide">
  86. <div class="arrow"></div>
  87. <p>请点击右下角<br>点击【分享】<br>邀请好友去打小鬼子吧</p>
  88. <a href="javascript:" class="closeSG" onClick="$('#bdShareGuide').fadeOut(200)">×</a>
  89. </div>
  90. <script>var document_class = "GameApp";</script><!--这部分内容在编译时会被替换,要修改文档类,请到工程目录下的egretProperties.json内编辑。-->
  91. <script src="./js/egret_loader.js"></script>
  92. <script src="./js/game-min.js"></script>
  93. <script type="text/javascript">
  94. var browser = {
  95. versions: function () {
  96. var u = navigator.userAgent, app = navigator.appVersion;
  97. return {
  98. trident: u.indexOf('Trident') > -1, //IE内核
  99. presto : u.indexOf('Presto') > -1, //opera内核
  100. webKit : u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
  101. gecko : u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,//火狐内核
  102. mobile : !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
  103. iOS : !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
  104. Android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
  105. iPhone : u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
  106. iPad : u.indexOf('iPad') > -1, //是否iPad
  107. webApp : u.indexOf('Safari') == -1, //是否web应该程序,没有头部与底部
  108. baidu : u.indexOf('baidu') > -1,
  109. weixin : u.indexOf('MicroMessenger') > -1
  110. };
  111. }(),
  112. language: (navigator.browserLanguage || navigator.language).toLowerCase()
  113. };
  114. window.shareData = {
  115. "imgUrl" : "http://game.ikongzhong.cn/icon/wzxgz.png",
  116. "timeLineLink": "http://game.ikongzhong.cn/game/wzxgz",
  117. "tTitle" : "围住小鬼子,你抓住了几个战犯!",
  118. "tContent" : "壮志饥餐胡虏肉,笑谈渴饮匈奴血!"
  119. };
  120. function share(n, m ,tag,txt) {
  121. if (m == 0) {
  122. document.title = window.shareData.tTitle = "围住小鬼子,你抓住了几个战犯!-新华社发布"
  123. }
  124. if (m == 1) {
  125. document.title = window.shareData.tTitle = "我用了" + n + "步抓住了鬼子" + txt + ",领先全国" + (99 - n) + "%的抗日英雄,小伙伴要加油哦!-新华社发布"
  126. }
  127. if (m == 2) {
  128. document.title = window.shareData.tTitle = "又让小鬼子" + txt + "给跑了,小伙伴快来帮我抓住战犯!-新华社发布"
  129. }
  130. window.setTimeout(hiddenMe, 5000);
  131. $("#wxShareGuide").css("display","block");
  132. }
  133. function hiddenMe(){
  134. $("#wxShareGuide").css("display","none");
  135. }
  136. var xhurl = "http://game.ikongzhong.cn";
  137. function showme(){
  138. window.location.href = xhurl;
  139. };
  140. var mebtnopenurl = "http://game.ikongzhong.cn";
  141. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  142. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  143. WeixinJSBridge.invoke('sendAppMessage', {
  144. "img_url": window.shareData.imgUrl,
  145. "link": window.shareData.timeLineLink,
  146. "desc": window.shareData.tContent,
  147. "title": window.shareData.tTitle
  148. }, function(res) {
  149. document.location.href = mebtnopenurl;
  150. })
  151. });
  152. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  153. WeixinJSBridge.invoke('shareTimeline', {
  154. "img_url": window.shareData.imgUrl,
  155. "img_width": "640",
  156. "img_height": "640",
  157. "link": window.shareData.timeLineLink,
  158. "desc": window.shareData.tContent,
  159. "title": window.shareData.tTitle
  160. }, function(res) {
  161. document.location.href = mebtnopenurl;
  162. });
  163. });
  164. WeixinJSBridge.on('menu:share:weibo', function(argv) {
  165. WeixinJSBridge.invoke('shareWeibo', {
  166. "content": window.shareData.tContent,
  167. "url": window.shareData.timeLineLink
  168. }, function(res) {
  169. document.location.href = mebtnopenurl;
  170. });
  171. });
  172. }, false);
  173. egret_h5.startGame();
  174. </script>
  175. <div style="display:none;">
  176. <script>
  177. var _hmt = _hmt || [];
  178. (function() {
  179. var hm = document.createElement("script");
  180. hm.src = "//hm.baidu.com/hm.js?fa356a94bf5ae253b76fefa953bb56e4";
  181. var s = document.getElementsByTagName("script")[0];
  182. s.parentNode.insertBefore(hm, s);
  183. })();
  184. </script>
  185. </div>
  186. </body>
  187. </html>