diff --git a/.gitignore b/.gitignore index 6ad341f..b87bd9f 100644 --- a/.gitignore +++ b/.gitignore @@ -172,3 +172,11 @@ dist vite.config.*.timestamp-*.mjs *.timestamp-* +# Auto-generated TypeScript declaration files +auto-imports.d.ts +components.d.ts +typed-router.d.ts + +# Package lock files (using pnpm) +package-lock.json + diff --git a/src/components/HitokotoCard.vue b/src/components/HitokotoCard.vue index 82f457a..a031cf2 100644 --- a/src/components/HitokotoCard.vue +++ b/src/components/HitokotoCard.vue @@ -8,12 +8,24 @@ height="100%" @click="fetchSentence" > - -
+ +
{{ sentence }}
-
- {{ author }} +
+ {{ author }} 《{{ origin }}》
@@ -53,7 +65,25 @@ export default { origin: '', loading: false, timer: null, - unwatch: null + unwatch: null, + fontSize: 28 // Will be updated in mounted() + } + }, + computed: { + contentStyle() { + return { + 'font-size': `${this.fontSize}px`, + 'white-space': 'pre-wrap', + 'line-height': '1.6', + 'text-align': 'left' + } + }, + authorStyle() { + const AUTHOR_FONT_RATIO = 0.6 // Author font size is 60% of the main font size + return { + 'font-size': `${this.fontSize * AUTHOR_FONT_RATIO}px`, + 'text-align': 'left' + } } }, async mounted() { @@ -78,6 +108,7 @@ export default { loadLocalSettings() { this.enabled = SettingsManager.getSetting('hitokoto.enabled') this.refreshInterval = SettingsManager.getSetting('hitokoto.refreshInterval') + this.fontSize = SettingsManager.getSetting('font.size') }, async loadKvSettings() { try {