diff --git a/Note.md b/Note.md
index c19e364c..67a9c1cd 100644
--- a/Note.md
+++ b/Note.md
@@ -16,4 +16,23 @@ wink-nlp
compromise
表现良好,另外自带分词功能
-以上所有库都会将:'Do you always get up so late? It's one o'clock!'分成两句....
\ No newline at end of file
+以上所有库都会将:'Do you always get up so late? It's one o'clock!'分成两句....
+
+
+1 错题本,添加错误次数
+
+bug
+换段的时候没发音
+打完一段的一最后一行的时候,没有自动换行,需要按下空格才能换段
+打完了没检测到
+
+所有的图标hover时,有放大效果
+各种声音可以单独调节音量大小
+
+列表加搜索
+
+BaseIcon 在选中模式下,应该显示白色
+
+添加文章时,正文输入123报错
+
+没有内容时,要显示占位符
\ No newline at end of file
diff --git a/README.md b/README.md
index 6b4816f6..e69de29b 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +0,0 @@
-1 错题本,添加错误次数
-
-bug
-换段的时候没发音
-打完一段的一最后一行的时候,没有自动换行,需要按下空格才能换段
-打完了没检测到
-
-所有的图标hover时,有放大效果
-各种声音可以单独调节音量大小
-
-列表加搜索
-
-BaseIcon 在选中模式下,应该显示白色
-
-添加文章时,正文输入123报错
\ No newline at end of file
diff --git a/components.d.ts b/components.d.ts
index d546941c..af023807 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -39,6 +39,7 @@ declare module 'vue' {
List: typeof import('./src/components/List.vue')['default']
MiniModal: typeof import('./src/components/MiniModal.vue')['default']
Modal: typeof import('./src/components/Modal/Modal.vue')['default']
+ Panel: typeof import('./src/components/Practice/Panel.vue')['default']
PopConfirm: typeof import('./src/components/PopConfirm.vue')['default']
Practice: typeof import('./src/components/Practice/Practice.vue')['default']
RepeatSetting: typeof import('./src/components/Toolbar/RepeatSetting.vue')['default']
diff --git a/package.json b/package.json
index a0ed5583..7b66a302 100644
--- a/package.json
+++ b/package.json
@@ -28,7 +28,6 @@
"mitt": "^3.0.1",
"pinia": "^2.1.6",
"sentence-splitter": "^4.2.1",
- "swiper": "^10.1.0",
"tesseract.js": "^4.1.1",
"uuid": "^9.0.1",
"vue": "^3.3.4",
diff --git a/src/components/Practice/Panel.vue b/src/components/Practice/Panel.vue
new file mode 100644
index 00000000..9cad161d
--- /dev/null
+++ b/src/components/Practice/Panel.vue
@@ -0,0 +1,286 @@
+
+
+
+
+
+
+
+
+
+
+ store.changeDict(store.currentDict,store.currentDict.chapterIndex,e)"
+ :isActive="settingStore.showPanel && tabIndex === 0"
+ :list="props.list??[]"
+ :activeIndex="props.index"/>
+
+
+
+
+
+
+ store.changeDict(store.newWordDict,store.newWordDict.chapterIndex,e)"
+ :isActive="settingStore.showPanel && tabIndex === 1"
+ :list="store.newWordDict.words"
+ :activeIndex="newWordDictActiveIndex"/>
+
+
+
+
+
+
+ store.changeDict(store.wrongWordDict,store.wrongWordDict.chapterIndex,e)"
+ :isActive="settingStore.showPanel && tabIndex === 2"
+ :list="store.wrongWordDict.words"
+ :activeIndex="wrongWordDictActiveIndex"/>
+
+
+
+
+
+
+ store.changeDict(store.skipWordDict,store.skipWordDict.chapterIndex,e)"
+ :isActive="settingStore.showPanel && tabIndex === 3"
+ :list="store.skipWordDict.words"
+ :activeIndex="skipWordDictActiveIndex"/>
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Practice/Practice.vue b/src/components/Practice/Practice.vue
index e0fce07a..007c7e8c 100644
--- a/src/components/Practice/Practice.vue
+++ b/src/components/Practice/Practice.vue
@@ -57,10 +57,15 @@ watch(() => store.load, n => {
}
})
+watch([() => store.current.index, () => store.current.dictType], n => {
+ getCurrentPractice()
+})
+
+
function getCurrentPractice() {
// console.log('store.currentDict',store.currentDict)
if (store.isArticle) {
- return
+ // return
let currentArticle = store.currentDict.articles[store.currentDict.chapterIndex]
let tempArticle = {...DefaultArticle, ...currentArticle}
console.log('article', tempArticle)
diff --git a/src/components/Practice/TypeWord.vue b/src/components/Practice/TypeWord.vue
index e82a03cd..a53657a8 100644
--- a/src/components/Practice/TypeWord.vue
+++ b/src/components/Practice/TypeWord.vue
@@ -13,6 +13,7 @@ import {useOnKeyboardEventListener} from "@/hooks/event.ts";
import {Icon} from "@iconify/vue";
import VolumeIcon from "@/components/VolumeIcon.vue";
import Tooltip from "@/components/Tooltip.vue";
+import Panel from "@/components/Practice/Panel.vue";
interface IProps {
words: Word[],
@@ -142,6 +143,9 @@ function prev() {
function ignore() {
activeBtnIndex = 2
next(false)
+ setTimeout(() => {
+ activeBtnIndex = -1
+ }, 200)
}
function collect() {
@@ -151,9 +155,12 @@ function collect() {
store.newWordDict.chapterWords = [store.newWordDict.words]
}
activeBtnIndex = 1
+ setTimeout(() => {
+ activeBtnIndex = -1
+ }, 200)
}
-function remove(){
+function remove() {
if (!store.skipWordNames.includes(word.name.toLowerCase())) {
store.skipWordDict.originWords.push(word)
store.skipWordDict.words.push(word)
@@ -161,6 +168,9 @@ function remove(){
}
activeBtnIndex = 0
next(false)
+ setTimeout(() => {
+ activeBtnIndex = -1
+ }, 200)
}
function onKeyUp(e: KeyboardEvent) {
@@ -286,16 +296,23 @@ useOnKeyboardEventListener(onKeyDown, onKeyUp)
{{ word.usphone }}
-
+
忽略
-
+
收藏
-
+
跳过
+
@@ -313,11 +330,12 @@ useOnKeyboardEventListener(onKeyDown, onKeyUp)
color: gray;
gap: 2rem;
position: relative;
+ width: var(--toolbar-width);
.near-word {
position: absolute;
top: 0;
- width: var(--toolbar-width);
+ width: 100%;
.word {
div {
diff --git a/src/components/Side.vue b/src/components/Side.vue
deleted file mode 100644
index 8ce62877..00000000
--- a/src/components/Side.vue
+++ /dev/null
@@ -1,307 +0,0 @@
-
-
-
-
-
-
-
swiperIns0 = e" class="mySwiper" :allow-touch-move="false">
-
-
-
-
store.changeDict(store.currentDict,store.currentDict.chapterIndex,e)"
- :isActive="store.sideIsOpen && tabIndex === 0"
- :list="store.currentDict.chapterWords[store.currentDict.chapterIndex]??[]"
- :activeIndex="dictActiveIndex"/>
-
-
-
-
-
-
-
store.changeDict(store.newWordDict,store.newWordDict.chapterIndex,e)"
- :isActive="store.sideIsOpen && tabIndex === 1"
- :list="store.newWordDict.words"
- :activeIndex="newWordDictActiveIndex"/>
-
-
-
-
-
-
-
store.changeDict(store.wrongWordDict,store.wrongWordDict.chapterIndex,e)"
- :isActive="store.sideIsOpen && tabIndex === 2"
- :list="store.wrongWordDict.words"
- :activeIndex="wrongWordDictActiveIndex"/>
-
-
-
-
-
-
-
store.changeDict(store.skipWordDict,store.skipWordDict.chapterIndex,e)"
- :isActive="store.sideIsOpen && tabIndex === 3"
- :list="store.skipWordDict.words"
- :activeIndex="skipWordDictActiveIndex"/>
-
-
-
-
-
-
-
-
-
diff --git a/src/components/Toolbar/Toolbar.vue b/src/components/Toolbar/Toolbar.vue
index 4288f4a4..4107603a 100644
--- a/src/components/Toolbar/Toolbar.vue
+++ b/src/components/Toolbar/Toolbar.vue
@@ -47,7 +47,6 @@ watch(() => settingStore.showToolbar, n => {
{{ store.dictTitle }} {{ practiceStore.repeatNumber ? ' 复习错词' : '' }}
-
settingStore.showToolbar, n => {
-
+
@@ -130,15 +129,24 @@ header {
.content {
min-height: 60rem;
display: flex;
+ align-items: center;
justify-content: space-between;
.info {
font-size: 16rem;
+ padding: 6rem 10rem;
+ border-radius: 6rem;
color: var(--color-font-1);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
+ transition: all .3s;
+
+ &:hover {
+ background: var(--color-main-active);
+ color: white;
+ }
}
.options {
diff --git a/src/stores/base.ts b/src/stores/base.ts
index ba5271c0..52ddedb0 100644
--- a/src/stores/base.ts
+++ b/src/stores/base.ts
@@ -17,7 +17,6 @@ export interface State {
repeatNumber: number,
},
simpleWords: string[],
- sideIsOpen: boolean,
load: boolean
}
@@ -130,7 +129,6 @@ export const useBaseStore = defineStore('base', {
editIndex: 0,
repeatNumber: 0,
},
- sideIsOpen: false,
simpleWords: [
'a', 'an', 'of', 'and',
'i', 'my', 'you', 'your',
diff --git a/src/stores/setting.ts b/src/stores/setting.ts
index ddfa5a39..90c92451 100644
--- a/src/stores/setting.ts
+++ b/src/stores/setting.ts
@@ -29,7 +29,7 @@ export interface SettingState {
wordForeignFontSize: number,
wordTranslateFontSize: number,
},
-
+ showPanel: boolean,
theme: string,
}
@@ -58,6 +58,7 @@ export const useSettingStore = defineStore('setting', {
showNearWord: true,
ignoreCase: true,
allowWordTip: true,
+ showPanel: true,
fontSize: {
articleForeignFontSize: 48,
articleTranslateFontSize: 20,
diff --git a/src/t.js b/src/t.js
deleted file mode 100644
index 2f234b91..00000000
--- a/src/t.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// ==UserScript==
-// @name Youtube新标签页打开
-// @namespace http://tampermonkey.net/
-// @version 0.1
-// @description Youtube新标签页打开.
-// @author You
-// @match https://www.youtube.com/*
-// @icon https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
-// @require https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
-// @license MIT
-// @grant none
-// ==/UserScript==
-
-(function () {
- 'use strict';
-
- function load() {
- console.log('load1')
- setTimeout(() => {
- console.log('load2')
- window.addEventListener('click', function (e) {
- let list = e.target.classList
- let isStop = Array.from(list).some(v => v.includes('preview'))
- if (isStop && location.pathname !== '/watch') {
- event.stopPropagation()
- }
- }, true);
-
- const ele = document.querySelector('#media-container-link')
- ele.setAttribute("target", "_blank");
-
- let imgList = $('img.yt-core-image')
- imgList.each(function (v) {
- let a = this.parentNode.parentNode
- a.setAttribute("target", "_blank");
- })
- })
- }
-
- // window.addEventListener('load', load)
- //火狐不触发load事件
- setTimeout(load, 3000)
-})();
\ No newline at end of file
diff --git a/src/utils/eventBus.ts b/src/utils/eventBus.ts
index dccf7f87..fc3b7486 100644
--- a/src/utils/eventBus.ts
+++ b/src/utils/eventBus.ts
@@ -3,7 +3,6 @@ import mitt from 'mitt'
export const emitter = mitt()
export const EventKey = {
resetWord: 'resetWord',
- openSide: 'openSide',
openStatModal: 'openStatModal',
closeOther: 'closeOther',
keydown: 'keydown',