index.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. let topU = ""
  74. try{
  75. if(window.parent.U){
  76. topU = window.parent
  77. }else if(window.parent.parent.U){
  78. topU = window.parent.parent
  79. }else if(window.top.U){
  80. topU = window.top
  81. }
  82. }catch(e){
  83. try {
  84. if(window.parent.parent.U){
  85. topU = window.parent.parent
  86. }else if(window.top.U){
  87. topU = window.top
  88. }
  89. } catch (error) {
  90. if(window.top.U){
  91. topU = window.top
  92. }
  93. }
  94. }
  95. window.topU = topU
  96. }
  97. document.domain = document.domain.split(".").slice(-2).join(".");
  98. </script>