123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <template>
- <div id="app">
- <router-view></router-view>
- <div class="tab-bar" v-if="!$route.meta.hideTabBar">
- <TabBar></TabBar>
- </div>
- </div>
- </template>
- <script>
- import TabBar from '@/components/TabBar.vue'
- export default {
- name: 'App',
- components: {
- TabBar
- },
- computed: {
- showTabBar() {
- const hideTabBarRoutes = ['/login', '/register', '/profile/detail', '/culture/detail','/InvitePeople']
- return !hideTabBarRoutes.includes(this.$route.path)
- }
- }
- }
- </script>
- <style>
- /* 引入更好的字体 */
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
- html {
- font-size: 16px;
- height: 100%;
- /* 优化字体渲染 */
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- text-rendering: optimizeLegibility;
- }
- body {
- margin: 0;
- padding: 0;
- font-size: 16px;
- -webkit-text-size-adjust: 100%;
- height: 100%;
- /* 优化字体显示 */
- font-feature-settings: "kern" 1;
- font-kerning: normal;
- }
- h1 {
- margin: 0;
- padding: 0;
- }
- #app {
- /* 优化字体栈 - 优先使用系统字体,fallback到网络字体 */
- font-family:
- /* 系统字体优先 */
- -apple-system, BlinkMacSystemFont,
- /* Windows 系统字体 */
- "Segoe UI",
- /* 现代无衬线字体 */
- "Inter", "Helvetica Neue", Helvetica, Arial,
- /* 中文字体 */
- "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
- /* 通用 fallback */
- sans-serif,
- /* Emoji 支持 */
- "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
-
- /* 字体渲染优化 */
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- font-variant-ligatures: common-ligatures;
-
- /* 文本渲染优化 */
- text-rendering: optimizeLegibility;
-
- /* 字体大小调整 */
- font-size: 14px;
- line-height: 1.5;
- letter-spacing: 0.01em;
-
- color: #2c3e50;
- height: 100%;
- min-height: 100vh;
- position: relative;
- }
- /* 针对不同元素的字体优化 */
- h1, h2, h3, h4, h5, h6 {
- font-family: inherit;
- font-weight: 600;
- line-height: 1.3;
- letter-spacing: -0.01em;
- }
- p, span, div {
- font-family: inherit;
- font-weight: 400;
- }
- /* 按钮字体优化 */
- button, .btn {
- font-family: inherit;
- font-weight: 500;
- letter-spacing: 0.02em;
- }
- /* 输入框字体优化 */
- input, textarea, select {
- font-family: inherit;
- font-size: inherit;
- line-height: 1.4;
- }
- /* PC端字体优化 */
- @media screen and (min-width: 768px) {
- #app {
- font-size: 15px;
- line-height: 1.6;
- letter-spacing: 0.005em;
- }
-
- h1, h2, h3, h4, h5, h6 {
- letter-spacing: -0.02em;
- }
-
- /* PC端使用稍细的字重 */
- body {
- font-weight: 400;
- }
- }
- /* 高分辨率屏幕优化 */
- @media screen and (-webkit-min-device-pixel-ratio: 2),
- screen and (min-resolution: 192dpi) {
- #app {
- -webkit-font-smoothing: subpixel-antialiased;
- }
- }
- /* 暗色模式字体优化 */
- @media (prefers-color-scheme: dark) {
- #app {
- -webkit-font-smoothing: antialiased;
- }
- }
- .tab-bar {
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- z-index: 100;
- /* 确保 tab-bar 也使用优化的字体 */
- font-family: inherit;
- }
- /* 特殊字体类 */
- .font-medium {
- font-weight: 500;
- }
- .font-semibold {
- font-weight: 600;
- }
- .font-bold {
- font-weight: 700;
- }
- .text-xs {
- font-size: 12px;
- }
- .text-sm {
- font-size: 13px;
- }
- .text-base {
- font-size: 14px;
- }
- .text-lg {
- font-size: 16px;
- }
- .text-xl {
- font-size: 18px;
- }
- </style>
|