mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2026-02-04 07:53:11 +00:00
Compare commits
No commits in common. "8a8ea05d81b0f1248048833b749ca558df063452" and "4244f84b340ad0104db8c193e44f87aaf2f8907c" have entirely different histories.
8a8ea05d81
...
4244f84b34
8
.gitignore
vendored
8
.gitignore
vendored
@ -172,11 +172,3 @@ 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
|
|
||||||
|
|
||||||
|
|||||||
@ -8,24 +8,12 @@
|
|||||||
height="100%"
|
height="100%"
|
||||||
@click="fetchSentence"
|
@click="fetchSentence"
|
||||||
>
|
>
|
||||||
<v-card-text
|
<v-card-text class="pa-6 d-flex flex-column justify-center" style="height: 100%">
|
||||||
class="pa-6 d-flex flex-column justify-center"
|
<div class="text-h6 font-weight-medium mb-4 serif-font" style="white-space: pre-wrap; line-height: 1.6;">
|
||||||
style="height: 100%"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="font-weight-medium mb-4 serif-font"
|
|
||||||
:style="contentStyle"
|
|
||||||
>
|
|
||||||
{{ sentence }}
|
{{ sentence }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="text-subtitle-2 text-medium-emphasis text-right serif-font">
|
||||||
class="text-medium-emphasis serif-font"
|
<span v-if="author" class="mr-2">{{ author }}</span>
|
||||||
: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>
|
||||||
@ -50,9 +38,6 @@ 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() {
|
||||||
@ -68,25 +53,7 @@ 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() {
|
||||||
@ -111,7 +78,6 @@ 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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user