index.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  8. <title>K3</title>
  9. <script>
  10. !function(d,a){var e=d.documentElement,c="orientationchange"in window?"orientationchange":"resize",v=function(){
  11. var f=e.clientWidth, ratio=1;
  12. if(f > 750 && f < 1300) {
  13. f = 1300 * 0.9;
  14. ratio = 1920 / 750;
  15. }
  16. if(f >= 1300) {
  17. f = 1920;
  18. ratio = 1920 / 750;
  19. }
  20. var p=20*(f/320) / ratio
  21. f&&(e.style.fontSize=p+"px")
  22. };d.addEventListener&&(a.addEventListener(c,v,!1),d.addEventListener("DOMContentLoaded",v,!1))}(document,window);
  23. </script>
  24. </head>
  25. <body>
  26. <noscript>
  27. <strong>We're sorry but K3 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  28. </noscript>
  29. <div id="app"></div>
  30. <script>
  31. window.EOS_PROTOCOL = "<?= $GLOBALS['eosProtocol'] ?>"
  32. window.EOS_HOST = "<?= $GLOBALS['eosHost'] ?>"
  33. window.EOS_PORT = "<?= $GLOBALS['eosPort'] ?>"
  34. </script>
  35. <script type="text/javascript" src="https://www.mee.chat/sdk.js"></script>
  36. <script>
  37. function __getOptions() {
  38. var options = {
  39. group_id : 10001
  40. };
  41. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  42. // 移动端的情况
  43. if (window.innerHeight >= window.innerWidth) {
  44. // 竖屏
  45. options.bottom = 0;
  46. options.left = 0;
  47. options.height = '66%';
  48. options.width = '100%';
  49. options.show = false;
  50. } else {
  51. // 横屏
  52. options.bottom = 0;
  53. options.left = 0;
  54. options.height = '100%';
  55. options.width = '60%';
  56. options.show = false;
  57. }
  58. } else {
  59. // PC 端的情况
  60. options.bottom = 10;
  61. options.right = 10;
  62. options.height = 500;
  63. options.width = 300;
  64. options.show = true;
  65. }
  66. return options;
  67. }
  68. __MeeChat.init(__getOptions());
  69. // *************************** 【可选】响应式网站可以加入以下代码 ************************
  70. resize();
  71. window.addEventListener('orientationchange', resize);
  72. window.addEventListener('resize', resize);
  73. function resize() {
  74. var options = __getOptions();
  75. delete options.show;
  76. __MeeChat.resize(options);
  77. }
  78. // ***********************************************************************************
  79. </script>
  80. <!-- built files will be auto injected -->
  81. </body>
  82. </html>