index.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>哥,挺住18秒!躲开条子</title>
  6. <link rel="icon" type="image/GIF" href="res/favicon.ico"/>
  7. <meta name="viewport" content="width=device-width,target-densitydpi=device-dpi,user-scalable=no" />
  8. <meta name="apple-mobile-web-app-capable" content="yes"/>
  9. <meta name="full-screen" content="yes"/>
  10. <meta name="screen-orientation" content="portrait"/>
  11. <meta name="x5-fullscreen" content="true"/>
  12. <meta name="360-fullscreen" content="true"/>
  13. <style>
  14. body, canvas, div {
  15. -moz-user-select: none;
  16. -webkit-user-select: none;
  17. -ms-user-select: none;
  18. -khtml-user-select: none;
  19. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  20. }
  21. .adbox{
  22. width: 100%;
  23. height: 50px;
  24. position: fixed;
  25. bottom: -50px;
  26. display: block;
  27. left: 50%;
  28. margin-left: -50%;
  29. background-size: contain;
  30. -webkit-animation: adbox .6s .2s;
  31. -webkit-animation-fill-mode: both;
  32. }
  33. .adbox2{
  34. width: 100%;
  35. height: 55px;
  36. position: fixed;
  37. top: -50px;
  38. display: block;
  39. left: 50%;
  40. margin-left: -50%;
  41. background-size: contain;
  42. -webkit-animation: adbox2 .6s .2s;
  43. -webkit-animation-fill-mode: both;
  44. }
  45. @-webkit-keyframes adbox{
  46. 100%{bottom: 0; }
  47. }
  48. @-webkit-keyframes adbox2{
  49. 100%{top: 0; }
  50. }
  51. canvas{
  52. background-size: contain;
  53. }
  54. </style>
  55. </head>
  56. <body style="padding:0; margin: 0; background: #000000;position: relative">
  57. <canvas id="gameCanvas" width="320" height="506" ></canvas>
  58. <!--<a href="#" style="position: absolute;left: 50%; top: 50%;background-image:url('res/uploadavatar/click.png')" >选择头像</a>-->
  59. <!--<input type="file" id="upload" style="opacity: 0;position: absolute;left: 50%; top: 50%;" name="image" />-->
  60. <script src="cocos2d-html5.js"></script>
  61. <script src="jquery-1.11.1.min.js" type="text/javascript"></script>
  62. <script language="JavaScript">
  63. /*document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  64. WeixinJSBridge.call('hideToolbar');
  65. });*/
  66. </script>
  67. <span style="display:none;">
  68. <script type="text/javascript" src="device.js"></script>
  69. <script type="text/javascript">
  70. //if(IsPC()){ document.body.innerHTML = ""; }
  71. var _hmt = _hmt || [];
  72. var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
  73. document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F258fa23a79b44bae7819d5e2a301d54b' type='text/javascript'%3E%3C/script%3E"));
  74. //imgUrl:分享出去图片
  75. //lineLink:分享出去的地址
  76. //descContent:分享出去的内容;
  77. //shareTitle:分享出去的标题
  78. function getAbsolutePath(relativePath) {
  79. var img=new Image();
  80. img.src=relativePath;
  81. var absolute=img.src;
  82. return absolute;
  83. }
  84. function getShareUrlPath() {
  85. /*var curWwwPath = window.document.location.href;
  86. var path = curWwwPath.substring(0,curWwwPath.lastIndexOf('/'));*/
  87. //return (path + "/a.html"+"?r="+curWwwPath+"?act=weixin_link");
  88. return ("http://game.ikongzhong.cn/games/gqtz");
  89. }
  90. var lineLink = getShareUrlPath();
  91. var shareTitle = '哥,挺住18秒!躲开条子';
  92. var shareCallback = "http://game.ikongzhong.cn/";
  93. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  94. WeixinJSBridge.on('menu:share:appmessage', function (argv) {
  95. WeixinJSBridge.invoke('sendAppMessage', {
  96. "img_url": getAbsolutePath(headSrc==res_k_head1?res_k_head3:res_f_head3),
  97. "link":lineLink,
  98. "desc":ShareWords,
  99. "content":ShareWords,
  100. "url":lineLink,
  101. "title":shareTitle
  102. }, function (res) {
  103. try {
  104. _hmt.push(['_trackEvent', 'escape', 'click', 'callback', '1']);
  105. } catch(e) {}
  106. document.location.href = shareCallback;
  107. })
  108. });
  109. WeixinJSBridge.on('menu:share:timeline', function (argv) {
  110. WeixinJSBridge.invoke('shareTimeline', {
  111. "img_url": getAbsolutePath(headSrc==res_k_head1?res_k_head3:res_f_head3),
  112. "link":lineLink,
  113. "desc":ShareWords,
  114. "content":ShareWords,
  115. "url":lineLink,
  116. "title":ShareWords
  117. }, function (res) {
  118. try {
  119. _hmt.push(['_trackEvent', 'escape', 'click', 'callback', '1']);
  120. } catch(e) {}
  121. document.location.href = shareCallback;
  122. });
  123. });
  124. WeixinJSBridge.on('menu:share:weibo', function (argv) {
  125. WeixinJSBridge.invoke('shareWeibo', {
  126. "img_url": getAbsolutePath(headSrc==res_k_head1?res_k_head3:res_f_head3),
  127. "link":lineLink,
  128. "desc":ShareWords,
  129. "content":ShareWords,
  130. "url":lineLink,
  131. "title":shareTitle
  132. }, function (res) {
  133. try {
  134. _hmt.push(['_trackEvent', 'escape', 'click', 'callback', '1']);
  135. } catch(e) {}
  136. document.location.href = mebtnopenurl;
  137. });
  138. });
  139. }, false);
  140. var c = document.getElementById("gameCanvas");
  141. c.style.background = "url(res/background.jpg) no-repeat center";
  142. c.style.backgroundSize = "cover";
  143. </script>
  144. </body>
  145. </html>