index.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Master Blender</title>
  6. <!--http://www.html5rocks.com/en/mobile/mobifying/-->
  7. <meta name="viewport"
  8. content="width=device-width,user-scalable=no,initial-scale=1,minimum-scale=1,maximum-scale=1,minimal-ui=true" />
  9. <!--https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
  10. <meta name="apple-mobile-web-app-capable" content="yes">
  11. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  12. <meta name="format-detection" content="telephone=no">
  13. <!-- force webkit on 360 -->
  14. <meta name="renderer" content="webkit" />
  15. <meta name="force-rendering" content="webkit" />
  16. <!-- force edge on IE -->
  17. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  18. <meta name="msapplication-tap-highlight" content="no">
  19. <!-- force full screen on some browser -->
  20. <meta name="full-screen" content="yes" />
  21. <meta name="x5-fullscreen" content="true" />
  22. <meta name="360-fullscreen" content="true" />
  23. <!--fix fireball/issues/3568 -->
  24. <!--<meta name="browsermode" content="application">-->
  25. <meta name="x5-page-mode" content="app">
  26. <!--<link rel="apple-touch-icon" href=".png" />-->
  27. <!--<link rel="apple-touch-icon-precomposed" href=".png" />-->
  28. <link rel="stylesheet" type="text/css" href="style.css" />
  29. </head>
  30. <body>
  31. <div id="GameDiv" cc_exact_fit_screen="true">
  32. <div id="Cocos3dGameContainer">
  33. <canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="99"></canvas>
  34. </div>
  35. </div>
  36. <!-- Polyfills bundle. -->
  37. <script src="src/polyfills.bundle.js" charset="utf-8"> </script>
  38. <!-- SystemJS support. -->
  39. <script src="src/system.bundle.js" charset="utf-8"> </script>
  40. <!-- Import map -->
  41. <script src="src/import-map.json" type="systemjs-importmap" charset="utf-8"> </script>
  42. <!-- <script>
  43. System.import('./index.js').catch(function (err) { console.error(err); })
  44. </script> -->
  45. <script>
  46. // 动态加载外部脚本的方法
  47. function loadScript(url) {
  48. return new Promise((resolve, reject) => {
  49. const script = document.createElement('script');
  50. script.src = url;
  51. script.async = true;
  52. script.onload = () => resolve();
  53. script.onerror = () => reject(new Error(`Failed to load script: ${url}`));
  54. document.head.appendChild(script);
  55. });
  56. }
  57. // 加载 PRESDK3.0.1.js,然后启动项目
  58. loadScript('https://www.cpsense.com/public/PRESDK3.0.1.js')
  59. .then(() => {
  60. console.log('PRESDK3.0.1.js loaded successfully');
  61. // 初始化广告 SDK
  62. var adSdkConfig = {
  63. el: document.querySelector("GameDiv"),
  64. client: 'cpsense',
  65. is_test: false
  66. };
  67. var adInstance = new adSdk(adSdkConfig);
  68. window.adInstance = adInstance;
  69. // 加载项目主入口
  70. return System.import('./index.js');
  71. })
  72. .then(() => {
  73. console.log('Game initialized successfully');
  74. })
  75. .catch(err => {
  76. console.error('Error during initialization:', err);
  77. });
  78. </script>
  79. </body>
  80. </html>