- {{ w }}
-
-
-
- {{ selectArticle?.quote?.text }}
-
-
-
-
-
-
- {{ w }}
+
+
-
-
-
+
+ {{ s }}
+
+
+
+
+
+
+
+
+
+
+ {{ selectArticle.textTranslate.split('\n\n')[i] }}
+
+
+
- {{ selectArticle?.quote?.text }}
+
+ {{ selectArticle?.quote?.translate }}
- {{ selectArticle?.quote?.translate }}
+
+
+
+
+
+
+
+
+
+
-
+
+
+ {{ w }}
+
+
+
+
+
+
+ 问题: {{ selectArticle?.question?.translate }}
+
+ {{ t }}
+ {{ selectArticle?.quote?.translate }}
+
-
+
+
-
- {{ sentence.translate }}
+
+
+
+
-
-
-
- 学习记录
+ 总学习时长:{{ msToHourMinute(total(currentPractice, 'spend')) }}
+
+ {{ _dateFormat(i.startDate) }}
+ {{ msToHourMinute(i.spend) }}
-
-
- 学习记录
- 总学习时长:{{ msToHourMinute(total(currentPractice, 'spend')) }}
-
- {{ _dateFormat(i.startDate) }}
- {{ msToHourMinute(i.spend) }}
-
-
-
-
+
- 结束后播放下一篇
-
-
+
+
+
-
-
+ 结束后播放下一篇
+
+
+
-
-
@@ -813,9 +781,7 @@ const currentPractice = inject('currentPractice', [])
v-for="(item, i) in currentPractice"
>
{{ i === currentPractice.length - 1 ? '当前' : i + 1 }}. {{
- _dateFormat(item.startDate)
- }}{{ i === currentPractice.length - 1 ? '当前' : i + 1 }}. {{ _dateFormat(item.startDate) }}
{{ msToHourMinute(item.spend) }}
-
-
@@ -517,60 +450,44 @@ $article-lh: 2.4;
.article-content {
position: relative;
- color: var(--color-article);
font-size: 1.6rem;
&.tall {
article {
line-height: $article-lh;
+ color: var(--color-article);
}
}
- article {
+ .article-row {
word-break: keep-all;
word-wrap: break-word;
white-space: pre-wrap;
- font-family: var(--en-article-family);
+ }
- .section {
- margin-bottom: 1.5rem;
+ .trans-row {
+ @apply cn-article-family font-bold;
+ }
- .sentence {
- transition: all 0.3s;
- display: inline;
- }
- }
+ article {
+ @apply en-article-family;
}
.translate {
- pointer-events: none;
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- font-size: 1.2rem;
+ @apply absolute top-0 left-0 h-full w-full text-xl pointer-events-none font-bold cn-article-family;
line-height: $translate-lh;
letter-spacing: 0.2rem;
- font-family: var(--zh-article-family);
- font-weight: bold;
- color: #818181;
.row {
- position: absolute;
- left: 0;
- width: 100%;
- opacity: 0;
- transition: all 0.3s;
-
- .space {
- transition: all 0.3s;
- display: inline-block;
- }
+ @apply absolute left-0 w-full opacity-0 transition-all duration-300;
}
}
}
+.space {
+ @apply inline-block w-2 transition-all duration-300;
+}
+
.sentence-translate-mobile {
display: none;
margin-top: 0.4rem;
diff --git a/src/pages/article/components/TypingArticle.vue b/src/pages/article/components/TypingArticle.vue
index 465fb6cf..bb728f9f 100644
--- a/src/pages/article/components/TypingArticle.vue
+++ b/src/pages/article/components/TypingArticle.vue
@@ -10,14 +10,7 @@ import { useBaseStore } from '@/stores/base.ts'
import { usePracticeStore } from '@/stores/practice.ts'
import { useSettingStore } from '@/stores/setting.ts'
import { getDefaultArticle, getDefaultWord } from '@/types/func.ts'
-import {
- Article,
- ArticleWord,
- PracticeArticleWordType,
- Sentence,
- ShortcutKey,
- Word,
-} from '@/types/types.ts'
+import { Article, ArticleWord, PracticeArticleWordType, Sentence, ShortcutKey, Word } from '@/types/types.ts'
import { _dateFormat, _nextTick, isMobile, msToHourMinute, total } from '@/utils'
import { emitter, EventKey, useEvents } from '@/utils/eventBus.ts'
import ContextMenu from '@imengyu/vue3-context-menu'
@@ -96,22 +89,19 @@ const settingStore = useSettingStore()
const statStore = usePracticeStore()
const isMob = isMobile()
-watch(
- [() => sectionIndex, () => sentenceIndex, () => wordIndex, () => stringIndex],
- ([a, b, c]) => {
- if (a !== 0 || b !== 0 || c !== 0) {
- setPracticeArticleCache({
- practiceData: {
- sectionIndex,
- sentenceIndex,
- wordIndex,
- },
- statStoreData: statStore.$state,
- })
- }
- checkCursorPosition(a, b, c)
+watch([() => sectionIndex, () => sentenceIndex, () => wordIndex, () => stringIndex], ([a, b, c]) => {
+ if (a !== 0 || b !== 0 || c !== 0) {
+ setPracticeArticleCache({
+ practiceData: {
+ sectionIndex,
+ sentenceIndex,
+ wordIndex,
+ },
+ statStoreData: statStore.$state,
+ })
}
-)
+ checkCursorPosition(a, b, c)
+})
// watch(() => props.article.id, init, {immediate: true})
@@ -286,11 +276,7 @@ const isNameWord = () => {
let currentSection = props.article.sections[sectionIndex]
let currentSentence = currentSection[sentenceIndex]
let w: ArticleWord = currentSentence.words[wordIndex]
- return (
- w?.type === PracticeArticleWordType.Word &&
- namePatterns.length > 0 &&
- namePatterns.includes(normalize(w.word))
- )
+ return w?.type === PracticeArticleWordType.Word && namePatterns.length > 0 && namePatterns.includes(normalize(w.word))
}
let isTyping = false
@@ -497,11 +483,7 @@ function del() {
}
}
-function showSentence(
- i1: number = sectionIndex,
- i2: number = sentenceIndex,
- i3: number = wordIndex
-) {
+function showSentence(i1: number = sectionIndex, i2: number = sentenceIndex, i3: number = wordIndex) {
hoverIndex = { sectionIndex: i1, sentenceIndex: i2, wordIndex: i3 }
}
@@ -690,13 +672,16 @@ const currentPractice = inject('currentPractice', [])
@beforeinput="handleMobileBeforeInput"
@input="handleMobileInput"
/>
-
- {{ runtimeStore.editDict.id ? '修改' : '创建' }}书籍
+
+
-
+
+
+
+ {{ runtimeStore.editDict.id ? '修改' : '创建' }}书籍
+
+
+
-
-
- {{ store.sbook.lastLearnIndex + 1 }}. {{ props.article?.title ?? '' }}
+
+
-
+
+ {{ store.sbook.lastLearnIndex + 1 }}.
+ {{ props.article?.title??'' }}
+ {{ props.article?.titleTranslate }}
-
- {{ props.article.titleTranslate }}
+
+
+
@@ -758,10 +739,7 @@ const currentPractice = inject('currentPractice', [])
:is-shake="isCurrent(indexI, indexJ, indexW) && isSpace && wrong !== ''"
/>
-
+
{{ sentence.translate }}
@@ -773,11 +751,7 @@ const currentPractice = inject('currentPractice', [])
class="row"
:class="[
`translate${indexI + '-' + indexJ}`,
- sectionIndex > indexI
- ? 'wrote'
- : sectionIndex >= indexI && sentenceIndex > indexJ
- ? 'wrote'
- : '',
+ sectionIndex > indexI ? 'wrote' : sectionIndex >= indexI && sentenceIndex > indexJ ? 'wrote' : '',
]"
v-for="(item, indexJ) in v"
>
@@ -788,18 +762,12 @@ const currentPractice = inject('currentPractice', [])
+
@@ -742,11 +727,7 @@ const currentPractice = inject('currentPractice', [])
]"
@click="playWordAudio(word.word)"
>
- Question: {{ props.article?.question?.text }}
+ 问题: {{ props.article?.question?.translate }}
