Jelajahi Sumber

样式优化

threethousanddream 4 minggu lalu
induk
melakukan
29a478eb8e
1 mengubah file dengan 9 tambahan dan 0 penghapusan
  1. 9 0
      template.h5.html

+ 9 - 0
template.h5.html

@@ -22,6 +22,15 @@
   </style>
   <!-- 正式发布的时候使用,开发期间不启用。↑ -->
   <script>
+    var coverSupport =
+      "CSS" in window &&
+      typeof CSS.supports === "function" &&
+      (CSS.supports("top: env(a)") || CSS.supports("top: constant(a)"));
+    document.write(
+      '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+      (coverSupport ? ", viewport-fit=cover" : "") +
+      '" />'
+    );
     document.addEventListener('DOMContentLoaded', function () {
       document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
     })