Compare commits
172 Commits
V1.0.0
..
760a457410
| Author | SHA1 | Date | |
|---|---|---|---|
| 760a457410 | |||
| 58116ff311 | |||
| b2d715a1b1 | |||
| f31020d31c | |||
| 7e5100fc5c | |||
| 9ca0619373 | |||
| 02237e3e30 | |||
| 2d805cf02d | |||
| 266a1764be | |||
| 52d154e1a3 | |||
| 7deefc8ea3 | |||
| 31b6a6ce2d | |||
| 7b76410df8 | |||
| c836302f99 | |||
| ecadb6ce2a | |||
| 1ff42aa911 | |||
| a666679ebd | |||
| 6cbbbe8541 | |||
| dcd46b9afe | |||
| 13ed3a8fe4 | |||
| 69e64fb08c | |||
| e6c35d25a5 | |||
| 26947ee678 | |||
| fe8f1606fa | |||
| b8113725bf | |||
| 66e1170c58 | |||
| 359acb41d1 | |||
| 6883e54a1b | |||
| 84273c3689 | |||
| 383280031c | |||
| bca8602a3a | |||
| 04c76dc347 | |||
| d75232e5e0 | |||
| ca27b2bbcc | |||
| 6486a90812 | |||
| 855695bc13 | |||
| d9869fcb87 | |||
| 2ecddb17aa | |||
| 73837d517d | |||
| 8e6a00f610 | |||
| ffbf926c9f | |||
| 93fea94c3a | |||
| eeb72097e5 | |||
| c2a496b228 | |||
| f27a869d6a | |||
| 084afc0cef | |||
| abb1fed1ef | |||
| 85a7f66af4 | |||
| d616564a55 | |||
| ba238a44d9 | |||
| 55f3e74cbf | |||
| 173cada6a4 | |||
| fb655552b3 | |||
| 9aa47a6b3b | |||
| b338b91e5a | |||
| 9034790421 | |||
| 204930e9e5 | |||
| b46b707329 | |||
| 3e526045bf | |||
| dab7d938f7 | |||
| 6e60f4a67c | |||
| 6fdc510f60 | |||
| 3b8a119ab0 | |||
| cd1c82082e | |||
| d836cecb91 | |||
| 5857af36dd | |||
| 9c8712ae26 | |||
| bc35da29af | |||
| 7291dedeaf | |||
| 0631f3ae24 | |||
| 3452dc748a | |||
| e1c02b68a3 | |||
| a789486823 | |||
| 0228151136 | |||
| 56ba451325 | |||
| c4537b1103 | |||
| 5ddb70e1ab | |||
| b90611e310 | |||
| 23d0b08242 | |||
| 744c054c1c | |||
| 2a76490656 | |||
| 53299b83b3 | |||
| 865ef1e383 | |||
| 0310eee39e | |||
| fcda974626 | |||
| 81b714333a | |||
| 6516fe4905 | |||
| e37d12a5f2 | |||
| 331e037714 | |||
| ef95e5ce73 | |||
| 75f9985265 | |||
| 95d1352a2b | |||
| 0c9091f5e6 | |||
| 0a86b75454 | |||
| b1c572903f | |||
| 521edd2a8f | |||
| 96425f7e70 | |||
| de3cd7bb34 | |||
| 1c87705166 | |||
| d2eb0fa284 | |||
| 4b1d0d2139 | |||
| bcd8fc3963 | |||
| b852159e39 | |||
| a31ad98a9e | |||
| 10ab2fb670 | |||
| 0d30d6cb5a | |||
| 05f3fbc454 | |||
| 2365231986 | |||
| 68aec74c80 | |||
| b2e4937c69 | |||
| 838856e53f | |||
| 9ad6d3bb9d | |||
| c7a10c7e98 | |||
| 9aed3ec064 | |||
| f1a7c74b93 | |||
| d3a29eed91 | |||
| ec35a111c7 | |||
| 171c8a404c | |||
| e56ff2ce07 | |||
| bc62099ddd | |||
| e968e5240a | |||
| 7c0fb75913 | |||
| c2d6fa1c86 | |||
| 494dd43bc9 | |||
| 7c84abdd64 | |||
| dbd6e4bd6b | |||
| ef724678cb | |||
| 1421865d5c | |||
| 530e5ca6a9 | |||
| c2561d5498 | |||
| b4ef6600c4 | |||
| 2cd8d41f5c | |||
| 0d9fdf2cd6 | |||
| 203c35b506 | |||
| a2432376c2 | |||
| b76dc08395 | |||
| 076b6e91dd | |||
| 75921e1b13 | |||
| 9ffd67758b | |||
| afcf5d56b4 | |||
| 18f3b97ab8 | |||
| e4673377fd | |||
| b63515128b | |||
| e4fab491db | |||
| b01ce6be88 | |||
| 6978b89ee5 | |||
| 2239c23a1e | |||
| fc2b56b9ad | |||
| 682c1eb6de | |||
| 97e7f6201a | |||
| 0518905615 | |||
| 2aefb3d75b | |||
| de004b4e0b | |||
| e85166d1f7 | |||
| 1cb7af4f66 | |||
| c85f6348bc | |||
| bf66ff6e1c | |||
| 702d65ef47 | |||
| 94e94956bb | |||
| 500509f837 | |||
| 925b9195a6 | |||
| f66d388ff7 | |||
| da9fc065c3 | |||
| 8b63bb71cc | |||
| d451b29b7f | |||
| 8db4370f17 | |||
| 2327d1c8bb | |||
| 8c91c76adc | |||
| 6f39070e9b | |||
| eb13a9efdb | |||
| d4f497f484 | |||
| f9d8b4670b |
@@ -0,0 +1,4 @@
|
||||
dist
|
||||
node_modules
|
||||
types/env.d.ts
|
||||
types/web.d.ts
|
||||
@@ -0,0 +1,21 @@
|
||||
/* eslint-env node */
|
||||
module.exports = {
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:vue/vue3-essential',
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
ecmaVersion: 'latest',
|
||||
},
|
||||
root: true,
|
||||
rules: {
|
||||
'vue/html-self-closing': 'off',
|
||||
'vue/max-attributes-per-line': 'off',
|
||||
'vue/multiline-html-element-content-newline': 'off',
|
||||
'vue/require-default-prop': 'off',
|
||||
'vue/singleline-html-element-content-newline': 'off',
|
||||
},
|
||||
};
|
||||
@@ -1,36 +0,0 @@
|
||||
## 类型(勾选其中一个)
|
||||
|
||||
- [ ] 提交链接
|
||||
- [ ] 修正链接
|
||||
- [ ] 发现 BUG
|
||||
- [ ] 建议
|
||||
|
||||
## 具体内容(根据“类型”选择其中一个,并删除其余 3 个)
|
||||
|
||||
### 1. 提交链接(不接受奇怪的网站)
|
||||
|
||||
- 链接分类(例如 资源 - 软件 - 工具):
|
||||
- 链接名称(例如 GitHub):
|
||||
- 具体链接(例如 https://github.com/):
|
||||
|
||||
### 2. 修正链接
|
||||
|
||||
- 链接所在的分类(例如 资源 - 软件 - 工具):
|
||||
- 链接名称(例如 GitHub):
|
||||
- 修正后的分类:
|
||||
- 修正后的名称:
|
||||
- 修正后的链接:
|
||||
|
||||
### 3. 发现 BUG
|
||||
|
||||
#### BUG 描述(例如 BUG 是在什么情况下出现的)
|
||||
|
||||
在此填写
|
||||
|
||||
#### 解决方法(可选)
|
||||
|
||||
在此填写
|
||||
|
||||
### 4. 建议
|
||||
|
||||
此处填写具体的建议内容。
|
||||
@@ -1 +0,0 @@
|
||||
填写描述,例如:修改的内容、作用
|
||||
@@ -0,0 +1,2 @@
|
||||
dist
|
||||
node_modules
|
||||
@@ -0,0 +1,3 @@
|
||||
1. 项目采用 Vite + Vue 3 + Naive UI 组件库开发,图标库使用 Material Design Icons(@mdi/font)。
|
||||
2. 项目使用 pnpm 作为包管理器。
|
||||
3. 项目开发服务已启动,首页访问地址是 http://localhost:9000/,不需要重复启动。
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"Vue.volar",
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"editor.tabSize": 2,
|
||||
"editor.wordWrap": "on",
|
||||
"files.autoSave": "off",
|
||||
"files.eol": "\n",
|
||||
"typescript.suggest.autoImports": false,
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
# 更新日志
|
||||
|
||||
## [3.1.6] - 2025-10-26
|
||||
|
||||
### Added
|
||||
|
||||
- `工具箱` 添加工具信息和工具更新日志显示。
|
||||
- `工具箱` 添加“JSON 编辑器”工具。
|
||||
|
||||
## [3.1.5] - 2025-04-06
|
||||
|
||||
### Added
|
||||
|
||||
- `工具箱` 添加“二维码解析和生成”工具。
|
||||
|
||||
### Changed
|
||||
|
||||
- `工具箱` 调整工具列表项顺序。
|
||||
|
||||
## [3.1.4] - 2025-02-08
|
||||
|
||||
### Added
|
||||
|
||||
- `工具箱` 添加在新窗口中打开当前工具功能。
|
||||
|
||||
### Fixed
|
||||
|
||||
- `工具箱/JSON 格式化` 优化“输出内容”显示样式,解决内容较多时行号显示不全的问题。
|
||||
|
||||
## [3.1.3] - 2025-02-07
|
||||
|
||||
### Added
|
||||
|
||||
- `工具箱` 添加“JSON 格式化”工具。
|
||||
- `工具箱` 添加“Minecraft 聊天记录查看”工具。
|
||||
- `工具箱` 添加“Unix 时间戳转换”工具。
|
||||
- `工具箱` 添加“WebSocket 测试”工具。
|
||||
- `工具箱` 添加“新窗口中打开”工具。
|
||||
|
||||
### Changed
|
||||
|
||||
- `网址导航` 更新导航链接列表(2025-02-03)。
|
||||
|
||||
### Fixed
|
||||
|
||||
- `工具箱/原神时钟` 解决特定情况下显示的小时值大于或等于 24 的问题。
|
||||
|
||||
## [3.1.2] - 2024-10-13
|
||||
|
||||
### Added
|
||||
|
||||
- `工具箱` 添加“保持亮屏”。
|
||||
- `工具箱` 添加“原神时钟”。
|
||||
|
||||
### Changed
|
||||
|
||||
- `工具箱` 调整页面路由生成逻辑,不跳过未启用的工具。
|
||||
|
||||
## [3.1.1] - 2024-09-08
|
||||
|
||||
### Fixed
|
||||
|
||||
- `配置文件` 解决打包异常。
|
||||
|
||||
## [3.1.0] - 2024-09-08
|
||||
|
||||
### Added
|
||||
|
||||
- `工具箱` 添加“工具箱”模块,包含“下载用时计算”“比例计算”“生成随机字符串”工具。
|
||||
- `网址导航` 支持记录最后一次选中的链接分类。
|
||||
|
||||
### Changed
|
||||
|
||||
- `功能` 修改页面跳转方式,支持返回。
|
||||
|
||||
## [3.0.0] - 2024-09-01
|
||||
|
||||
重构新版本,支持“搜索”功能和“网址导航”功能。
|
||||
@@ -1,21 +1,674 @@
|
||||
MIT License
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (c) 2019 Frost-ZX
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Preamble
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
||||
@@ -1,43 +1,74 @@
|
||||
# frost-navigation
|
||||
|
||||
## 简介
|
||||
|
||||
### 名称
|
||||
一个使用 Vue 3 开发的网站导航和工具箱,绿色无广告。
|
||||
|
||||
- Frost 网址导航
|
||||
- Frost Site Navigation
|
||||

|
||||
|
||||
### 页面链接
|
||||

|
||||
|
||||
- [链接一](https://frost-zx.github.io/frost-navigation/)(GitHub Pages)
|
||||
- [链接二](http://nav.frost-zx.top/)(网站)
|
||||

|
||||
|
||||

|
||||
|
||||
## 使用方法
|
||||
|
||||
### 在线
|
||||
|
||||
- [GitHub Pages](https://frost-zx.github.io/frost-navigation/)
|
||||
- [V1 版本](https://frost-zx.github.io/frost-navigation/v1/)(2020-09-10)
|
||||
- [V2 版本](https://frost-zx.github.io/frost-navigation/v2/)(2024-08-31)
|
||||
- [V3 版本](https://frost-zx.github.io/frost-navigation/v3/)(开发中)
|
||||
- [Vercel](https://frost-navigation.vercel.app/)
|
||||
|
||||
### 离线(需要手动更新)
|
||||
|
||||
1. [点击此处下载](https://github.com/Frost-ZX/frost-navigation/archive/gh-pages.zip)
|
||||
2. 解压,放置于任意合适的喜欢的位置(可重命名)
|
||||
2. 在浏览器中打开 `index.html`(也可以将其加入浏览器的书签栏或在浏览器设置中将其设置为主页)
|
||||
|
||||
## 注意
|
||||
|
||||
- 部分链接由于不能及时更新,可能已过期(不存在、指向了错误的网站等),访问时请注意。若您在使用时发现相关情况,欢迎进行反馈。
|
||||
|
||||
## 鸣谢
|
||||
|
||||
- [GitHub Pages - Websites for you and your projects](https://pages.github.com/)
|
||||
- [Vercel - Develop. Preview. Ship. For the best frontend teams](https://vercel.com/)
|
||||
|
||||
## 反馈
|
||||
|
||||
### 提交链接
|
||||
|
||||
有以下两种方法:
|
||||
|
||||
1. 到 [Issues](https://github.com/Frost-ZX/frost-navigation/issues) 提交。
|
||||
2. 到 [发布页面](https://blog.frost-zx.top/website/frost-navigation.html) 的评论区提交。
|
||||
|
||||
请到 [Issues](https://github.com/Frost-ZX/frost-navigation/issues) ,根据相关提示进行提交。
|
||||
|
||||
### 修正链接
|
||||
|
||||
有以下两种方法:
|
||||
请到 [Issues](https://github.com/Frost-ZX/frost-navigation/issues) ,根据相关提示进行提交。
|
||||
|
||||
1. 到 [Issues](https://github.com/Frost-ZX/frost-navigation/issues) 提交。
|
||||
2. 到 [发布页面](https://blog.frost-zx.top/website/frost-navigation.html) 的评论区提交。
|
||||
## 开发
|
||||
|
||||
### 离线使用
|
||||
### Project Setup
|
||||
|
||||
支持离线使用,[下载](https://github.com/Frost-ZX/frost-navigation/archive/master.zip) 后打开 `index.html` 即可,也可以将其加入浏览器的书签栏或在浏览器设置中将其设置为主页。
|
||||
```sh
|
||||
pnpm install
|
||||
```
|
||||
|
||||
`注意:需要手动更新文件`
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
### 自定义
|
||||
```sh
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
- [下载](https://github.com/Frost-ZX/frost-navigation/archive/master.zip) 后打开 `index.html` 和 `assets/js/nav-links.js` 根据需要进行修改。
|
||||
### Compile and Minify for Production
|
||||
|
||||
## 第三方资源
|
||||
```sh
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
### 插件
|
||||
### Lint with ESLint
|
||||
|
||||
- [Slinky 4.2.1](https://github.com/alizahid/slinky)
|
||||
- [jQuery 3.2.1](https://jquery.org/)
|
||||
```sh
|
||||
pnpm run lint
|
||||
```
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
/* 背景 */
|
||||
|
||||
.page-background {
|
||||
z-index: -100;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-attachment: fixed;
|
||||
background-image: url(../img/Unsplash_V6TWE6h8gyg_Blur.jpg);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
/*
|
||||
.page-background:after {
|
||||
content: "";
|
||||
z-index: -90;
|
||||
position: inherit;
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
background: inherit;
|
||||
filter: blur(4px);
|
||||
}
|
||||
*/
|
||||
|
||||
/* 滚动条 */
|
||||
|
||||
::-webkit-scrollbar {
|
||||
height: 8px;
|
||||
width: 8px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #CCC;
|
||||
border-radius: 0;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #03A9F4;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #FFF;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* 选中 */
|
||||
|
||||
::selection {
|
||||
background:#03A9F4;
|
||||
color:#FFF;
|
||||
}
|
||||
::-moz-selection {
|
||||
background:#03A9F4;
|
||||
color:#FFF;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background:#03A9F4;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* 动画 */
|
||||
|
||||
@keyframes spinner {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes FloatingBarSlide {
|
||||
from {
|
||||
bottom: -50px;
|
||||
}
|
||||
}
|
||||
@keyframes ToTopAnimation {
|
||||
0% {
|
||||
}
|
||||
50% {
|
||||
right: 2.2rem;
|
||||
bottom: 2.2rem;
|
||||
height: 2.6rem;
|
||||
width: 2.6rem;
|
||||
line-height: 40px;
|
||||
color: #FFF;
|
||||
}
|
||||
100% {
|
||||
color: #2196F3;
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes ToolPanelShow {
|
||||
from {
|
||||
bottom: -110%;
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
bottom: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@@ -1,362 +0,0 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
/* 标签 */
|
||||
|
||||
body {
|
||||
background-color: #999;
|
||||
color: #000;
|
||||
margin: 6em auto;
|
||||
text-transform: none;
|
||||
overflow-x: hidden;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #222;
|
||||
}
|
||||
a:hover {
|
||||
color: #03A9F4;
|
||||
}
|
||||
a:active {
|
||||
color: #00BCD4;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #FFF;
|
||||
font-size: 1.6em;
|
||||
text-shadow: 2px 2px 2px #00000040;
|
||||
}
|
||||
h3 {
|
||||
color: #03A9F4;
|
||||
}
|
||||
|
||||
/* 覆盖 Slinky */
|
||||
|
||||
header,
|
||||
h1 {
|
||||
color: #444;
|
||||
}
|
||||
header h1::before {
|
||||
background-image: url('../../favicon.ico');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
header p {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
main {
|
||||
opacity: 0;
|
||||
background-color: transparent;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
footer {
|
||||
color: #FFF;
|
||||
font-size: 0.9em;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
footer a {
|
||||
color: #FFF;
|
||||
}
|
||||
footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* 工具面板 */
|
||||
|
||||
.tool-panel {
|
||||
display: none;
|
||||
z-index: 100;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
opacity: 1;
|
||||
transition: all 0.5s;
|
||||
animation: ToolPanelShow 0.5s;
|
||||
}
|
||||
|
||||
.tool-panel-bar,
|
||||
.tool-panel-newtab,
|
||||
.tool-panel-close,
|
||||
.tool-panel-blank {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.tool-panel-newtab,
|
||||
.tool-panel-close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 80px;
|
||||
box-shadow: -2px 0 10px 0 #00000020;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.tool-panel-blank {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #FFF;
|
||||
box-shadow: 0 0 10px #00000020;
|
||||
}
|
||||
|
||||
.tool-panel-newtab {
|
||||
right: calc(80px + 8px);
|
||||
background-color: #2196F3;
|
||||
}
|
||||
|
||||
.tool-panel-close {
|
||||
right: 8px;
|
||||
background-color: #F44336;
|
||||
}
|
||||
|
||||
.tool-panel-iframe iframe {
|
||||
height: calc(100vh - 40px);
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
/* 链接图标 */
|
||||
|
||||
/*
|
||||
main section li img {
|
||||
height: 28px;
|
||||
position: absolute;
|
||||
transform: translate(10px, 10px);
|
||||
}
|
||||
|
||||
main section li a:not(.back) {
|
||||
padding-left: 45px !important;
|
||||
}
|
||||
*/
|
||||
|
||||
/* 全屏文字 */
|
||||
|
||||
.fullscreen-text {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
font-size: 5vw;
|
||||
color: #FFF;
|
||||
transform: translate(-50%, -50%);
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
/* 查找面板 */
|
||||
|
||||
.search-panel {
|
||||
visibility: hidden;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
height: 300px;
|
||||
width: 500px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.search-bar{
|
||||
text-align: center;
|
||||
font-size: 0;
|
||||
}
|
||||
.search-bar .search-input {
|
||||
position: relative;
|
||||
top: -2px; /* 修正 border 导致的垂直位移 */
|
||||
margin: 20px 5px 0 0;
|
||||
padding: 0 10px;
|
||||
width: 60%;
|
||||
height: 40px;
|
||||
border: solid 2px #4CAF50;
|
||||
font-size: 16px;
|
||||
transition: border 0.2s;
|
||||
}
|
||||
.search-bar .search-input:hover {
|
||||
border-color: #388E3C;
|
||||
}
|
||||
.search-bar .search-submit,
|
||||
.search-bar .search-cancel {
|
||||
width: 70px;
|
||||
height: 40px;
|
||||
border: none;
|
||||
background-color: #4CAF50;
|
||||
font-size: 16px;
|
||||
color: #FFF;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.search-bar .search-submit:hover,
|
||||
.search-bar .search-cancel:hover {
|
||||
background-color: #388E3C;
|
||||
}
|
||||
.search-bar .search-submit {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.search-result {
|
||||
margin-top: 10px;
|
||||
padding: 0 16px;
|
||||
height: calc(100% - 100px);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.search-result a {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
}
|
||||
#search-result-title {
|
||||
border-bottom: 1px solid #DDD;
|
||||
}
|
||||
#search-result-link {
|
||||
margin-top: 7px;
|
||||
}
|
||||
@media screen and (max-width: 500px) {
|
||||
.search-panel {
|
||||
height: 300px;
|
||||
width: 95%;
|
||||
}
|
||||
.search-bar .search-input {
|
||||
margin: 15px 5px 0 0;
|
||||
padding: 0 10px;
|
||||
width: 55%;
|
||||
height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.search-bar .search-submit,
|
||||
.search-bar .search-cancel {
|
||||
width: 16%;
|
||||
height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.search-result {
|
||||
padding: 0 5%;
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
.search-result a {
|
||||
margin-bottom: 8px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 搜索引擎 */
|
||||
|
||||
.search-engine {
|
||||
width: 100%;
|
||||
}
|
||||
.search-engine-bar {
|
||||
height: 45px;
|
||||
width: 100%;
|
||||
background-color: #FFF;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.search-engine-select {
|
||||
color: #FFF;
|
||||
text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
#search-engine-input {
|
||||
padding-left: 15px;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
width: calc(100% - 45px);
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
.search-engine-submit {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
top: 7px;
|
||||
left: 7px;
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
color: #03A9F4;
|
||||
fill: currentcolor;
|
||||
user-select: none;
|
||||
}
|
||||
.search-engine-select ul {
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.search-engine-select ul li {
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
list-style: none;
|
||||
font-size: 16px;
|
||||
}
|
||||
/* radio 样式 */
|
||||
.search-engine-select ul li input[type="radio"] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
}
|
||||
.search-engine-select ul li input[type="radio"] + label:before {
|
||||
content: '';
|
||||
border-radius: 0px;
|
||||
background: #FFF;
|
||||
border: 1px solid #999;
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
position: relative;
|
||||
top: 0;
|
||||
margin-right: 0.25em;
|
||||
vertical-align: top;
|
||||
text-align: center;
|
||||
transition: all 0.25s ease;
|
||||
}
|
||||
.search-engine-select ul li input[type="radio"]:checked + label:before {
|
||||
background-color: #4CAF50;
|
||||
box-shadow: inset 0 0 0 2px #FFF;
|
||||
}
|
||||
.search-engine-select ul li input[type="radio"]:focus + label:before {
|
||||
outline: none;
|
||||
border-color: #4CAF50;
|
||||
}
|
||||
.search-engine-select ul li input[type="radio"]:disabled + label:before {
|
||||
box-shadow: inset 0 0 0 2px #FFF;
|
||||
border-color: #999;
|
||||
background: #999;
|
||||
}
|
||||
.search-engine-select ul li input[type="radio"] + label:empty:before {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
/* 悬浮栏 */
|
||||
|
||||
.floating-bar {
|
||||
z-index: 50;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
padding: 4px 0;
|
||||
box-shadow: 0 0 10px 0 #00000020;
|
||||
background-color: #FFF;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 0;
|
||||
animation: FloatingBarSlide 1s ease-out 1;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.floating-bar-search,
|
||||
.floating-bar-tool,
|
||||
.floating-bar-about,
|
||||
.floating-bar-totop {
|
||||
display: inline-block;
|
||||
width: 64px;
|
||||
height: 35px;
|
||||
background-color: #009688;
|
||||
text-align: center;
|
||||
line-height: 35px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
}
|
||||
.floating-bar-tool,
|
||||
.floating-bar-about,
|
||||
.floating-bar-totop {
|
||||
margin-left: 4px;
|
||||
}
|
||||
@@ -1,240 +0,0 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
html {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
body {
|
||||
padding: 1.2rem 0 5rem 0;
|
||||
background-color: #999;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
/* 主要 */
|
||||
|
||||
.main {
|
||||
margin: 0 auto;
|
||||
width: 25rem;
|
||||
}
|
||||
.main > div {
|
||||
margin: 1.2rem 0;
|
||||
padding: 1rem;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
border-radius: 0.4rem;
|
||||
background-color: #FFF;
|
||||
box-shadow: 0 0 0.6rem rgba(0, 0, 0, 0.05);
|
||||
user-select: none;
|
||||
}
|
||||
.main > div header {
|
||||
margin-bottom: 1rem;
|
||||
text-align: center;
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
.main > div hr {
|
||||
margin: 0.5rem 0;
|
||||
height: 0.1rem;
|
||||
border: none;
|
||||
background-color: #EEE;
|
||||
}
|
||||
.main > div input:focus {
|
||||
outline: none;
|
||||
}
|
||||
.main > div input[type="checkbox"] {
|
||||
width: 0.8rem;
|
||||
height: 0.8rem;
|
||||
}
|
||||
.main > div input[type="radio"] {
|
||||
width: 0.8rem;
|
||||
height: 0.8rem;
|
||||
}
|
||||
.main > div input[type="range"] {
|
||||
-webkit-appearance: none;
|
||||
width: 6rem;
|
||||
}
|
||||
.main > div input[type=range]::-webkit-slider-runnable-track {
|
||||
height: 0.7rem;
|
||||
border-radius: 0.7rem;
|
||||
background-color: #999;
|
||||
}
|
||||
.main > div input[type="range"]::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
height: 1.2rem;
|
||||
width: 1rem;
|
||||
margin-top: -0.25rem;
|
||||
background: #555;
|
||||
border-radius: 0.2rem;
|
||||
}
|
||||
.main > div input[type="text"] {
|
||||
padding: 0.3rem 0.4rem;
|
||||
border: 0.08rem solid #03A9F4;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.main > div p {
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
.main > div textarea {
|
||||
padding: 0.4rem;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
border: 0.08rem solid #03A9F4;
|
||||
box-shadow: 0 0 0.4rem rgba(3, 169, 244, 0.2);
|
||||
font-size: 0.9rem;
|
||||
resize: vertical;
|
||||
}
|
||||
.main > div textarea:focus {
|
||||
outline: none;
|
||||
}
|
||||
/* 按钮 */
|
||||
.tool-button {
|
||||
margin: 0.5rem 0 !important;
|
||||
}
|
||||
.tool-button > div {
|
||||
display: inline-block;
|
||||
user-select: none;
|
||||
margin: 0 0.4rem 0 0 !important;
|
||||
padding: 0.4rem 0.9rem;
|
||||
background-color: #03A9F4;
|
||||
text-align: center;
|
||||
font-size: 0.9rem;
|
||||
color: #FFF;
|
||||
border-radius: 0.4rem;
|
||||
box-shadow: 0.2rem 0.2rem 0.4rem rgba(3, 169, 244, 0.4);
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.tool-button > div:hover {
|
||||
background-color: #2196F3;
|
||||
}
|
||||
|
||||
/* 索引 */
|
||||
|
||||
.tool-nav ul li {
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
}
|
||||
.tool-nav ul li a {
|
||||
display: block;
|
||||
float: left;
|
||||
padding: 0.4rem 0.6rem;
|
||||
border-radius: 0.4rem;
|
||||
background-color: #4CAF50;
|
||||
text-decoration: none;
|
||||
font-size: 0.9rem;
|
||||
color: #FFF;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.tool-nav ul li a:hover {
|
||||
background-color: #8BC34A;
|
||||
}
|
||||
.tool-nav-link {
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Unix 时间戳转换 */
|
||||
#tool-unixtime > div {
|
||||
margin: 0.2rem 0;
|
||||
}
|
||||
#tool-unixtime > div > span {
|
||||
display: inline-block;
|
||||
width: 7rem;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
#tool-unixtime > p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
#tool-unixtime input[type="text"] {
|
||||
width: 10rem;
|
||||
}
|
||||
|
||||
/* 计算下载用时 */
|
||||
#tool-downloadtime {
|
||||
|
||||
}
|
||||
#tool-downloadtime-input {
|
||||
|
||||
}
|
||||
#tool-downloadtime-output {
|
||||
|
||||
}
|
||||
#tool-downloadtime-help {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* 简易计算 */
|
||||
|
||||
#tool-calculate textarea {
|
||||
font-size: 1rem;
|
||||
}
|
||||
#tool-calculate-tofixed {
|
||||
width: 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 生成批量下载链接 */
|
||||
|
||||
#tool-genlink-link input[type="text"] {
|
||||
width: 80%;
|
||||
}
|
||||
#tool-genlink-settings > div {
|
||||
margin: 0.4rem 0;
|
||||
}
|
||||
#tool-genlink-settings input[type="text"] {
|
||||
width: 1.5rem;
|
||||
text-align: center;
|
||||
}
|
||||
#tool-genlink-settings input[type="radio"] + label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 生成随机字符串 */
|
||||
|
||||
#genstring-result input[type="text"] {
|
||||
width: 80%;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
/* 新窗口(小窗)中打开 */
|
||||
|
||||
#tool-newwindow > div {
|
||||
margin-bottom: 0.6rem;
|
||||
}
|
||||
#tool-newwindow-link input[type="text"] {
|
||||
width: 80%;
|
||||
}
|
||||
#tool-newwindow-meta input[type="text"] {
|
||||
width: 7rem;
|
||||
}
|
||||
|
||||
/* 运行 JavaScript */
|
||||
|
||||
#tool-runjs textarea {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
/* 返回顶部 */
|
||||
|
||||
.to-top {
|
||||
position: fixed;
|
||||
right: 2rem;
|
||||
bottom: 2rem;
|
||||
height: 3rem;
|
||||
width: 3rem;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 0.6rem 0 rgba(0, 0, 0, 0.1);
|
||||
background-color: #FFF;
|
||||
text-align: center;
|
||||
line-height: 3rem;
|
||||
font-family: monospace;
|
||||
font-size: 1.2rem;
|
||||
color: #2196F3;
|
||||
user-select: none;
|
||||
}
|
||||
.to-top:hover {
|
||||
animation: ToTopAnimation 0.5s ease-in-out;
|
||||
}
|
||||
@@ -1,221 +0,0 @@
|
||||
/*
|
||||
* colors
|
||||
* primary #4cd964
|
||||
* accent #5ac8fa
|
||||
* accent #ff2d55
|
||||
* background #fff
|
||||
* text #222
|
||||
*/
|
||||
|
||||
/* reset */
|
||||
|
||||
* {
|
||||
border-radius: 0;
|
||||
box-sizing: border-box;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
padding: 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: #cbf3b4;
|
||||
}
|
||||
|
||||
/* global */
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
cursor: default;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font: normal 14px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
|
||||
Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
||||
justify-content: center;
|
||||
margin: 4em auto;
|
||||
max-width: calc(100% - 2em);
|
||||
min-height: calc(100vh - 8em);
|
||||
text-transform: lowercase;
|
||||
width: 30em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #4cd964;
|
||||
text-decoration: none;
|
||||
transition: 200ms;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #59e671;
|
||||
}
|
||||
|
||||
a:active {
|
||||
color: #3fcc57;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: 'Consolas', monospace;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #4cd964;
|
||||
font-size: 1.5em;
|
||||
margin-bottom: 2em;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
h2::before {
|
||||
content: '';
|
||||
height: 1px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #5ac8fa;
|
||||
font-size: 1.25em;
|
||||
margin: 2em 0;
|
||||
}
|
||||
|
||||
img {
|
||||
border: none;
|
||||
max-width: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 2em 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: #f6f7f8;
|
||||
display: block;
|
||||
line-height: 1.4;
|
||||
padding: 1em;
|
||||
user-select: text;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table {
|
||||
background: #f6f7f8;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
margin: 2em 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
thead tr {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.025);
|
||||
}
|
||||
|
||||
thead th {
|
||||
color: #ff2d55;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
tbody tr:not(:first-child) {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.025);
|
||||
}
|
||||
|
||||
tbody td {
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 1em;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* layout */
|
||||
|
||||
header,
|
||||
h1 {
|
||||
align-items: center;
|
||||
align-self: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
header h1::before {
|
||||
content: '';
|
||||
background: url('slinky.svg') center no-repeat;
|
||||
background-size: 2em;
|
||||
height: 2em;
|
||||
margin-bottom: 1em;
|
||||
width: 2em;
|
||||
}
|
||||
|
||||
header p {
|
||||
color: gray;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
main {
|
||||
background: #fff;
|
||||
margin: 4em 0;
|
||||
}
|
||||
|
||||
main section:not(:first-child) {
|
||||
margin-top: 4em;
|
||||
}
|
||||
|
||||
footer {
|
||||
color: #999;
|
||||
font-size: 0.875em;
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
footer img {
|
||||
height: 1.5em;
|
||||
}
|
||||
|
||||
/* components */
|
||||
|
||||
#menu {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.loading {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.loading::before {
|
||||
animation: spinner 1s infinite linear;
|
||||
content: '';
|
||||
border: 2px solid transparent;
|
||||
border-top-color: #5ac8fa;
|
||||
border-right-color: #5ac8fa;
|
||||
border-radius: 1em;
|
||||
height: 1.5em;
|
||||
margin-right: 1em;
|
||||
width: 1.5em;
|
||||
}
|
||||
|
||||
/* animations */
|
||||
|
||||
@keyframes spinner {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
.slinky-menu {
|
||||
overflow: hidden;
|
||||
transform: translateZ(0); }
|
||||
.slinky-menu > ul {
|
||||
left: 0;
|
||||
position: relative;
|
||||
transform: translateZ(0); }
|
||||
.slinky-menu ul,
|
||||
.slinky-menu li {
|
||||
list-style: none;
|
||||
margin: 0; }
|
||||
.slinky-menu ul {
|
||||
width: 100%; }
|
||||
.slinky-menu a {
|
||||
align-items: center;
|
||||
display: flex; }
|
||||
.slinky-menu a span {
|
||||
flex: 1;
|
||||
line-height: 1.4; }
|
||||
.slinky-menu li ul {
|
||||
display: none;
|
||||
left: 100%;
|
||||
position: absolute;
|
||||
top: 0; }
|
||||
.slinky-menu .header {
|
||||
display: flex; }
|
||||
.slinky-menu .header .title {
|
||||
flex: 1;
|
||||
line-height: 1.4;
|
||||
margin: 0;
|
||||
order: 1; }
|
||||
|
||||
.slinky-theme-default {
|
||||
background: #f6f7f8; }
|
||||
.slinky-theme-default .title {
|
||||
color: #333;
|
||||
padding: 1em; }
|
||||
.slinky-theme-default li {
|
||||
line-height: 1; }
|
||||
.slinky-theme-default a:not(.back) {
|
||||
color: #333;
|
||||
padding: 1em; }
|
||||
.slinky-theme-default a:not(.back):hover {
|
||||
background: rgba(90, 200, 250, 0.25); }
|
||||
.slinky-theme-default a:not(.back):active {
|
||||
background: rgba(90, 200, 250, 0.5); }
|
||||
.slinky-theme-default .next::after,
|
||||
.slinky-theme-default .back::before {
|
||||
background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+ICAgIDxwYXRoIGQ9Ik0xMi4yMTkgMi4yODFMMTAuNzggMy43MiAxOC4wNjIgMTFIMnYyaDE2LjA2M2wtNy4yODIgNy4yODEgMS40MzggMS40MzggOS05IC42ODctLjcxOS0uNjg3LS43MTl6IiAvPjwvc3ZnPg==) center no-repeat;
|
||||
background-size: 1em;
|
||||
content: '';
|
||||
height: 1em;
|
||||
opacity: 0.25;
|
||||
transition: 200ms;
|
||||
width: 1em; }
|
||||
.slinky-theme-default .next::after {
|
||||
margin-left: 1em; }
|
||||
.slinky-theme-default .back::before {
|
||||
padding: 1em;
|
||||
transform: scaleX(-1); }
|
||||
.slinky-theme-default .next:hover::after,
|
||||
.slinky-theme-default .back:hover::before {
|
||||
opacity: 0.75; }
|
||||
.slinky-theme-default .next:active::after,
|
||||
.slinky-theme-default .back:active::before {
|
||||
opacity: 1; }
|
||||
|
||||
|
||||
/*# sourceMappingURL=slinky.min.css.map*/
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"sources":["webpack:///./src/slinky.scss"],"names":[],"mappings":"AAAA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,cAAc;AACd;AACA,gBAAgB;AAChB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,eAAe;;AAEf;AACA,sBAAsB;AACtB;AACA;AACA,iBAAiB;AACjB;AACA,mBAAmB;AACnB;AACA;AACA,iBAAiB;AACjB;AACA,2CAA2C;AAC3C;AACA,0CAA0C;AAC1C;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,qBAAqB;AACrB;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,kBAAkB;AAClB;AACA;AACA,eAAe","file":"slinky.min.css","sourcesContent":[".slinky-menu {\n overflow: hidden;\n transform: translateZ(0); }\n .slinky-menu > ul {\n left: 0;\n position: relative;\n transform: translateZ(0); }\n .slinky-menu ul,\n .slinky-menu li {\n list-style: none;\n margin: 0; }\n .slinky-menu ul {\n width: 100%; }\n .slinky-menu a {\n align-items: center;\n display: flex; }\n .slinky-menu a span {\n flex: 1;\n line-height: 1.4; }\n .slinky-menu li ul {\n display: none;\n left: 100%;\n position: absolute;\n top: 0; }\n .slinky-menu .header {\n display: flex; }\n .slinky-menu .header .title {\n flex: 1;\n line-height: 1.4;\n margin: 0;\n order: 1; }\n\n.slinky-theme-default {\n background: #f6f7f8; }\n .slinky-theme-default .title {\n color: #333;\n padding: 1em; }\n .slinky-theme-default li {\n line-height: 1; }\n .slinky-theme-default a:not(.back) {\n color: #333;\n padding: 1em; }\n .slinky-theme-default a:not(.back):hover {\n background: rgba(90, 200, 250, 0.25); }\n .slinky-theme-default a:not(.back):active {\n background: rgba(90, 200, 250, 0.5); }\n .slinky-theme-default .next::after,\n .slinky-theme-default .back::before {\n background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+ICAgIDxwYXRoIGQ9Ik0xMi4yMTkgMi4yODFMMTAuNzggMy43MiAxOC4wNjIgMTFIMnYyaDE2LjA2M2wtNy4yODIgNy4yODEgMS40MzggMS40MzggOS05IC42ODctLjcxOS0uNjg3LS43MTl6IiAvPjwvc3ZnPg==) center no-repeat;\n background-size: 1em;\n content: '';\n height: 1em;\n opacity: 0.25;\n transition: 200ms;\n width: 1em; }\n .slinky-theme-default .next::after {\n margin-left: 1em; }\n .slinky-theme-default .back::before {\n padding: 1em;\n transform: scaleX(-1); }\n .slinky-theme-default .next:hover::after,\n .slinky-theme-default .back:hover::before {\n opacity: 0.75; }\n .slinky-theme-default .next:active::after,\n .slinky-theme-default .back:active::before {\n opacity: 1; }\n"],"sourceRoot":""}
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ff2d55">
|
||||
<path d="M16.398 4C14.602 4 13 4.898 12 6.3 11 4.899 9.398 4 7.602 4A5.591 5.591 0 0 0 2 9.602C2 14 12 22 12 22s10-8 10-12.398C22 6.5 19.5 4 16.398 4z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 241 B |
@@ -1,8 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
|
||||
<rect fill="#6BA73C" width="100" height="10"/>
|
||||
<rect fill="#ECAE3C" y="18" width="100" height="10"/>
|
||||
<rect fill="#DB752D" y="36" width="100" height="10"/>
|
||||
<rect fill="#C43935" y="54" width="100" height="10"/>
|
||||
<rect fill="#742F81" y="72" width="100" height="10"/>
|
||||
<rect fill="#3E82CC" y="90" width="100" height="10"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 202 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 1.3 MiB |
@@ -1,19 +0,0 @@
|
||||
// 查找字符 tChar 在 str 中第 num 次出现的位置
|
||||
|
||||
function findChar(str, tChar, num) {
|
||||
var charPos = str.indexOf(tChar);
|
||||
num = num - 1;
|
||||
if (num > 0) {
|
||||
for (var i = 0; i < num; i++) {
|
||||
charPos = str.indexOf(tChar, charPos + 1);
|
||||
}
|
||||
}
|
||||
return charPos;
|
||||
}
|
||||
|
||||
// 返回顶部
|
||||
|
||||
function toTop() {
|
||||
document.body.scrollTop = 0;
|
||||
document.documentElement.scrollTop = 0;
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
/* ---- */
|
||||
/* 变量 */
|
||||
/* ---- */
|
||||
|
||||
// main 中的 A 标签的对象的集合(链接列表)//
|
||||
var LinkList = document.querySelectorAll("main a");
|
||||
|
||||
// 查找面板 //
|
||||
var SearchMode = 1;
|
||||
var SearchPanel = document.querySelector(".search-panel"); // 查找面板
|
||||
var SearchInput = document.querySelector(".search-input"); // 查找输入框
|
||||
var SearchResultTitle = document.querySelector("#search-result-title"); // 查找结果(标题)
|
||||
var SearchResultLink = document.querySelector("#search-result-link"); // 查找结果(链接)
|
||||
var SearchResultItem = "";
|
||||
|
||||
// 搜索引擎 //
|
||||
var SearchEngineBaidu = document.querySelector("#search-engine-baidu"); // 百度
|
||||
var SearchEngineBing = document.querySelector("#search-engine-bing"); // Bing
|
||||
var SearchEngineGoogle = document.querySelector("#search-engine-google"); // Google
|
||||
var SearchEnginebilibili = document.querySelector("#search-engine-bilibili"); // bilibili
|
||||
|
||||
// 工具面板 //
|
||||
var ToolPanel = document.querySelector(".tool-panel");
|
||||
|
||||
|
||||
/* ---- */
|
||||
/* 函数 */
|
||||
/* ---- */
|
||||
|
||||
/* 链接查找 */
|
||||
|
||||
function searchLink() {
|
||||
var LinkListCount = LinkList.length; // 循环次数
|
||||
var SearchWord = SearchInput.value.toLowerCase(); // 查找关键词
|
||||
if (SearchMode == 1 && SearchWord != "") {
|
||||
SearchResultTitle.innerHTML = ""; // 清空查找结果(标题)
|
||||
SearchResultLink.innerHTML = ""; // 清空查找结果(链接)
|
||||
for (var i = 0; i < LinkListCount; i++) {
|
||||
// 排除 href 是 # 的元素 //
|
||||
if (LinkList[i].href.endsWith("#") == false) {
|
||||
// 匹配关键词 //
|
||||
if (LinkList[i].innerHTML.toLowerCase().indexOf(SearchWord) != -1) {
|
||||
// 匹配标题 //
|
||||
SearchResultItem = LinkList[i].cloneNode(true);
|
||||
SearchResultTitle.appendChild(SearchResultItem); // 复制元素
|
||||
} else if (LinkList[i].href.indexOf(SearchWord) != -1) {
|
||||
// 匹配链接 //
|
||||
SearchResultItem = LinkList[i].cloneNode(true);
|
||||
SearchResultLink.appendChild(SearchResultItem); // 复制元素
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (SearchMode == 1 && SearchWord == "") {
|
||||
SearchResultTitle.innerHTML = "";
|
||||
SearchResultLink.innerHTML = "未输入关键词";
|
||||
} else if (SearchMode == 2) {
|
||||
SearchInput.value = ""; // 清空输入框
|
||||
SearchResultTitle.innerHTML = ""; // 清空查找结果(标题)
|
||||
SearchResultLink.innerHTML = ""; // 清空查找结果(链接)
|
||||
SearchPanel.style.visibility = "hidden"; // 隐藏查找面板
|
||||
} else {
|
||||
SearchResultTitle.innerHTML = "";
|
||||
SearchResultLink.innerHTML = "异常";
|
||||
}
|
||||
}
|
||||
|
||||
/* 搜索引擎 */
|
||||
|
||||
// 搜索 //
|
||||
function searchWeb() {
|
||||
var GetSearchWord = document.querySelector("#search-engine-input"); // 关键词输入框
|
||||
var SearchWord = GetSearchWord.value; // 关键词
|
||||
if (SearchEngineBaidu.checked == true) {
|
||||
window.open("https://www.baidu.com/s?ie=UTF-8&wd=" + SearchWord);
|
||||
} else if (SearchEngineBing.checked == true) {
|
||||
window.open("https://cn.bing.com/search?q=" + SearchWord);
|
||||
} else if (SearchEngineGoogle.checked == true) {
|
||||
window.open("https://www.google.com/search?q=" + SearchWord);
|
||||
} else if (SearchEnginebilibili.checked == true) {
|
||||
window.open("https://search.bilibili.com/all" + "?keyword=" + SearchWord);
|
||||
} else {
|
||||
GetSearchWord.value = "搜索引擎选择有误!"
|
||||
}
|
||||
}
|
||||
|
||||
// 储存当前搜索引擎 //
|
||||
function setSearchEngine(Name) {
|
||||
switch (Name)
|
||||
{
|
||||
case "baidu":
|
||||
localStorage.setItem("SearchEngine", "baidu");
|
||||
break;
|
||||
case "bing":
|
||||
localStorage.setItem("SearchEngine", "bing");
|
||||
break;
|
||||
case "google":
|
||||
localStorage.setItem("SearchEngine", "google");
|
||||
break;
|
||||
case "bilibili":
|
||||
localStorage.setItem("SearchEngine", "bilibili");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 设置当前搜索引擎 //
|
||||
function getSearchEngine() {
|
||||
var SearchEngine = localStorage.getItem("SearchEngine");
|
||||
switch (SearchEngine){
|
||||
case "baidu":
|
||||
SearchEngineBaidu.checked = true;
|
||||
break;
|
||||
case "bing":
|
||||
SearchEngineBing.checked = true;
|
||||
break;
|
||||
case "google":
|
||||
SearchEngineGoogle.checked = true;
|
||||
break;
|
||||
case "bilibili":
|
||||
SearchEnginebilibili.checked = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
getSearchEngine();
|
||||
|
||||
/* 工具面板 */
|
||||
|
||||
// 显示 //
|
||||
function showToolPanel() {
|
||||
ToolPanel.style.display = "block";
|
||||
}
|
||||
|
||||
// 关闭 //
|
||||
function closeToolPanel() {
|
||||
ToolPanel.style.bottom = "-110%";
|
||||
ToolPanel.style.opacity = "0";
|
||||
setTimeout(function () {
|
||||
ToolPanel.style.display = "none";
|
||||
ToolPanel.style.bottom = "0";
|
||||
ToolPanel.style.opacity = "1";
|
||||
}, 500);
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
var LinkList=document.querySelectorAll("main a");var SearchMode=1;var SearchPanel=document.querySelector(".search-panel");var SearchInput=document.querySelector(".search-input");var SearchResultTitle=document.querySelector("#search-result-title");var SearchResultLink=document.querySelector("#search-result-link");var SearchResultItem="";var SearchEngineBaidu=document.querySelector("#search-engine-baidu");var SearchEngineBing=document.querySelector("#search-engine-bing");var SearchEngineGoogle=document.querySelector("#search-engine-google");var SearchEnginebilibili=document.querySelector("#search-engine-bilibili");var ToolPanel=document.querySelector(".tool-panel");function findChar(str,tChar,num){var charPos=str.indexOf(tChar);num=num-1;if(num>0){for(var i=0;i<num;i++){charPos=str.indexOf(tChar,charPos+1)}}return charPos}function searchLink(){var LinkListCount=LinkList.length;var SearchWord=SearchInput.value.toLowerCase();if(SearchMode==1&&SearchWord!=""){SearchResultTitle.innerHTML="";SearchResultLink.innerHTML="";for(var i=0;i<LinkListCount;i++){if(LinkList[i].href.endsWith("#")==false){if(LinkList[i].innerHTML.toLowerCase().indexOf(SearchWord)!=-1){SearchResultItem=LinkList[i].cloneNode(true);SearchResultTitle.appendChild(SearchResultItem)}else if(LinkList[i].href.indexOf(SearchWord)!=-1){SearchResultItem=LinkList[i].cloneNode(true);SearchResultLink.appendChild(SearchResultItem)}}}}else if(SearchMode==1&&SearchWord==""){SearchResultTitle.innerHTML="";SearchResultLink.innerHTML="未输入关键词"}else if(SearchMode==2){SearchInput.value="";SearchResultTitle.innerHTML="";SearchResultLink.innerHTML="";SearchPanel.style.visibility="hidden"}else{SearchResultTitle.innerHTML="";SearchResultLink.innerHTML="异常"}}function searchWeb(){var GetSearchWord=document.querySelector("#search-engine-input");var SearchWord=GetSearchWord.value;if(SearchEngineBaidu.checked==true){window.open("https://www.baidu.com/s?ie=UTF-8&wd="+SearchWord)}else if(SearchEngineBing.checked==true){window.open("https://cn.bing.com/search?q="+SearchWord)}else if(SearchEngineGoogle.checked==true){window.open("https://www.google.com/search?q="+SearchWord)}else if(SearchEnginebilibili.checked==true){window.open("https://search.bilibili.com/all"+"?keyword="+SearchWord)}else{GetSearchWord.value="搜索引擎选择有误!"}}function setSearchEngine(Name){switch(Name){case"baidu":localStorage.setItem("SearchEngine","baidu");break;case"bing":localStorage.setItem("SearchEngine","bing");break;case"google":localStorage.setItem("SearchEngine","google");break;case"bilibili":localStorage.setItem("SearchEngine","bilibili");break;default:break}}function getSearchEngine(){var SearchEngine=localStorage.getItem("SearchEngine");switch(SearchEngine){case"baidu":SearchEngineBaidu.checked=true;break;case"bing":SearchEngineBing.checked=true;break;case"google":SearchEngineGoogle.checked=true;break;case"bilibili":SearchEnginebilibili.checked=true;break;default:break}}getSearchEngine();function showToolPanel(){ToolPanel.style.display="block"}function closeToolPanel(){ToolPanel.style.bottom="-110%";ToolPanel.style.opacity="0";setTimeout(function(){ToolPanel.style.display="none";ToolPanel.style.bottom="0";ToolPanel.style.opacity="1"},500)}
|
||||
@@ -1,52 +0,0 @@
|
||||
// Slinky 插件的设置 //
|
||||
var SlinkyOption = {
|
||||
title: true,
|
||||
speed: 400
|
||||
};
|
||||
|
||||
var ListIDPrefix = '#list_'; // 列表 ID 前缀(自定义)
|
||||
var ListCount = 0;
|
||||
var ListCountMax = 17; // 列表总数(自定义)
|
||||
var FullsSreenText = document.querySelector('.fullscreen-text');
|
||||
|
||||
// 链接 //
|
||||
var Links = {};
|
||||
|
||||
// 设置 target = '_blank' //
|
||||
function setTarget() {
|
||||
for (var i = 0; i < LinkList.length; i++) {
|
||||
if (LinkList[i].href.endsWith('#') == false) {
|
||||
LinkList[i].target = '_blank';
|
||||
/* 自动加图标(暂不使用;可使用 LazyLoad)
|
||||
var slashPos = findChar(LinkList[i].href, '/', 3);
|
||||
getFavicon = 'https://www.google.cn/s2/favicons?domain=' + LinkList[i].href.substring(0, slashPos);
|
||||
var imgTag = '<img src="' + getFavicon + '" />';
|
||||
LinkList[i].insertAdjacentHTML('beforeBegin', imgTag);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 显示列表 //
|
||||
function displayList() {
|
||||
document.querySelector('main').style.opacity = '1';
|
||||
FullsSreenText.style.opacity = '0';
|
||||
setTimeout(function () {
|
||||
document.querySelector('.fullscreen-text').style.display = 'none';
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 加载列表 //
|
||||
function loadList() {
|
||||
ListCount = ListCount + 1;
|
||||
$(ListIDPrefix + ListCount).slinky(SlinkyOption);
|
||||
FullsSreenText.innerHTML = '已加载 ' + ListCount + ' 个分类';
|
||||
// 加载完毕 //
|
||||
if (ListCount == ListCountMax) {
|
||||
clearInterval(iLoadList);
|
||||
FullsSreenText.innerHTML = '加载完毕';
|
||||
setTarget();
|
||||
displayList();
|
||||
}
|
||||
}
|
||||
var iLoadList = setInterval('loadList()', 100);
|
||||
@@ -1,487 +0,0 @@
|
||||
/* ---- */
|
||||
/* 变量 */
|
||||
/* ---- */
|
||||
|
||||
var Settings = {
|
||||
// 全局 //
|
||||
Global: {
|
||||
FontSize: localStorage.getItem("SettingFont") // 字体大小
|
||||
},
|
||||
// 工具 //
|
||||
Tool: {
|
||||
// 生成随机字符串 //
|
||||
GenString: {
|
||||
length: "8", // 长度
|
||||
hasNum: true, // 包含数字
|
||||
hasChar: false, // 包含字母
|
||||
hasSymbol: false, // 包含其他符号
|
||||
caseSense: true, // 包含大小写
|
||||
lowerCase: false // 全小写
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- */
|
||||
/* 函数 */
|
||||
/* ---- */
|
||||
|
||||
/* 设置 */
|
||||
|
||||
// 字体大小 //
|
||||
function toolSettingsFont(mode) {
|
||||
var RootEle = document.querySelector("html");
|
||||
var Input = document.querySelector(".tool-setting-font p input");
|
||||
var Output = document.querySelector(".tool-setting-font p label");
|
||||
switch (mode){
|
||||
// 重置 //
|
||||
case "reset":
|
||||
Settings.Global.FontSize = "16";
|
||||
localStorage.setItem("SettingFont", Settings.Global.FontSize);
|
||||
Output.innerHTML = Input.value = Settings.Global.FontSize;
|
||||
RootEle.style.fontSize = Settings.Global.FontSize + "px";
|
||||
break;
|
||||
// 获取 //
|
||||
case "get":
|
||||
if (Settings.Global.FontSize == null) {
|
||||
toolSettingsFont("reset");
|
||||
}
|
||||
Output.innerHTML = Input.value = Settings.Global.FontSize;
|
||||
RootEle.style.fontSize = Settings.Global.FontSize + "px";
|
||||
break;
|
||||
// 显示数值 //
|
||||
case "show":
|
||||
Output.innerHTML = Input.value;
|
||||
break;
|
||||
// 设置 //
|
||||
case "set":
|
||||
Settings.Global.FontSize = Input.value;
|
||||
localStorage.setItem("SettingFont", Settings.Global.FontSize);
|
||||
RootEle.style.fontSize = Settings.Global.FontSize + "px";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Unix 时间戳转换 */
|
||||
|
||||
// 将传入的时间转换为时间戳 //
|
||||
function toolUnixTimeToUnix(GetTime, isMillisecond) {
|
||||
var Time = new Date(); // 创建 Date 对象
|
||||
// 根据 GetTime 设置时间 //
|
||||
Time.setFullYear(GetTime.substring(0, 4)); // GetTime 的子串:年
|
||||
Time.setMonth(GetTime.substring(5, 7) - 1); // GetTime 的子串:月
|
||||
Time.setDate(GetTime.substring(8, 10)); // GetTime 的子串:日
|
||||
Time.setHours(GetTime.substring(11, 13)); // GetTime 的子串:时
|
||||
Time.setMinutes(GetTime.substring(14, 16)); // GetTime 的子串:分
|
||||
Time.setSeconds(GetTime.substring(17, 19)); // GetTime 的子串:秒
|
||||
// 调试 //
|
||||
// console.log("时间:" + Time);
|
||||
// 根据 isMillisecond 确认输出的单位
|
||||
if (isMillisecond == false) {
|
||||
// 模式:秒 //
|
||||
var TextLength = Time.getTime().toString().length; // 获取字符串长度
|
||||
return Time.getTime().toString().substring(0, TextLength - 3); // 返回时间戳
|
||||
} else if (isMillisecond == true) {
|
||||
// 模式:毫秒 //
|
||||
var TextLength = Time.getTime().toString().length; // 获取字符串长度
|
||||
return Time.getTime().toString().substring(0, TextLength - 3) + "000"; // 返回时间戳
|
||||
} else {
|
||||
return "模式有误!";
|
||||
}
|
||||
}
|
||||
|
||||
// 将传入的时间戳转换为时间 //
|
||||
function toolUnixTimeToTime(GetUnix, isMillisecond) {
|
||||
var Time = new Date(); // 创建 Date 对象
|
||||
// 根据 isMillisecond 确认输入的单位
|
||||
if (isMillisecond == false) {
|
||||
// 模式:秒 //
|
||||
GetUnix = GetUnix + "000"; // 补零变为毫秒
|
||||
Time.setTime(GetUnix); // 根据 GetUnix 设置时间
|
||||
} else if (isMillisecond == true) {
|
||||
// 模式:毫秒 //
|
||||
Time.setTime(GetUnix); // 根据 GetUnix 设置时间
|
||||
} else {
|
||||
Time.setTime("0"); // 把时间设置为 0
|
||||
}
|
||||
var TimeYear = Time.getFullYear(); // 年
|
||||
var TimeMonth = Time.getMonth() + 1; // 月
|
||||
// 补零 //
|
||||
if (TimeMonth < 10) {
|
||||
TimeMonth = "0" + TimeMonth;
|
||||
}
|
||||
var TimeDate = Time.getDate(); // 日
|
||||
// 补零 //
|
||||
if (TimeDate < 10) {
|
||||
TimeDate = "0" + TimeDate;
|
||||
}
|
||||
var TimeHour = Time.getHours(); // 时
|
||||
// 补零 //
|
||||
if (TimeHour < 10) {
|
||||
TimeHour = "0" + TimeHour;
|
||||
}
|
||||
var TimeMinute = Time.getMinutes(); // 分
|
||||
// 补零 //
|
||||
if (TimeMinute < 10) {
|
||||
TimeMinute = "0" + TimeMinute;
|
||||
}
|
||||
var TimeSecond = Time.getSeconds(); // 秒
|
||||
// 补零 //
|
||||
if (TimeSecond < 10) {
|
||||
TimeSecond = "0" + TimeSecond;
|
||||
}
|
||||
// 返回:年-月-日 时:分:秒 //
|
||||
return TimeYear + "-" + TimeMonth + "-" + TimeDate + " " + TimeHour + ":" + TimeMinute + ":" + TimeSecond;
|
||||
}
|
||||
|
||||
// 当前 //
|
||||
function toolUnixTimeNow() {
|
||||
var GetInputA = document.getElementById("tool-unixtime-input-a").getElementsByTagName("input")[0]; // 输入框 A
|
||||
var GetInputB = document.getElementById("tool-unixtime-input-b").getElementsByTagName("input")[0]; // 输入框 B
|
||||
var GetSettingAA = document.getElementById("unixtime-setting-aa").checked; // A 模式:秒
|
||||
var GetSettingAB = document.getElementById("unixtime-setting-ab").checked; // A 模式:毫秒
|
||||
var GetSettingBA = document.getElementById("unixtime-setting-ba").checked; // B 模式:秒
|
||||
var GetSettingBB = document.getElementById("unixtime-setting-bb").checked; // B 模式:毫秒
|
||||
// 调用函数,获取时间 //
|
||||
if (GetSettingAA == true) {
|
||||
var Time = new Date(); // 创建 Date 对象
|
||||
var TextLength = Time.getTime().toString().length; // 获取字符串长度
|
||||
GetInputA.value = Time.getTime().toString().substring(0, TextLength - 3); // 时间戳(秒)
|
||||
} else if (GetSettingAB == true) {
|
||||
GetInputA.value = new Date().getTime(); // 时间戳(毫秒)
|
||||
}
|
||||
GetInputB.value = toolUnixTimeToTime(new Date().getTime(), true); // 时间
|
||||
}
|
||||
|
||||
// 转换 //
|
||||
function toolUnixTimeSubmit() {
|
||||
var GetInputA = document.getElementById("tool-unixtime-input-a").getElementsByTagName("input")[0]; // 输入框 A
|
||||
var GetInputB = document.getElementById("tool-unixtime-input-b").getElementsByTagName("input")[0]; // 输入框 B
|
||||
var GetOutputA = document.getElementById("tool-unixtime-output-a").getElementsByTagName("input")[0]; // 输出框 A
|
||||
var GetOutputB = document.getElementById("tool-unixtime-output-b").getElementsByTagName("input")[0]; // 输出框 B
|
||||
var GetSettingAA = document.getElementById("unixtime-setting-aa").checked; // A 模式:秒
|
||||
var GetSettingAB = document.getElementById("unixtime-setting-ab").checked; // A 模式:毫秒
|
||||
var GetSettingBA = document.getElementById("unixtime-setting-ba").checked; // B 模式:秒
|
||||
var GetSettingBB = document.getElementById("unixtime-setting-bb").checked; // B 模式:毫秒
|
||||
// 调用函数,转换时间 //
|
||||
if (GetSettingAA == true) {
|
||||
// 秒 //
|
||||
GetOutputA.value = toolUnixTimeToTime(GetInputA.value, false); // 转换为时间
|
||||
} else if (GetSettingAB == true) {
|
||||
// 毫秒 //
|
||||
GetOutputA.value = toolUnixTimeToTime(GetInputA.value, GetSettingAB); // 转换为时间
|
||||
}
|
||||
GetOutputB.value = toolUnixTimeToUnix(GetInputB.value, GetSettingBB); // 转换为时间戳
|
||||
}
|
||||
|
||||
// 按钮:重置 //
|
||||
function toolUnixTimeClear() {
|
||||
document.querySelector("#tool-unixtime-input-a input").value = ''; // 清空输入框 A
|
||||
document.querySelector("#tool-unixtime-input-b input").value = ''; // 清空输入框 B
|
||||
document.querySelector("#tool-unixtime-output-a input").value = ''; // 清空输出框 A
|
||||
document.querySelector("#tool-unixtime-output-b input").value = ''; // 清空输出框 B
|
||||
}
|
||||
|
||||
/* 计算 */
|
||||
|
||||
function toolCalculateSubmit() {
|
||||
GetInput = document.getElementById("tool-calculate-input"); // 算式输入框
|
||||
GetToFixed = document.getElementById("tool-calculate-tofixed"); // 保留小数点后的位数
|
||||
GetResult = document.getElementById("tool-calculate-result").getElementsByTagName("span")[0]; // 结果
|
||||
GetCal = GetInput.value; // 获取输入的算式
|
||||
GetCal = GetCal.replace(/π/g, "Math.PI"); // 替换(圆周率,Math.PI)
|
||||
GetCal = GetCal.replace(/幂/g, "Math.pow"); // 替换(乘方运算,Math.pow)
|
||||
GetCal = GetCal.replace(/平方根/g, "Math.sqrt"); // 替换(乘方运算,Math.pow)
|
||||
// 运行 //
|
||||
if (GetToFixed.value >= 0 && GetToFixed.value <= 16) {
|
||||
GetResult.innerText = eval(GetCal).toFixed(GetToFixed.value);
|
||||
} else {
|
||||
GetResult.innerText = "保留位数有误(0 ~ 16 之间)";
|
||||
}
|
||||
}
|
||||
|
||||
function toolCalculateClear() {
|
||||
GetInput = document.getElementById("tool-calculate-input"); // 算式输入框
|
||||
GetInput.value = ''; // 清空“输入框”和“结果”
|
||||
GetResult.innerText = ''; // 清空“结果”
|
||||
}
|
||||
|
||||
/* 生成批量下载链接 */
|
||||
|
||||
function toolGenLinkSubmit() {
|
||||
var VarText = "(*)"; // 变量表示
|
||||
var BaseLink = document.getElementById("tool-genlink-link").getElementsByTagName("input")[0].value; // 网址
|
||||
var GetSettingType = document.getElementsByName("genlink-settings"); // 批量变化类型
|
||||
// 设定 //
|
||||
var GetSettingA = document.getElementById("tool-genlink-settings-a").getElementsByTagName("input"); // 等差数列
|
||||
var GetSettingB = document.getElementById("tool-genlink-settings-b").getElementsByTagName("input"); // 等比数列
|
||||
var GetSettingC = document.getElementById("tool-genlink-settings-c").getElementsByTagName("input"); // 字母变化
|
||||
// 结果 //
|
||||
var GetResult = document.getElementById("tool-genlink-result");
|
||||
var LinkReplace = '';
|
||||
var LinkResult = '';
|
||||
// 自动补零 //
|
||||
function AddZero() {
|
||||
if (NumLength < NumLastLength) {
|
||||
var ZeroMax = NumLastLength - NumLength; // 自动补零的个数
|
||||
// 自动补 0 //
|
||||
for (let i = 1; i <= ZeroMax; i++) {
|
||||
Num = "0" + Num;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 替换变量;替换变量;判断是否开启倒序;拼接结果;拼接结果 //
|
||||
function CheckReverse() {
|
||||
LinkReplace = BaseLink.replace(VarText, Num); // 替换链接中的变量为当前值(VarText 替换为 Num)
|
||||
if (GetReverse == false) {
|
||||
// console.log("非倒序");
|
||||
LinkResult = LinkResult + LinkReplace + "\n"; // 拼接结果
|
||||
} else if (GetReverse == true) {
|
||||
// console.log("倒序");
|
||||
LinkResult = LinkReplace + "\n" + LinkResult; // 拼接结果
|
||||
}
|
||||
}
|
||||
// 运行 //
|
||||
if (GetSettingType[0].checked == true) {
|
||||
// 等差数列 //
|
||||
// console.log("等差数列");
|
||||
var GetFirst = parseInt(GetSettingA[1].value); // 首项
|
||||
var GetLength = parseInt(GetSettingA[2].value); // 项数
|
||||
var GetDiff = parseInt(GetSettingA[3].value); // 公差
|
||||
var GetZero = GetSettingA[4].checked; // 补零
|
||||
var GetReverse = GetSettingA[5].checked; // 倒序
|
||||
// 判断是否开启补零 //
|
||||
if (GetZero == true) {
|
||||
// 等差数列 补零 //
|
||||
// console.log("等差数列 补零");
|
||||
var Num; // 当前项的值
|
||||
var NumLength; // 当前项的值的位数
|
||||
var NumLast = GetFirst + (GetLength - 1) * GetDiff; // 根据等差数列通项公式计算末项的值
|
||||
var NumLastLength = NumLast.toString().length; // 末项的值的位数
|
||||
// console.log("末项的值:" + NumLast);
|
||||
for (var i = 1; i <= GetLength; i++) {
|
||||
Num = GetFirst + (i - 1) * GetDiff; // 根据等差数列通项公式计算当前项的值
|
||||
NumLength = Num.toString().length; // 当前项的值的位数
|
||||
AddZero(); // 若位数不足,自动补零
|
||||
CheckReverse(); // 替换变量;判断是否开启倒序;拼接结果
|
||||
}
|
||||
} else if (GetZero == false) {
|
||||
// 等差数列 不补零 //
|
||||
// console.log("等差数列 不补零");
|
||||
var Num; // 当前项的值
|
||||
for (var i = 1; i <= GetLength; i++) {
|
||||
Num = GetFirst + (i - 1) * GetDiff; // 根据等差数列通项公式计算当前项的值
|
||||
CheckReverse(); // 替换变量;判断是否开启倒序;拼接结果
|
||||
}
|
||||
}
|
||||
} else if (GetSettingType[1].checked == true) {
|
||||
// 等比数列 //
|
||||
var GetFirst = parseInt(GetSettingB[1].value); // 首项
|
||||
var GetLength = parseInt(GetSettingB[2].value); // 项数
|
||||
var GetDiff = parseInt(GetSettingB[3].value); // 公比
|
||||
var GetZero = GetSettingB[4].checked; // 补零
|
||||
var GetReverse = GetSettingB[5].checked; // 倒序
|
||||
// 判断是否开启补零 //
|
||||
if (GetZero == true) {
|
||||
// 等比数列 补零 //
|
||||
// console.log("等比数列 补零");
|
||||
var Num; // 当前项的值
|
||||
var NumLength; // 当前项的值的位数
|
||||
var NumLast = GetFirst * Math.pow(GetDiff, (GetLength - 1)); // 根据等比数列通项公式计算末项的值
|
||||
var NumLastLength = NumLast.toString().length; // 末项的值的位数
|
||||
// console.log("末项的值:" + NumLast);
|
||||
for (var i = 1; i <= GetLength; i++) {
|
||||
Num = GetFirst * Math.pow(GetDiff, (i - 1)); // 根据等比数列通项公式计算当前项的值
|
||||
NumLength = Num.toString().length; // 当前项的值的位数
|
||||
AddZero(); // 若位数不足,自动补零
|
||||
CheckReverse(); // 替换变量;判断是否开启倒序;拼接结果
|
||||
}
|
||||
} else if (GetZero == false) {
|
||||
// 等比数列 不补零 //
|
||||
// console.log("等比数列 不补零");
|
||||
var Num; // 当前项的值
|
||||
for (var i = 1; i <= GetLength; i++) {
|
||||
Num = GetFirst * Math.pow(GetDiff, (i - 1)); // 根据等比数列通项公式计算当前项的值
|
||||
CheckReverse(); // 替换变量;判断是否开启倒序;拼接结果
|
||||
}
|
||||
}
|
||||
} else if (GetSettingType[2].checked == true) {
|
||||
// 字母变化 //
|
||||
var GetFirst = GetSettingC[1].value.charCodeAt(0); // 从(获取对应字母的 Unicode 编码)
|
||||
var GetLast = GetSettingC[2].value.charCodeAt(0); // 到(获取对应字母的 Unicode 编码)
|
||||
var GetReverse = GetSettingC[3].checked; // 倒序
|
||||
// console.log("从:" + GetFirst);
|
||||
// console.log("到:" + GetLast);
|
||||
// console.log("倒序:" + GetReverse);
|
||||
if (GetFirst >= 65 && GetFirst <= 122 && GetLast >= 65 && GetLast <= 122) {
|
||||
if (GetFirst < GetLast) {
|
||||
for (var i = GetFirst; i <= GetLast; i++) {
|
||||
if (i >= 91 && i <= 96) {
|
||||
continue; // 若为 [ \ ] ^ _ ` 则跳出循环
|
||||
}
|
||||
Num = String.fromCharCode(i); // 获取对应 Unicode 编码的字母
|
||||
CheckReverse(); // 替换变量;判断是否开启倒序;拼接结果
|
||||
}
|
||||
} else if (GetFirst > GetLast) {
|
||||
GetResult.placeholder = "字母先后顺序有误。\n请按此顺序填写:\nA - Z a - z\n例如:\n从 a 到 d\n从 A 到 D\n从 X 到 g";
|
||||
} else if (GetFirst == GetLast) {
|
||||
GetResult.placeholder = "仅有 1 条链接,无需生成。";
|
||||
} else {
|
||||
GetResult.placeholder = "异常。";
|
||||
}
|
||||
} else {
|
||||
GetResult.placeholder = "超出范围。";
|
||||
}
|
||||
} else {
|
||||
// 异常 //
|
||||
GetResult.placeholder = "类型选择有误";
|
||||
}
|
||||
GetResult.value = LinkResult; // 输出批量结果
|
||||
}
|
||||
|
||||
function toolGenLinkClear() {
|
||||
var GetResult = document.getElementById("tool-genlink-result");
|
||||
GetResult.value = ''; // 清空结果
|
||||
GetResult.placeholder = "结果";
|
||||
}
|
||||
|
||||
/*
|
||||
* 生成随机字符串
|
||||
*
|
||||
* 来源:https://www.cnblogs.com/hankuksui/p/9892729.html
|
||||
*
|
||||
* 033 - 047:! - /
|
||||
* 048 - 057:0 - 9
|
||||
* 058 - 064:: - @
|
||||
* 065 - 090:A - Z
|
||||
* 091 - 096:[ - `
|
||||
* 097 - 122:a - z
|
||||
* 123 - 127:{ -
|
||||
*
|
||||
* @param length 长度
|
||||
* @param hasNum 是否包含数字
|
||||
* @param hasChar 是否包含字母
|
||||
* @param hasSymbol 是否包含其他符号
|
||||
* @param caseSense 是否包含大小写
|
||||
* @param lowerCase 是否全小写,当 caseSense 为 false 时起作用
|
||||
*/
|
||||
|
||||
function toolGenString(length, hasNum, hasChar, hasSymbol, caseSense, lowerCase) {
|
||||
var m = "请选中数字、字母或其他符号的其中一项!";
|
||||
if (hasNum == false && hasChar == false && hasSymbol == false) {
|
||||
return m;
|
||||
}
|
||||
m = "";
|
||||
for (var i = length; i > 0; i--) {
|
||||
var num = Math.floor((Math.random() * 94) + 33);
|
||||
if (
|
||||
(
|
||||
(hasNum == false) && ((num >= 48) && (num <= 57))
|
||||
) || (
|
||||
(hasChar == false) && ((
|
||||
(num >= 65) && (num <= 90)
|
||||
) || (
|
||||
(num >= 97) && (num <= 122)
|
||||
))
|
||||
) || (
|
||||
(hasSymbol == false) && ((
|
||||
(num >= 33) && (num <= 47)
|
||||
) || (
|
||||
(num >= 58) && (num <= 64)
|
||||
) || (
|
||||
(num >= 91) && (num <= 96)
|
||||
) || (
|
||||
(num >= 123) && (num <= 127)
|
||||
))
|
||||
)
|
||||
) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
m += String.fromCharCode(num);
|
||||
}
|
||||
if (caseSense == false) {
|
||||
m = (lowerCase == false) ? m.toUpperCase() : m.toLowerCase();
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
function toolGenStringSettings(name) {
|
||||
var InputSettings = document.querySelectorAll("#genstring-settings p input");
|
||||
var ObjSettings = Settings.Tool.GenString;
|
||||
switch (name){
|
||||
case "length":
|
||||
ObjSettings.length = InputSettings[0].value;
|
||||
break;
|
||||
case "hasNum":
|
||||
ObjSettings.hasNum = InputSettings[1].checked;
|
||||
break;
|
||||
case "hasChar":
|
||||
ObjSettings.hasChar = InputSettings[2].checked;
|
||||
break;
|
||||
case "hasSymbol":
|
||||
ObjSettings.hasSymbol = InputSettings[3].checked;
|
||||
break;
|
||||
case "caseSense":
|
||||
ObjSettings.caseSense = InputSettings[4].checked;
|
||||
break;
|
||||
case "lowerCase":
|
||||
ObjSettings.lowerCase = InputSettings[5].checked;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function toolGenStringSubmit() {
|
||||
var Result = document.querySelector("#genstring-result input");
|
||||
var ObjSettings = Settings.Tool.GenString;
|
||||
var Str = toolGenString(ObjSettings.length, ObjSettings.hasNum, ObjSettings.hasChar, ObjSettings.hasSymbol, ObjSettings.caseSense, ObjSettings.lowerCase);
|
||||
Result.value = Str;
|
||||
}
|
||||
|
||||
/* 新窗口(小窗)中打开 */
|
||||
|
||||
function toolNewWindowSubmit() {
|
||||
var link = document.querySelector("#tool-newwindow-link input").value; // 网址
|
||||
var width = document.querySelectorAll("#tool-newwindow-meta input")[0].value; // 宽度
|
||||
var height = document.querySelectorAll("#tool-newwindow-meta input")[1].value; // 高度
|
||||
if (width == "") {
|
||||
width = 400;
|
||||
}
|
||||
if (height == "") {
|
||||
height = 300;
|
||||
}
|
||||
window.open(link, "_blank", "height=" + height + ", width=" + width + ", toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=yes, status=yes");
|
||||
}
|
||||
|
||||
function toolNewWindowClear() {
|
||||
document.querySelector("#tool-newwindow-link input").value = ""; // 网址
|
||||
document.querySelectorAll("#tool-newwindow-meta input")[0].value = ""; // 宽度
|
||||
document.querySelectorAll("#tool-newwindow-meta input")[1].value = ""; // 高度
|
||||
}
|
||||
|
||||
/* 运行 JavaScript */
|
||||
|
||||
function toolRunJSSubmit() {
|
||||
var GetCode = document.querySelector("#tool-runjs-input"); // 代码输入框
|
||||
eval(GetCode.value); // 运行
|
||||
}
|
||||
|
||||
function toolRunJSClear() {
|
||||
var GetCode = document.querySelector("#tool-runjs-input"); // 代码输入框
|
||||
GetCode.value = ''; // 清空
|
||||
}
|
||||
|
||||
/* ---- */
|
||||
/* 事件 */
|
||||
/* ---- */
|
||||
|
||||
|
||||
|
||||
/* ---- */
|
||||
/* 调用 */
|
||||
/* ---- */
|
||||
|
||||
toolSettingsFont("get"); // 读取字体大小
|
||||
@@ -1,8 +0,0 @@
|
||||
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),e.exports=n(2)},function(e,t){function n(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}
|
||||
/*
|
||||
* Slinky
|
||||
* Rather sweet menus
|
||||
* @author Ali Zahid <ali.zahid@live.com>
|
||||
* @license MIT
|
||||
*/var a=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.settings=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(r,!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},this.options,{},r),this._init(t)}return s(e,[{key:"options",get:function(){return{resize:!0,speed:300,theme:"slinky-theme-default",title:!1}}}]),s(e,[{key:"_init",value:function(e){this.menu=jQuery(e),this.base=this.menu.children().first();var t=this.menu,n=this.settings;t.addClass("slinky-menu").addClass(n.theme),this._transition(n.speed),jQuery("a + ul",t).prev().addClass("next"),jQuery("li > a",t).wrapInner("<span>");var i=jQuery("<li>").addClass("header");jQuery("li > ul",t).prepend(i);var r=jQuery("<a>").prop("href","#").addClass("back");jQuery(".header",t).prepend(r),n.title&&jQuery("li > ul",t).each(function(e,t){var n=jQuery(t).parent().find("a").first().text();if(n){var i=jQuery("<header>").addClass("title").text(n);jQuery("> .header",t).append(i)}}),this._addListeners(),this._jumpToInitial()}},{key:"_addListeners",value:function(){var e=this,t=this.menu,n=this.settings;jQuery("a",t).on("click",function(i){if(e._clicked+n.speed>Date.now())return!1;e._clicked=Date.now();var r=jQuery(i.currentTarget);(0===r.attr("href").indexOf("#")||r.hasClass("next")||r.hasClass("back"))&&i.preventDefault(),r.hasClass("next")?(t.find(".active").removeClass("active"),r.next().show().addClass("active"),e._move(1),n.resize&&e._resize(r.next())):r.hasClass("back")&&(e._move(-1,function(){t.find(".active").removeClass("active"),r.parent().parent().hide().parentsUntil(t,"ul").first().addClass("active")}),n.resize&&e._resize(r.parent().parent().parentsUntil(t,"ul")))})}},{key:"_jumpToInitial",value:function(){var e=this.menu,t=this.settings,n=e.find(".active");n.length>0&&(n.removeClass("active"),this.jump(n,!1)),setTimeout(function(){return e.height(e.outerHeight())},t.speed)}},{key:"_move",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(0!==e){var n=this.settings,i=this.base,r=Math.round(parseInt(i.get(0).style.left))||0;i.css("left","".concat(r-100*e,"%")),"function"==typeof t&&setTimeout(t,n.speed)}}},{key:"_resize",value:function(e){this.menu.height(e.outerHeight())}},{key:"_transition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,t=this.menu,n=this.base;t.css("transition-duration","".concat(e,"ms")),n.css("transition-duration","".concat(e,"ms"))}},{key:"jump",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var n=this.menu,i=this.settings,r=jQuery(e),s=n.find(".active"),a=0;s.length>0&&(a=s.parentsUntil(n,"ul").length),n.find("ul").removeClass("active").hide();var o=r.parentsUntil(n,"ul");o.show(),r.show().addClass("active"),t||this._transition(0),this._move(o.length-a),i.resize&&this._resize(r),t||this._transition(i.speed)}}},{key:"home",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.base,n=this.menu,i=this.settings;e||this._transition(0);var r=n.find(".active"),s=r.parentsUntil(n,"ul");this._move(-s.length,function(){r.removeClass("active").hide(),s.not(t).hide()}),i.resize&&this._resize(t),!1===e&&this._transition(i.speed)}},{key:"destroy",value:function(){var e=this,t=this.base,n=this.menu;jQuery(".header",n).remove(),jQuery("a",n).removeClass("next").off("click"),n.css({height:"","transition-duration":""}),t.css({left:"","transition-duration":""}),jQuery("li > a > span",n).contents().unwrap(),n.find(".active").removeClass("active"),n.attr("class").split(" ").forEach(function(e){0===e.indexOf("slinky")&&n.removeClass(e)});["settings","menu","base"].forEach(function(t){return delete e[t]})}}]),e}();jQuery.fn.slinky=function(e){return new a(this,e)}},function(e,t,n){}]);
|
||||
//# sourceMappingURL=slinky.min.js.map
|
||||
|
Before Width: | Height: | Size: 264 KiB |
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"baseUrl": ".",
|
||||
"composite": true,
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@package-json": ["./package.json"],
|
||||
},
|
||||
"types": [
|
||||
"@types/w3c-web-serial"
|
||||
]
|
||||
},
|
||||
"exclude": [],
|
||||
"include": [
|
||||
"package.json",
|
||||
"public/nav-links.js",
|
||||
"src/**/*.js",
|
||||
"src/**/*.vue",
|
||||
"types/env.d.ts",
|
||||
"types/web.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./jsconfig.node.json" },
|
||||
{ "path": "./jsconfig.app.json" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "@tsconfig/node20/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"composite": true,
|
||||
"noEmit": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"types": [
|
||||
"@types/node"
|
||||
]
|
||||
},
|
||||
"exclude": [],
|
||||
"include": [
|
||||
"vite.config.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "frost-navigation",
|
||||
"description": "Frost Navigation",
|
||||
"version": "3.1.6",
|
||||
"license": "GPL-3.0-only",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev-host": "vite dev --host 0.0.0.0",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
||||
},
|
||||
"packageManager": "pnpm@10.11.0",
|
||||
"dependencies": {
|
||||
"@frost-utils/javascript": "^2.1.3",
|
||||
"@mdi/font": "^7.4.47",
|
||||
"@vueuse/core": "^13.3.0",
|
||||
"axios": "^1.9.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"highlight.js": "^11.11.1",
|
||||
"lunisolar": "^2.5.2",
|
||||
"mathjs": "^14.5.2",
|
||||
"monaco-editor": "^0.54.0",
|
||||
"naive-ui": "^2.41.0",
|
||||
"radash": "^12.1.0",
|
||||
"uuid": "^11.1.0",
|
||||
"vue": "^3.5.16",
|
||||
"vue-router": "^4.5.1",
|
||||
"zxing-wasm": "^2.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node20": "^20.1.5",
|
||||
"@types/node": "^20.17.57",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@types/w3c-web-serial": "^1.0.8",
|
||||
"@vitejs/plugin-legacy": "^6.1.1",
|
||||
"@vitejs/plugin-vue": "^5.2.4",
|
||||
"@vitejs/plugin-vue-jsx": "~4.1.2",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"eslint": "^9.28.0",
|
||||
"eslint-plugin-vue": "^9.33.0",
|
||||
"less": "^4.3.0",
|
||||
"vite": "^6.3.5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
onlyBuiltDependencies:
|
||||
- core-js
|
||||
- esbuild
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,2 @@
|
||||
zxing_full.wasm
|
||||
zxing-wasm v2.1.2
|
||||
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 77 KiB |
@@ -0,0 +1,288 @@
|
||||
<template>
|
||||
<n-config-provider
|
||||
:date-locale="configProviderProps.dateLocale"
|
||||
:hljs="hljs"
|
||||
:inline-theme-disabled="configProviderProps.inlineThemeDisabled"
|
||||
:locale="configProviderProps.locale"
|
||||
:theme-overrides="themeOverrides"
|
||||
>
|
||||
|
||||
<!-- Naive UI 全局样式 -->
|
||||
<n-global-style></n-global-style>
|
||||
|
||||
<!-- 全局侧边栏 -->
|
||||
<div class="app-aside-wrapper">
|
||||
<app-aside />
|
||||
</div>
|
||||
|
||||
<!-- 路由页面 -->
|
||||
<router-view class="app-view"></router-view>
|
||||
|
||||
</n-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
NConfigProvider, NGlobalStyle,
|
||||
useThemeVars,
|
||||
} from 'naive-ui';
|
||||
|
||||
import {
|
||||
onMounted, onBeforeUnmount,
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
configProviderProps,
|
||||
} from './assets/js/naive-ui';
|
||||
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
import hljsJavascript from 'highlight.js/lib/languages/javascript';
|
||||
import hljsJson from 'highlight.js/lib/languages/json';
|
||||
|
||||
import AppAside from './components/AppAside.vue';
|
||||
|
||||
/** 主题变量配置 */
|
||||
const themeOverrides = configProviderProps.themeOverrides;
|
||||
|
||||
/** 默认主题变量 */
|
||||
const themeVars = useThemeVars();
|
||||
|
||||
/**
|
||||
* @description 阻止默认右键菜单
|
||||
* @param {PointerEvent} event
|
||||
*/
|
||||
function handleContextMenu(event) {
|
||||
|
||||
let elements = event.composedPath();
|
||||
let classValue = '';
|
||||
let classRegExp = /(n-code|n-input|n-input-number|n-ol|n-select)/;
|
||||
|
||||
// 排除按住 Ctrl 键时
|
||||
if (event.ctrlKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
|
||||
let element = elements[i];
|
||||
|
||||
// 获取元素 class 信息
|
||||
if (element instanceof HTMLElement) {
|
||||
classValue = element.classList.value;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 排除输入框元素
|
||||
if (element instanceof HTMLInputElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 排除指定元素
|
||||
if (classValue && classRegExp.test(classValue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
}
|
||||
|
||||
/** 初始化 CSS 变量列表 */
|
||||
function initCssVars() {
|
||||
|
||||
let rootStyle = document.documentElement.style;
|
||||
let overrides = themeOverrides.common;
|
||||
let variables = themeVars.value;
|
||||
|
||||
let cssVars = {
|
||||
// 主题变量
|
||||
'--border-radius': overrides.borderRadius,
|
||||
'--border-radius-small': overrides.borderRadiusSmall,
|
||||
'--box-shadow-1': variables.boxShadow1,
|
||||
'--box-shadow-2': variables.boxShadow2,
|
||||
'--box-shadow-3': variables.boxShadow3,
|
||||
'--color-action': variables.actionColor,
|
||||
'--color-border': variables.borderColor,
|
||||
'--color-error': overrides.errorColor,
|
||||
'--color-info': overrides.infoColor,
|
||||
'--color-primary': overrides.primaryColor,
|
||||
'--color-success': overrides.successColor,
|
||||
'--color-text-1': variables.textColor1,
|
||||
'--color-text-2': variables.textColor2,
|
||||
'--color-text-3': variables.textColor3,
|
||||
'--color-warning': overrides.warningColor,
|
||||
// 其他颜色
|
||||
'--color-bg-dark': 'var(--color-text-2)',
|
||||
'--color-bg-light': '#F8F8F8',
|
||||
'--color-black': 'var(--color-text-2)',
|
||||
'--color-gray': '#E0E0E0',
|
||||
'--color-red': 'var(--color-error)',
|
||||
'--color-green': 'var(--color-success)',
|
||||
'--color-blue': 'var(--color-info)',
|
||||
'--color-orange': 'var(--color-warning)',
|
||||
// 元素大小
|
||||
'--dialog-content-max-height': 'calc(100vh - 160px)',
|
||||
'--scrollbar-size': '8px',
|
||||
};
|
||||
|
||||
for (let key in cssVars) {
|
||||
rootStyle.setProperty(key, cssVars[key]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 初始化 highlight.js */
|
||||
function initHighlightJs() {
|
||||
hljs.registerLanguage('javascript', hljsJavascript);
|
||||
hljs.registerLanguage('json', hljsJson);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initCssVars();
|
||||
initHighlightJs();
|
||||
window.addEventListener('contextmenu', handleContextMenu);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('contextmenu', handleContextMenu);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
// 滚动条
|
||||
::-webkit-scrollbar {
|
||||
width: var(--scrollbar-size);
|
||||
height: var(--scrollbar-size);
|
||||
}
|
||||
::-webkit-scrollbar-corner {
|
||||
display: none;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 16px;
|
||||
background-color: #CFCFCF;
|
||||
|
||||
&:hover {
|
||||
background-color: #C0C0C0;
|
||||
}
|
||||
}
|
||||
|
||||
// 预设样式
|
||||
.shadow-1 {
|
||||
box-shadow: var(--box-shadow-1);
|
||||
}
|
||||
.shadow-2 {
|
||||
box-shadow: var(--box-shadow-2);
|
||||
}
|
||||
.shadow-3 {
|
||||
box-shadow: var(--box-shadow-3);
|
||||
}
|
||||
|
||||
html, body, #app, .n-config-provider {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
html, body {
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
background-color: #FFF;
|
||||
color: var(--color-black);
|
||||
font-size: 16px;
|
||||
line-height: 1;
|
||||
|
||||
* {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.n-config-provider {
|
||||
display: flex;
|
||||
flex-direction: row
|
||||
}
|
||||
|
||||
.app-aside, .app-view {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.app-aside-wrapper {
|
||||
width: 64px;
|
||||
border-right: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.app-view {
|
||||
flex-grow: 1;
|
||||
width: 0;
|
||||
background-color: var(--color-action);
|
||||
|
||||
&.flex-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.app-view-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding: 0 16px;
|
||||
height: 64px;
|
||||
background-color: #FFF;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
|
||||
.placeholder {
|
||||
flex-grow: 1;
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.app-view-content {
|
||||
flex-grow: 1;
|
||||
position: relative;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
background-color: #FFF;
|
||||
|
||||
&.is-transparent {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&.with-margin {
|
||||
margin: 20px;
|
||||
width: calc(100% - 40px);
|
||||
border: 1px solid var(--color-border);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -- Naive UI --
|
||||
|
||||
.n-dialog-content--with-max-height {
|
||||
max-height: var(--dialog-content-max-height);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.n-drawer--right-placement {
|
||||
.n-drawer-body {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.n-drawer-body-content-wrapper {
|
||||
padding: 20px !important;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.n-flex {
|
||||
gap: 10px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,11 @@
|
||||
@font-face {
|
||||
font-family: "HarmonyOS Sans SC";
|
||||
font-weight: normal;
|
||||
src: url("./HarmonyOS_Sans_SC_Regular.ttf");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "HarmonyOS Sans SC";
|
||||
font-weight: bold;
|
||||
src: url("./HarmonyOS_Sans_SC_Bold.ttf");
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// 本地储存
|
||||
|
||||
import { useLocalStorage } from '@vueuse/core';
|
||||
|
||||
/** 本地储存 key 前缀 */
|
||||
export const KEY_PREFIX = 'frost-navigation/';
|
||||
|
||||
/** NavView 模块 */
|
||||
export const storeNavView = {
|
||||
|
||||
/** 导航链接侧边栏折叠状态 */
|
||||
isAsideCollapsed: useLocalStorage(KEY_PREFIX + 'nav-view/isAsideCollapsed', false),
|
||||
|
||||
/** 导航链接当前选中分类 */
|
||||
currentCategory: useLocalStorage(KEY_PREFIX + 'nav-view/currentCategory', ''),
|
||||
|
||||
/** 导航链接搜索类型 */
|
||||
searchType: useLocalStorage(KEY_PREFIX + 'nav-view/searchType', 'all'),
|
||||
|
||||
};
|
||||
|
||||
/** SearchView 模块 */
|
||||
export const storeSearchView = {
|
||||
|
||||
/** 当前使用的搜索引擎名称 */
|
||||
searchEngineName: useLocalStorage(KEY_PREFIX + 'search-view/searchEngineName', '必应'),
|
||||
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
||||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
||||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
||||
|
||||
/** 初始化 MonacoEnvironment */
|
||||
export function initMonacoEnvironment() {
|
||||
if (!self.MonacoEnvironment) {
|
||||
// 配置编辑器环境(Service Worker 等)
|
||||
self.MonacoEnvironment = {
|
||||
getWorker(workerId, label) {
|
||||
if (label === 'javascript' || label === 'typescript') {
|
||||
return new tsWorker();
|
||||
} else if (label === 'json') {
|
||||
return new jsonWorker();
|
||||
} else {
|
||||
return new editorWorker();
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
// Naive UI 配置和功能
|
||||
|
||||
import {
|
||||
createDiscreteApi,
|
||||
dateZhCN, zhCN,
|
||||
} from 'naive-ui';
|
||||
|
||||
/** @type { import('naive-ui').ConfigProviderProps } */
|
||||
export const configProviderProps = {
|
||||
|
||||
// 语言
|
||||
dateLocale: dateZhCN,
|
||||
locale: zhCN,
|
||||
|
||||
// 禁用 inline 主题
|
||||
inlineThemeDisabled: true,
|
||||
|
||||
// 调整主题变量
|
||||
themeOverrides: {
|
||||
common: {
|
||||
borderRadius: '4px',
|
||||
borderRadiusSmall: '2px',
|
||||
errorColor: '#E34D59',
|
||||
errorColorHover: '#F36D78',
|
||||
errorColorPressed: '#C9353F',
|
||||
errorColorSuppl: '#F36D78',
|
||||
fontFamily: '"HarmonyOS Sans SC", sans-serif',
|
||||
fontFamilyMono: '"Sarasa Mono", "Sarasa Mono SC", monospace',
|
||||
infoColor: '#0052D9',
|
||||
infoColorHover: '#366EF4',
|
||||
infoColorPressed: '#003CAB',
|
||||
infoColorSuppl: '#366EF4',
|
||||
lineHeight: 1.6,
|
||||
primaryColor: '#0894FA',
|
||||
primaryColorHover: '#6BB2FF',
|
||||
primaryColorPressed: '#007AD3',
|
||||
primaryColorSuppl: '#6BB2FF',
|
||||
successColor: '#00A870',
|
||||
successColorHover: '#48C79C',
|
||||
successColorPressed: '#078D5C',
|
||||
successColorSuppl: '#48C79C',
|
||||
warningColor: '#ED7B2F',
|
||||
warningColorHover: '#F2995F',
|
||||
warningColorPressed: '#D35A21',
|
||||
warningColorSuppl: '#F2995F',
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
export const {
|
||||
dialog: $dialog,
|
||||
message: $message,
|
||||
notification: $notification,
|
||||
} = createDiscreteApi(
|
||||
[
|
||||
'dialog',
|
||||
'message',
|
||||
'notification',
|
||||
],
|
||||
{
|
||||
configProviderProps: configProviderProps,
|
||||
messageProviderProps: {
|
||||
closable: true,
|
||||
duration: 2000,
|
||||
keepAliveOnHover: true,
|
||||
placement: 'top',
|
||||
},
|
||||
notificationProviderProps: {
|
||||
keepAliveOnHover: true,
|
||||
placement: 'top-right',
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @description 处理导航链接列表
|
||||
* @param {boolean} withAll 是否添加“全部”项
|
||||
*/
|
||||
export function formatNavLinks(withAll = false) {
|
||||
|
||||
/** @type {NavLinkItem[]} */
|
||||
let list0 = JSON.parse(JSON.stringify(window['NAV_LINK_LIST']));
|
||||
|
||||
/** @type {NavLinkItem[]} */
|
||||
let list1 = [];
|
||||
|
||||
let index = 0;
|
||||
|
||||
(function fn(treeData, target) {
|
||||
for (let i = 0; i < treeData.length; i++) {
|
||||
|
||||
let {
|
||||
title, children, date, desc,
|
||||
icon, isInvalid, showOnly, url,
|
||||
} = treeData[i];
|
||||
|
||||
/** @type {NavLinkItem} */
|
||||
let data = {
|
||||
title: (typeof title === 'string' ? title : ''),
|
||||
children: [],
|
||||
date: (typeof date === 'string' ? date : ''),
|
||||
desc: (typeof desc === 'string' ? desc : ''),
|
||||
icon: (typeof icon === 'string' ? icon : ''),
|
||||
isInvalid: (typeof isInvalid === 'boolean' ? isInvalid : false),
|
||||
showOnly: (typeof showOnly === 'boolean' ? showOnly : false),
|
||||
url: (typeof url === 'string' ? url : ''),
|
||||
_key: `item_${++index}`,
|
||||
};
|
||||
|
||||
// 添加项
|
||||
target && target.push(data);
|
||||
|
||||
// 递归处理
|
||||
if (children) {
|
||||
fn(children, data.children);
|
||||
} else {
|
||||
data.children = null;
|
||||
}
|
||||
|
||||
}
|
||||
})(list0, list1);
|
||||
|
||||
if (withAll) {
|
||||
list1.unshift({
|
||||
title: '全部',
|
||||
icon: 'mdi mdi-view-grid',
|
||||
children: JSON.parse(JSON.stringify(list1)),
|
||||
});
|
||||
}
|
||||
|
||||
return list1;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
/** PNG 转 ICO 图标,支持生成多尺寸 ICO */
|
||||
class PNGtoICOConverter {
|
||||
|
||||
/**
|
||||
* @description 将 PNG 图像转换为 ICO 格式
|
||||
* @param {File|Blob|string} source PNG 文件、Blob 或 DataURL
|
||||
* @param {number[]} sizes 需要生成的尺寸数组,默认 `[32, 128, 256]`
|
||||
* @returns {Promise<Blob>} ICO 文件的 Blob 对象
|
||||
*/
|
||||
static async convert(source, sizes = [32, 128, 256]) {
|
||||
try {
|
||||
|
||||
// 1. 加载 PNG 图像
|
||||
let pngBlob = await this._preparePNG(source);
|
||||
let imageBitmap = await createImageBitmap(pngBlob);
|
||||
|
||||
// 2. 创建各尺寸的图像
|
||||
let imageDatas = await this._createMultiSizeImages(imageBitmap, sizes);
|
||||
|
||||
// 3. 生成 ICO 文件
|
||||
let icoBlob = await this._generateICO(imageDatas);
|
||||
|
||||
return icoBlob;
|
||||
|
||||
} catch (error) {
|
||||
throw new Error(`PNG 转 ICO 失败: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 准备 PNG 源数据
|
||||
* @private
|
||||
*/
|
||||
static async _preparePNG(source) {
|
||||
|
||||
if (source instanceof File || source instanceof Blob) {
|
||||
return source;
|
||||
}
|
||||
|
||||
if (typeof source === 'string') {
|
||||
if (source.startsWith('data:image/png')) {
|
||||
const response = await fetch(source);
|
||||
return await response.blob();
|
||||
} else {
|
||||
throw new Error('不支持的数据格式,仅支持 PNG 文件、Blob 或 DataURL');
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('无效的输入类型');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 创建多尺寸图像数据
|
||||
* @private
|
||||
*/
|
||||
static async _createMultiSizeImages(imageBitmap, sizes) {
|
||||
|
||||
let results = [];
|
||||
|
||||
for (let size of sizes) {
|
||||
|
||||
// 按尺寸创建 Canvas
|
||||
let canvas = document.createElement('canvas');
|
||||
|
||||
canvas.width = size;
|
||||
canvas.height = size;
|
||||
|
||||
let ctx = canvas.getContext('2d');
|
||||
|
||||
// 设置高质量缩放
|
||||
ctx.imageSmoothingEnabled = true;
|
||||
ctx.imageSmoothingQuality = 'high';
|
||||
|
||||
// 绘制缩放后的图像
|
||||
ctx.drawImage(imageBitmap, 0, 0, size, size);
|
||||
|
||||
// 获取 PNG 数据
|
||||
let pngBlob = await new Promise(resolve => {
|
||||
canvas.toBlob(resolve, 'image/png');
|
||||
});
|
||||
|
||||
let arrayBuffer = await pngBlob.arrayBuffer();
|
||||
|
||||
results.push({
|
||||
size,
|
||||
width: size,
|
||||
height: size,
|
||||
data: new Uint8Array(arrayBuffer),
|
||||
pngSize: arrayBuffer.byteLength
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return results;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 生成 ICO 文件
|
||||
* @private
|
||||
*/
|
||||
static async _generateICO(imageDatas) {
|
||||
|
||||
// ICO 文件结构:
|
||||
// 1. ICONDIR 头 (6 字节)
|
||||
// 2. ICONDIRENTRY 数组 (每个 16 字节)
|
||||
// 3. PNG 数据
|
||||
|
||||
let numImages = imageDatas.length;
|
||||
|
||||
// 计算总大小
|
||||
let totalSize = 6; // ICONDIR 头
|
||||
totalSize += numImages * 16; // ICONDIRENTRY 数组
|
||||
totalSize += imageDatas.reduce((sum, img) => sum + img.pngSize, 0);
|
||||
|
||||
// 创建 ArrayBuffer
|
||||
let buffer = new ArrayBuffer(totalSize);
|
||||
let view = new DataView(buffer);
|
||||
let offset = 0;
|
||||
|
||||
// 1. 写入 ICONDIR 头
|
||||
view.setUint16(offset, 0, true); // Reserved (0)
|
||||
offset += 2;
|
||||
view.setUint16(offset, 1, true); // Type (1 for ICO)
|
||||
offset += 2;
|
||||
view.setUint16(offset, numImages, true); // Number of images
|
||||
offset += 2;
|
||||
|
||||
// 2. 写入 ICONDIRENTRY 数组
|
||||
let dataOffset = 6 + (numImages * 16);
|
||||
|
||||
for (let img of imageDatas) {
|
||||
|
||||
// 宽度和高度 (0 表示 256 像素)
|
||||
view.setUint8(offset, img.width === 256 ? 0 : img.width);
|
||||
offset += 1;
|
||||
view.setUint8(offset, img.height === 256 ? 0 : img.height);
|
||||
offset += 1;
|
||||
|
||||
view.setUint8(offset, 0); // Color palette (0 for no palette)
|
||||
offset += 1;
|
||||
view.setUint8(offset, 0); // Reserved
|
||||
offset += 1;
|
||||
|
||||
view.setUint16(offset, 1, true); // Color planes
|
||||
offset += 2;
|
||||
view.setUint16(offset, 32, true); // Bits per pixel
|
||||
offset += 2;
|
||||
|
||||
view.setUint32(offset, img.pngSize, true); // PNG data size
|
||||
offset += 4;
|
||||
view.setUint32(offset, dataOffset, true); // PNG data offset
|
||||
offset += 4;
|
||||
|
||||
dataOffset += img.pngSize;
|
||||
|
||||
}
|
||||
|
||||
// 3. 写入 PNG 数据
|
||||
for (let img of imageDatas) {
|
||||
let uint8View = new Uint8Array(buffer, offset, img.pngSize);
|
||||
uint8View.set(img.data);
|
||||
offset += img.pngSize;
|
||||
}
|
||||
|
||||
return new Blob([buffer], { type: 'image/x-icon' });
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 下载 ICO 文件
|
||||
* @param {Blob} icoBlob ICO 文件的 Blob 对象
|
||||
* @param {string} filename 下载的文件名
|
||||
*/
|
||||
static download(icoBlob, filename = 'icon.ico') {
|
||||
|
||||
let url = URL.createObjectURL(icoBlob);
|
||||
let a = document.createElement('a');
|
||||
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 将 PNG 转换为 ICO 并下载
|
||||
* @param {File|Blob|string} source PNG 文件、Blob 或 DataURL
|
||||
* @param {number[]} sizes 需要生成的尺寸数组
|
||||
* @param {string} filename 下载的文件名
|
||||
*/
|
||||
export async function convertPNGtoICO(source, sizes, filename) {
|
||||
try {
|
||||
let blob = await PNGtoICOConverter.convert(source, sizes);
|
||||
PNGtoICOConverter.download(blob, filename);
|
||||
return { blob: blob, error: '', success: true };
|
||||
} catch (error) {
|
||||
console.error('转换失败:', error);
|
||||
return { blob: null, error: error.message, success: false };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,412 @@
|
||||
import {
|
||||
prepareZXingModule,
|
||||
readBarcodes,
|
||||
writeBarcode,
|
||||
} from 'zxing-wasm/full';
|
||||
|
||||
/** 默认背景颜色 */
|
||||
const DEFAULT_BGC = 'transparent';
|
||||
|
||||
/** 默认前景颜色 */
|
||||
const DEFAULT_FGC = '#000000';
|
||||
|
||||
/** 模块名称 */
|
||||
const PREFIX = '[qr-code]';
|
||||
|
||||
/**
|
||||
* @desc 二维码读取配置选项
|
||||
* @type { import('zxing-wasm').ReaderOptions }
|
||||
*/
|
||||
const readerOptions = {
|
||||
formats: ['QRCode'],
|
||||
maxNumberOfSymbols: 8,
|
||||
textMode: 'Plain',
|
||||
tryDownscale: true,
|
||||
tryHarder: true,
|
||||
tryInvert: true,
|
||||
tryRotate: true,
|
||||
};
|
||||
|
||||
/**
|
||||
* @desc 二维码生成配置选项
|
||||
* @type { import('zxing-wasm').WriterOptions }
|
||||
*/
|
||||
const writerOptions = {
|
||||
ecLevel: '',
|
||||
format: 'QRCode',
|
||||
scale: 0,
|
||||
};
|
||||
|
||||
// 配置 wasm 文件路径
|
||||
prepareZXingModule({
|
||||
overrides: {
|
||||
locateFile: (path, prefix) => {
|
||||
if (path.endsWith('.wasm')) {
|
||||
return `./wasm/${path}`;
|
||||
} else {
|
||||
return (prefix + path);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 在图片上绘制矩形,返回 DataURL
|
||||
* @param {Blob} blob 图片二进制
|
||||
* @param {Rect[]} rects 矩形位置信息列表
|
||||
*/
|
||||
function drawRectsOnImage(blob, rects) {
|
||||
|
||||
/** @typedef {{ x: number; y: number; w: number; h: number }} Rect */
|
||||
|
||||
let canvas = document.createElement('canvas');
|
||||
let ctx = canvas.getContext('2d');
|
||||
|
||||
return renderImageToCanvas(blob, canvas).then((success) => {
|
||||
|
||||
if (!success) {
|
||||
return '';
|
||||
}
|
||||
|
||||
rects.forEach((rect, index) => {
|
||||
|
||||
let { x, y, w, h } = rect;
|
||||
|
||||
let text = String(index + 1);
|
||||
|
||||
// 绘制矩形
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.25)';
|
||||
ctx.lineWidth = 4;
|
||||
ctx.strokeStyle = 'rgba(0, 255, 0, 1)';
|
||||
ctx.fillRect(x, y, w, h);
|
||||
ctx.strokeRect(x, y, w, h);
|
||||
|
||||
// 绘制文本
|
||||
ctx.font = `bold ${Math.round(w / 2)}px sans-serif`;
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 1)';
|
||||
ctx.lineWidth = Number((w / 100).toFixed(4));
|
||||
ctx.strokeStyle = 'rgba(0, 0, 0, 1)';
|
||||
ctx.fillText(text, x, y + h);
|
||||
ctx.strokeText(text, x, y + h);
|
||||
|
||||
});
|
||||
|
||||
return canvas.toDataURL('image/png');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 修改 SVG 内容,获取信息
|
||||
* @param {object} options
|
||||
* @param {string} options.background
|
||||
* @param {string} options.foreground
|
||||
* @param {string} options.svgString
|
||||
*/
|
||||
function modifySvgContent(options) {
|
||||
|
||||
let {
|
||||
background = DEFAULT_BGC,
|
||||
foreground = DEFAULT_FGC,
|
||||
svgString,
|
||||
} = options;
|
||||
|
||||
let divElement = document.createElement('div');
|
||||
let gElement = null;
|
||||
let pathElement = null;
|
||||
let rectElement = null;
|
||||
let svgElement = null;
|
||||
|
||||
// 添加 DOM 元素,用于获取位置大小信息
|
||||
document.body.appendChild(divElement);
|
||||
|
||||
divElement.innerHTML = svgString;
|
||||
gElement = divElement.getElementsByTagName('g')[0] || null;
|
||||
pathElement = divElement.getElementsByTagName('path')[0] || null;
|
||||
rectElement = divElement.getElementsByTagName('rect')[0] || null;
|
||||
svgElement = divElement.getElementsByTagName('svg')[0] || null;
|
||||
|
||||
if (!(gElement && pathElement && rectElement && svgElement)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 修改填充颜色
|
||||
gElement.setAttribute('fill', foreground);
|
||||
rectElement.setAttribute('fill', background);
|
||||
|
||||
// 获取位置大小信息
|
||||
let rectOfG = gElement.getBoundingClientRect();
|
||||
let rectOfPath = pathElement.getBoundingClientRect();
|
||||
|
||||
let offsetX = Math.round(rectOfPath.left - rectOfG.left);
|
||||
let offsetY = Math.round(rectOfPath.top - rectOfG.top);
|
||||
let sizeW = Math.round(rectOfPath.width);
|
||||
let sizeH = Math.round(rectOfPath.height);
|
||||
let result = {
|
||||
offsetX: offsetX,
|
||||
offsetY: offsetY,
|
||||
sizeW: sizeW,
|
||||
sizeH: sizeH,
|
||||
svgString: divElement.innerHTML,
|
||||
};
|
||||
|
||||
// 输出处理结果
|
||||
console.debug(PREFIX, '处理 SVG', result);
|
||||
|
||||
// 处理完成,移除 DOM 元素
|
||||
document.body.removeChild(divElement);
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 将图片 Blob 渲染到 Canvas
|
||||
* @param {Blob} blob
|
||||
* @param {HTMLCanvasElement} canvas
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
function renderImageToCanvas(blob, canvas) {
|
||||
|
||||
let ctx = canvas.getContext('2d');
|
||||
|
||||
if (window.createImageBitmap) {
|
||||
return createImageBitmap(blob).then((bitmap) => {
|
||||
canvas.width = bitmap.width;
|
||||
canvas.height = bitmap.height;
|
||||
ctx.drawImage(bitmap, 0, 0);
|
||||
return true;
|
||||
}).catch((error) => {
|
||||
console.error('渲染图片失败:');
|
||||
console.error(error);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
|
||||
let image = new Image();
|
||||
let url = URL.createObjectURL(blob);
|
||||
|
||||
image.onload = () => {
|
||||
canvas.width = image.naturalWidth;
|
||||
canvas.height = image.naturalHeight;
|
||||
URL.revokeObjectURL(url);
|
||||
ctx.drawImage(image, 0, 0);
|
||||
resolve(true);
|
||||
};
|
||||
|
||||
image.onerror = () => {
|
||||
console.error(PREFIX, '渲染图片失败:加载图片失败');
|
||||
URL.revokeObjectURL(url);
|
||||
resolve(false);
|
||||
};
|
||||
|
||||
image.src = url;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 将 SVG 字符串渲染到 Canvas
|
||||
* @param {object} options
|
||||
* @param {HTMLCanvasElement} options.canvas
|
||||
* @param {string} options.svgString
|
||||
* @param {string} options.background
|
||||
* @param {string} options.foreground
|
||||
* @param {number} options.drawLeft
|
||||
* @param {number} options.drawTop
|
||||
* @param {number} options.drawWidth
|
||||
* @param {number} options.drawHeight
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
function renderSvgToCanvas(options) {
|
||||
|
||||
let {
|
||||
canvas, svgString,
|
||||
background = DEFAULT_BGC, foreground = DEFAULT_FGC,
|
||||
drawLeft = 0, drawTop = 0,
|
||||
drawWidth = 0, drawHeight = 0,
|
||||
} = options;
|
||||
|
||||
let svgInfo = modifySvgContent({
|
||||
background: background,
|
||||
foreground: foreground,
|
||||
svgString: svgString,
|
||||
});
|
||||
|
||||
if (!svgInfo) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
|
||||
let ctx = canvas.getContext('2d');
|
||||
let image = new Image();
|
||||
let svgBlob = new Blob([svgInfo.svgString], {
|
||||
type: 'image/svg+xml;charset=utf-8',
|
||||
});
|
||||
let svgUrl = URL.createObjectURL(svgBlob);
|
||||
|
||||
image.onerror = () => {
|
||||
console.error(PREFIX, '加载 SVG 失败');
|
||||
URL.revokeObjectURL(svgUrl);
|
||||
resolve(false);
|
||||
};
|
||||
|
||||
image.onload = () => {
|
||||
ctx.drawImage(
|
||||
image,
|
||||
svgInfo.offsetX, svgInfo.offsetY, svgInfo.sizeW, svgInfo.sizeH,
|
||||
drawLeft, drawTop, drawWidth, drawHeight,
|
||||
);
|
||||
URL.revokeObjectURL(svgUrl);
|
||||
resolve(true);
|
||||
};
|
||||
|
||||
image.src = svgUrl;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 解析二维码图片
|
||||
* @param {Blob} blob 图片二进制
|
||||
*/
|
||||
export function readQrCodeImage(blob) {
|
||||
|
||||
/**
|
||||
* @desc 返回结果
|
||||
* @type {{ error: string; image: string; textList: string[]; }}
|
||||
*/
|
||||
let result = {
|
||||
error: '',
|
||||
image: '',
|
||||
textList: [],
|
||||
};
|
||||
|
||||
return readBarcodes(blob, readerOptions).then((codeList) => {
|
||||
|
||||
let rectList = [];
|
||||
let textList = result.textList;
|
||||
|
||||
if (codeList.length === 0) {
|
||||
console.warn(PREFIX, '解析二维码失败:未识别到内容');
|
||||
} else {
|
||||
console.debug(PREFIX, '解析二维码成功:', codeList);
|
||||
}
|
||||
|
||||
for (let i = 0; i < codeList.length; i++) {
|
||||
|
||||
let item = codeList[i];
|
||||
let position = item.position;
|
||||
let posX0 = position.topLeft.x;
|
||||
let posX1 = position.bottomRight.x;
|
||||
let posY0 = position.topLeft.y;
|
||||
let posY1 = position.bottomRight.y;
|
||||
|
||||
// 记录二维码坐标
|
||||
rectList.push({
|
||||
x: posX0,
|
||||
y: posY0,
|
||||
w: posX1 - posX0,
|
||||
h: posY1 - posY0,
|
||||
});
|
||||
|
||||
// 记录二维码文本
|
||||
textList.push(item.text);
|
||||
|
||||
}
|
||||
|
||||
// 框选二维码区域
|
||||
return drawRectsOnImage(blob, rectList);
|
||||
|
||||
}).then((dataURL) => {
|
||||
|
||||
if (dataURL) {
|
||||
result.image = dataURL;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}).catch((error) => {
|
||||
console.error(PREFIX, '解析二维码失败:');
|
||||
console.error(error);
|
||||
result.error = String(error);
|
||||
return result;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 生成二维码图片
|
||||
* @param {object} options
|
||||
* @param {string} options.content
|
||||
* @param {string} options.background
|
||||
* @param {string} options.foreground
|
||||
* @param {number} options.width
|
||||
* @param {number} options.height
|
||||
* @returns 二维码图片 DataURL
|
||||
*/
|
||||
export function writeQrCodeImage(options = {}) {
|
||||
|
||||
let {
|
||||
content = '',
|
||||
background = DEFAULT_BGC, foreground = DEFAULT_FGC,
|
||||
width = 256, height = 256,
|
||||
} = options;
|
||||
|
||||
let canvas = document.createElement('canvas');
|
||||
let ctx = canvas.getContext('2d');
|
||||
|
||||
// 更新画布大小
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
|
||||
// 设置背景颜色
|
||||
ctx.fillStyle = background;
|
||||
ctx.fillRect(0, 0, width, height);
|
||||
|
||||
return writeBarcode(content, writerOptions).then((result) => {
|
||||
|
||||
console.debug(PREFIX, '生成二维码', result);
|
||||
|
||||
if (result.error) {
|
||||
console.error(PREFIX, `生成二维码失败:${result.error}`);
|
||||
return '';
|
||||
} else {
|
||||
return result.svg;
|
||||
}
|
||||
|
||||
}).then((svgString) => {
|
||||
if (svgString) {
|
||||
return renderSvgToCanvas({
|
||||
canvas: canvas,
|
||||
svgString: svgString,
|
||||
background: background,
|
||||
foreground: foreground,
|
||||
drawLeft: 0,
|
||||
drawTop: 0,
|
||||
drawWidth: width,
|
||||
drawHeight: height,
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}).then((success) => {
|
||||
|
||||
if (success) {
|
||||
return canvas.toDataURL('image/png');
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.error(PREFIX, '生成二维码失败:');
|
||||
console.error(error);
|
||||
return '';
|
||||
});
|
||||
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
// 搜索引擎
|
||||
|
||||
import {
|
||||
ref,
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
storeSearchView,
|
||||
} from './local-storage';
|
||||
|
||||
import {
|
||||
$message,
|
||||
} from './naive-ui';
|
||||
|
||||
import icon_baidu from '@/assets/website-icon/baidu.svg';
|
||||
import icon_bing from '@/assets/website-icon/bing.svg';
|
||||
import icon_sogou from '@/assets/website-icon/sogou.svg';
|
||||
import icon_360 from '@/assets/website-icon/360.svg';
|
||||
import icon_google from '@/assets/website-icon/google.svg';
|
||||
import icon_yandex from '@/assets/website-icon/yandex.svg';
|
||||
import icon_netease_music from '@/assets/website-icon/netease_music.svg';
|
||||
import icon_acfun from '@/assets/website-icon/acfun.svg';
|
||||
import icon_bilibili from '@/assets/website-icon/bilibili.svg';
|
||||
import icon_qq_music from '@/assets/website-icon/qq_music.svg';
|
||||
import icon_cnblogs from '@/assets/website-icon/cnblogs.svg';
|
||||
import icon_csdn from '@/assets/website-icon/csdn.svg';
|
||||
import icon_github from '@/assets/website-icon/github.svg';
|
||||
import icon_mdn from '@/assets/website-icon/mdn.svg';
|
||||
import icon_zcool from '@/assets/website-icon/zcool.svg';
|
||||
import icon_iconfont from '@/assets/website-icon/iconfont.svg';
|
||||
import icon_zhihu from '@/assets/website-icon/zhihu.svg';
|
||||
|
||||
/** 打开搜索结果页面 */
|
||||
export function openSearchResult() {
|
||||
|
||||
let engine = storeSearchView.searchEngineName.value;
|
||||
let keyword = searchKeyword.value;
|
||||
let baseURL = '';
|
||||
let useURL = '';
|
||||
|
||||
// 获取搜索引擎 URL
|
||||
for (let i = 0; i < searchEngineList.length; i++) {
|
||||
|
||||
let category = searchEngineList[i];
|
||||
let engines = category.list;
|
||||
|
||||
for (let j = 0; j < engines.length; j++) {
|
||||
let item = engines[j];
|
||||
if (item.name === engine) {
|
||||
baseURL = item.url;
|
||||
}
|
||||
}
|
||||
|
||||
if (baseURL) {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (baseURL) {
|
||||
useURL = baseURL.replace(/%keyword%/, keyword);
|
||||
}
|
||||
|
||||
if (useURL) {
|
||||
window.open(useURL, '_blank');
|
||||
} else {
|
||||
$message.error('搜索失败:找不到对应的搜索引擎');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 搜索引擎列表 */
|
||||
export const searchEngineList = [
|
||||
{
|
||||
title: '搜索',
|
||||
list: [
|
||||
{
|
||||
name: '百度',
|
||||
desc: 'www.baidu.com',
|
||||
url: 'https://www.baidu.com/s?wd=%keyword%',
|
||||
icon: icon_baidu,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '必应',
|
||||
desc: 'cn.bing.com',
|
||||
url: 'https://cn.bing.com/search?q=%keyword%',
|
||||
icon: icon_bing,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '搜狗',
|
||||
desc: 'www.sogou.com',
|
||||
url: 'https://www.sogou.com/web?query=%keyword%',
|
||||
icon: icon_sogou,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '360',
|
||||
desc: 'www.so.com',
|
||||
url: 'https://www.so.com/s?q=%keyword%',
|
||||
icon: icon_360,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'Google',
|
||||
desc: 'www.google.com',
|
||||
url: 'https://www.google.com/search?q=%keyword%',
|
||||
icon: icon_google,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'Yandex',
|
||||
desc: 'yandex.com',
|
||||
url: 'https://yandex.com/search/?text=%keyword%',
|
||||
icon: icon_yandex,
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '多媒体',
|
||||
list: [
|
||||
{
|
||||
name: '网易云音乐',
|
||||
desc: 'music.163.com',
|
||||
url: 'https://music.163.com/#/search/m/?s=%keyword%',
|
||||
icon: icon_netease_music,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'AcFun',
|
||||
desc: 'www.acfun.cn',
|
||||
url: 'https://www.acfun.cn/search/?keyword=%keyword%',
|
||||
icon: icon_acfun,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'bilibili',
|
||||
desc: 'search.bilibili.com',
|
||||
url: 'https://search.bilibili.com/all?keyword=%keyword%',
|
||||
icon: icon_bilibili,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'QQ音乐',
|
||||
desc: 'y.qq.com',
|
||||
url: 'https://y.qq.com/n/ryqq/search?w=%keyword%',
|
||||
icon: icon_qq_music,
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '技术',
|
||||
list: [
|
||||
{
|
||||
name: '博客园',
|
||||
desc: 'zzk.cnblogs.co',
|
||||
url: 'https://zzk.cnblogs.com/s?w=%keyword%',
|
||||
icon: icon_cnblogs,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'CSDN',
|
||||
desc: 'so.csdn.net',
|
||||
url: 'https://so.csdn.net/so/search/all?q=%keyword%',
|
||||
icon: icon_csdn,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'GitHub',
|
||||
desc: 'github.com',
|
||||
url: 'https://github.com/search?q=%keyword%',
|
||||
icon: icon_github,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'MDN',
|
||||
desc: 'developer.mozilla.org',
|
||||
url: 'https://developer.mozilla.org/zh-CN/search?q=%keyword%',
|
||||
icon: icon_mdn,
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '设计',
|
||||
list: [
|
||||
{
|
||||
name: '站酷',
|
||||
desc: 'www.zcool.com.cn',
|
||||
url: 'https://www.zcool.com.cn/search/content?word=%keyword%',
|
||||
icon: icon_zcool,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'Iconfont',
|
||||
desc: 'www.iconfont.cn',
|
||||
url: 'https://www.iconfont.cn/search/index?searchType=icon&q=%keyword%',
|
||||
icon: icon_iconfont,
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '社区',
|
||||
list: [
|
||||
{
|
||||
name: '知乎',
|
||||
desc: 'www.zhihu.com',
|
||||
url: 'https://www.zhihu.com/search?type=content&q=%keyword%',
|
||||
icon: icon_zhihu,
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
/** 搜索关键词 */
|
||||
export const searchKeyword = ref('');
|
||||
@@ -0,0 +1,112 @@
|
||||
// 生成扇形、环形、圆形,或弧形的 SVG 路径
|
||||
//
|
||||
// 修改自
|
||||
// https://github.com/svgcamp/svg-arc
|
||||
// License
|
||||
// MIT
|
||||
|
||||
const PI = Math.PI;
|
||||
|
||||
/**
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
* @param {number} r
|
||||
* @param {number} angle
|
||||
*/
|
||||
function point(x, y, r, angle) {
|
||||
return [
|
||||
(x + Math.sin(angle) * r).toFixed(2),
|
||||
(y - Math.cos(angle) * r).toFixed(2),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
* @param {number} R
|
||||
* @param {number} r
|
||||
*/
|
||||
function full(x, y, R, r) {
|
||||
if (r <= 0) {
|
||||
return `M ${x - R} ${y} A ${R} ${R} 0 1 1 ${x + R} ${y} A ${R} ${R} 1 1 1 ${x - R} ${y} Z`;
|
||||
}
|
||||
return `M ${x - R} ${y} A ${R} ${R} 0 1 1 ${x + R} ${y} A ${R} ${R} 1 1 1 ${x - R} ${y} M ${x - r} ${y} A ${r} ${r} 0 1 1 ${x + r} ${y} A ${r} ${r} 1 1 1 ${x - r} ${y} Z`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
* @param {number} R
|
||||
* @param {number} r
|
||||
* @param {number} start
|
||||
* @param {number} end
|
||||
*/
|
||||
function part(x, y, R, r, start, end) {
|
||||
|
||||
let s = (start / 360) * 2 * PI;
|
||||
let e = (end / 360) * 2 * PI;
|
||||
let P = [
|
||||
point(x, y, r, s),
|
||||
point(x, y, R, s),
|
||||
point(x, y, R, e),
|
||||
point(x, y, r, e),
|
||||
];
|
||||
let flag = (e - s > PI ? '1' : '0');
|
||||
|
||||
return `M ${P[0][0]} ${P[0][1]} L ${P[1][0]} ${P[1][1]} A ${R} ${R} 0 ${flag} 1 ${P[2][0]} ${P[2][1]} L ${P[3][0]} ${P[3][1]} A ${r} ${r} 0 ${flag} 0 ${P[0][0]} ${P[0][1]} Z`;
|
||||
|
||||
}
|
||||
|
||||
// 关于角度:
|
||||
// 12 点钟方向 - 0, 360, 720, ...
|
||||
// 3 点钟方向 - 90, 450, ...
|
||||
// 6 点钟方向 - 180, 540, ...
|
||||
// 9 点钟方向 - 270, 630, ...
|
||||
|
||||
// 注意事项:
|
||||
// 绘制环形时,需要将 `fill-rule` 属性的值设置为 `evenodd`,否则 `fill` 可能无法正确填充颜色。
|
||||
|
||||
/**
|
||||
* @description 生成 SVG `<path>` 元素的 d 属性值
|
||||
* @param {object} opts 配置选项
|
||||
* @param {number} opts.x 圆心水平坐标
|
||||
* @param {number} opts.y 圆心垂直坐标
|
||||
* @param {number} opts.R 内层半径(用于圆环)
|
||||
* @param {number} opts.r 外层半径(圆形半径)
|
||||
* @param {number} opts.start 起始角度(0 ~ 360)
|
||||
* @param {number} opts.end 结束角度(0 ~ 360)
|
||||
*/
|
||||
function arc(opts = {}) {
|
||||
|
||||
let { x = 0, y = 0 } = opts;
|
||||
let { R = 0, r = 0, start, end } = opts;
|
||||
|
||||
[R, r] = [Math.max(R, r), Math.min(R, r)];
|
||||
|
||||
if (R <= 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (start !== +start || end !== +end) {
|
||||
return full(x, y, R, r);
|
||||
}
|
||||
|
||||
if (Math.abs(start - end) < 0.000001) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (Math.abs(start - end) % 360 < 0.000001) {
|
||||
return full(x, y, R, r);
|
||||
}
|
||||
|
||||
[start, end] = [start % 360, end % 360];
|
||||
|
||||
if (start > end) {
|
||||
end += 360;
|
||||
}
|
||||
|
||||
return part(x, y, R, r, start, end);
|
||||
|
||||
}
|
||||
|
||||
export default arc;
|
||||
@@ -0,0 +1,20 @@
|
||||
/** 工具更新日志 */
|
||||
export const CHANGE_LOGS = {
|
||||
'json-formatter': [
|
||||
'[2] - 2025-02-07\n优化“输出内容”显示样式,解决内容较多时行号显示不全的问题。',
|
||||
'[1] - 2025-02-04\n初始版本。',
|
||||
],
|
||||
'keep-screen-on': [
|
||||
'[3] - 2026-01-03\n调整界面样式,与其他模块统一。',
|
||||
'[2] - 2024-10-13\n优化界面样式,背景添加圆角。',
|
||||
'[1] - 2024-10-11\n初始版本。',
|
||||
],
|
||||
'msu2-usb-monitor-controller': [
|
||||
'[2] - 2026-02-24\n完善功能:添加旧算法;支持设置显示方向;支持配置渲染间隔和发送间隔。',
|
||||
'[1] - 2026-02-21\n初始版本。',
|
||||
],
|
||||
'qrcode-reader-and-generator': [
|
||||
'[2] - 2025-02-23\n支持生成二维码。\n支持解析剪贴板中的二维码图片。\n优化解析功能,在二维码所在位置添加矩形标记。',
|
||||
'[1] - 2025-02-21\n初始版本。',
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,428 @@
|
||||
// 工具箱
|
||||
|
||||
import { CHANGE_LOGS } from './toolbox-changelogs';
|
||||
|
||||
const MODULES = import.meta.glob('../../views/ToolboxView/**/*.vue');
|
||||
|
||||
/**
|
||||
* @desc 工具列表
|
||||
* @type {ToolboxCategory[]}
|
||||
*/
|
||||
export const toolList = [
|
||||
{
|
||||
id: 'calculation-tools',
|
||||
title: '计算',
|
||||
enabled: true,
|
||||
items: [
|
||||
{
|
||||
id: 'calc-ratio',
|
||||
component: 'Calculation/CalcRatio',
|
||||
title: '比例计算',
|
||||
iconClass: 'mdi mdi-calculator-variant-outline',
|
||||
desc: '按设定的比例计算给出的数值所对应的数值。',
|
||||
createdAt: '2024-09-08',
|
||||
updatedAt: '2024-09-08',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'calc-download-time',
|
||||
component: 'Calculation/CalcDownloadTime',
|
||||
title: '下载用时计算',
|
||||
iconClass: 'mdi mdi-calculator-variant-outline',
|
||||
desc: '根据设定的文件大小和下载速度简单计算大约下载完成所需的时间。',
|
||||
createdAt: '2024-09-08',
|
||||
updatedAt: '2024-09-08',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'conversion-tools',
|
||||
title: '转换',
|
||||
enabled: true,
|
||||
items: [
|
||||
{
|
||||
id: 'base64-encode-decode',
|
||||
component: 'Conversion/Base64StringEncodeDecode',
|
||||
title: 'Base64 字符串编码 / 解码',
|
||||
iconClass: 'mdi mdi-swap-horizontal',
|
||||
desc: '处理 Base64 编码的字符串。',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
id: 'png-to-ico',
|
||||
component: 'Conversion/PngToIco',
|
||||
title: 'PNG 转 ICO 图标',
|
||||
iconClass: 'mdi mdi-image-outline',
|
||||
desc: '将 PNG 图片转换为 ICO 图标。',
|
||||
createdAt: '2026-01-26',
|
||||
updatedAt: '2026-01-26',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'convert-timestamp',
|
||||
component: 'Conversion/ConvertTimestamp',
|
||||
title: 'Unix 时间戳转换',
|
||||
iconClass: 'mdi mdi-swap-horizontal',
|
||||
desc: '时间戳转时间字符串 / 时间字符串转时间戳',
|
||||
createdAt: '2025-02-05',
|
||||
updatedAt: '2025-02-05',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'url-encode-decode',
|
||||
component: 'Conversion/UrlEncodeDecode',
|
||||
title: 'URL 编码 / 解码',
|
||||
iconClass: 'mdi mdi-swap-horizontal',
|
||||
desc: '处理 URL 编码的字符串。',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
id: 'qrcode-reader-and-generator',
|
||||
component: 'Conversion/QrcodeReaderAndGenerator',
|
||||
title: '二维码解析和生成',
|
||||
iconClass: 'mdi mdi-qrcode',
|
||||
desc: '解析二维码 / 生成二维码',
|
||||
createdAt: '2025-02-21',
|
||||
updatedAt: '2025-02-23',
|
||||
version: '2',
|
||||
enabled: true,
|
||||
changelogs: CHANGE_LOGS['qrcode-reader-and-generator'],
|
||||
},
|
||||
{
|
||||
id: 'convert-text-structure',
|
||||
component: 'Conversion/ConvertTextStructure',
|
||||
title: '文本结构转换',
|
||||
iconClass: 'mdi mdi-swap-horizontal',
|
||||
desc: '倒序、横竖互换等',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
id: 'convert-html-entities',
|
||||
component: 'Conversion/ConvertHtmlEntities',
|
||||
title: '转换 HTML 实体',
|
||||
iconClass: 'mdi mdi-swap-horizontal',
|
||||
desc: '',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'edit-tools',
|
||||
title: '编辑',
|
||||
enabled: true,
|
||||
items: [
|
||||
{
|
||||
id: 'csv-editor',
|
||||
component: 'Edit/CsvEditor',
|
||||
title: 'CSV 编辑',
|
||||
iconClass: 'mdi mdi-table-edit',
|
||||
desc: '查看或编辑 CSV 文件',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
id: 'json-editor',
|
||||
component: 'Edit/JsonEditor',
|
||||
title: 'JSON 编辑器',
|
||||
iconClass: 'mdi mdi-code-json',
|
||||
desc: '基于 Monaco Editor 实现的 JSON 编辑器。',
|
||||
createdAt: '2025-10-26',
|
||||
updatedAt: '2025-10-26',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'json-formatter',
|
||||
component: 'Edit/JsonFormatter',
|
||||
title: 'JSON 格式化',
|
||||
iconClass: 'mdi mdi-code-json',
|
||||
desc: '格式化 / 美化 JSON 字符串',
|
||||
createdAt: '2025-02-04',
|
||||
updatedAt: '2025-02-07',
|
||||
version: '2',
|
||||
enabled: true,
|
||||
changelogs: CHANGE_LOGS['json-formatter'],
|
||||
},
|
||||
{
|
||||
id: 'text-editor',
|
||||
component: 'Edit/TextEditor',
|
||||
title: '文本编辑器',
|
||||
iconClass: 'mdi mdi-text-long',
|
||||
desc: '基于 Monaco Editor 实现的文本编辑器。',
|
||||
createdAt: '2025-12-21',
|
||||
updatedAt: '2025-12-21',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'generator-tools',
|
||||
title: '生成',
|
||||
enabled: true,
|
||||
items: [
|
||||
{
|
||||
id: 'frp-config-generator',
|
||||
component: 'Generator/FrpConfigGenerator/FrpConfigGenerator',
|
||||
title: 'frp 配置文件生成',
|
||||
iconClass: 'mdi mdi-file-cog-outline',
|
||||
desc: '生成用于 frpc、frps 的配置文件。',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
id: 'uuid-generator',
|
||||
component: 'Generator/UuidGenerator',
|
||||
title: 'UUID 生成器',
|
||||
iconClass: 'mdi mdi-identifier',
|
||||
desc: '生成 UUID 列表。',
|
||||
createdAt: '2026-01-03',
|
||||
updatedAt: '2026-01-03',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'generate-urls',
|
||||
component: 'Generator/GenerateUrls',
|
||||
title: '生成批量下载链接',
|
||||
iconClass: 'mdi mdi-link-variant',
|
||||
desc: '根据设置,生成有一定规律的用于批量下载的链接。',
|
||||
createdAt: '2026-01-03',
|
||||
updatedAt: '2026-01-03',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'generate-random-string',
|
||||
component: 'Generator/GenerateRandomString',
|
||||
title: '生成随机字符串',
|
||||
iconClass: 'mdi mdi-format-text',
|
||||
desc: '生成随机组合的字符串,可用于密码。',
|
||||
createdAt: '2024-09-08',
|
||||
updatedAt: '2024-09-08',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'minecraft-tools',
|
||||
title: 'Minecraft',
|
||||
enabled: true,
|
||||
items: [
|
||||
{
|
||||
id: 'minecraft-uuid-converter',
|
||||
component: 'Minecraft/UuidConverter',
|
||||
title: 'Minecraft UUID 转换',
|
||||
iconClass: 'mdi mdi-identifier',
|
||||
desc: '随机生成或转换 Minecraft 的 UUID。',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
id: 'minecraft-chat-history-reader',
|
||||
component: 'Minecraft/ChatHistoryReader/ChatHistoryReader',
|
||||
title: 'Minecraft 聊天记录查看',
|
||||
iconClass: 'mdi mdi-format-list-text',
|
||||
desc: '读取并解析 latest.log 文件,显示聊天记录。',
|
||||
createdAt: '2025-02-03',
|
||||
updatedAt: '2025-02-03',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'calc-minecraft-chunk-location',
|
||||
component: 'Minecraft/CalcChunkLocation',
|
||||
title: 'Minecraft 区块位置计算',
|
||||
iconClass: 'mdi mdi-calculator-variant-outline',
|
||||
desc: '',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
id: 'generate-minecraft-dynmap-renderdata',
|
||||
component: 'Minecraft/GenerateDynmapRenderdata',
|
||||
title: '生成 Dynmap renderdata',
|
||||
iconClass: 'mdi mdi-file-outline',
|
||||
desc: '生成用于 Minecraft Dynmap 插件或模组的 renderdata 数据。',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'network-tools',
|
||||
title: '网络',
|
||||
enabled: true,
|
||||
items: [
|
||||
{
|
||||
id: 'websocket-test-tool',
|
||||
component: 'Network/WebSocketTestTool',
|
||||
title: 'WebSocket 测试',
|
||||
iconClass: 'mdi mdi-connection',
|
||||
desc: '连接 WebSocket 服务端,发送和接收消息。',
|
||||
createdAt: '2024-12-01',
|
||||
updatedAt: '2024-12-01',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'other-tools',
|
||||
title: '其他',
|
||||
enabled: true,
|
||||
items: [
|
||||
{
|
||||
id: 'keep-screen-on',
|
||||
component: 'Other/KeepScreenOn',
|
||||
title: '保持亮屏',
|
||||
iconClass: 'mdi mdi-monitor',
|
||||
desc: '保持屏幕开启,不息屏,不休眠。',
|
||||
createdAt: '2024-10-11',
|
||||
updatedAt: '2026-01-03',
|
||||
version: '3',
|
||||
enabled: true,
|
||||
changelogs: CHANGE_LOGS['keep-screen-on'],
|
||||
},
|
||||
{
|
||||
id: 'visualized-working-hours',
|
||||
component: 'Other/VisualizedWorkingHours/VisualizedWorkingHours',
|
||||
title: '工作时间可视化',
|
||||
iconClass: 'mdi mdi-clock-digital',
|
||||
desc: '用趣味化的方式呈现工作收益与时间进度,让薪资进度和下班期待看得见。',
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
version: '0',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
id: 'timer-tool',
|
||||
component: 'Other/TimerTool',
|
||||
title: '计时器',
|
||||
iconClass: 'mdi mdi-timer-outline',
|
||||
desc: '正计时、倒计时工具。',
|
||||
createdAt: '2025-12-29',
|
||||
updatedAt: '2025-12-29',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'open-new-window',
|
||||
component: 'Other/OpenNewWindow',
|
||||
title: '新窗口中打开',
|
||||
iconClass: 'mdi mdi-window-maximize',
|
||||
desc: '从新的小窗口中打开指定的链接(仅支持 PC 端浏览器)。',
|
||||
createdAt: '2025-02-04',
|
||||
updatedAt: '2025-02-04',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'run-javascript',
|
||||
component: 'Other/RunJavaScript',
|
||||
title: '执行 JavaScript',
|
||||
iconClass: 'mdi mdi-code-braces',
|
||||
desc: '执行简单的 JavaScript 代码片段。',
|
||||
createdAt: '2026-01-03',
|
||||
updatedAt: '2026-01-03',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
id: 'msu2-usb-monitor-controller',
|
||||
component: 'Other/Msu2UsbMonitorController/Msu2UsbMonitorController',
|
||||
title: 'MSU2 USB 小屏幕控制',
|
||||
iconClass: 'mdi mdi-usb',
|
||||
desc: 'MSU2 USB 小屏幕控制工具,参考了原 Python 程序的代码。',
|
||||
createdAt: '2026-02-21',
|
||||
updatedAt: '2026-02-24',
|
||||
version: '2',
|
||||
enabled: true,
|
||||
changelogs: CHANGE_LOGS['msu2-usb-monitor-controller'],
|
||||
},
|
||||
{
|
||||
id: 'genshin-impact-clock',
|
||||
component: 'Other/GenshinImpactClock/GenshinImpactClock',
|
||||
title: '《原神》时钟',
|
||||
iconClass: 'mdi mdi-clock-outline',
|
||||
desc: '在网页上实现的《原神》时钟效果。',
|
||||
createdAt: '2024-10-13',
|
||||
updatedAt: '2024-10-13',
|
||||
version: '1',
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* @description 获取动态组件
|
||||
* @param {string} path 工具页面相对路径
|
||||
*/
|
||||
function getDynamicComponent(path) {
|
||||
|
||||
let key = `../../views/ToolboxView/${path}.vue`;
|
||||
let component = MODULES[key];
|
||||
|
||||
return component;
|
||||
|
||||
}
|
||||
|
||||
/** 生成工具箱页面路由 */
|
||||
export function getToolboxRoutes() {
|
||||
|
||||
/** @type {VueRouteRecordRaw[]} */
|
||||
let routes = [];
|
||||
|
||||
toolList.forEach((categoryItem) => {
|
||||
categoryItem.items.forEach((toolItem) => {
|
||||
|
||||
// // 跳过未启用的工具
|
||||
// if (!toolItem.enabled) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
routes.push({
|
||||
path: `/toolbox-view/${toolItem.id}`,
|
||||
name: `Toolbox/${toolItem.component}`,
|
||||
component: getDynamicComponent(toolItem.component),
|
||||
meta: {
|
||||
isToolDetail: true,
|
||||
title: toolItem.title,
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
return routes;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// 工具函数
|
||||
|
||||
import {
|
||||
description as appDesc,
|
||||
} from '@package-json';
|
||||
|
||||
import {
|
||||
v4 as uuidV4,
|
||||
} from 'uuid';
|
||||
|
||||
/** 将十六进制颜色值转为灰度值 */
|
||||
export function colorHexToGrayLevel(hex = '') {
|
||||
|
||||
let rgb = colorHexToRgb(hex);
|
||||
|
||||
return Math.round(rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114);
|
||||
|
||||
}
|
||||
|
||||
/** 将十六进制颜色值转为 RGB */
|
||||
export function colorHexToRgb(hex = '') {
|
||||
|
||||
// 去除可能存在的 '#' 字符
|
||||
hex = hex.replace('#', '');
|
||||
|
||||
// 检查十六进制颜色值的长度,并根据长度决定如何处理
|
||||
if (hex.length === 3) {
|
||||
// 如果是简写形式,如 #FFF,需要将其转换为完整形式 #FFFFFF
|
||||
hex = hex.split('').map(char => char + char).join('');
|
||||
}
|
||||
|
||||
// 分别解析出红色、绿色和蓝色的值
|
||||
let r = parseInt(hex.slice(0, 2), 16);
|
||||
let g = parseInt(hex.slice(2, 4), 16);
|
||||
let b = parseInt(hex.slice(4, 6), 16);
|
||||
|
||||
return { r, g, b };
|
||||
|
||||
}
|
||||
|
||||
/** 获取 V4 UUID */
|
||||
export function getUuidV4(noSplit = false) {
|
||||
let uuid = uuidV4();
|
||||
return noSplit ? uuid.replace(/-/g, '') : uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 更新页面标题
|
||||
* @param {string} title
|
||||
*/
|
||||
export function updateAppTitle(title = '') {
|
||||
document.title = (title ? `${title} - ${appDesc}` : appDesc);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#FFFFFF" p-id="8789"></path><path d="M428.846545 71.796364c53.504-4.096 107.892364 2.792727 158.487273 20.712727a389.701818 389.701818 0 0 1 242.967273 254.464c22.132364 73.541818 22.109091 153.553455 0.093091 227.118545-2.653091 8.052364-4.770909 16.360727-8.378182 24.087273 0.558545-8.96 0.698182-18.129455-2.001455-26.763636a64.581818 64.581818 0 0 0-20.340363-31.022546 66.094545 66.094545 0 0 0-48.058182-14.824727 64.488727 64.488727 0 0 0-45.079273 24.017455c-1.442909 1.792-2.885818 3.560727-4.282182 5.399272 16.709818-44.450909 21.317818-93.370182 13.172364-140.148363a260.910545 260.910545 0 0 0-123.950545-179.828364 258.490182 258.490182 0 0 0-124.858182-36.328727 259.258182 259.258182 0 0 0-142.08 37.073454 262.237091 262.237091 0 0 0-110.498909 133.585455 262.818909 262.818909 0 0 0 2.071272 186.624 66.792727 66.792727 0 0 0-33.512727-27.461818c-19.851636-7.424-43.333818-4.631273-60.602182 7.796363-10.472727 7.098182-18.618182 17.454545-23.133091 29.323637-3.863273 9.541818-4.491636 20.084364-3.630545 30.277818a394.100364 394.100364 0 0 1-24.692364-123.764364 390.120727 390.120727 0 0 1 31.557819-166.632727 389.771636 389.771636 0 0 1 118.272-152.971636 385.256727 385.256727 0 0 1 208.47709-80.756364z" fill="#0FB264"></path><path d="M121.995636 536.296727c17.268364-12.427636 40.750545-15.220364 60.602182-7.819636a66.792727 66.792727 0 0 1 33.512727 27.485091c6.190545 13.125818 12.032 26.484364 19.781819 38.795636 20.247273 33.792 48.267636 62.836364 81.198545 84.410182a257.954909 257.954909 0 0 0 112.174546 40.587636c42.193455 4.887273 85.597091-0.558545 125.044363-16.290909a257.186909 257.186909 0 0 0 91.787637-61.277091 263.261091 263.261091 0 0 0 56.15709-87.202909c1.396364-1.838545 2.839273-3.607273 4.282182-5.399272a64.488727 64.488727 0 0 1 45.079273-24.017455 66.094545 66.094545 0 0 1 48.058182 14.824727c9.774545 7.936 16.616727 19.083636 20.340363 30.999273 2.699636 8.657455 2.56 17.826909 2.001455 26.786909-0.698182 3.723636-2.443636 7.098182-3.863273 10.589091a391.889455 391.889455 0 0 1-81.640727 123.810909 387.793455 387.793455 0 0 1-128.605091 87.226182 387.979636 387.979636 0 0 1-209.198545 24.901818 382.836364 382.836364 0 0 1-128.279273-44.334545 390.260364 390.260364 0 0 1-164.747636-179.130182c-3.607273-8.378182-7.400727-16.709818-10.472728-25.344-0.837818-10.193455-0.209455-20.712727 3.653818-30.301091 4.491636-11.845818 12.660364-22.202182 23.133091-29.300364z m749.614546 157.602909c13.730909-1.629091 27.973818 1.163636 39.842909 8.331637a63.441455 63.441455 0 0 1 30.394182 63.092363 63.534545 63.534545 0 0 1-41.192728 50.734546 63.534545 63.534545 0 0 1-64.023272-12.823273 63.953455 63.953455 0 0 1-20.549818-46.08 63.255273 63.255273 0 0 1 55.552-63.255273z" fill="#FF9932"></path></svg>
|
||||
<!-- IconFont UID: 157961 -->
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1092 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M521.007 0L0 859.065 260.504 1024l53.99-184.999 413.375-31.18 107.266 204.805 256.673-153.56L521.008 0zM414.7 642.136l98.648-217.36 111.096 217.36H414.699z" fill="#FD4C5D"></path></svg>
|
||||
<!-- IconFont UID: 6087667 -->
|
||||
|
After Width: | Height: | Size: 317 B |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M184.682058 538.758771c111.176877-23.873478 96.029086-156.736593 92.70169-185.775677-5.444828-44.768588-58.101436-123.020542-129.605526-116.831122-89.979276 8.074168-103.125977 138.051991-103.125977 138.051991-12.169424 60.079258 29.132158 188.451554 140.029813 164.554808z m118.064352 231.102709c-3.25759 9.330667-10.51736 33.227413-4.234867 54.029449 12.402109 46.676604 52.912561 48.770769 52.912562 48.770769h58.217778V730.351572h-62.336302c-28.01527 8.35339-41.534266 30.155972-44.559171 39.509908z m88.280676-453.898564c61.405563 0 111.037266-70.666424 111.037266-158.039629 0-87.280131-49.631703-157.923287-111.037266-157.923287-61.312489 0-111.060534 70.643156-111.060534 157.923287 0 87.373205 49.771314 158.039629 111.060534 158.039629z m264.469733 10.447555c82.067988 10.656971 134.840938-76.92565 145.33503-143.310671 10.703508-66.291947-42.25559-143.287402-100.357026-156.527177-58.217779-13.356117-130.908562 79.904017-137.540084 140.704599-7.911289 74.319578 10.633703 148.59262 92.56208 159.133249z m201.086348 390.212688s-126.976186-98.239593-201.109617-204.413743c-100.473368-156.550445-243.202327-92.841302-290.949282-13.216506-47.537539 79.601527-121.624432 129.954554-132.141792 143.287403-10.68024 13.123432-153.38593 90.165424-121.694237 230.870023 31.668424 140.611525 142.938375 137.935648 142.938374 137.935648s81.998182 8.074168 177.119797-13.216506c95.168151-21.104526 177.096528 5.25868 177.096528 5.258681s222.283948 74.435921 283.107798-68.851482c60.754045-143.333939-34.36757-217.653518-34.367569-217.653518z m-380.323578 213.255772h-144.520632c-62.406108-12.448646-87.256862-55.029995-90.39811-62.289765-3.071442-7.376113-20.802036-41.604072-11.424832-99.845119 26.968188-87.256862 103.870569-93.516088 103.870569-93.516088h76.92565v-94.563171l65.524087 1.000546v349.213597z m269.146701-1.000545h-166.299946c-64.453736-16.613707-67.455372-62.406108-67.455371-62.406108v-183.890929l67.455371-1.093619v165.276131c4.118524 17.63752 26.014179 20.825304 26.01418 20.825305h68.525722v-185.007817h71.760044v246.297037z m235.40738-490.988548c0-31.761498-26.386475-127.395019-124.230503-127.395019-98.006908 0-111.107071 90.258498-111.107072 154.060716 0 60.893656 5.142338 145.893474 126.883112 143.194329 121.787311-2.699146 108.454463-137.935648 108.454463-169.860026z m0 0" fill="#3245DF"></path></svg>
|
||||
<!-- IconFont UID: 26416 -->
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M306.005333 117.632L444.330667 256h135.296l138.368-138.325333a42.666667 42.666667 0 0 1 60.373333 60.373333L700.330667 256H789.333333A149.333333 149.333333 0 0 1 938.666667 405.333333v341.333334a149.333333 149.333333 0 0 1-149.333334 149.333333h-554.666666A149.333333 149.333333 0 0 1 85.333333 746.666667v-341.333334A149.333333 149.333333 0 0 1 234.666667 256h88.96L245.632 177.962667a42.666667 42.666667 0 0 1 60.373333-60.373334zM789.333333 341.333333h-554.666666a64 64 0 0 0-63.701334 57.856L170.666667 405.333333v341.333334a64 64 0 0 0 57.856 63.701333L234.666667 810.666667h554.666666a64 64 0 0 0 63.701334-57.856L853.333333 746.666667v-341.333334A64 64 0 0 0 789.333333 341.333333zM341.333333 469.333333a42.666667 42.666667 0 0 1 42.666667 42.666667v85.333333a42.666667 42.666667 0 0 1-85.333333 0v-85.333333a42.666667 42.666667 0 0 1 42.666666-42.666667z m341.333334 0a42.666667 42.666667 0 0 1 42.666666 42.666667v85.333333a42.666667 42.666667 0 0 1-85.333333 0v-85.333333a42.666667 42.666667 0 0 1 42.666667-42.666667z" fill="#00A1D6"></path></svg>
|
||||
<!-- IconFont UID: 5455300 -->
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" ><path d="M56.888889 56.888889h910.222222v910.222222H56.888889V56.888889z" fill="#0C8484"></path><path d="M227.555556 170.666667v606.037333L369.777778 881.777778l426.666666-234.325334V483.555556L446.976 340.366222l73.159111 177.777778L625.777778 568.888889l-369.777778 199.111111L398.222222 625.777778V227.555556z" fill="#FFFFFF"></path></svg>
|
||||
<!-- IconFont UID: 5519894 -->
|
||||
|
After Width: | Height: | Size: 466 B |
@@ -0,0 +1,2 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" with="64" height="64"><defs><clipPath id="prefix__clip-path"><path class="prefix__cls-1" d="M29.48 25.24c-.16-1.89-.08-1.5-.24-3.16a72.24 72.24 0 00-2-10.37L26 6.25l-2.6 5.41-.44.89q-.24.48-.54 1a20.43 20.43 0 01-1.24 1.84 20.08 20.08 0 01-3.08 3.24 19.72 19.72 0 01-3.87 2.53c-.72.33-1.45.71-2.23 1-.34.14-1.19.44-1.93.66a2.55 2.55 0 01-1.07-.3c-.34-1-.83-2.24-1.2-3.19-.5-1.25-1-2.5-1.51-3.73a59.11 59.11 0 00-3.62-7.25 59.82 59.82 0 001.51 7.94c.3 1.3.7 2.58 1.05 3.87S6 22.71 6.44 24a1.4 1.4 0 001.29.93c1.28 0 2.57.06 3.86.05s2.59 0 3.88-.11a56 56 0 007.79-.87c-1.92-.49-7.5-.81-10.79-1.06a43 43 0 006.53-1.7 24.06 24.06 0 005.38-3.45c.71-.62 1.21 1.88 2.39 5.27.62 1.69.34 1 1 2.66s1.37 4.38 2.17 6c-.07-1.82-.31-4.67-.46-6.48z"/></clipPath><clipPath id="prefix__clip-path-2"><path class="prefix__cls-1" d="M20.92 3.46a4.25 4.25 0 01.31 5.86 3.91 3.91 0 01-5.66.24 4.25 4.25 0 01-.31-5.86 3.91 3.91 0 015.66-.24m1.35-1.54a5.89 5.89 0 00-8.53.36 6.41 6.41 0 00.48 8.83 5.91 5.91 0 008.53-.36 6.41 6.41 0 00-.48-8.83z"/></clipPath><style>.prefix__cls-1{fill:#3e3a39}@media (prefers-color-scheme:dark){.prefix__cls-1{fill:#efefef}}</style></defs><g style="isolation:isolate"><g id="prefix__layer_1" data-name="layer 1"><path class="prefix__cls-1" d="M29.48 25.24c-.16-1.89-.08-1.5-.24-3.16a72.24 72.24 0 00-2-10.37L26 6.25l-2.6 5.41-.44.89q-.24.48-.54 1a20.43 20.43 0 01-1.24 1.84 20.08 20.08 0 01-3.08 3.24 19.72 19.72 0 01-3.87 2.53c-.72.33-1.45.71-2.23 1-.34.14-1.19.44-1.93.66a2.55 2.55 0 01-1.07-.3c-.34-1-.83-2.24-1.2-3.19-.5-1.25-1-2.5-1.51-3.73a59.11 59.11 0 00-3.62-7.25 59.82 59.82 0 001.51 7.94c.3 1.3.7 2.58 1.05 3.87S6 22.71 6.44 24a1.4 1.4 0 001.29.93c1.28 0 2.57.06 3.86.05s2.59 0 3.88-.11a56 56 0 007.79-.87c-1.92-.49-7.5-.81-10.79-1.06a43 43 0 006.53-1.7 24.06 24.06 0 005.38-3.45c.71-.62 1.21 1.88 2.39 5.27.62 1.69.34 1 1 2.66s1.37 4.38 2.17 6c-.07-1.82-.31-4.67-.46-6.48z"/><g clip-path="url(#prefix__clip-path)"><path class="prefix__cls-1" d="M-.87-.78h34.42v33.07H-.87z"/></g><path class="prefix__cls-1" d="M20.92 3.46a4.25 4.25 0 01.31 5.86 3.91 3.91 0 01-5.66.24 4.25 4.25 0 01-.31-5.86 3.91 3.91 0 015.66-.24m1.35-1.54a5.89 5.89 0 00-8.53.36 6.41 6.41 0 00.48 8.83 5.91 5.91 0 008.53-.36 6.41 6.41 0 00-.48-8.83z"/><g clip-path="url(#prefix__clip-path-2)"><path class="prefix__cls-1" d="M-.87-.78h34.42v33.07H-.87z"/></g></g></g></svg>
|
||||
<!-- https://assets.cnblogs.com/favicon.svg -->
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h1024v1024H0z" fill="#FC5531"></path><path d="M698.9824 42.3936c-158.8736-32.5632-289.536 31.2832-324.9152 48.5888-94.72 46.2848-147.712 108.288-174.4896 140.288-25.9584 31.0272-82.7392 105.9328-108.288 215.8592-21.6576 93.1328-10.752 167.7824-6.0416 194.2528 11.4688 64.3072 33.28 186.88 150.4256 275.2 132.5056 99.8912 293.4784 85.5552 342.9888 80.9472 107.264-10.0352 289.4848-57.2928 300.8512-145.7152 5.1712-39.936-24.4224-89.4464-66.2016-102.5024-65.6384-20.5312-108.3392 63.5392-228.6592 80.9472-8.5504 1.2288-126.5664 16.6912-216.6272-48.5888-105.8816-76.6976-98.9696-211.3024-96.256-264.3968 1.536-30.5664 5.5808-93.5424 48.128-161.8944 14.7968-23.7568 60.3136-94.5664 156.4672-134.912 25.2928-10.5984 76.8512-31.5904 144.4352-26.9824 70.0416 4.7616 120.9856 34.5088 144.4352 48.5888 75.8272 45.4144 86.528 90.0608 120.3712 86.3232 35.8912-3.9424 69.9904-59.2896 66.2016-107.9296-7.424-93.7984-155.5968-158.1056-252.8256-178.0736z" fill="#FFFFFF"></path></svg>
|
||||
<!-- IconFont UID: 7767443 -->
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M884.224 501.248c0 13.824 0 29.184-1.536 43.008H394.752c0 83.968 73.728 145.92 154.624 145.92 54.784 0 108.032-27.648 135.68-75.776h178.688c-48.128 135.68-175.104 226.816-319.488 226.816-51.712 0-102.912-11.776-149.504-35.84C346.624 829.44 281.6 855.04 228.352 855.04c-72.192 0-99.84-43.008-99.84-111.616 0-39.424 8.704-77.312 20.48-115.2 5.12-24.064 34.304-73.728 46.592-97.792 51.712-92.672 118.272-185.344 200.704-256C332.8 302.08 260.608 372.224 216.064 423.936c34.304-153.088 171.52-262.656 328.192-262.656h20.48c51.712-24.064 125.44-49.664 183.808-49.664 67.072 0 126.976 25.6 126.976 102.912 0 39.424-15.36 83.968-32.768 121.856 27.648 49.664 41.472 108.032 41.472 164.864zM855.04 231.424c0-48.128-34.304-75.776-78.848-75.776-35.84 0-75.776 13.824-108.032 29.184 70.656 27.648 126.976 75.776 164.864 137.216 11.776-26.624 22.016-61.44 22.016-90.624zM181.76 752.128c0 49.664 29.184 75.776 77.312 75.776 37.888 0 78.848-15.36 111.616-35.84-70.656-41.472-121.856-104.96-147.456-180.224-19.456 40.448-41.472 95.744-41.472 140.288z m212.992-300.544h305.664C698.88 370.688 624.64 312.32 547.328 312.32c-78.848 0-151.04 58.368-152.576 139.264z m0 0" fill="#555555"></path></svg>
|
||||
<!-- IconFont UID: 946930 -->
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M0 524.992q0 166.016 95.488 298.496t247.488 185.504q6.016 0.992 10.016 0.992t6.496-1.504 4-3.008 2.016-4.992 0.512-4.992v-100.512q-36.992 4-66.016-0.512t-45.504-14.016-28.992-23.488-16.992-25.504-8.992-24-5.504-14.496q-8.992-15.008-27.008-27.488t-27.008-20-2.016-14.496q50.016-26.016 112.992 66.016 34.016 51.008 119.008 30.016 10.016-40.992 40-70.016Q293.984 736 237.984 670.976t-56-158.016q0-87.008 55.008-151.008-22.016-64.992 6.016-136.992 28.992-2.016 64.992 11.488t50.496 23.008 25.504 17.504q56.992-16 128.512-16t129.504 16q12.992-8.992 28.992-19.008t48.992-21.504 60.992-9.504q27.008 71.008 7.008 135.008 56 64 56 151.008 0 92.992-56.992 158.496t-172 85.504q43.008 43.008 43.008 104v128.992q0 0.992 0.992 3.008 0 6.016 0.512 8.992t4.512 6.016 12 3.008q152.992-52 250.496-185.504t97.504-300.512q0-104-40.512-199.008t-108.992-163.488-163.488-108.992T512.032 12.96 313.024 53.472 149.536 162.464t-108.992 163.488-40.512 199.008z" fill="#24292E"></path></svg>
|
||||
<!-- IconFont UID: 394374 -->
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M214.101333 512c0-32.512 5.546667-63.701333 15.36-92.928L57.173333 290.218667A491.861333 491.861333 0 0 0 4.693333 512c0 79.701333 18.858667 154.88 52.394667 221.610667l172.202667-129.066667A290.56 290.56 0 0 1 214.101333 512" fill="#FBBC05"></path><path d="M516.693333 216.192c72.106667 0 137.258667 25.002667 188.458667 65.962667L854.101333 136.533333C763.349333 59.178667 646.997333 11.392 516.693333 11.392c-202.325333 0-376.234667 113.28-459.52 278.826667l172.373334 128.853333c39.68-118.016 152.832-202.88 287.146666-202.88" fill="#EA4335"></path><path d="M516.693333 807.808c-134.357333 0-247.509333-84.864-287.232-202.88l-172.288 128.853333c83.242667 165.546667 257.152 278.826667 459.52 278.826667 124.842667 0 244.053333-43.392 333.568-124.757333l-163.584-123.818667c-46.122667 28.458667-104.234667 43.776-170.026666 43.776" fill="#34A853"></path><path d="M1005.397333 512c0-29.568-4.693333-61.44-11.648-91.008H516.650667V614.4h274.602666c-13.696 65.962667-51.072 116.650667-104.533333 149.632l163.541333 123.818667c93.994667-85.418667 155.136-212.650667 155.136-375.850667" fill="#4285F4"></path></svg>
|
||||
<!-- IconFont UID: 608646 -->
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1.703827 0h1022.296173v1022.296173H1.703827z" fill="#E94618"></path><path d="M501.799188 865.690622c-38.777398-23.478735-30.512133-64.416586-55.495348-90.18356-45.955621-47.388539-126.495521-49.818196-173.427434-104.054416-157.356938-181.844339-6.25986-521.808932 291.356113-471.721531 173.442769 29.18826 305.577957 272.184652 187.299993 443.973005-50.872865 73.896679-148.708313 79.747621-208.112239 159.553171-17.406296 17.273398-8.592399 60.780619-41.621085 62.433331zM252.06416 470.276686c-6.982283 131.959694 180.363714 125.277285 180.363714 6.937983 0-60.245617-54.101617-108.603634-124.866663-83.245577-49.779008 17.835661-53.437125 37.388779-55.497051 76.307594z m381.53797 97.11984c158.950017 44.573817 162.964233-230.536306 0-173.427434-77.096466 27.017584-68.110483 154.329238 0 173.427434z m-159.551468 83.247281c25.407468 5.697597 32.996313-68.502363 6.93628-69.374722-14.470602 14.327481-48.605072 59.225025-6.93628 69.374722z m62.429924 0h13.879374c17.914037-28.413018-6.004286-65.42014-34.686509-69.374722 2.320612 27.740007-8.91783 69.037364 20.807135 69.374722z" fill="#FFFFFF"></path></svg>
|
||||
<!-- IconFont UID: 294408 -->
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 433.493333c0-20.48-3.413333-40.96-3.413333-61.44 0-10.24-3.413333-20.48-10.24-27.306666-6.826667-10.24-17.066667-17.066667-30.72-20.48-23.893333-10.24-47.786667-20.48-68.266667-27.306667-34.133333-10.24-64.853333-23.893333-95.573333-40.96-20.48-10.24-34.133333-34.133333-37.546667-58.026667-3.413333-27.306667-17.066667-51.2-40.96-64.853333-27.306667-13.653333-54.613333-17.066667-85.333333-10.24-20.48 3.413333-44.373333 3.413333-64.853334 0l-30.72-10.24-10.24-3.413333-23.893333-6.826667c-44.373333-13.653333-64.853333-20.48-136.533333-6.826667C307.2 112.64 238.933333 150.186667 180.906667 204.8L0 399.36h163.84l-98.986667 105.813333h170.666667L136.533333 610.986667h136.533334l-44.373334 116.053333c170.666667 174.08 351.573333 208.213333 351.573334 208.213333 0-47.786667 10.24-235.52 23.893333-266.24 3.413333-17.066667 13.653333-30.72 20.48-44.373333 23.893333-27.306667 58.026667-44.373333 95.573333-44.373333 37.546667 0 75.093333 6.826667 109.226667 20.48 20.48 10.24 44.373333 6.826667 64.853333-3.413334 13.653333-10.24 27.306667-17.066667 44.373334-27.306666 3.413333-3.413333 10.24-6.826667 17.066666-6.826667 17.066667 3.413333 30.72-6.826667 37.546667-20.48 3.413333-10.24 10.24-17.066667 13.653333-27.306667 13.653333-23.893333 17.066667-51.2 17.066667-81.92z" fill="#212121"></path></svg>
|
||||
<!-- IconFont UID: 3917962 -->
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M627.086668 5.114963c28.132297-7.672445 58.822075-7.672445 86.954372 0 33.24726 7.672445 63.937038 23.017334 89.511853 43.477186 10.229926 7.672445 17.902371 15.344889 23.017334 28.132297 7.672445 17.902371 5.114963 38.362223-5.114963 53.707112-7.672445 12.787408-23.017334 23.017334-40.919704 25.574815-12.787408 2.557482-25.574815 0-38.362223-7.672445-5.114963-2.557482-10.229926-10.229926-17.902371-12.787407-17.902371-10.229926-35.804741-20.459852-56.264593-17.902371-15.344889 0-28.132297 7.672445-35.804742 17.902371-10.229926 10.229926-12.787408 23.017334-10.229926 35.804741 7.672445 25.574815 12.787408 53.707112 20.459853 79.281927 51.14963 2.557482 99.741779 15.344889 143.218965 40.919704 40.919704 25.574815 79.281927 58.822075 109.971705 97.184298 25.574815 33.24726 46.034667 71.609483 56.264593 112.529187 12.787408 43.477186 17.902371 89.511853 12.787408 132.989039-2.557482 38.362223-10.229926 74.166964-23.017334 109.971705-33.24726 84.39689-92.069335 161.121336-171.351261 209.713485-56.264593 35.804741-122.759113 58.822075-189.253633 66.49452-46.034667 5.114963-92.069335 5.114963-138.104002-2.557482-94.626816-15.344889-181.581188-61.379556-250.633189-130.431558-66.49452-66.49452-112.529187-153.448891-132.989039-245.518225-7.672445-69.052001-7.672445-138.104002 7.672445-207.156004 17.902371-81.839409 61.379556-161.121336 117.644149-222.500892 48.592149-51.14963 107.414224-89.511853 171.351262-117.64415 7.672445-2.557482 12.787408-5.114963 20.459852-7.672444 15.344889-2.557482 30.689778 0 43.477186 10.229926 17.902371 12.787408 25.574815 33.24726 23.017334 53.707112-2.557482 20.459852-17.902371 38.362223-35.804741 46.034667-63.937038 25.574815-122.759113 69.052001-163.678818 122.759113C205.102218 373.392302 179.527402 432.214377 171.854958 493.593933c-7.672445 61.379556 0 122.759113 20.459852 181.581188 30.689778 84.39689 94.626816 156.006373 173.908743 196.926077 48.592149 25.574815 102.299261 38.362223 156.006373 38.362223 43.477186 0 89.511853-7.672445 130.431558-23.017334 35.804741-12.787408 71.609483-33.24726 99.741779-58.822074 28.132297-23.017334 51.14963-53.707112 66.494519-84.396891 7.672445-15.344889 17.902371-33.24726 20.459853-51.14963 15.344889-51.14963 17.902371-107.414224 2.557481-158.563854-12.787408-43.477186-38.362223-81.839409-71.609482-109.971706-15.344889-12.787408-30.689778-25.574815-48.592149-35.804741-15.344889-7.672445-30.689778-15.344889-48.592149-17.902371 12.787408 46.034667 23.017334 92.069335 35.804741 135.546521 2.557482 10.229926 5.114963 23.017334 5.114963 33.24726 2.557482 46.034667-15.344889 94.626816-46.034667 130.431557-28.132297 33.24726-69.052001 58.822075-112.529187 66.49452-46.034667 10.229926-97.184298 0-138.104002-25.574815-38.362223-25.574815-66.49452-63.937038-81.839409-104.856743-7.672445-23.017334-12.787408-48.592149-12.787407-74.166964-2.557482-56.264593 12.787408-109.971705 43.477185-156.006373 35.804741-53.707112 94.626816-92.069335 158.563855-109.971705-5.114963-17.902371-10.229926-35.804741-12.787408-53.707112-12.787408-38.362223-10.229926-81.839409 7.672445-115.086668 10.229926-20.459852 23.017334-38.362223 40.919704-51.149631C583.609483 25.574815 604.069335 12.787408 627.086668 5.114963m-148.333928 414.312006c-17.902371 17.902371-28.132297 40.919704-33.24726 63.937038-5.114963 20.459852-5.114963 43.477186 0 66.49452 5.114963 23.017334 17.902371 46.034667 38.362223 61.379556 15.344889 10.229926 35.804741 15.344889 56.264594 10.229926 35.804741-5.114963 63.937038-38.362223 63.937038-74.166964-2.557482-7.672445-2.557482-17.902371-5.114963-25.574815-12.787408-48.592149-25.574815-99.741779-38.362223-148.333928-30.689778 7.672445-58.822075 23.017334-81.839409 46.034667z" fill="#E72D2C"></path></svg>
|
||||
<!-- IconFont UID: 4194729 -->
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M35.84 529.92c0 263.68 215.04 478.72 478.72 478.72 263.68 0 478.72-215.04 478.72-478.72C993.28 266.24 780.8 51.2 514.56 51.2 250.88 51.2 35.84 266.24 35.84 529.92z" fill="#FFDC00"></path><path d="M660.48 10.24c-17.92 20.48-56.32 38.4-107.52 51.2-87.04 20.48-104.96 25.6-130.56 40.96-15.36 7.68-33.28 20.48-43.52 30.72-20.48 17.92-35.84 51.2-30.72 61.44 2.56 5.12 51.2 74.24 110.08 158.72 58.88 81.92 115.2 163.84 128 181.76 12.8 17.92 20.48 33.28 20.48 33.28 0 2.56-10.24 0-20.48-2.56-40.96-12.8-112.64 0-163.84 25.6-38.4 20.48-81.92 64-99.84 99.84-20.48 40.96-23.04 97.28-7.68 135.68 15.36 40.96 48.64 74.24 92.16 97.28 33.28 17.92 40.96 17.92 84.48 20.48 35.84 2.56 56.32 0 76.8-5.12 94.72-28.16 163.84-102.4 168.96-189.44 2.56-48.64-2.56-64-66.56-176.64-99.84-174.08-189.44-332.8-189.44-335.36 0 0 17.92-2.56 40.96-5.12 66.56-2.56 120.32-35.84 148.48-89.6 12.8-23.04 12.8-30.72 12.8-79.36 0-30.72-2.56-58.88-5.12-61.44-2.56-7.68-5.12-5.12-17.92 7.68z" fill="#13BF74"></path></svg>
|
||||
<!-- IconFont UID: 307228 -->
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 917.5c-225 0-407.4-182.4-407.4-407.3 0-225 182.4-407.4 407.4-407.4s407.4 182.4 407.4 407.4c0 99.9-36 191.3-95.7 262.2l32.4 23.3c64.4-77.5 103.1-177 103.1-285.5C959.1 263.2 758.9 63 512 63 265 63 64.9 263.2 64.9 510.1c0 247 200.1 447.2 447.1 447.2 58.6 0.1 116.6-11.4 170.7-33.8l-20.2-34.8c-47.8 19-98.9 28.8-150.5 28.8z m188.1 8.7l20.2 34.8c67.3-27.9 126.8-71.7 173.4-127.8l-32.4-23.3c-43.4 51.4-98.7 91.4-161.2 116.3z" fill="#FA4D23"></path><path d="M503.5 678.9s-162.7 1.2-251.3-81.3l-7 115.3s535.5 194.2 540.3-117.7c0 0 11.4-74.1-182.5-125 0 0-76.5-18.6-162.7-68 0 0-47.4-54.6 88-43.7 160.6 12.9 242.2 54.6 242.2 54.6v-102s-363.6-137.2-506.8 19.4c0 0-47.1 71.6 1.5 116.5 48.6 44.9 147.6 102 280 136 0 0 170.7 77.7-41.7 95.9z" fill="#FA4D23"></path></svg>
|
||||
<!-- IconFont UID: 186394 -->
|
||||
|
After Width: | Height: | Size: 893 B |
|
After Width: | Height: | Size: 6.5 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M451 1024V691.8L229 96h111.6l163.6 459.4L692.4 0h102.6L553.6 695.6V1024h-102.6z" fill="#FF0000"></path></svg>
|
||||
<!-- IconFont UID: 597369 -->
|
||||
|
After Width: | Height: | Size: 240 B |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M641.6 33.36c2.96-6.24 11.36-27.44 19.12-13.76 31.2 72.96 25.76 158.56-5.36 230.8 91.2-16.48 179.12-54 251.2-112.72 28.32-21.76 51.92-48.64 77.6-73.28 11.52 16.32 6.08 37.36 6.96 55.92-2.24 124.8-44.72 247.44-116.88 349.04 45.92-4.16 89.28-20.16 134-30-24.24 110.56-112.8 201.36-217.2 241.68-21.52 120.24-100.72 229.36-209.84 284.88-97.76 51.36-218.48 56.16-320 12.8-78.4-32.8-145.52-91.6-187.84-165.36C2.56 693.68-5.12 536.4 61.44 413.28 112.56 318.64 205.6 252.8 305.92 218.4c65.92-24.24 138.48-25.2 202.4-55.76 58-25.28 108.16-70.64 133.28-129.28M244 448.08c-1.04 17.92 3.92 47.04 27.44 45.68 55.76 1.12 111.44-0.24 167.2 0.48-56.72 63.2-116.16 123.92-173.76 186.16-27.52 30.72-20.4 74.4-19.52 112.08 0.96 24.88 27.68 38.32 50 36 103.92-0.48 207.92 0.56 311.76-0.4 23.12-4.08 24-33.76 23.2-52.4-2.16-36.16-2.96-83.04-38.96-102.96 0.08 12.16 0.96 29.92-16.32 27.2-51.76 0.88-103.6-0.8-155.36 0.8 44.8-51.36 92.16-100.24 137.28-151.28 19.36-21.04 42.24-42.48 46.8-72.16 5.12-37.76-0.56-76.16 5.84-113.92-50.64 9.12-102.24 4.88-153.36 5.76-50.96-0.64-101.92 1.52-152.88 0.24-18.16 2.32-23.84-12.88-19.76-27.92-36.24 21.36-38.16 69.2-39.6 106.64z" fill="#272828"></path><path d="M244 448.08c1.44-37.44 3.36-85.28 39.6-106.64-4.08 15.04 1.6 30.24 19.76 27.92 50.96 1.28 101.92-0.88 152.88-0.24 51.12-0.88 102.72 3.36 153.36-5.76-6.4 37.76-0.72 76.16-5.84 113.92-4.56 29.68-27.44 51.12-46.8 72.16-45.12 51.04-92.48 99.92-137.28 151.28 51.76-1.6 103.6 0.08 155.36-0.8 17.28 2.72 16.4-15.04 16.32-27.2 36 19.92 36.8 66.8 38.96 102.96 0.8 18.64-0.08 48.32-23.2 52.4-103.84 0.96-207.84-0.08-311.76 0.4-22.32 2.32-49.04-11.12-50-36-0.88-37.68-8-81.36 19.52-112.08 57.6-62.24 117.04-122.96 173.76-186.16-55.76-0.72-111.44 0.64-167.2-0.48-23.52 1.36-28.48-27.76-27.44-45.68z" fill="#F4C921"></path></svg>
|
||||
<!-- IconFont UID: 578395 -->
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M157.568 0h708.864A157.44 157.44 0 0 1 1024 156.352v711.296A157.376 157.376 0 0 1 866.432 1024H157.568A157.44 157.44 0 0 1 0 867.648V156.352A157.376 157.376 0 0 1 157.568 0z" fill="#0084FF"></path><path d="M240.448 529.728h108.16c2.432-36.672 0-115.584 0-171.328h-52.8c-14.72 32.832-28.608 59.584-55.808 70.4a62.912 62.912 0 0 1-40.32 3.584c11.968 1.408 52.928-148.864 72.96-176.448 13.76-17.28 34.176-27.52 56-28.352-4.032 29.44-12.032 58.176-24 85.376h200.192v45.632H396.224c0 55.168 1.984 134.016 0 171.328h125.632l-0.64 46.08-127.168-0.64c-1.216 9.984-2.24 34.112-3.392 43.392 0 0 66.56 70.592 101.952 116.48v79.232c-37.76-50.88-116.352-146.176-116.352-146.176-47.424 122.048-113.6 166.08-113.6 166.08H189.632s144.192-160.192 155.2-257.92H194.048l46.4-46.72z m304.96-219.84h251.008v460.16l-102.144 0.448-76.032 63.296-30.784-63.744h-42.048v-460.16z m204.608 44.224H592.064v361.792h8.96l27.008 56.832 69.632-56.832h52.352V354.112z" fill="#FFFFFF"></path></svg>
|
||||
<!-- IconFont UID: 4788168 -->
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<!-- 侧边栏 -->
|
||||
<div class="app-aside">
|
||||
|
||||
<div class="app-icon-wrapper">
|
||||
<div class="app-icon"></div>
|
||||
</div>
|
||||
|
||||
<div class="app-modules">
|
||||
<div
|
||||
v-for="item in modules"
|
||||
:key="item.name"
|
||||
:title="item.title"
|
||||
:class="{
|
||||
'is-active': (currRouteName === item.name),
|
||||
'module-item': true,
|
||||
}"
|
||||
@click="changePage(item.name)"
|
||||
>
|
||||
<span :class="item.className"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed, shallowRef, onBeforeMount,
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
useRoute, useRouter,
|
||||
} from 'vue-router';
|
||||
|
||||
/** 当前路由名称 */
|
||||
const currRouteName = computed(() => {
|
||||
return route.name;
|
||||
});
|
||||
|
||||
/**
|
||||
* @desc 模块列表
|
||||
* @type {VueRef<{ className: string; name: string; title: string; }[]>}
|
||||
*/
|
||||
const modules = shallowRef([]);
|
||||
|
||||
/** 路由 */
|
||||
const route = useRoute();
|
||||
|
||||
/** 路由 */
|
||||
const router = useRouter();
|
||||
|
||||
/** 切换页面 */
|
||||
function changePage(routeName = '') {
|
||||
router.push({ name: routeName });
|
||||
}
|
||||
|
||||
/** 初始化数据 */
|
||||
function initData() {
|
||||
|
||||
/** @type {typeof modules.value} */
|
||||
let list = [];
|
||||
|
||||
// 提取路由信息
|
||||
router.getRoutes().forEach((item) => {
|
||||
|
||||
let m = item.meta;
|
||||
|
||||
if (m.showInAside) {
|
||||
list.push({
|
||||
className: m.iconClass,
|
||||
name: item.name,
|
||||
title: m.title,
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
modules.value = list;
|
||||
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
initData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.app-aside {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.app-icon-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.app-icon {
|
||||
margin: auto;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background-image: url("/favicon.ico");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.app-modules {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 48px;
|
||||
}
|
||||
|
||||
.module-item {
|
||||
display: flex;
|
||||
margin: 0 auto;
|
||||
width: 1.8em;
|
||||
height: 1.8em;
|
||||
border-radius: 50%;
|
||||
color: #808080;
|
||||
font-size: 24px;
|
||||
cursor: pointer;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
&:hover, &.is-active {
|
||||
background-color: #F2F2F2;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
span {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,4 @@
|
||||
// 接口配置
|
||||
|
||||
/** HTTP 请求超时毫秒数 */
|
||||
export const HTTP_TIMEOUT = 10000;
|
||||
@@ -0,0 +1,10 @@
|
||||
// 环境变量
|
||||
|
||||
/** 环境变量信息 */
|
||||
const ENV = import.meta.env;
|
||||
|
||||
/** 是否为开发环境 */
|
||||
export const IS_DEV = ENV.DEV;
|
||||
|
||||
/** 是否为生产环境 */
|
||||
export const IS_PROD = ENV.PROD;
|
||||
@@ -0,0 +1,33 @@
|
||||
// 模块显示配置
|
||||
|
||||
// import { IS_DEV } from './env';
|
||||
|
||||
/** 启用模块 */
|
||||
export const ABOUT_MODULE_ENABLED = true;
|
||||
|
||||
/** 模块标题 */
|
||||
export const ABOUT_MODULE_TITLE = '关于';
|
||||
|
||||
/** 启用模块 */
|
||||
export const MC_CTRL_MODULE_ENABLED = false;
|
||||
|
||||
/** 模块标题 */
|
||||
export const MC_CTRL_MODULE_TITLE = 'MINECRAFT 联动控制';
|
||||
|
||||
/** 启用模块 */
|
||||
export const NAV_MODULE_ENABLED = true;
|
||||
|
||||
/** 模块标题 */
|
||||
export const NAV_MODULE_TITLE = '网址导航';
|
||||
|
||||
/** 启用模块 */
|
||||
export const SEARCH_MODULE_ENABLED = true;
|
||||
|
||||
/** 模块标题 */
|
||||
export const SEARCH_MODULE_TITLE = '搜索';
|
||||
|
||||
/** 启用模块 */
|
||||
export const TOOLBOX_MODULE_ENABLED = true;
|
||||
|
||||
/** 模块标题 */
|
||||
export const TOOLBOX_MODULE_TITLE = '工具箱';
|
||||
@@ -0,0 +1,44 @@
|
||||
import { createApp } from 'vue';
|
||||
import { router } from './router';
|
||||
|
||||
import '@mdi/font/css/materialdesignicons.css';
|
||||
import '@/assets/fonts/index.css';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import dayjsDuration from 'dayjs/plugin/duration';
|
||||
|
||||
import 'dayjs/locale/zh-cn';
|
||||
import 'dayjs/locale/zh-hk';
|
||||
|
||||
import lunisolar from 'lunisolar';
|
||||
import lunisolarLang1 from 'lunisolar/locale/en';
|
||||
import lunisolarLang2 from 'lunisolar/locale/zh-cn';
|
||||
import lunisolarFestivals from 'lunisolar/markers/festivals.zh-cn';
|
||||
|
||||
import App from './App.vue';
|
||||
|
||||
// 加载 Day.js Duration 插件
|
||||
dayjs.extend(dayjsDuration);
|
||||
|
||||
// 配置 Day.js 默认语言
|
||||
dayjs.locale('zh-cn');
|
||||
|
||||
// 加载 Lunisolar 语言包
|
||||
lunisolar.locale([
|
||||
lunisolarLang1,
|
||||
lunisolarLang2,
|
||||
], false);
|
||||
|
||||
// 加载 Lunisolar 节日列表
|
||||
lunisolar.Markers.add(lunisolarFestivals, 'festivals');
|
||||
|
||||
// Lunisolar 全局配置
|
||||
lunisolar.config({
|
||||
isUTC: false,
|
||||
lang: 'zh-cn',
|
||||
});
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
app.use(router);
|
||||
app.mount('#app');
|
||||
@@ -0,0 +1,100 @@
|
||||
import {
|
||||
createRouter,
|
||||
createWebHashHistory,
|
||||
} from 'vue-router';
|
||||
|
||||
import {
|
||||
getToolboxRoutes,
|
||||
} from '@/assets/js/toolbox-data';
|
||||
|
||||
import {
|
||||
updateAppTitle,
|
||||
} from '@/assets/js/utils';
|
||||
|
||||
import {
|
||||
ABOUT_MODULE_ENABLED,
|
||||
ABOUT_MODULE_TITLE,
|
||||
MC_CTRL_MODULE_ENABLED,
|
||||
MC_CTRL_MODULE_TITLE,
|
||||
NAV_MODULE_ENABLED,
|
||||
NAV_MODULE_TITLE,
|
||||
SEARCH_MODULE_ENABLED,
|
||||
SEARCH_MODULE_TITLE,
|
||||
TOOLBOX_MODULE_ENABLED,
|
||||
TOOLBOX_MODULE_TITLE,
|
||||
} from '@/config/modules';
|
||||
|
||||
import AboutView from '@/views/AboutView/AboutView.vue';
|
||||
import IndexView from '@/views/IndexView/IndexView.vue';
|
||||
|
||||
export const router = createRouter({
|
||||
history: createWebHashHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'IndexView',
|
||||
component: IndexView,
|
||||
meta: {
|
||||
iconClass: 'mdi mdi-home',
|
||||
showInAside: true,
|
||||
title: '主页',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/search-view',
|
||||
name: 'SearchView',
|
||||
component: () => import('@/views/SearchView/SearchView.vue'),
|
||||
meta: {
|
||||
iconClass: 'mdi mdi-magnify',
|
||||
showInAside: SEARCH_MODULE_ENABLED,
|
||||
title: SEARCH_MODULE_TITLE,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/nav-view',
|
||||
name: 'NavView',
|
||||
component: () => import('@/views/NavView/NavView.vue'),
|
||||
meta: {
|
||||
iconClass: 'mdi mdi-compass',
|
||||
showInAside: NAV_MODULE_ENABLED,
|
||||
title: NAV_MODULE_TITLE,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/toolbox-view',
|
||||
name: 'ToolboxView',
|
||||
component: () => import('@/views/ToolboxView/ToolboxView.vue'),
|
||||
meta: {
|
||||
iconClass: 'mdi mdi-tools',
|
||||
isToolDetail: false,
|
||||
showInAside: TOOLBOX_MODULE_ENABLED,
|
||||
title: TOOLBOX_MODULE_TITLE,
|
||||
},
|
||||
children: getToolboxRoutes(),
|
||||
},
|
||||
{
|
||||
path: '/minecraft-ctrl-view',
|
||||
name: 'MinecraftCtrlView',
|
||||
component: () => import('@/views/MinecraftCtrlView/MinecraftCtrlView.vue'),
|
||||
meta: {
|
||||
iconClass: 'mdi mdi-gamepad',
|
||||
showInAside: MC_CTRL_MODULE_ENABLED,
|
||||
title: MC_CTRL_MODULE_TITLE,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/about-view',
|
||||
name: 'AboutView',
|
||||
component: AboutView,
|
||||
meta: {
|
||||
iconClass: 'mdi mdi-information',
|
||||
showInAside: ABOUT_MODULE_ENABLED,
|
||||
title: ABOUT_MODULE_TITLE,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
router.afterEach((to) => {
|
||||
updateAppTitle(to.meta.title);
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<div class="about-view flex-col">
|
||||
<div class="app-view-header">
|
||||
<span>{{ ABOUT_MODULE_TITLE }}</span>
|
||||
</div>
|
||||
<div class="app-view-content with-margin">
|
||||
|
||||
<n-h4>简介</n-h4>
|
||||
|
||||
<n-p>一个多功能的网址导航,绿色无广告。</n-p>
|
||||
<n-p>当前版本:V{{ version }}</n-p>
|
||||
<n-p>导航链接列表更新日期:{{ NAV_LINK_DATE }}</n-p>
|
||||
|
||||
<n-h4>开发人员</n-h4>
|
||||
|
||||
<n-ul>
|
||||
<n-li>Frost-ZX</n-li>
|
||||
</n-ul>
|
||||
|
||||
<n-h4>项目地址</n-h4>
|
||||
|
||||
<n-ul>
|
||||
<n-li>
|
||||
<span>GitHub:</span>
|
||||
<n-a :href="URL_GITHUB" target="_blank">{{ URL_GITHUB }}</n-a>
|
||||
</n-li>
|
||||
<n-li>
|
||||
<span>Gitee:</span>
|
||||
<n-a :href="URL_GITEE" target="_blank">{{ URL_GITEE }}</n-a>
|
||||
</n-li>
|
||||
</n-ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { NA, NH4, NLi, NP, NUl } from 'naive-ui';
|
||||
import { version } from '@package-json';
|
||||
import { ABOUT_MODULE_TITLE } from '@/config/modules';
|
||||
|
||||
/** 导航链接列表更新日期 */
|
||||
const NAV_LINK_DATE = window['NAV_LINK_DATE'];
|
||||
|
||||
/** Gitee 地址 */
|
||||
const URL_GITEE = 'https://gitee.com/frost-craft/frost-navigation';
|
||||
|
||||
/** GitHub 地址 */
|
||||
const URL_GITHUB = 'https://github.com/Frost-ZX/frost-navigation';
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="index-view flex-col">
|
||||
<div class="app-view-header">
|
||||
<span>{{ appDesc }}</span>
|
||||
</div>
|
||||
<div class="app-view-content">
|
||||
|
||||
<div class="date-time">
|
||||
<div class="time-info">{{ timeInfo.time }}</div>
|
||||
<div class="date-info">
|
||||
<div class="date-info-row">
|
||||
<span>{{ timeInfo.date1 }}</span>
|
||||
<span>{{ timeInfo.week }}</span>
|
||||
<span v-show="timeInfo.festival">{{ timeInfo.festival }}</span>
|
||||
<span v-show="timeInfo.solarTerm">{{ timeInfo.solarTerm }}</span>
|
||||
</div>
|
||||
<div class="date-info-row">
|
||||
<span>{{ timeInfo.date2 }}</span>
|
||||
<span>{{ timeInfo.date3 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
description as appDesc,
|
||||
} from '@package-json';
|
||||
|
||||
import {
|
||||
reactive, ref,
|
||||
onBeforeMount, onBeforeUnmount,
|
||||
} from 'vue';
|
||||
|
||||
import lunisolar from 'lunisolar';
|
||||
|
||||
/** 当前时间信息 */
|
||||
const timeInfo = reactive({
|
||||
|
||||
/** 公历 */
|
||||
date1: '',
|
||||
|
||||
/** 农历 */
|
||||
date2: '',
|
||||
|
||||
/** 八字 */
|
||||
date3: '',
|
||||
|
||||
/** 节日 */
|
||||
festival: '',
|
||||
|
||||
/** 节气 */
|
||||
solarTerm: '',
|
||||
|
||||
/** 时间 */
|
||||
time: '',
|
||||
|
||||
/** 星期 */
|
||||
week: '',
|
||||
|
||||
});
|
||||
|
||||
/** 时间更新定时器 */
|
||||
const timeUpdater = ref(null);
|
||||
|
||||
/** 更新时间信息 */
|
||||
function updateTime() {
|
||||
|
||||
let date = lunisolar();
|
||||
|
||||
let { markers, solarTerm } = date;
|
||||
|
||||
// 公历
|
||||
timeInfo.date1 = date.format('YYYY 年 M 月 D 日');
|
||||
// 农历
|
||||
timeInfo.date2 = date.format('lMlD');
|
||||
// 八字
|
||||
timeInfo.date3 = date.format('cY年 cM月 cD日');
|
||||
// 节日
|
||||
timeInfo.festival = markers.list.map(v => v.name).join(' & ');
|
||||
// 节气
|
||||
timeInfo.solarTerm = solarTerm ? solarTerm.name : '';
|
||||
// 时间
|
||||
timeInfo.time = date.format('HH:mm:ss');
|
||||
// 星期
|
||||
timeInfo.week = date.format('dddd');
|
||||
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
updateTime();
|
||||
timeUpdater.value = setInterval(updateTime, 500);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
clearInterval(timeUpdater.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.app-view-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.date-time {
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
|
||||
.time-info {
|
||||
font-size: 80px;
|
||||
}
|
||||
|
||||
.date-info {
|
||||
margin-bottom: 160px;
|
||||
font-size: 16px;
|
||||
|
||||
span:not(:first-child)::before {
|
||||
content: " / ";
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<div class="minecraft-ctrl-view flex-col">
|
||||
<div class="app-view-header">
|
||||
<span>{{ MC_CTRL_MODULE_TITLE }}</span>
|
||||
</div>
|
||||
<div class="app-view-content is-transparent">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
MC_CTRL_MODULE_TITLE,
|
||||
} from '@/config/modules';
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,486 @@
|
||||
<template>
|
||||
<div class="nav-view flex-col">
|
||||
|
||||
<div class="app-view-header">
|
||||
<div>{{ NAV_MODULE_TITLE }}</div>
|
||||
<div class="placeholder"></div>
|
||||
<n-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:circle="true"
|
||||
:secondary="true"
|
||||
@click="showHelp"
|
||||
>
|
||||
<span class="mdi mdi-help"></span>
|
||||
</n-button>
|
||||
</div>
|
||||
|
||||
<div class="app-view-content">
|
||||
<n-layout
|
||||
class="page-layout"
|
||||
:has-sider="true"
|
||||
>
|
||||
|
||||
<!-- 左 -->
|
||||
<n-layout-sider
|
||||
class="left-aside"
|
||||
collapse-mode="width"
|
||||
show-trigger="arrow-circle"
|
||||
:bordered="true"
|
||||
:collapsed="storeNavView.isAsideCollapsed.value"
|
||||
:collapsed-width="64"
|
||||
:native-scrollbar="false"
|
||||
:scrollbar-props="{ trigger: 'hover' }"
|
||||
:width="240"
|
||||
@collapse="storeNavView.isAsideCollapsed.value = true"
|
||||
@expand="storeNavView.isAsideCollapsed.value = false"
|
||||
>
|
||||
<n-menu
|
||||
v-model:value="navLinksTitle"
|
||||
mode="vertical"
|
||||
:collapsed="storeNavView.isAsideCollapsed.value"
|
||||
:collapsed-icon-size="24"
|
||||
:collapsed-width="64"
|
||||
:icon-size="24"
|
||||
:indent="24"
|
||||
:options="navLinksCategory"
|
||||
:on-update:value="handleSelectCategory"
|
||||
/>
|
||||
</n-layout-sider>
|
||||
|
||||
<!-- 右 -->
|
||||
<n-layout class="right-content">
|
||||
<div class="right-content-header">
|
||||
<n-input-group>
|
||||
<n-select
|
||||
v-model:value="storeNavView.searchType.value"
|
||||
class="search-type"
|
||||
:options="searchTypes"
|
||||
/>
|
||||
<n-input
|
||||
v-model:value="searchKeyword"
|
||||
class="search-input"
|
||||
placeholder="搜索链接项"
|
||||
:clearable="true"
|
||||
/>
|
||||
</n-input-group>
|
||||
</div>
|
||||
<div class="right-content-body">
|
||||
<n-scrollbar trigger="none">
|
||||
<n-tree
|
||||
children-field="children"
|
||||
key-field="_key"
|
||||
label-field="title"
|
||||
:cancelable="false"
|
||||
:block-line="true"
|
||||
:block-node="true"
|
||||
:data="navLinksCurr"
|
||||
:filter="treeDataFilter"
|
||||
:pattern="searchKeyword"
|
||||
:render-label="renderTreeLabel"
|
||||
:selectable="true"
|
||||
:show-irrelevant-nodes="false"
|
||||
/>
|
||||
</n-scrollbar>
|
||||
</div>
|
||||
</n-layout>
|
||||
|
||||
</n-layout>
|
||||
</div>
|
||||
|
||||
<!-- 链接详情 -->
|
||||
<n-drawer
|
||||
v-model:show="detailDrawer.show"
|
||||
class="nav-url-detail-drawer"
|
||||
placement="right"
|
||||
>
|
||||
<n-drawer-content
|
||||
title="链接详情"
|
||||
:closable="true"
|
||||
>
|
||||
<n-descriptions
|
||||
label-placement="top"
|
||||
:column="1"
|
||||
>
|
||||
<n-descriptions-item label="ID">
|
||||
{{ detailDrawer.data._key || '-' }}
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item label="链接标题">
|
||||
{{ detailDrawer.data.title || '-' }}
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item label="链接简介">
|
||||
{{ detailDrawer.data.desc || '-' }}
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item label="链接地址">
|
||||
{{ detailDrawer.data.url || '-' }}
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item label="更新日期">
|
||||
{{ detailDrawer.data.date || '-' }}
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item label="是否有效">
|
||||
{{ detailDrawer.data.isInvalid ? '否' : '是' }}
|
||||
</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
</n-drawer-content>
|
||||
</n-drawer>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="jsx" setup>
|
||||
import {
|
||||
NButton, NDescriptions, NDescriptionsItem,
|
||||
NDrawer, NDrawerContent, NInput, NInputGroup,
|
||||
NLayout, NLayoutSider, NLi, NMenu,
|
||||
NScrollbar, NSelect, NTree, NUl,
|
||||
} from 'naive-ui';
|
||||
|
||||
import {
|
||||
reactive, shallowRef, onBeforeMount,
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
NAV_MODULE_TITLE,
|
||||
} from '@/config/modules';
|
||||
|
||||
import {
|
||||
storeNavView,
|
||||
} from '@/assets/js/local-storage';
|
||||
|
||||
import {
|
||||
$dialog, $message,
|
||||
} from '@/assets/js/naive-ui';
|
||||
|
||||
import {
|
||||
formatNavLinks,
|
||||
} from '@/assets/js/nav-links';
|
||||
|
||||
import {
|
||||
useLocalStorage,
|
||||
} from '@vueuse/core';
|
||||
|
||||
/** 链接详情 */
|
||||
const detailDrawer = reactive({
|
||||
|
||||
/** @type {NavLinkItem | null} */
|
||||
data: null,
|
||||
|
||||
/** @type {boolean} */
|
||||
show: false,
|
||||
|
||||
});
|
||||
|
||||
/** 完整的链接列表 */
|
||||
const navLinksAll = formatNavLinks(true);
|
||||
|
||||
/**
|
||||
* @desc 链接分类列表
|
||||
* @type { import('naive-ui').MenuOption[] }
|
||||
*/
|
||||
const navLinksCategory = navLinksAll.map((item) => {
|
||||
return {
|
||||
icon: () => <span class={item.icon}></span>,
|
||||
key: item.title,
|
||||
label: item.title,
|
||||
_data: item,
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* @desc 当前显示的链接列表
|
||||
* @type {VueRef<NavLinkItem[]>}
|
||||
*/
|
||||
const navLinksCurr = shallowRef([]);
|
||||
|
||||
/** 当前显示的链接分类标题 */
|
||||
const navLinksTitle = shallowRef('');
|
||||
|
||||
/** 搜索关键词 */
|
||||
const searchKeyword = shallowRef('');
|
||||
|
||||
/**
|
||||
* @desc 搜索类型列表
|
||||
* @type { import('naive-ui').SelectOption[] }
|
||||
*/
|
||||
const searchTypes = [
|
||||
{ label: '全部', value: 'all' },
|
||||
{ label: '标题', value: 'title' },
|
||||
{ label: '链接', value: 'url' },
|
||||
{ label: '简介', value: 'desc' },
|
||||
];
|
||||
|
||||
/**
|
||||
* @description 切换链接列表
|
||||
* @param {NavLinkItem} [data] 链接分类信息
|
||||
*/
|
||||
function changeList(data = null) {
|
||||
|
||||
let useData = null;
|
||||
let storedKey = '';
|
||||
|
||||
if (data) {
|
||||
useData = data;
|
||||
} else {
|
||||
storedKey = storeNavView.currentCategory.value;
|
||||
}
|
||||
|
||||
if (storedKey) {
|
||||
useData = navLinksAll.find((item) => {
|
||||
return item.title === storedKey;
|
||||
});
|
||||
}
|
||||
|
||||
if (!useData) {
|
||||
useData = navLinksAll[0] || null;
|
||||
}
|
||||
|
||||
if (useData) {
|
||||
storeNavView.currentCategory.value = useData.title;
|
||||
navLinksCurr.value = useData.children;
|
||||
navLinksTitle.value = useData.title;
|
||||
} else {
|
||||
storeNavView.currentCategory.value = '';
|
||||
navLinksCurr.value = [];
|
||||
navLinksTitle.value = '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 处理选择链接分类
|
||||
* @param {string} key
|
||||
* @param {NavLinkItem} item
|
||||
*/
|
||||
function handleSelectCategory(key, item) {
|
||||
changeList(item._data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 打开链接
|
||||
* @param {NavLinkItem} data
|
||||
*/
|
||||
function openURL(data) {
|
||||
if (data.isInvalid) {
|
||||
$message.warning('链接已失效,仅支持查看详情');
|
||||
} else if (data.showOnly) {
|
||||
$message.warning('该链接不支持直接打开,请在链接详情中复制后手动打开');
|
||||
} else if (data.url) {
|
||||
window.open(data.url, '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 树形数据节点内容渲染函数
|
||||
* @param {object} info
|
||||
* @param {NavLinkItem} info.option
|
||||
*/
|
||||
function renderTreeLabel(info) {
|
||||
|
||||
let data = info.option;
|
||||
let isURL = !data.children;
|
||||
|
||||
let open = () => {
|
||||
isURL && openURL(data);
|
||||
};
|
||||
|
||||
let show = () => {
|
||||
isURL && toggleDetailDrawer(true, data);
|
||||
};
|
||||
|
||||
return <div
|
||||
class="item-wrapper"
|
||||
onContextmenu={show}
|
||||
onClick={open}
|
||||
>
|
||||
<div class="item-title">
|
||||
<span>{ data.title }</span>
|
||||
{ data.desc ? <span> - { data.desc }</span> : ''}
|
||||
</div>
|
||||
<div class="item-url">{ data.url }</div>
|
||||
</div>;
|
||||
|
||||
}
|
||||
|
||||
/** 显示说明 */
|
||||
function showHelp() {
|
||||
$dialog.create({
|
||||
content: () => {
|
||||
return <NUl>
|
||||
<NLi>点击目录项左侧按钮以展开目录。</NLi>
|
||||
<NLi>PC 端右键或移动端长按链接项以显示详情。</NLi>
|
||||
</NUl>
|
||||
},
|
||||
title: '操作说明',
|
||||
type: 'default',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 处理搜索
|
||||
* @param {string} pattern
|
||||
* @param {NavLinkItem} node
|
||||
*/
|
||||
function treeDataFilter(pattern = '', node = null) {
|
||||
|
||||
if (pattern === '') {
|
||||
return true;
|
||||
} else {
|
||||
pattern = pattern.toLowerCase();
|
||||
}
|
||||
|
||||
let type = storeNavView.searchType.value;
|
||||
|
||||
let desc = String(node.desc).toLowerCase();
|
||||
let title = String(node.title).toLowerCase();
|
||||
let url = String(node.url).toLowerCase();
|
||||
|
||||
switch (type) {
|
||||
case 'all':
|
||||
return (
|
||||
title.includes(pattern) ||
|
||||
url.includes(pattern) ||
|
||||
desc.includes(pattern)
|
||||
);
|
||||
case 'desc':
|
||||
return desc.includes(pattern);
|
||||
case 'title':
|
||||
return title.includes(pattern);
|
||||
case 'url':
|
||||
return url.includes(pattern);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 切换链接详情显示隐藏
|
||||
* @param {boolean} show
|
||||
* @param {NavLinkItem} data
|
||||
*/
|
||||
function toggleDetailDrawer(show = false, data = null) {
|
||||
if (show) {
|
||||
detailDrawer.data = data;
|
||||
}
|
||||
detailDrawer.show = show;
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
changeList(null);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.page-layout {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.left-aside {
|
||||
:deep(.n-menu-item-content__icon) {
|
||||
color: var(--color-text-2);
|
||||
}
|
||||
|
||||
:deep(.n-menu-item-content-header) {
|
||||
color: var(--color-text-2);
|
||||
}
|
||||
}
|
||||
|
||||
.right-content {
|
||||
width: 0;
|
||||
height: 100%;
|
||||
|
||||
:deep(> div) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.right-content-header,
|
||||
.right-content-body {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.right-content-header {
|
||||
// 注:右侧 padding 2px 防止输入框聚焦样式显示不全
|
||||
padding: 10px 2px 0 16px;
|
||||
|
||||
.search-type {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex-grow: 1;
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.right-content-body {
|
||||
flex-grow: 1;
|
||||
padding: 16px 2px 0 16px;
|
||||
height: 0;
|
||||
|
||||
:deep(.n-tree-node) {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
:deep(.n-tree-node-content) {
|
||||
color: var(--color-text-2);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
:deep(.n-tree-node-content__text) {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
:deep(.n-tree-node-indent > div) {
|
||||
width: 16px !important;
|
||||
}
|
||||
|
||||
:deep(.n-tree-node--selected) {
|
||||
.n-tree-node-content,
|
||||
.n-tree-node-switcher__icon {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.n-tree-node-switcher__icon) {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
color: var(--color-text-2);
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
:deep(.item-wrapper) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
white-space: nowrap;
|
||||
|
||||
> div {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.item-url) {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="less">
|
||||
.nav-url-detail-drawer {
|
||||
width: 100% !important;
|
||||
max-width: 320px;
|
||||
|
||||
.n-descriptions-table-content {
|
||||
user-select: text;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div class="search-view flex-col">
|
||||
<div class="app-view-header">
|
||||
<span>{{ SEARCH_MODULE_TITLE }}</span>
|
||||
</div>
|
||||
<div class="app-view-content is-transparent">
|
||||
|
||||
<!-- 搜索栏 -->
|
||||
<div class="search-bar-wrapper">
|
||||
<n-input
|
||||
v-model:value="searchKeyword"
|
||||
class="search-bar-element shadow-1"
|
||||
placeholder="搜索"
|
||||
size="large"
|
||||
:clearable="true"
|
||||
@keydown.enter="openSearchResult"
|
||||
>
|
||||
<template #suffix>
|
||||
<div
|
||||
class="search-btn mdi mdi-magnify"
|
||||
@click="openSearchResult"
|
||||
></div>
|
||||
</template>
|
||||
</n-input>
|
||||
</div>
|
||||
|
||||
<!-- 搜索引擎列表 -->
|
||||
<div class="search-engines-wrapper">
|
||||
<n-radio-group
|
||||
v-model:value="storeSearchView.searchEngineName.value"
|
||||
class="search-engines-list"
|
||||
>
|
||||
<!-- 搜索引擎分类 -->
|
||||
<div
|
||||
v-for="categoryItem in searchEngineList"
|
||||
:key="categoryItem.title"
|
||||
class="search-engine-category"
|
||||
>
|
||||
<div class="category-title">{{ categoryItem.title }}</div>
|
||||
<div class="category-items">
|
||||
<!-- 搜索引擎项 -->
|
||||
<n-radio
|
||||
v-for="engineItem in categoryItem.list"
|
||||
:key="engineItem.name"
|
||||
:value="engineItem.name"
|
||||
class="search-engine-item shadow-1"
|
||||
>
|
||||
<img
|
||||
class="item-icon"
|
||||
draggable="false"
|
||||
:src="engineItem.icon"
|
||||
/>
|
||||
<span class="item-label">{{ engineItem.name }}</span>
|
||||
<span class="item-desc">{{ engineItem.desc }}</span>
|
||||
</n-radio>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</n-radio-group>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
NInput, NRadio, NRadioGroup,
|
||||
} from 'naive-ui';
|
||||
|
||||
import {
|
||||
storeSearchView,
|
||||
} from '@/assets/js/local-storage';
|
||||
|
||||
import {
|
||||
openSearchResult,
|
||||
searchEngineList,
|
||||
searchKeyword,
|
||||
} from '@/assets/js/search-engine';
|
||||
|
||||
import {
|
||||
SEARCH_MODULE_TITLE,
|
||||
} from '@/config/modules';
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.app-view-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.search-bar-wrapper,
|
||||
.search-engines-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.search-bar-wrapper {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
margin-top: 64px;
|
||||
max-width: 640px;
|
||||
|
||||
:deep(.search-bar-element) {
|
||||
.n-input-wrapper {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.n-input__border, .n-input__state-border {
|
||||
box-shadow: none;
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
display: flex;
|
||||
width: 40px;
|
||||
height: 100%;
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
transition: color 0.25s;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
&::before {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-engines-wrapper {
|
||||
--item-margin: 12px;
|
||||
margin-top: 32px;
|
||||
padding-bottom: 64px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.search-engine-category {
|
||||
&:not(:first-child) {
|
||||
margin-top: var(--item-margin);
|
||||
}
|
||||
|
||||
.category-title {
|
||||
font-size: 16px;
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
.category-items {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.search-engine-item {
|
||||
margin: var(--item-margin);
|
||||
width: 240px;
|
||||
height: 40px;
|
||||
border-radius: var(--border-radius);
|
||||
border-left: 4px solid transparent;
|
||||
background-color: #FFF;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
transition: border 0.25s;
|
||||
|
||||
&.n-radio--checked {
|
||||
border-left-color: var(--color-primary);
|
||||
}
|
||||
|
||||
:deep(.n-radio__dot-wrapper) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:deep(.n-radio__label) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 12px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.item-label {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.item-desc {
|
||||
margin-left: 8px;
|
||||
font-size: 12px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<div class="tool-detail-page">
|
||||
|
||||
<!-- 配置参数 -->
|
||||
<n-card size="small" title="配置参数">
|
||||
<n-form
|
||||
class="form-no-feedback"
|
||||
label-align="right"
|
||||
label-placement="left"
|
||||
label-width="auto"
|
||||
>
|
||||
|
||||
<n-form-item label="文件大小:">
|
||||
<n-input-group>
|
||||
<n-input-number
|
||||
v-model:value="inputs.sizeValue"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:max="10000"
|
||||
:step="1"
|
||||
/>
|
||||
<n-select
|
||||
v-model:value="inputs.sizeUnit"
|
||||
label-field="name"
|
||||
value-field="name"
|
||||
:options="units"
|
||||
/>
|
||||
</n-input-group>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="已下载大小:">
|
||||
<n-input-group>
|
||||
<n-input-number
|
||||
v-model:value="inputs.downloadedValue"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:max="10000"
|
||||
:step="1"
|
||||
/>
|
||||
<n-select
|
||||
v-model:value="inputs.downloadedUnit"
|
||||
label-field="name"
|
||||
value-field="name"
|
||||
:options="units"
|
||||
/>
|
||||
</n-input-group>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="下载速度:">
|
||||
<n-input-group>
|
||||
<n-input-number
|
||||
v-model:value="inputs.speedValue"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:max="10000"
|
||||
:step="1"
|
||||
/>
|
||||
<n-select
|
||||
v-model:value="inputs.speedUnit"
|
||||
label-field="speed"
|
||||
value-field="name"
|
||||
:options="units"
|
||||
/>
|
||||
</n-input-group>
|
||||
</n-form-item>
|
||||
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<!-- 计算结果 -->
|
||||
<n-card size="small" title="计算结果">
|
||||
<n-form
|
||||
class="form-no-feedback"
|
||||
label-align="right"
|
||||
label-placement="left"
|
||||
label-width="auto"
|
||||
>
|
||||
|
||||
<n-form-item label="大约需要时长:">
|
||||
<span>{{ outputs.duration || '未计算' }}</span>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="大约结束时间:">
|
||||
<span>{{ outputs.time || '未计算' }}</span>
|
||||
</n-form-item>
|
||||
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
NCard, NForm, NFormItem,
|
||||
NInputGroup, NInputNumber, NSelect,
|
||||
} from 'naive-ui';
|
||||
|
||||
import {
|
||||
reactive, ref,
|
||||
watch,
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
$message,
|
||||
} from '@/assets/js/naive-ui';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
/** 单位和比率(基于 KB) */
|
||||
const units = [
|
||||
{ name: 'KiB', speed: 'KiB/s', rate: 1 },
|
||||
{ name: 'MiB', speed: 'MiB/s', rate: 1024 },
|
||||
{ name: 'GiB', speed: 'GiB/s', rate: 1048576 },
|
||||
];
|
||||
|
||||
/** 参数 */
|
||||
const inputs = reactive({
|
||||
downloadedUnit: 'KiB',
|
||||
downloadedValue: 0,
|
||||
sizeUnit: 'KiB',
|
||||
sizeValue: 0,
|
||||
speedUnit: 'KiB',
|
||||
speedValue: 0,
|
||||
});
|
||||
|
||||
/** 计算结果 */
|
||||
const outputs = reactive({
|
||||
duration: '',
|
||||
time: '',
|
||||
});
|
||||
|
||||
/** 防抖定时器 */
|
||||
const timer = ref(null);
|
||||
|
||||
/** 计算结果 */
|
||||
function calc() {
|
||||
|
||||
let {
|
||||
downloadedUnit, downloadedValue,
|
||||
sizeUnit, sizeValue,
|
||||
speedUnit, speedValue,
|
||||
} = inputs;
|
||||
|
||||
if (sizeValue === 0 || speedValue === 0) {
|
||||
outputs.duration = '';
|
||||
outputs.time = '';
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取转换比例
|
||||
let downloadedRate = units[units.findIndex((obj) => {
|
||||
return (obj.name === downloadedUnit);
|
||||
})].rate;
|
||||
let sizeRate = units[units.findIndex((obj) => {
|
||||
return (obj.name === sizeUnit);
|
||||
})].rate;
|
||||
let speedRate = units[units.findIndex((obj) => {
|
||||
return (obj.name === speedUnit);
|
||||
})].rate;
|
||||
|
||||
// 转为 KB 单位
|
||||
let realDownloaded = downloadedValue * downloadedRate;
|
||||
let realSize = sizeValue * sizeRate - realDownloaded;
|
||||
let realSpeed = speedValue * speedRate;
|
||||
|
||||
if (realSize < 0) {
|
||||
$message.warning('参数有误,请检查');
|
||||
return;
|
||||
}
|
||||
|
||||
// 时长(秒)
|
||||
let dSeconds = (realSize / realSpeed).toFixed(0);
|
||||
// 起始时间
|
||||
let timeStart = dayjs();
|
||||
// 结束时间
|
||||
let timeEnd = timeStart.add(dSeconds, 'second');
|
||||
// 时长(天,整数)
|
||||
let dDays = timeEnd.diff(timeStart, 'day');
|
||||
// 最后一天的起始时间
|
||||
let timeLastDay = timeStart.add(dDays, 'day');
|
||||
// 时长(格式化,最后一天剩余)
|
||||
let dLastDay = dayjs.duration(timeEnd.diff(timeLastDay)).format('HH 时 mm 分 ss 秒');
|
||||
|
||||
outputs.duration = `${dDays} 天 ${dLastDay}`;
|
||||
outputs.time = timeEnd.format('YYYY-MM-DD HH:mm:ss');
|
||||
|
||||
}
|
||||
|
||||
// 自动计算
|
||||
watch(inputs, () => {
|
||||
clearTimeout(timer.value);
|
||||
timer.value = setTimeout(() => {
|
||||
calc();
|
||||
}, 1000);
|
||||
}, { deep: true });
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tool-detail-page {
|
||||
:deep(.n-input-number) {
|
||||
width: 12em;
|
||||
}
|
||||
|
||||
:deep(.n-select) {
|
||||
width: 8em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<div class="tool-detail-page">
|
||||
|
||||
<!-- 计算模式 -->
|
||||
<n-card size="small" title="计算模式">
|
||||
<n-form-item
|
||||
class="form-item-no-feedback"
|
||||
:show-label="false"
|
||||
>
|
||||
<n-select
|
||||
v-model:value="mode"
|
||||
:options="[
|
||||
{ label: '1 -> 2', value: '1-to-2' },
|
||||
{ label: '2 -> 1', value: '2-to-1' },
|
||||
]"
|
||||
:on-blur="update"
|
||||
/>
|
||||
</n-form-item>
|
||||
</n-card>
|
||||
|
||||
<!-- 小数位数 -->
|
||||
<n-card size="small" title="小数位数">
|
||||
<n-form-item
|
||||
class="form-item-no-feedback"
|
||||
:show-label="false"
|
||||
>
|
||||
<n-input-number
|
||||
v-model:value="decimals"
|
||||
:min="0"
|
||||
:max="10"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:on-blur="update"
|
||||
></n-input-number>
|
||||
</n-form-item>
|
||||
</n-card>
|
||||
|
||||
<!-- 基础比例 -->
|
||||
<n-card size="small" title="基础比例">
|
||||
<n-form-item
|
||||
class="form-item-no-feedback"
|
||||
:show-label="false"
|
||||
>
|
||||
<n-input-number
|
||||
v-model:value="base.a"
|
||||
:min="limit.min"
|
||||
:max="limit.max"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:on-blur="update"
|
||||
></n-input-number>
|
||||
<span class="split">:</span>
|
||||
<n-input-number
|
||||
v-model:value="base.b"
|
||||
:min="limit.min"
|
||||
:max="limit.max"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:on-blur="update"
|
||||
></n-input-number>
|
||||
</n-form-item>
|
||||
</n-card>
|
||||
|
||||
<!-- 计算比例 -->
|
||||
<n-card size="small" title="计算比例">
|
||||
<n-form-item
|
||||
class="form-item-no-feedback"
|
||||
:show-label="false"
|
||||
>
|
||||
<n-input-number
|
||||
v-model:value="calc.a"
|
||||
:disabled="mode === '2-to-1'"
|
||||
:step="1"
|
||||
:on-blur="update"
|
||||
></n-input-number>
|
||||
<span class="split">:</span>
|
||||
<n-input-number
|
||||
v-model:value="calc.b"
|
||||
:disabled="mode === '1-to-2'"
|
||||
:step="1"
|
||||
:on-blur="update"
|
||||
></n-input-number>
|
||||
</n-form-item>
|
||||
</n-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
bignumber, divide, floor, multiply, number, round,
|
||||
} from 'mathjs';
|
||||
|
||||
import {
|
||||
NCard, NFormItem, NInputNumber, NSelect,
|
||||
} from 'naive-ui';
|
||||
|
||||
import {
|
||||
reactive, ref,
|
||||
} from 'vue';
|
||||
|
||||
/** 基础比例 */
|
||||
const base = reactive({
|
||||
a: 1,
|
||||
b: 1,
|
||||
});
|
||||
|
||||
/** 计算比例 */
|
||||
const calc = reactive({
|
||||
a: 1,
|
||||
b: 1,
|
||||
});
|
||||
|
||||
/** 小数位数 */
|
||||
const decimals = ref(5);
|
||||
|
||||
/** 数值范围限制 */
|
||||
const limit = {
|
||||
min: -99999999,
|
||||
max: 99999999,
|
||||
};
|
||||
|
||||
/** 模式 */
|
||||
const mode = ref('1-to-2');
|
||||
|
||||
/** 计算 */
|
||||
function calculate() {
|
||||
|
||||
let { min, max } = limit;
|
||||
|
||||
let useMode = mode.value;
|
||||
let ratio = divide(bignumber(base.a), bignumber(base.b));
|
||||
|
||||
if (useMode === '1-to-2') {
|
||||
|
||||
// 注:只允许整数
|
||||
let a = number(floor(calc.a));
|
||||
|
||||
(a < min) && (a = min);
|
||||
(a > max) && (a = max);
|
||||
|
||||
calc.a = a;
|
||||
calc.b = number(round(divide(bignumber(a), ratio), decimals.value));
|
||||
|
||||
} else if (useMode === '2-to-1') {
|
||||
|
||||
// 注:只允许整数
|
||||
let b = number(floor(calc.b));
|
||||
|
||||
(b < min) && (b = min);
|
||||
(b > max) && (b = max);
|
||||
|
||||
calc.a = number(round(multiply(bignumber(b), ratio), decimals.value));
|
||||
calc.b = b;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 更新 */
|
||||
function update() {
|
||||
calculate();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tool-detail-page {
|
||||
:deep(.n-input-number) {
|
||||
width: 12em;
|
||||
}
|
||||
|
||||
:deep(.n-select) {
|
||||
width: 12em;
|
||||
}
|
||||
}
|
||||
|
||||
.split {
|
||||
display: inline-block;
|
||||
width: 2em;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="tool-detail-page"></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="tool-detail-page"></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="tool-detail-page"></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<div class="tool-detail-page">
|
||||
|
||||
<!-- 操作 -->
|
||||
<n-card size="small" title="操作">
|
||||
<n-form
|
||||
class="form-no-feedback form-data"
|
||||
label-align="right"
|
||||
label-placement="left"
|
||||
label-width="9em"
|
||||
>
|
||||
|
||||
<n-form-item label="转换模式:">
|
||||
<n-select
|
||||
v-model:value="data.convertMode"
|
||||
:options="[
|
||||
{ label: '本地时间 -> 时间戳', value: 'toTimestamp' },
|
||||
{ label: '时间戳 -> 本地时间', value: 'toLocalTime' },
|
||||
]"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="时间戳单位:">
|
||||
<n-select
|
||||
v-model:value="data.timestampUnit"
|
||||
:options="[
|
||||
{ label: '毫秒(ms)', value: 'ms' },
|
||||
{ label: '秒(s)', value: 's' },
|
||||
]"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="自动更新:">
|
||||
<n-switch v-model:value="data.autoUpdate" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="操作:">
|
||||
<n-flex>
|
||||
<n-button
|
||||
type="primary"
|
||||
@click="convertTime"
|
||||
>转换</n-button>
|
||||
<n-button
|
||||
type="error"
|
||||
@click="clearInputs"
|
||||
>清空</n-button>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<!-- 当前 -->
|
||||
<n-card size="small" title="当前">
|
||||
<n-form
|
||||
class="form-no-feedback form-data"
|
||||
label-align="right"
|
||||
label-placement="left"
|
||||
label-width="9em"
|
||||
>
|
||||
|
||||
<n-form-item label="本地时间:">
|
||||
<n-input
|
||||
v-model:value="data.currentLocalTime"
|
||||
placeholder=""
|
||||
type="text"
|
||||
:readonly="true"
|
||||
></n-input>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="时间戳(ms):">
|
||||
<n-input
|
||||
v-model:value="data.currentTimestamp"
|
||||
placeholder=""
|
||||
type="text"
|
||||
:readonly="true"
|
||||
></n-input>
|
||||
</n-form-item>
|
||||
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<!-- 结果 -->
|
||||
<n-card size="small" title="结果">
|
||||
<n-form
|
||||
class="form-no-feedback form-data"
|
||||
label-align="right"
|
||||
label-placement="left"
|
||||
label-width="9em"
|
||||
>
|
||||
|
||||
<n-form-item label="本地时间:">
|
||||
<n-input
|
||||
v-model:value="data.convertLocalTime"
|
||||
:placeholder="`参考格式:年-月-日 时:分:秒`"
|
||||
:readonly="data.convertMode === 'toLocalTime'"
|
||||
type="text"
|
||||
></n-input>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="时间戳:">
|
||||
<n-input
|
||||
v-model:value="data.convertTimestamp"
|
||||
:placeholder="timestampPlaceholder"
|
||||
:readonly="data.convertMode === 'toTimestamp'"
|
||||
type="text"
|
||||
></n-input>
|
||||
</n-form-item>
|
||||
|
||||
</n-form>
|
||||
<n-p>注意:</n-p>
|
||||
<n-p>在“本地时间 -> 时间戳”的模式中,若输入的“本地时间”不包含“时间”部分(例如 2025-02-01),将会加上本地时区与零时区的时差后计算。</n-p>
|
||||
<n-p>即本地时区为北京时间(UTC+8)时按 08:00 计算,本地时区为东京时间(UTC+9)时按 09:00 计算。</n-p>
|
||||
</n-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
NButton, NCard, NFlex,
|
||||
NForm, NFormItem,
|
||||
NInput, NP, NSelect, NSwitch,
|
||||
} from 'naive-ui';
|
||||
|
||||
import {
|
||||
computed, reactive,
|
||||
onBeforeMount, onBeforeUnmount,
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
$message,
|
||||
} from '@/assets/js/naive-ui';
|
||||
|
||||
import {
|
||||
getCommonDateTime,
|
||||
} from '@frost-utils/javascript/common/index';
|
||||
|
||||
/** 数据 */
|
||||
const data = reactive({
|
||||
autoUpdate: true,
|
||||
convertLocalTime: '',
|
||||
convertMode: 'toTimestamp',
|
||||
convertTimestamp: '',
|
||||
currentLocalTime: '',
|
||||
currentTimestamp: '',
|
||||
timestampUnit: 'ms',
|
||||
timer: null,
|
||||
});
|
||||
|
||||
/** 时间戳输入占位文本 */
|
||||
const timestampPlaceholder = computed(() => {
|
||||
let suffix = (data.timestampUnit === 'ms' ? '000' : '');
|
||||
return '示例:1577808000' + suffix;
|
||||
});
|
||||
|
||||
/** 清空输入内容 */
|
||||
function clearInputs() {
|
||||
data.convertLocalTime = '';
|
||||
data.convertTimestamp = '';
|
||||
}
|
||||
|
||||
/** 转换输入的时间 */
|
||||
function convertTime() {
|
||||
|
||||
let mode = data.convertMode;
|
||||
let unit = data.timestampUnit;
|
||||
|
||||
if (mode === 'toLocalTime') {
|
||||
|
||||
let ts = parseInt(data.convertTimestamp);
|
||||
|
||||
// 检测输入内容
|
||||
if (isNaN(ts)) {
|
||||
$message.warning('请输入时间戳');
|
||||
return;
|
||||
}
|
||||
|
||||
// 转换时间戳为毫秒
|
||||
if (unit === 's') {
|
||||
ts *= 1000;
|
||||
}
|
||||
|
||||
// 更新结果
|
||||
data.convertLocalTime = getCommonDateTime(ts, 'all');
|
||||
|
||||
} else if (mode === 'toTimestamp') {
|
||||
|
||||
let localTime = data.convertLocalTime;
|
||||
let converted = 0;
|
||||
|
||||
if (localTime) {
|
||||
converted = new Date(localTime).getTime();
|
||||
} else {
|
||||
$message.warning('请输入本地时间');
|
||||
return;
|
||||
}
|
||||
|
||||
// 检测输入内容
|
||||
if (isNaN(converted)) {
|
||||
$message.warning('请输入有效的本地时间');
|
||||
return;
|
||||
}
|
||||
|
||||
// 更新结果
|
||||
data.convertLocalTime = getCommonDateTime(converted, 'all');
|
||||
|
||||
// 转换时间戳为秒
|
||||
if (unit === 's') {
|
||||
converted = Math.round(converted / 1000);
|
||||
}
|
||||
|
||||
// 更新输入内容
|
||||
data.convertTimestamp = String(converted);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 处理定时器 */
|
||||
function setTimer(isStart = false) {
|
||||
|
||||
if (data.timer) {
|
||||
clearInterval(data.timer);
|
||||
}
|
||||
|
||||
if (!isStart) {
|
||||
data.timer = null;
|
||||
return;
|
||||
}
|
||||
|
||||
data.timer = setInterval(() => {
|
||||
|
||||
if (!data.autoUpdate) {
|
||||
return;
|
||||
}
|
||||
|
||||
let currTime = Math.round(Date.now() / 1000) * 1000;
|
||||
let timeText = getCommonDateTime(currTime, 'all');
|
||||
|
||||
data.currentLocalTime = timeText;
|
||||
data.currentTimestamp = String(currTime);
|
||||
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
setTimer(true);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
setTimer(false);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.form-data {
|
||||
.n-input {
|
||||
max-width: 256px;
|
||||
}
|
||||
|
||||
.n-select {
|
||||
max-width: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||