From 166a6d817189c3158fabfcd189c249bbac28fbd5 Mon Sep 17 00:00:00 2001 From: Kisechan Date: Tue, 4 Mar 2025 21:29:51 +0800 Subject: [PATCH] new fonts --- package-lock.json | 9 +++++++ package.json | 1 + src/App.vue | 18 ++++++++++++- src/assets/styles/global.css | 49 +++++++++++++++++++++++++++++++++--- src/components/AppFooter.vue | 25 ++++++++++++++++++ src/main.js | 1 + src/views/AboutView.vue | 1 - 7 files changed, 99 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f593ea..47257da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "@element-plus/icons-vue": "^2.3.1", + "@fortawesome/fontawesome-free": "^6.7.2", "element-plus": "^2.9.5", "vue": "^3.5.13", "vue-router": "^4.5.0" @@ -500,6 +501,14 @@ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.9.tgz", "integrity": "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==" }, + "node_modules/@fortawesome/fontawesome-free": { + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz", + "integrity": "sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA==", + "engines": { + "node": ">=6" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", diff --git a/package.json b/package.json index 8d0065d..b8bd55f 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@element-plus/icons-vue": "^2.3.1", + "@fortawesome/fontawesome-free": "^6.7.2", "element-plus": "^2.9.5", "vue": "^3.5.13", "vue-router": "^4.5.0" diff --git a/src/App.vue b/src/App.vue index 2e2fe45..70f5871 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,4 +11,20 @@ import AppFooter from "./components/AppFooter.vue"; - + diff --git a/src/assets/styles/global.css b/src/assets/styles/global.css index 5257767..019eaf2 100644 --- a/src/assets/styles/global.css +++ b/src/assets/styles/global.css @@ -1,12 +1,55 @@ +/* 定义 LXGW WenKai 字体 */ @font-face { - font-family: "jx"; - src: url("@/assets/fonts/jx.ttf") format("truetype"); + font-family: 'LXGW WenKai'; + src: url('@/assets/fonts/LXGWWenKai-Regular.ttf') format('truetype'); font-weight: normal; font-style: normal; } +@font-face { + font-family: 'LXGW WenKai'; + src: url('@/assets/fonts/LXGWWenKai-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} + +@font-face { + font-family: 'LXGW WenKai'; + src: url('@/assets/fonts/LXGWWenKai-Light.ttf') format('truetype'); + font-weight: 300; /* Light 通常对应 font-weight: 300 */ + font-style: normal; +} + +/* 定义 LXGW WenKai Mono 字体 */ +@font-face { + font-family: 'LXGW WenKai Mono'; + src: url('@/assets/fonts/LXGWWenKaiMono-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'LXGW WenKai Mono'; + src: url('@/assets/fonts/LXGWWenKaiMono-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} + +@font-face { + font-family: 'LXGW WenKai Mono'; + src: url('@/assets/fonts/LXGWWenKaiMono-Light.ttf') format('truetype'); + font-weight: 300; /* Light 通常对应 font-weight: 300 */ + font-style: normal; +} + +/* 设置全局字体 */ body { - font-family: "jx", sans-serif; + font-family: 'LXGW WenKai', sans-serif; margin: 0; padding: 0; } + +/* 设置代码或等宽文本的字体 */ +code, pre, .monospace { + font-family: 'LXGW WenKai Mono', monospace; +} \ No newline at end of file diff --git a/src/components/AppFooter.vue b/src/components/AppFooter.vue index 7725041..214462a 100644 --- a/src/components/AppFooter.vue +++ b/src/components/AppFooter.vue @@ -3,6 +3,17 @@ @@ -21,4 +32,18 @@ max-width: 1200px; margin: 0 auto; } + +.social-icons { + margin-top: 10px; +} + +.social-icons a { + color: #b9b7b7; + margin: 0 10px; + font-size: 24px; +} + +.social-icons a:hover { + color: #dddade; +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index f11d2e6..7000a3b 100644 --- a/src/main.js +++ b/src/main.js @@ -5,6 +5,7 @@ import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' import * as ElementPlusIconsVue from '@element-plus/icons-vue' import './assets/styles/global.css' +import '@fortawesome/fontawesome-free/css/all.css'; const app = createApp(App) diff --git a/src/views/AboutView.vue b/src/views/AboutView.vue index b20f622..36ee12d 100644 --- a/src/views/AboutView.vue +++ b/src/views/AboutView.vue @@ -1,6 +1,5 @@