This commit is contained in:
zyronon
2023-10-16 01:16:36 +08:00
parent 3d1db78f89
commit ecc639d6fc
9 changed files with 95 additions and 60 deletions

View File

@@ -72,7 +72,7 @@ API 等词库。 尽可能满足大部分用户对背单词的需求,也非常
### 灵感来源
[qwerty-learner](https://github.com/RealKai42/qwerty-learner/) 很喜欢作者的这个项目,但是它没有背单词所必备的 **生词本、错词本、简单词** 的功能,可能是作者反复强调和提醒这个项目是“**为键盘工作者设计的单词记忆与英语肌肉记忆锻炼软件**”而不是一个“背单词”的软件吧,尽管绝大多数用户都是用它来背单词😂😂😂。
[qwerty-learner](https://github.com/RealKai42/qwerty-learner/) 很喜欢作者的这个项目,但是它没有背单词所必备的 **生词本、错词本、简单词** 的功能,可能是作者反复强调和提醒这个项目是“**为键盘工作者设计的单词记忆与英语肌肉记忆锻炼软件**”而不是一个“**背单词**”的软件吧,尽管绝大多数用户都是用它来背单词😂😂😂。
本项目加上**生词本、错词本、简单词** 的功能,而且还新增 **文章练习** 功能
本项目参考其思路用 Vue 重写了,并添加了**生词本、错词本、简单词** **文章练习** 功能

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="/vite.svg"/>
<link rel="icon" type="image/svg+xml" href="/logo.jpg"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Typing Word</title>
<script>

View File

@@ -23,6 +23,7 @@
"copy-to-clipboard": "^3.3.3",
"element-plus": "^2.3.9",
"file-saver": "^2.0.5",
"git-last-commit": "^1.0.1",
"hover.css": "^2.3.2",
"localforage": "^1.10.0",
"lodash-es": "^4.17.21",

7
pnpm-lock.yaml generated
View File

@@ -29,6 +29,9 @@ dependencies:
file-saver:
specifier: ^2.0.5
version: 2.0.5
git-last-commit:
specifier: ^1.0.1
version: 1.0.1
hover.css:
specifier: ^2.3.2
version: 2.3.2
@@ -1839,6 +1842,10 @@ packages:
has-symbols: 1.0.3
dev: false
/git-last-commit@1.0.1:
resolution: {integrity: sha512-FDSgeMqa7GnJDxt/q0AbrxbfeTyxp4ImxEw1e4nw6NUHA5FMhFUq33dTXI4Xdgcj1VQ1q5QLWF6WxFrJ8KCBOg==}
dev: false
/glob-parent@5.1.2:
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
engines: {node: '>= 6'}

BIN
public/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -24,14 +24,19 @@ useWatchAllSound()
@close="emit('close')"
title="设置">
<div class="setting-modal">
<div class="tabs">
<div class="tab" :class="tabIndex === 0 && 'active'" @click="tabIndex = 0">
<Icon icon="bx:headphone" width="20" color="#0C8CE9"/>
<span>音效设置</span>
<div class="left">
<div class="tabs">
<div class="tab" :class="tabIndex === 0 && 'active'" @click="tabIndex = 0">
<Icon icon="bx:headphone" width="20" color="#0C8CE9"/>
<span>音效设置</span>
</div>
<div class="tab" :class="tabIndex === 1 && 'active'" @click="tabIndex = 1">
<Icon icon="icon-park-outline:setting-config" width="20" color="#0C8CE9"/>
<span>其他设置</span>
</div>
</div>
<div class="tab" :class="tabIndex === 1 && 'active'" @click="tabIndex = 1">
<Icon icon="icon-park-outline:setting-config" width="20" color="#0C8CE9"/>
<span>其他设置</span>
<div class="git-log">
Build {{ LATEST_COMMIT_HASH }}
</div>
</div>
<div class="content">
@@ -234,32 +239,46 @@ useWatchAllSound()
.setting-modal {
width: 40vw;
height: 650rem;
height: 70vh;
display: flex;
color: var(--color-font-1);
.tabs {
padding: 10rem 20rem;
.left {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
//justify-content: center;
gap: 10rem;
.tab {
cursor: pointer;
padding: 10rem 15rem;
border-radius: 8rem;
.tabs {
padding: 10rem 20rem;
display: flex;
flex-direction: column;
align-items: center;
//justify-content: center;
gap: 10rem;
&.active {
background: whitesmoke;
.tab {
cursor: pointer;
padding: 10rem 15rem;
border-radius: 8rem;
display: flex;
align-items: center;
gap: 10rem;
&.active {
background: whitesmoke;
}
}
}
.git-log{
font-size: 10rem;
color: gray;
margin-bottom: 5rem;
}
}
.content {
background: var(--color-header-bg);
flex: 1;

2
src/vite-env.d.ts vendored
View File

@@ -6,7 +6,7 @@ import {ElMessageBox} from "element-plus";
// const src: string
// export default src
// }
declare const LATEST_COMMIT_HASH: string
declare module '*.mp3' {
const src: string;

View File

@@ -6,8 +6,9 @@ import {visualizer} from "rollup-plugin-visualizer";
import {ElementPlusResolver} from "unplugin-vue-components/resolvers";
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import {getLastCommit} from "git-last-commit";
function pathResolve(dir) {
function pathResolve(dir:string) {
return resolve(__dirname, ".", dir)
}
@@ -15,44 +16,52 @@ const lifecycle = process.env.npm_lifecycle_event;
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
reactivityTransform: true
}),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
vueJsx(),
lifecycle === 'report' ?
visualizer({
gzipSize: true,
brotliSize: true,
emitFile: false,
filename: "report.html", //分析图生成的文件名
open: true //如果存在本地服务端口,将在打包后自动展示
}) : null,
],
base: './',
resolve: {
alias: {
"@": pathResolve("src"),
export default defineConfig(async () => {
const latestCommitHash = await new Promise<string>((resolve) => {
return getLastCommit((err, commit) => (err ? 'unknown' : resolve(commit.shortHash)))
})
return {
plugins: [
vue({
reactivityTransform: true
}),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
vueJsx(),
lifecycle === 'report' ?
visualizer({
gzipSize: true,
brotliSize: true,
emitFile: false,
filename: "report.html", //分析图生成的文件名
open: true //如果存在本地服务端口,将在打包后自动展示
}) : null,
],
define: {
LATEST_COMMIT_HASH: JSON.stringify(latestCommitHash + (process.env.NODE_ENV === 'production' ? '' : ' (dev)')),
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
server: {
port: 3000,
open: false,
host: '0.0.0.0',
fs: {
strict: false,
//默认是'',导致只能在一级域名下使用。
base: './',
resolve: {
alias: {
"@": pathResolve("src"),
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
proxy: {
'/baidu': 'https://api.fanyi.baidu.com/api/trans/vip/translate'
server: {
port: 3000,
open: false,
host: '0.0.0.0',
fs: {
strict: false,
},
proxy: {
'/baidu': 'https://api.fanyi.baidu.com/api/trans/vip/translate'
}
}
}
})