Skip to content

Commit 8a8ea05

Browse files
authored
Merge pull request #28 from ZeroCatDev/copilot/adjust-font-size
[WIP] Adjust font size for 一言 element
2 parents adfc7f1 + b873486 commit 8a8ea05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/HitokotoCard.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ const GLOBAL_SENSITIVE_WORDS_ENCODED = [
5050
// 解码敏感词列表
5151
const GLOBAL_SENSITIVE_WORDS = GLOBAL_SENSITIVE_WORDS_ENCODED.map(word => Base64.decode(word))
5252
53+
// 一言字体大小比例(75%的全局字体大小)
54+
const HITOKOTO_FONT_RATIO = 0.75
55+
5356
export default {
5457
name: 'HitokotoCard',
5558
data() {
@@ -72,7 +75,7 @@ export default {
7275
computed: {
7376
contentStyle() {
7477
return {
75-
'font-size': `${this.fontSize}px`,
78+
'font-size': `${this.fontSize * HITOKOTO_FONT_RATIO}px`,
7679
'white-space': 'pre-wrap',
7780
'line-height': '1.6',
7881
'text-align': 'left'
@@ -81,7 +84,7 @@ export default {
8184
authorStyle() {
8285
const AUTHOR_FONT_RATIO = 0.6 // Author font size is 60% of the main font size
8386
return {
84-
'font-size': `${this.fontSize * AUTHOR_FONT_RATIO}px`,
87+
'font-size': `${this.fontSize * HITOKOTO_FONT_RATIO * AUTHOR_FONT_RATIO}px`,
8588
'text-align': 'left'
8689
}
8790
}

0 commit comments

Comments
 (0)