index.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>友期APP</title>
  7. <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  8. </head>
  9. <style>
  10. body {
  11. font-family: "pingfang SC", "MicrosoftYaHei";
  12. font-size: 16px;
  13. -webkit-font-smoothing: antialiased;
  14. }
  15. * {
  16. -webkit-tap-highlight-color: transparent;
  17. margin: 0;
  18. padding: 0;
  19. }
  20. .bar {
  21. width: 100%;
  22. box-sizing: border-box;
  23. padding: 8px 15px;
  24. background: #ffffff;
  25. display: flex;
  26. justify-content: space-between;
  27. align-items: center;
  28. position: fixed;
  29. bottom: 0;
  30. }
  31. .bar>img {
  32. width: 90px;
  33. height: 33px;
  34. }
  35. .bar>a {
  36. width: 6.875rem;
  37. height: 2.25rem;
  38. background-image: linear-gradient(90deg, #9C6CFA, #4979FF);
  39. border-radius: 1.25rem;
  40. color: #ffffff;
  41. display: flex;
  42. justify-content: center;
  43. align-items: center;
  44. text-decoration: none;
  45. font-size: 14px;
  46. }
  47. .iphoneX {
  48. display: none;
  49. width: 100%;
  50. height: 34px;
  51. }
  52. .main {
  53. width: 100%;
  54. }
  55. .main img{
  56. width: 100%;
  57. height: auto;
  58. }
  59. </style>
  60. <body>
  61. <div class="main">
  62. <img src="./img/2.png">
  63. <div style="width: 100%;height: 49px;"></div>
  64. <div class="iphoneX"></div>
  65. </div>
  66. <div class="bar">
  67. <img src="./img/logo.png">
  68. <a href="https://uqchat.oss-cn-shenzhen.aliyuncs.com/package/uqchat.apk" class="btn">下载友期APP</a>
  69. </div>
  70. </body>
  71. <script>
  72. const baseSize = 16
  73. function setRem() {
  74. const scale = document.documentElement.clientWidth / 375
  75. document.documentElement.style.fontSize = baseSize * scale + 'px'
  76. }
  77. setRem()
  78. window.onresize = function () {
  79. setRem()
  80. }
  81. function isIPhoneX() {
  82. var u = navigator.userAgent,
  83. isX;
  84. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  85. if (isIOS) {
  86. if (screen.height == 812 && screen.width == 375) {
  87. isX = true
  88. } else {
  89. isX = false
  90. }
  91. }
  92. return isX
  93. }
  94. if (isIPhoneX()) {
  95. document.querySelector('.bar').style.padding = "8px 15px 42px"
  96. document.querySelector('.iphoneX').style.display = "block"
  97. }
  98. let u = navigator.userAgent,
  99. ios = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  100. a = document.querySelector('.bar>a');
  101. if (ios) {
  102. a.setAttribute("href", "https://itunes.apple.com/app/id1511863353");
  103. }
  104. </script>
  105. </html>