index.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  6. <title>PBL教师端</title>
  7. <link rel="shortcut icon" type="image/x-icon" href="static/logo.ico">
  8. <style>
  9. @charset "utf-8";
  10. /* @font-face {
  11. font-family: 'Source Han Sans SC';
  12. src: url('./static/SourceHanSans-Regular.otf') format('truetype');
  13. font-weight: normal;
  14. font-style: normal;
  15. } */
  16. div::-webkit-scrollbar {
  17. /*滚动条整体样式*/
  18. width: 6px;
  19. /*高宽分别对应横竖滚动条的尺寸*/
  20. height: 6px;
  21. }
  22. /*定义滚动条轨道 内阴影+圆角*/
  23. div::-webkit-scrollbar-track {
  24. border-radius: 10px;
  25. background-color: rgba(0, 0, 0, 0.1);
  26. }
  27. /*定义滑块 内阴影+圆角*/
  28. div::-webkit-scrollbar-thumb {
  29. border-radius: 10px;
  30. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  31. background-color: rgba(0, 0, 0, 0.1);
  32. }
  33. html,
  34. body {
  35. height: 100%;
  36. width: 100%;
  37. background: #e6eaf0;
  38. font-family: '黑体';
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div id="app"></div>
  44. <!-- built files will be auto injected -->
  45. </body>
  46. </html>
  47. <script>
  48. function stopSafari() {
  49. //阻止safari浏览器双击放大功能
  50. let lastTouchEnd = 0 //更新手指弹起的时间
  51. document.documentElement.addEventListener("touchstart", function (event) {
  52. //多根手指同时按下屏幕,禁止默认行为
  53. if (event.touches.length > 1) {
  54. event.preventDefault();
  55. }
  56. });
  57. document.documentElement.addEventListener("touchend", function (event) {
  58. let now = (new Date()).getTime();
  59. if (now - lastTouchEnd <= 300) {
  60. //当两次手指弹起的时间小于300毫秒,认为双击屏幕行为
  61. event.preventDefault();
  62. } else { // 否则重新手指弹起的时间
  63. lastTouchEnd = now;
  64. }
  65. }, false);
  66. //阻止双指放大页面
  67. document.documentElement.addEventListener("gesturestart", function (event) {
  68. event.preventDefault();
  69. });
  70. }
  71. window.onload = () => {
  72. stopSafari();
  73. }
  74. document.domain = document.domain.split(".").slice(-2).join(".");
  75. </script>