Skip to content

Commit f657103

Browse files
committed
大量修改,CDN测试
1 parent ccc59ec commit f657103

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1366
-1001
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"html.customData": ["./node_modules/mdui/html-data.zh-cn.json"],
33
"css.customData": ["./node_modules/mdui/css-data.zh-cn.json"]
4-
}
4+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CSBigCaptain Blog
22

3-
![GitHub License](https://img.shields.io/github/license/csbigcaptain/csbigcaptain.github.io) ![Website](https://img.shields.io/website?url=https%3A%2F%2Fcsbigcaptain.github.io) ![Node Current](https://img.shields.io/node/v/nuxt3) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/csbigcaptain/csbigcaptain.github.io)
3+
![GitHub License](https://img.shields.io/github/license/csbigcaptain/csbigcaptain.github.io) ![Website](https://img.shields.io/website?url=https%3A%2F%2Fcsbigcaptain.github.io) ![Node Current](https://img.shields.io/node/v/nuxt3) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/csbigcaptain/csbigcaptain.github.io)
44

55
本项目是 [CSBigCaptain](https://github.com/csbigcaptain) 的个人博客的仓库。使用 Nuxt 3 开发构建,使用 Material Design 设计风格,并使用 [Nuxt Content](https://content.nuxtjs.org/) 来作为本地基于文件的 CMS 系统。
66

app/app.config.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
export default defineAppConfig({
2-
title: 'CSBigCaptain Blog',
3-
// theme: {
4-
// dark: true,
5-
// colors: {
6-
// primary: '#ff0000'
7-
// }
8-
// }
9-
})
10-
2+
title: 'CSBigCaptain Blog',
3+
// theme: {
4+
// dark: true,
5+
// colors: {
6+
// primary: '#ff0000'
7+
// }
8+
// }
9+
})

app/app.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<script setup lang="ts">
66
// 注入 Microsoft Clarity 代码
7-
const config = useRuntimeConfig();
8-
const analyticsId = config.public.msAnalyticsId;
7+
const config = useRuntimeConfig()
8+
const analyticsId = config.public.msAnalyticsId
99
1010
useHead({
1111
script: [
@@ -17,10 +17,22 @@ useHead({
1717
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
1818
})(window, document, "clarity", "script", "${analyticsId}");
1919
`,
20-
type: "text/javascript",
20+
type: 'text/javascript',
21+
},
22+
{
23+
innerHTML: `
24+
(function(d) {
25+
var config = {
26+
kitId: 'wih3lxc',
27+
scriptTimeout: 3000,
28+
async: true
29+
},
30+
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
31+
})(document);`,
32+
type: 'text/javascript',
2133
},
2234
],
23-
});
35+
})
2436
25-
getPagesTheme();
37+
getPagesTheme()
2638
</script>

app/assets/css/global.less

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,42 @@
1-
// @import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
1+
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
22

33
* {
44
box-sizing: border-box;
55
}
66

7-
li, li {
7+
li,
8+
li {
89
list-style: none;
910
}
1011

1112
:root {
1213
--inline-padding: 15px;
14+
font-family:
15+
source-han-sans-sc-variable,
16+
-apple-system,
17+
sans-serif;
18+
font-variation-settings: 'wght' 480;
19+
letter-spacing: 0.015rem;
20+
word-spacing: 0.1rem;
1321
}
1422

1523
body {
1624
margin: 0;
1725
padding: 0;
18-
font-family: "Inter", -apple-system, sans-serif;
26+
}
27+
28+
h1, h2 {
29+
font-variation-settings: 'wght' 400;
30+
}
31+
// 部分 mdui 组件不支持可变粗细字体
32+
mdui-chip,
33+
mdui-button {
34+
font-family: sans-serif;
1935
}
2036

2137
code,
2238
pre {
23-
font-family: "Jetbrains Mono", "Roboto Mono", monospace;
39+
font-family: 'Jetbrains Mono', 'Roboto Mono', monospace;
2440
}
2541

2642
.webMain {
@@ -29,15 +45,21 @@ pre {
2945
--body-primary-color: rgb(var(--mdui-color-primary));
3046
--body-on-primary-color: rgb(var(--mdui-color-on-primary));
3147
--body-primary-container-color: rgb(var(--mdui-color-primary-container));
32-
--body-on-primary-container-color: rgb(var(--mdui-color-on-primary-container));
48+
--body-on-primary-container-color: rgb(
49+
var(--mdui-color-on-primary-container)
50+
);
3351
--body-secondary-color: rgb(var(--mdui-color-secondary));
3452
--body-on-secondary-color: rgb(var(--mdui-color-on-secondary));
3553
--body-secondary-container-color: rgb(var(--mdui-color-secondary-container));
36-
--body-on-secondary-container-color: rgb(var(--mdui-color-on-secondary-container));
54+
--body-on-secondary-container-color: rgb(
55+
var(--mdui-color-on-secondary-container)
56+
);
3757
--body-tertiary-color: rgb(var(--mdui-color-tertiary));
3858
--body-on-tertiary-color: rgb(var(--mdui-color-on-tertiary));
3959
--body-tertiary-container-color: rgb(var(--mdui-color-tertiary-container));
40-
--body-on-tertiary-container-color: rgb(var(--mdui-color-on-tertiary-container));
60+
--body-on-tertiary-container-color: rgb(
61+
var(--mdui-color-on-tertiary-container)
62+
);
4163
--bar-text-color: rgb(var(--mdui-color-on-surface-variant));
4264
--bar-bg-color: rgb(var(--mdui-color-surface-variant));
4365
}

app/components/DefaultNav.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
</template>
2222

2323
<script lang="ts" setup>
24-
import "mdui/components/button-icon.js";
25-
import "@mdui/icons/search.js";
26-
import "@mdui/icons/menu.js";
27-
import "@mdui/icons/more-vert.js";
28-
import "@mdui/icons/mode-night.js";
29-
import "@mdui/icons/wb-sunny.js";
30-
import "@mdui/icons/palette.js";
31-
import "@mdui/icons/share.js";
24+
import 'mdui/components/button-icon.js'
25+
import '@mdui/icons/search.js'
26+
import '@mdui/icons/menu.js'
27+
import '@mdui/icons/more-vert.js'
28+
import '@mdui/icons/mode-night.js'
29+
import '@mdui/icons/wb-sunny.js'
30+
import '@mdui/icons/palette.js'
31+
import '@mdui/icons/share.js'
3232
</script>
3333

3434
<style scoped>

app/components/app/RandomSentence.vue

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@
22
<div class="OuterMain">
33
<div class="inner">
44
<div class="sentence" @click="typeText">
5-
{{ displayText }}<span class="cursor" v-if="isTyping">|</span>
5+
{{ displayText }}
6+
<span class="cursor" v-if="isTyping">|</span>
67
</div>
78
<div class="source">
8-
{{ sentence ? sentence.author : "" }}
9-
{{ sentence ? `(${sentence.name})` : "" }}
9+
{{ sentence ? sentence.author : '' }}
10+
{{ sentence ? `(${sentence.name})` : '' }}
1011
</div>
1112
</div>
1213
</div>
1314
</template>
1415

1516
<script setup>
1617
const sentence = ref()
17-
const displayText = ref("")
18-
const fullText = ref("")
18+
const displayText = ref('')
19+
const fullText = ref('')
1920
const isTyping = ref(false)
2021
2122
// 打字效果函数
2223
const typeText = async () => {
2324
isTyping.value = true
24-
displayText.value = ""
25+
displayText.value = ''
2526
2627
for (let i = 0; i < fullText.value.length; i++) {
2728
if (!isTyping.value) break
@@ -37,27 +38,31 @@ const typeText = async () => {
3738
const { data } = await useAsyncData(
3839
`sentence-${Math.floor(Date.now() / 60000)}`,
3940
async () => {
40-
const res = await $fetch("https://open.saintic.com/api/sentence/")
41+
const res = await $fetch('https://open.saintic.com/api/sentence/')
4142
return {
42-
sentence: res?.data?.sentence || "",
43-
author: res?.data?.author || "",
44-
name: res?.data?.name || "",
43+
sentence: res?.data?.sentence || '',
44+
author: res?.data?.author || '',
45+
name: res?.data?.name || '',
4546
}
4647
},
4748
{
4849
default: () => null,
49-
server: false
50-
}
50+
server: false,
51+
},
5152
)
5253
5354
// 监听数据变化并执行打字效果
54-
watch(data, async (newData) => {
55-
if (newData?.sentence) {
56-
sentence.value = newData
57-
fullText.value = newData.sentence
58-
await typeText()
59-
}
60-
}, { immediate: true })
55+
watch(
56+
data,
57+
async (newData) => {
58+
if (newData?.sentence) {
59+
sentence.value = newData
60+
fullText.value = newData.sentence
61+
await typeText()
62+
}
63+
},
64+
{ immediate: true },
65+
)
6166
6267
// 组件卸载时停止打字
6368
onBeforeUnmount(() => {
@@ -74,7 +79,7 @@ onBeforeUnmount(() => {
7479
height: 45vh;
7580
background: rgb(var(--mdui-color-surface-container-highest));
7681
transform: translateY(calc(-1 * var(--inline-padding)));
77-
82+
7883
.inner {
7984
width: 70%;
8085
min-width: 370px;
@@ -84,7 +89,7 @@ onBeforeUnmount(() => {
8489
flex-direction: column;
8590
align-items: center;
8691
box-sizing: border-box;
87-
92+
8893
.sentence {
8994
font-size: 1.5rem;
9095
line-height: 1.6;
@@ -94,13 +99,13 @@ onBeforeUnmount(() => {
9499
text-align: center;
95100
font-weight: bold;
96101
}
97-
102+
98103
.source {
99104
font-size: 1rem;
100105
opacity: 0.7;
101106
text-align: center;
102107
}
103-
108+
104109
.cursor {
105110
animation: blink 1s infinite;
106111
color: var(--mdui-color-primary);
@@ -109,7 +114,13 @@ onBeforeUnmount(() => {
109114
}
110115
111116
@keyframes blink {
112-
0%, 50% { opacity: 1; }
113-
51%, 100% { opacity: 0; }
117+
0%,
118+
50% {
119+
opacity: 1;
120+
}
121+
51%,
122+
100% {
123+
opacity: 0;
124+
}
114125
}
115126
</style>

app/components/app/container.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<script lang="ts" setup>
2-
</script>
1+
<script lang="ts" setup></script>
32

43
<template>
54
<div class="outer">

app/components/content/ProseA.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</template>
88

99
<style scoped>
10-
.main a{
10+
.main a {
1111
text-decoration: none;
1212
box-sizing: content-box;
1313
padding: 0.1em 0.35em;
@@ -22,25 +22,25 @@
2222
</style>
2323

2424
<script setup lang="ts">
25-
import type { PropType } from "vue";
25+
import type { PropType } from 'vue'
2626
2727
const props = defineProps({
2828
href: {
2929
type: String,
30-
default: "",
30+
default: '',
3131
},
3232
target: {
3333
type: String as PropType<
34-
| "_blank"
35-
| "_parent"
36-
| "_self"
37-
| "_top"
34+
| '_blank'
35+
| '_parent'
36+
| '_self'
37+
| '_top'
3838
| (string & object)
3939
| null
4040
| undefined
4141
>,
4242
default: undefined,
4343
required: false,
4444
},
45-
});
45+
})
4646
</script>

app/components/content/ProseBlockquote.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@
1818
font-size: 0.9rem; /* 减小字体大小 */
1919
line-height: 1.4; /* 调整行高 */
2020
}
21-
22-
</style>
21+
</style>

0 commit comments

Comments
 (0)