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