App.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="top-wrapper">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script setup>
  7. import { ref, computed, watch, onMounted } from "vue"
  8. import { useRoute, useRouter } from "vue-router"
  9. import { useStore } from "vuex"
  10. import { checkLoginStatusAndProcess } from '@/api.js'
  11. const {
  12. windowSizeInCssForRef,
  13. windowSizeWhenDesignForRef,
  14. } = useSizeAdapt(390, 752)
  15. const route = useRoute()
  16. const router = useRouter()
  17. const store = useStore()
  18. checkLoginStatusAndProcess()
  19. </script>
  20. <style lang="less">
  21. html, body {
  22. overscroll-behavior: none;
  23. overflow: hidden;
  24. height: 100%;
  25. }
  26. // * {
  27. // user-select: none;
  28. // -webkit-touch-callout: none;
  29. // }
  30. #app {
  31. height: 100%;
  32. position: relative;
  33. left: 50%;
  34. top: 0;
  35. transform: translate(-50%, 0);
  36. }
  37. // // 360浏览器不支持not()
  38. // input, textarea {
  39. // user-select: initial;
  40. // }
  41. // 字体
  42. // @font-face {
  43. // font-family: 'Source Han Serif CN';
  44. // src: url('@/assets/style/SourceHanSerifCN-Regular.otf');
  45. // }
  46. @font-face {
  47. font-family: 'heiti';
  48. src: url('@/assets/style/Adobe Heiti Std.otf');
  49. }
  50. // i {
  51. // font-style: italic;
  52. // }
  53. // 滚动条,只设置某一项可能导致不生效。
  54. // ::-webkit-scrollbar { background: #dddecc; width: 6px; height: 6px; }
  55. // ::-webkit-scrollbar-thumb { background: #828a5b; border-radius: 3px; }
  56. // ::-webkit-scrollbar-corner { background: #dddecc; }
  57. // vue组件过渡效果
  58. .fade-out-leave-active {
  59. transition: opacity 1s;
  60. pointer-events: none;
  61. }
  62. .fade-out-leave-to {
  63. opacity: 0;
  64. }
  65. // vue组件过渡效果
  66. .fade-in-enter-active {
  67. transition: opacity 1s;
  68. }
  69. .fade-in-enter-from {
  70. opacity: 0;
  71. }
  72. .fade-out-leave-active {
  73. transition: opacity 1s;
  74. pointer-events: none;
  75. }
  76. .fade-out-leave-to {
  77. opacity: 0;
  78. }
  79. .fade-in-out-enter-active {
  80. transition: opacity 1s;
  81. }
  82. .fade-in-out-leave-active {
  83. transition: opacity 1s;
  84. pointer-events: none;
  85. }
  86. .fade-in-out-enter-from {
  87. opacity: 0;
  88. }
  89. .fade-in-out-leave-to {
  90. opacity: 0;
  91. }
  92. // 不断渐变显隐 animation
  93. .animation-show-hide {
  94. animation: show-hide 1.8s infinite;
  95. }
  96. @keyframes show-hide {
  97. 0% {
  98. opacity: 0;
  99. }
  100. 50% {
  101. opacity: 1;
  102. }
  103. 100% {
  104. opacity: 0;
  105. }
  106. }
  107. // // vue-viewer
  108. // .viewer-container {
  109. // background-color: rgba(0, 0, 0, 80%) !important;
  110. // }
  111. // 或者
  112. // .viewer-backdrop {
  113. // background-color: rgba(0, 0, 0, 90%) !important;
  114. // }
  115. </style>
  116. <style lang="less" scoped>
  117. .top-wrapper{
  118. position: absolute;
  119. left: 50%;
  120. top: 0;
  121. transform: translate(-50%, 0);
  122. width: calc(390 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  123. height: 100%;
  124. }
  125. </style>