design.htm 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  6. <title>测测代表你的英伦歌</title>
  7. <script type="text/javascript" src="/static/ishow/js/jquery-3.2.1.min.js"></script>
  8. <script type="text/javascript" src="/static/ishow/js/pixi.min.js"></script>
  9. <script type="text/javascript" src="/static/ishow/js/hammer.min.js"></script>
  10. <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  11. <script type="text/javascript" src="/static/ishow/js/design.js"></script>
  12. <script type="text/javascript" src="/static/ishow/js/main.js"></script>
  13. <style type="text/css">
  14. *{
  15. margin: 0;
  16. padding: 0;
  17. }
  18. body{
  19. width: 100%;
  20. height: 100%;
  21. }
  22. #loadingDiv{
  23. display: block;
  24. position: fixed;
  25. width: 100%;
  26. height: 100%;
  27. text-align: center;
  28. z-index: 99999;
  29. margin: 0 auto;
  30. left: 0;
  31. right: 0;
  32. top: 0;
  33. bottom: 0;
  34. display: none;
  35. }
  36. #loadingDiv img{
  37. position: relative;
  38. display: block;
  39. width: 100%;
  40. max-width: 64px;
  41. margin: 0 auto;
  42. top: 42%;
  43. z-index: 99999;
  44. }
  45. #appDiv{
  46. width: 100%;
  47. position: absolute;
  48. margin: 0 auto;
  49. text-align: center;
  50. }
  51. #appCanvas{
  52. top: 0px;
  53. margin: 0 auto;
  54. position: relative;
  55. }
  56. #btnDiv{
  57. /* display: block; */
  58. position: fixed;
  59. width: 100%;
  60. max-width: 640px;
  61. /* height: 100%; */
  62. margin-left: auto;
  63. margin-right: auto;
  64. text-align: center;
  65. z-index: 9999;
  66. bottom: 10px;
  67. left: 0;
  68. right: 0;
  69. }
  70. table{
  71. margin: 0 auto;
  72. /* width: 100%;
  73. max-width: 640px; */
  74. }
  75. .bb{
  76. max-width: 100px;
  77. }
  78. .fileinput-button {
  79. position: relative;
  80. display: inline-block;
  81. overflow: hidden;
  82. }
  83. .fileinput-button input{
  84. position:absolute;
  85. right: 0px;
  86. top: 0px;
  87. opacity: 0;
  88. -ms-filter: 'alpha(opacity=0)';
  89. font-size: 200px;
  90. }
  91. #uploadDiv{
  92. position: absolute;
  93. display: block;
  94. // width: 100%;
  95. // height: 100%;
  96. z-index: 99999;
  97. }
  98. </style>
  99. <script>
  100. window.onresize = resizeView;
  101. wx.config({
  102. debug: false,
  103. appId: "<!--{echo $we_appid;}-->",
  104. timestamp: <!--{echo $we_timestamp;}-->,
  105. nonceStr: "<!--{echo $we_nonceStr;}-->",
  106. signature: "<!--{echo $we_signature;}-->",
  107. jsApiList: ['checkJsApi',
  108. 'chooseImage',
  109. 'uploadImage']
  110. });
  111. wx.ready(function () {
  112. /* wx.checkJsApi({
  113. * jsApiList: ['chooseImage', 'uploadImage'],
  114. * success: function(res) {
  115. * alert(res);
  116. * if ( res.checkResult && res.checkResult.chooseImage ) {
  117. * }else{
  118. * alert("choose Image not support");
  119. * }
  120. * }
  121. * });*/
  122. wx.error(function (res) {
  123. alert(res.errMsg);
  124. });
  125. });
  126. </script>
  127. </head>
  128. <body>
  129. <!--
  130. <div id="uploadDiv">
  131. <span class="fileinput-button">
  132. <img src="/static/ishow/img/btn_cece.png">
  133. <input type="file">
  134. </span>
  135. </div>
  136. -->
  137. <div id="loadingDiv">
  138. <img src="/static/ishow/img/loading.gif"/>
  139. </div>
  140. <div id="appDiv">
  141. <canvas id="appCanvas">
  142. </canvas>
  143. <!-- <div id="btnDiv">
  144. <table>
  145. <tr>
  146. <td>
  147. <img id="btnTry" class="bb" src="/static/ishow/img/btn_sure.png" onclick="onClickChoose();"/>
  148. <img id="btnMake" class="bb" src="/static/ishow/img/btn_sure.png"/>
  149. </td>
  150. </tr>
  151. </table>
  152. </div> -->
  153. </div>
  154. <script>
  155. var options = {
  156. backgroundColor : 0x1099bb,
  157. forceCanvas: true,
  158. view: document.getElementById("appCanvas")
  159. }
  160. myApp = new PIXI.Application(designW, designH, options);
  161. myApp.renderer.autoResize = true;
  162. myApp.renderer.visible = false;
  163. container = new PIXI.Container();
  164. myApp.stage.addChild(container);
  165. PIXI.loader.add([
  166. "/static/ishow/img/yinlun1.png",
  167. "/static/ishow/img/btn_cece.png",
  168. "/static/ishow/img/blank.png",
  169. ]).load(setup).on("progress", loadProgress);
  170. function loadProgress(loader, resource) {
  171. console.log("progress: " + loader.progress + "%");
  172. }
  173. function setup() {
  174. console.log("load completed");
  175. makeDesignView();
  176. resizeView();
  177. }
  178. </script>
  179. </body>
  180. </html>