1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-02-04 16:03:10 +00:00

Compare commits

...

13 Commits

Author SHA1 Message Date
Sunwuyuan
8a8ea05d81
Merge pull request #28 from ZeroCatDev/copilot/adjust-font-size
[WIP] Adjust font size for 一言 element
2025-12-25 18:00:47 +08:00
copilot-swe-agent[bot]
b873486dde Fix comment to match actual font size ratio (75%)
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
2025-12-25 10:00:27 +00:00
Sunwuyuan
13e188c9b1
Update Hitokoto font size ratio
Adjust Hitokoto font size ratio from 0.85 to 0.75.
2025-12-25 17:57:57 +08:00
copilot-swe-agent[bot]
628fdc52c4 Refactor: Extract HITOKOTO_FONT_RATIO to module-level constant
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
2025-12-25 09:57:09 +00:00
copilot-swe-agent[bot]
1ca0606485 Make Hitokoto font size smaller (85% of general font size)
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
2025-12-25 09:55:50 +00:00
copilot-swe-agent[bot]
319ba48c2f Initial plan 2025-12-25 09:52:50 +00:00
Sunwuyuan
adfc7f1438
Merge pull request #27 from ZeroCatDev/copilot/align-text-to-left
Left-align Hitokoto card text and apply custom font size settings
2025-12-25 17:46:03 +08:00
copilot-swe-agent[bot]
7bbae7fd73 Revert unrelated linting changes, keep only HitokotoCard modifications
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
2025-12-24 12:33:02 +00:00
copilot-swe-agent[bot]
bf56de8299 Address code review: use named constant and safe initialization
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
2025-12-24 10:36:30 +00:00
copilot-swe-agent[bot]
a332d9365f Improve font size initialization and style organization
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
2025-12-24 10:35:23 +00:00
copilot-swe-agent[bot]
a89bca2ca4 Remove auto-generated files and update .gitignore
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
2025-12-24 10:30:50 +00:00
copilot-swe-agent[bot]
487da6324f Align hitokoto text to left and apply custom font size settings
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
2025-12-24 10:29:42 +00:00
copilot-swe-agent[bot]
3ab1566ef1 Initial plan 2025-12-24 10:24:33 +00:00
2 changed files with 47 additions and 5 deletions

8
.gitignore vendored
View File

@ -172,3 +172,11 @@ dist
vite.config.*.timestamp-*.mjs vite.config.*.timestamp-*.mjs
*.timestamp-* *.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

View File

@ -8,12 +8,24 @@
height="100%" height="100%"
@click="fetchSentence" @click="fetchSentence"
> >
<v-card-text class="pa-6 d-flex flex-column justify-center" style="height: 100%"> <v-card-text
<div class="text-h6 font-weight-medium mb-4 serif-font" style="white-space: pre-wrap; line-height: 1.6;"> class="pa-6 d-flex flex-column justify-center"
style="height: 100%"
>
<div
class="font-weight-medium mb-4 serif-font"
:style="contentStyle"
>
{{ sentence }} {{ sentence }}
</div> </div>
<div class="text-subtitle-2 text-medium-emphasis text-right serif-font"> <div
<span v-if="author" class="mr-2">{{ author }}</span> class="text-medium-emphasis serif-font"
:style="authorStyle"
>
<span
v-if="author"
class="mr-2"
>{{ author }}</span>
<span v-if="origin">{{ origin }}</span> <span v-if="origin">{{ origin }}</span>
</div> </div>
</v-card-text> </v-card-text>
@ -38,6 +50,9 @@ const GLOBAL_SENSITIVE_WORDS_ENCODED = [
// //
const GLOBAL_SENSITIVE_WORDS = GLOBAL_SENSITIVE_WORDS_ENCODED.map(word => Base64.decode(word)) const GLOBAL_SENSITIVE_WORDS = GLOBAL_SENSITIVE_WORDS_ENCODED.map(word => Base64.decode(word))
// 75%
const HITOKOTO_FONT_RATIO = 0.75
export default { export default {
name: 'HitokotoCard', name: 'HitokotoCard',
data() { data() {
@ -53,7 +68,25 @@ export default {
origin: '', origin: '',
loading: false, loading: false,
timer: null, timer: null,
unwatch: null unwatch: null,
fontSize: 28 // Will be updated in mounted()
}
},
computed: {
contentStyle() {
return {
'font-size': `${this.fontSize * HITOKOTO_FONT_RATIO}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 * HITOKOTO_FONT_RATIO * AUTHOR_FONT_RATIO}px`,
'text-align': 'left'
}
} }
}, },
async mounted() { async mounted() {
@ -78,6 +111,7 @@ export default {
loadLocalSettings() { loadLocalSettings() {
this.enabled = SettingsManager.getSetting('hitokoto.enabled') this.enabled = SettingsManager.getSetting('hitokoto.enabled')
this.refreshInterval = SettingsManager.getSetting('hitokoto.refreshInterval') this.refreshInterval = SettingsManager.getSetting('hitokoto.refreshInterval')
this.fontSize = SettingsManager.getSetting('font.size')
}, },
async loadKvSettings() { async loadKvSettings() {
try { try {