index.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>飞越天空之城</title>
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
  6. <meta charset="utf-8"/>
  7. <style type="text/css">
  8. *{
  9. margin:0;
  10. padding:0;
  11. }
  12. body,div{
  13. text-align:center;
  14. }
  15. img {
  16. max-width:100%;
  17. height:auto;
  18. width:auto9;
  19. -webkit-tap-highlight-color:rgba(0,0,0,0);
  20. }
  21. </style>
  22. </head>
  23. <body bgcolor = "black">
  24. <div>
  25. <section>
  26. <canvas id="gameCanvas" width="320" ></canvas>
  27. </section>
  28. </div>
  29. <script>
  30. // alert("width"+window.innerWidth + "height" + window.innerHeight);
  31. canv = document.getElementById("gameCanvas");
  32. // canv.setAttribute("width", window.innerWidth);
  33. canv.setAttribute("height", window.innerHeight);//1-150/640
  34. </script>
  35. <script src="game.min.js"></script>
  36. <script language=javascript>
  37. var mebtnopenurl = 'http://mp.weixin.qq.com/s?__biz=MzI4MjA2MjE0MQ==&mid=246005295&idx=1&sn=490f8141976d607ba079d48f52a3fcd7#rd';
  38. window.shareData = {
  39. "imgUrl": "http://game.ikongzhong.cn/icon/fytkzc.png",
  40. "timeLineLink": "http://game.ikongzhong.cn/games/fytkzc/",
  41. "tTitle": "飞越天空之城",
  42. "tContent": "飞越天空之城"
  43. };
  44. function goHome(){
  45. window.location=mebtnopenurl;
  46. }
  47. function clickMore(){
  48. if((window.location+"").indexOf("zf",1)>0){
  49. window.location = "http://game.ikongzhong.cn/games/fytkzc/";
  50. }
  51. else{
  52. goHome();
  53. }
  54. }
  55. function dp_share(){
  56. document.title ="我一飞冲天,竟然冲上了"+myData.score+"米高,谁敢挑战一下?";
  57. document.getElementById("share").style.display="";
  58. window.shareData.tTitle = document.title;
  59. }
  60. function dp_Ranking(){
  61. window.location=mebtnopenurl;
  62. }
  63. function showAd(){
  64. }
  65. function hideAd(){
  66. }
  67. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  68. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  69. WeixinJSBridge.invoke('sendAppMessage', {
  70. "img_url": window.shareData.imgUrl,
  71. "link": window.shareData.timeLineLink,
  72. "desc": window.shareData.tContent,
  73. "title": window.shareData.tTitle
  74. }, onShareComplete);
  75. });
  76. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  77. WeixinJSBridge.invoke('shareTimeline', {
  78. "img_url": window.shareData.imgUrl,
  79. "img_width": "640",
  80. "img_height": "640",
  81. "link": window.shareData.timeLineLink,
  82. "desc": window.shareData.tContent,
  83. "title": window.shareData.tTitle
  84. }, onShareComplete);
  85. });
  86. }, false);
  87. </script>
  88. <div id=share style="display: none">
  89. <img width=100% src="http://game.ikongzhong.cn/icon/fytkzc.png"
  90. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  91. ontouchstart="document.getElementById('share').style.display='none';" />
  92. </div>
  93. <div style="display: none;">
  94. <script type="text/javascript">
  95. var myData = { gameid: "zb" };
  96. window.shareData.timeLineLink = "http://game.ikongzhong.cn/games/fytkzc/index.html" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
  97. function dp_submitScore(score){
  98. myData.score = score;
  99. myData.scoreName =score+"米";
  100. if(score>0){
  101. if (confirm("我靠,一飞冲天,冲了"+score+"米!要不要让小伙伴乐呵乐呵?")){
  102. dp_share();
  103. }
  104. }
  105. }
  106. function onShareComplete(res) {
  107. if (localStorage.myuid && myData.score != undefined) {
  108. setTimeout(function(){
  109. if (confirm("要将成绩提交到游戏排行榜吗?")) {
  110. window.location = "http://game.ikongzhong.cn/games/fytkzc" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
  111. }
  112. else {
  113. document.location.href = mebtnopenurl;
  114. }
  115. }, 500);
  116. }
  117. else {
  118. document.location.href = mebtnopenurl;
  119. }
  120. }
  121. </script>
  122. <div style="display: none;">
  123. </div>
  124. </body>
  125. </html>