App.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div id="app">
  3. <router-view></router-view>
  4. <div class="tab-bar" v-if="!$route.meta.hideTabBar">
  5. <TabBar></TabBar>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import TabBar from '@/components/TabBar.vue'
  11. export default {
  12. name: 'App',
  13. components: {
  14. TabBar
  15. },
  16. computed: {
  17. showTabBar() {
  18. const hideTabBarRoutes = ['/login', '/register', '/profile/detail', '/culture/detail','/InvitePeople']
  19. return !hideTabBarRoutes.includes(this.$route.path)
  20. }
  21. }
  22. }
  23. </script>
  24. <style>
  25. /* 引入更好的字体 */
  26. @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
  27. html {
  28. font-size: 16px;
  29. height: 100%;
  30. /* 优化字体渲染 */
  31. -webkit-font-smoothing: antialiased;
  32. -moz-osx-font-smoothing: grayscale;
  33. text-rendering: optimizeLegibility;
  34. }
  35. body {
  36. margin: 0;
  37. padding: 0;
  38. font-size: 16px;
  39. -webkit-text-size-adjust: 100%;
  40. height: 100%;
  41. /* 优化字体显示 */
  42. font-feature-settings: "kern" 1;
  43. font-kerning: normal;
  44. }
  45. h1 {
  46. margin: 0;
  47. padding: 0;
  48. }
  49. #app {
  50. /* 优化字体栈 - 优先使用系统字体,fallback到网络字体 */
  51. font-family:
  52. /* 系统字体优先 */
  53. -apple-system, BlinkMacSystemFont,
  54. /* Windows 系统字体 */
  55. "Segoe UI",
  56. /* 现代无衬线字体 */
  57. "Inter", "Helvetica Neue", Helvetica, Arial,
  58. /* 中文字体 */
  59. "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
  60. /* 通用 fallback */
  61. sans-serif,
  62. /* Emoji 支持 */
  63. "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  64. /* 字体渲染优化 */
  65. -webkit-font-smoothing: antialiased;
  66. -moz-osx-font-smoothing: grayscale;
  67. font-variant-ligatures: common-ligatures;
  68. /* 文本渲染优化 */
  69. text-rendering: optimizeLegibility;
  70. /* 字体大小调整 */
  71. font-size: 14px;
  72. line-height: 1.5;
  73. letter-spacing: 0.01em;
  74. color: #2c3e50;
  75. height: 100%;
  76. min-height: 100vh;
  77. position: relative;
  78. }
  79. /* 针对不同元素的字体优化 */
  80. h1, h2, h3, h4, h5, h6 {
  81. font-family: inherit;
  82. font-weight: 600;
  83. line-height: 1.3;
  84. letter-spacing: -0.01em;
  85. }
  86. p, span, div {
  87. font-family: inherit;
  88. font-weight: 400;
  89. }
  90. /* 按钮字体优化 */
  91. button, .btn {
  92. font-family: inherit;
  93. font-weight: 500;
  94. letter-spacing: 0.02em;
  95. }
  96. /* 输入框字体优化 */
  97. input, textarea, select {
  98. font-family: inherit;
  99. font-size: inherit;
  100. line-height: 1.4;
  101. }
  102. /* PC端字体优化 */
  103. @media screen and (min-width: 768px) {
  104. #app {
  105. font-size: 15px;
  106. line-height: 1.6;
  107. letter-spacing: 0.005em;
  108. }
  109. h1, h2, h3, h4, h5, h6 {
  110. letter-spacing: -0.02em;
  111. }
  112. /* PC端使用稍细的字重 */
  113. body {
  114. font-weight: 400;
  115. }
  116. }
  117. /* 高分辨率屏幕优化 */
  118. @media screen and (-webkit-min-device-pixel-ratio: 2),
  119. screen and (min-resolution: 192dpi) {
  120. #app {
  121. -webkit-font-smoothing: subpixel-antialiased;
  122. }
  123. }
  124. /* 暗色模式字体优化 */
  125. @media (prefers-color-scheme: dark) {
  126. #app {
  127. -webkit-font-smoothing: antialiased;
  128. }
  129. }
  130. .tab-bar {
  131. position: fixed;
  132. bottom: 0;
  133. left: 0;
  134. width: 100%;
  135. z-index: 100;
  136. /* 确保 tab-bar 也使用优化的字体 */
  137. font-family: inherit;
  138. }
  139. /* 特殊字体类 */
  140. .font-medium {
  141. font-weight: 500;
  142. }
  143. .font-semibold {
  144. font-weight: 600;
  145. }
  146. .font-bold {
  147. font-weight: 700;
  148. }
  149. .text-xs {
  150. font-size: 12px;
  151. }
  152. .text-sm {
  153. font-size: 13px;
  154. }
  155. .text-base {
  156. font-size: 14px;
  157. }
  158. .text-lg {
  159. font-size: 16px;
  160. }
  161. .text-xl {
  162. font-size: 18px;
  163. }
  164. </style>