index.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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-student</title>
  7. <base target="_blank">
  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. font-family: '黑体';
  36. }
  37. </style>
  38. </head>
  39. <body>
  40. <div id="app"></div>
  41. <!-- built files will be auto injected -->
  42. </body>
  43. </html>
  44. <script>
  45. function stopSafari() {
  46. //阻止safari浏览器双击放大功能
  47. let lastTouchEnd = 0 //更新手指弹起的时间
  48. document.documentElement.addEventListener("touchstart", function (event) {
  49. //多根手指同时按下屏幕,禁止默认行为
  50. if (event.touches.length > 1) {
  51. event.preventDefault();
  52. }
  53. });
  54. document.documentElement.addEventListener("touchend", function (event) {
  55. let now = (new Date()).getTime();
  56. if (now - lastTouchEnd <= 300) {
  57. //当两次手指弹起的时间小于300毫秒,认为双击屏幕行为
  58. event.preventDefault();
  59. } else { // 否则重新手指弹起的时间
  60. lastTouchEnd = now;
  61. }
  62. }, false);
  63. //阻止双指放大页面
  64. document.documentElement.addEventListener("gesturestart", function (event) {
  65. event.preventDefault();
  66. });
  67. }
  68. window.onload = () => {
  69. stopSafari();
  70. }
  71. document.domain = "cocorobo.cn"
  72. </script>