33 Commits
Author SHA1 Message Date
zihluwang 18be1fc099 build: 修改应用版本 2025-08-06 23:46:03 +08:00
zihluwang 825042e5b0 refactor: 修改应用图标 2025-08-06 23:44:33 +08:00
zihluwang 7d5a5cd14c build: 修改应用 identifier 2025-08-06 23:44:17 +08:00
zihluwang 65bc9cf80d chore: 移除 Square 和 Store Logo
根据 Tauri 官方文档 https://v2.tauri.app/develop/icons/,Square* 和 StoreLogo 都是为 AppX 和微软 Store 预留的图标。该应用没有上架应用商店的计划。
2025-08-06 23:39:42 +08:00
zihluwang 5dbddc69cd build: 发布 0.2.1 2025-07-30 11:26:15 +08:00
zihluwang 662b41cf44 docs: 添加 Mac 运行报错解决方案说明 2025-07-30 11:24:33 +08:00
zihluwang 32bd0ee261 docs: 根据原作者的要求移除其二维码 2025-07-30 11:24:11 +08:00
zihluwang 8daaa195ee fix: 修复无法获取上一条语录的问题 2025-07-29 16:17:39 +08:00
zihluwang a8d7519fb3 fix: 修复由于迁移数据库位置导致的无法启动的问题 2025-07-29 16:12:32 +08:00
zihluwang 84e06241aa feat: 禁用首条消息获取上一条功能 2025-07-29 16:04:28 +08:00
zihluwang e23a6e0cdc refactor: 应用 UI 工程化 2025-07-29 16:02:12 +08:00
zihluwang 404bbdd28a refactor: 添加使用许可说明 2025-07-29 14:07:41 +08:00
zihluwang 11bf8a7b66 refactor: 应用重命名为祖安语录 2025-07-29 11:30:07 +08:00
zihluwang ca79942a04 docs: 添加贡献指引 2025-07-29 11:01:21 +08:00
zihluwang 9627c4b1ad feat: 禁用窗口大小调节 2025-07-29 10:47:34 +08:00
zihluwang 68f70e9148 build: 针对 Windows 7 添加 WebView 安装引导
添加 WebView 安装引导
2025-07-29 10:43:29 +08:00
zihluwang 8e63340a27 docs: 添加构建配置
添加版权、作者信息,修改打包出的 Windows 安装包后缀 `en_US` 到 `zh_CN`
2025-07-29 10:38:55 +08:00
zihluwang 144f252759 docs: 修改错误的原仓库链接 2025-07-28 17:52:33 +08:00
zihluwang e91aecbef9 docs: 添加贡献文档 2025-07-28 17:51:04 +08:00
zihluwang c38905319d docs: add license and readme 2025-07-28 17:36:13 +08:00
zihluwang 11ff6011ce Merge pull request #1 from zihluwang/release/0.2.0
Release 0.2.0
2025-07-28 15:04:07 +08:00
zihluwang 9b746da864 build: prepare 0.2.0 2025-07-28 15:03:24 +08:00
zihluwang 2be4bb11b2 feat(ui): update ui performance 2025-07-28 15:02:08 +08:00
zihluwang ef85c82ecb ci: change ci config 2025-07-28 14:04:03 +08:00
zihluwang fd37b663db ci: change ci config 2025-07-28 12:50:20 +08:00
zihluwang 907d31177e ci: change ci config 2025-07-28 12:49:39 +08:00
zihluwang 9eac6a5957 build: add pnpm version 2025-07-28 12:37:55 +08:00
zihluwang f5e4688a79 build: build 0.4.0 2025-07-28 12:35:11 +08:00
zihluwang c584834692 ci: update ci configurations 2025-07-28 12:33:28 +08:00
zihluwang 00ac6214e1 refactor: update application configurations 2025-07-28 12:29:35 +08:00
zihluwang a936e2cfd6 refactor: update application name 2025-07-28 12:15:26 +08:00
zihluwang 8c05558528 build: build 0.2.0 2025-07-28 11:37:02 +08:00
zihluwang 7f477b519d ci: add package settings 2025-07-28 11:36:05 +08:00
30 changed files with 238 additions and 42 deletions

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
name: Package and Publish
on:
workflow_dispatch:
pull_request:
types:
- closed
jobs:
build:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
name: Build Application Installer
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
- platform: 'windows-latest'
args: ''
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4.1.0
with:
version: latest
- name: Setup Node
uses: actions/setup-node@v4.4.0
with:
node-version: 20
cache: 'pnpm'
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Install Dependencies
run: pnpm install
- name: Build
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: __VERSION__
releaseName: 'v__VERSION__'
args: ${{ matrix.args }}
+30
View File
@@ -0,0 +1,30 @@
# Contributing
本项目基于 Tauri v2.0 开发,技术栈如下:
**后端**
- Rust 1.88.0
**前端**
- React v18
- Tailwind CSS v4
欢迎您从**代码**或**内容**两方面参与贡献,共同完善本项目。
## 贡献指引
### 代码贡献
1. 【可选】创建 Issue,讨论你的想法。
2. Fork 本仓库。
3. 基于 `develop` 分支创建新 `feature/<your_feature_name>` 分支。
4. 开始完善你的功能。
5. 测试功能。
6. 提交你的代码并通过创建 Pull Request 将代码合并到 `develop` 分支。
7. 等待上线。
### 内容贡献
**暂时还没想好怎么提交新内容,等待这里更新再说吧。**
+19
View File
@@ -0,0 +1,19 @@
Copyright (c) 2025 Zihlu Wang
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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.
+39 -4
View File
@@ -1,7 +1,42 @@
# Tauri + React + Typescript
# 祖安语录桌面版
This template should help get you started developing with Tauri, React and Typescript in Vite.
![MIT Licence](https://img.shields.io/github/license/zihluwang/zuanbot)
## Recommended IDE Setup
> 本仓库为 [cndiandian/zuanbot.com](https://github.com/cndiandian/zuanbot.com) 的客户端版本。
- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
## 有什么用
可以随机输出一条骂人的句子,有**口吐芬芳**与**火力全开**两个模式。
## 词库下载
[GitHub 下载](/src-tauri/resources/data.db)、[阿里云盘](https://www.aliyundrive.com/s/StTs9ojDAEF)、[蓝揍云](https://shadiao.lanzouw.com/b0116bgub) `密码hck1` 、 [诚通网盘](https://url08.ctfile.com/d/14688008-46477369-3732e0) `密码9919`
在线文档:[Notion文档](https://dians.notion.site/d865fac077f1430f9510d020f8713c8e)、[口吐芬芳(谷歌文档)](https://docs.google.com/document/d/1SskgYtDpYL6P_4qmX2A1ndBl8MY5NeDcBaYPxS-yxIo/edit?usp=sharing) 、[火力全开(谷歌文档)](https://docs.google.com/document/d/14YG9qaNDZk275av-Iss6B6YY-eDTdkS5w_my3f7349A/edit?usp=sharing)
## 如何使用
下载对应操作系统的安装包,执行安装即可。
包类型(文件后缀):
- Windows: `x64.msi`
- macOS
- Intel: `x64.dmg`
- Apple Silicon: `aarch64.dmg`
由于没有代码签名,在 Mac 上会因为没有开启允许所有开发者而提示软件损坏,此时可以打开**终端**,并输入 `xattr -d com.apple.quaratine /Applications/zuanbot.app` 再打开软件。
## 什么原理
收集整理了N条骂人的句子,然后随机读取一条输出即可。
核心代码就一行:
```sql
SELECT * FROM `main` ORDER BY RANDOM() limit 1
```
## 词库都是怎么来的
最初来源于网络收集了一些,后来基本就都是各位用户的投稿了,投稿渠道现已关闭。
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "zuanbot",
"private": true,
"version": "0.1.0",
"version": "0.2.1",
"type": "module",
"scripts": {
"dev": "vite",
+1 -1
View File
@@ -5233,7 +5233,7 @@ dependencies = [
[[package]]
name = "zuanbot"
version = "0.1.0"
version = "0.2.1"
dependencies = [
"anyhow",
"rusqlite",
+3 -3
View File
@@ -1,8 +1,8 @@
[package]
name = "zuanbot"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
version = "0.2.1"
description = "祖安助手"
authors = ["zihluwang"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Regular → Executable
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Regular → Executable
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Regular → Executable
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Regular → Executable
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 77 KiB

+7
View File
@@ -0,0 +1,7 @@
Copyright (c) 2025 Zihlu Wang
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
File renamed without changes.
+1 -1
View File
@@ -30,7 +30,7 @@ impl Database {
fn get_bundled_database_path(app_handle: &tauri::AppHandle) -> Result<PathBuf> {
let resource_path = app_handle
.path()
.resolve("data.db", tauri::path::BaseDirectory::Resource)?;
.resolve("./resources/data.db", tauri::path::BaseDirectory::Resource)?;
println!("Database path: {:?}", resource_path);
Ok(resource_path)
+25 -8
View File
@@ -1,8 +1,8 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "zuanbot",
"version": "0.1.0",
"identifier": "io.github.zihluwang.zuanbot",
"productName": "Zuanbot",
"version": "0.3.0",
"identifier": "me.zihluwang.zuanbot",
"build": {
"beforeDevCommand": "pnpm dev",
"devUrl": "http://localhost:1420",
@@ -12,9 +12,13 @@
"app": {
"windows": [
{
"title": "zuanbot",
"width": 800,
"height": 600
"title": "祖安语录",
"width": 560,
"maxWidth": 560,
"minWidth": 560,
"height": 400,
"maxHeight": 400,
"minHeight": 400
}
],
"security": {
@@ -23,7 +27,20 @@
},
"bundle": {
"active": true,
"targets": "all",
"publisher": "Zihlu Wang",
"category": "Utility",
"targets": ["dmg", "msi"],
"windows": {
"wix": {
"language": "zh-CN"
},
"webviewInstallMode": {
"type": "embedBootstrapper"
}
},
"license": "MIT",
"licenseFile": "./resources/Licence.txt",
"copyright": "Data Collected by @cndiandian, Developed by @zihluwang.",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
@@ -32,7 +49,7 @@
"icons/icon.ico"
],
"resources": [
"./data.db"
"./resources/data.db"
]
}
}
+34 -24
View File
@@ -1,38 +1,48 @@
import React, { useEffect, useState } from "react"
import { invoke } from "@tauri-apps/api/core"
enum Level {
min = "min",
max = "max",
}
import { Level } from "@/types"
import * as service from "@/service"
export default function App() {
// 文本内容状态
const [text, setText] = useState<string>("")
const [isLast, setIsLast] = useState<boolean>(false)
const [last, setLast] = useState<string>("")
useEffect(() => {
// 加载一条祖安语录
;(async () => {
await getMessage()
})()
// 第一条消息,禁用上一条功能
setIsLast(true)
}, [])
/**
* 获取一条祖安语录
* @param level 语录等级
*/
const getMessage = async (level?: Level) => {
// 开放上一条功能
setIsLast(false)
// 保存上一条信息
setLast(text)
// 获取下一条信息
const nextMessage = await invoke<string>("get_message", { level })
setText(nextMessage)
const nextZuanMessage = await service.nextZuan(level)
setText(nextZuanMessage)
}
/**
* 展示上一条祖安语录
*/
const showLast = () => {
setIsLast(true)
setText(last)
}
// 复制文字到剪贴板
/**
* 复制文字到剪贴板
*/
const copyToClipboard = () => {
if (navigator.clipboard) {
navigator.clipboard.writeText(text).then(
@@ -44,39 +54,39 @@ export default function App() {
}
)
} else {
alert("当前浏览器不支持复制功能")
alert("暂时不支持复制功能")
}
}
return (
<div className="min-h-screen bg-gray-100 text-gray-700 flex flex-col">
<header className="bg-purple-700 text-white flex flex-col md:flex-row items-center md:justify-between px-6 py-5 sticky top-0 z-40 shadow-md">
<h3 className="text-xl font-semibold mb-2 md:mb-0">骂人宝典</h3>
<nav className="flex space-x-6 text-sm md:text-base"></nav>
</header>
<main className="flex-grow max-w-4xl mx-auto p-4">
<section className="mb-6 flex flex-wrap justify-center gap-4">
<main className="flex-grow max-w-[800px] p-4 row-auto">
<section className="mb-6 flex flex-wrap justify-center gap-4 columns-2">
<button
onClick={() => getMessage(Level.min)}
className="bg-pink-600 hover:bg-pink-700 text-white font-semibold py-3 px-6 rounded shadow-md transition">
onClick={() => getMessage(Level.max)}
className="bg-pink-600 hover:bg-pink-700 text-white font-semibold py-3 px-6 rounded-md shadow-md transition">
😤 火力全开
</button>
<button
onClick={() => getMessage(Level.max)}
className="bg-teal-500 hover:bg-teal-600 text-white font-semibold py-3 px-6 rounded shadow-md transition">
onClick={() => getMessage(Level.min)}
className="bg-teal-500 hover:bg-teal-600 text-white font-semibold py-3 px-6 rounded-md shadow-md transition">
🙂 口吐莲花
</button>
</section>
{text}
<textarea
className="mb-6 p-2 border rounded-md block mx-auto w-full max-w-[400px] columns-1"
rows={4}
value={text}
readOnly
/>
<section className="mb-6 flex flex-wrap justify-center items-center gap-4">
<button
onClick={showLast}
disabled={isLast}
className="bg-green-600 hover:bg-green-700 text-white font-semibold py-3 px-6 rounded shadow-md transition">
className="bg-green-600 hover:bg-green-700 text-white font-semibold py-3 px-6 rounded shadow-md transition disabled:bg-[#CCCCCC]">
上一条
</button>
+10
View File
@@ -0,0 +1,10 @@
import { invoke } from "@tauri-apps/api/core"
import { Level } from "@/types"
/**
* 从服务端获取下一条祖安语录
* @param level 祖安级别
*/
export async function nextZuan(level?: Level) {
return await invoke<string>("get_message", { level })
}
+4
View File
@@ -0,0 +1,4 @@
export enum Level {
min = "min",
max = "max"
}