index.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. div::-webkit-scrollbar {
  11. /*滚动条整体样式*/
  12. width: 6px;
  13. /*高宽分别对应横竖滚动条的尺寸*/
  14. height: 6px;
  15. }
  16. /*定义滚动条轨道 内阴影+圆角*/
  17. div::-webkit-scrollbar-track {
  18. border-radius: 10px;
  19. background-color: rgba(0, 0, 0, 0.1);
  20. }
  21. /*定义滑块 内阴影+圆角*/
  22. div::-webkit-scrollbar-thumb {
  23. border-radius: 10px;
  24. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  25. background-color: rgba(0, 0, 0, 0.1);
  26. }
  27. html,
  28. body {
  29. height: 100%;
  30. width: 100%;
  31. background: #e6eaf0;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div id="app"></div>
  37. <!-- built files will be auto injected -->
  38. </body>
  39. </html>
  40. <script>
  41. function stopSafari() {
  42. //阻止safari浏览器双击放大功能
  43. let lastTouchEnd = 0 //更新手指弹起的时间
  44. document.documentElement.addEventListener("touchstart", function (event) {
  45. //多根手指同时按下屏幕,禁止默认行为
  46. if (event.touches.length > 1) {
  47. event.preventDefault();
  48. }
  49. });
  50. document.documentElement.addEventListener("touchend", function (event) {
  51. let now = (new Date()).getTime();
  52. if (now - lastTouchEnd <= 300) {
  53. //当两次手指弹起的时间小于300毫秒,认为双击屏幕行为
  54. event.preventDefault();
  55. } else { // 否则重新手指弹起的时间
  56. lastTouchEnd = now;
  57. }
  58. }, false);
  59. //阻止双指放大页面
  60. document.documentElement.addEventListener("gesturestart", function (event) {
  61. event.preventDefault();
  62. });
  63. }
  64. window.onload = () => {
  65. stopSafari();
  66. }
  67. document.domain = document.domain.split(".").slice(-2).join(".");
  68. </script>