fix cr issues

This commit is contained in:
Zhou Hua 2025-04-03 11:03:49 +08:00
parent 6d23be9d29
commit ffdd5b389b
8 changed files with 1223 additions and 463 deletions

View file

@ -10,6 +10,10 @@
- **音量控制**:单独控制白噪音音量,也许可以与你的音乐共存
- **计时器功能**:内置一个简单的番茄钟功能,可以与白噪音联动
## 截图
![截图](./screenshots/screenshot.png)
## 安装方法
1. 打开Obsidian导航至**设置**
@ -20,6 +24,7 @@
## 致谢
本插件使用了来自[Moodist](https://github.com/remvze/moodist)项目的声音素材。但为了更好地适用于 obsidian 环境,对一些声音素材进行了删改:
- 删除了部分可能让人紧张的音效(如雷声等);
- 删除了少量体积过大的音频,以减小插件的体积;
- 对音频进行了再次压缩,修改为动态码率,合并双声道为联合立体声,仅保留 40Hz ~ 15000Hz 的声音;

View file

@ -10,6 +10,10 @@ A white noise plugin for Obsidian designed to help users focus better and enter
- **Volume Control**: Independently control the white noise volume, which can coexist with your music
- **Timer Function**: Built-in simple pomodoro timer that works in conjunction with white noise
## Screenshot
![screenshot](./screenshots/screenshot.png)
## Installation
1. Open Obsidian and navigate to **Settings**
@ -20,6 +24,7 @@ A white noise plugin for Obsidian designed to help users focus better and enter
## Credits
This plugin uses sound materials from the [Moodist](https://github.com/remvze/moodist) project. To better adapt to the Obsidian environment, some sound materials have been modified:
- Removed some potentially anxiety-inducing sound effects (such as thunder)
- Removed several oversized audio files to reduce the plugin size
- Further compressed the audio, modified to variable bit rate, merged dual channels into joint stereo, and preserved only sounds between 40Hz ~ 15000Hz

View file

@ -2,8 +2,8 @@
"id": "white-noise",
"name": "White Noise",
"version": "0.0.2",
"minAppVersion": "1.7.7",
"description": "Play white noise in Obsidian to help you focus on your work",
"minAppVersion": "1.8.0",
"description": "Play white noise to help you focus on your work",
"author": "Zhou Hua",
"authorUrl": "https://zhouhua.site",
"isDesktopOnly": true

View file

@ -2,7 +2,7 @@
"name": "obsidian-white-noise",
"type": "module",
"version": "0.0.2",
"description": "Play white noise in Obsidian to help you focus on your work",
"description": "Play white noise to help you focus on your work",
"author": "zhouhua",
"license": "MIT",
"keywords": [
@ -21,29 +21,29 @@
"typesafe-i18n": "typesafe-i18n"
},
"devDependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/language": "^6.11.0",
"@codemirror/state": "^6.0.0",
"@codemirror/view": "^6.0.0",
"@codemirror/view": "^6.36.5",
"@lezer/common": "^1.2.0",
"@shadcn/ui": "^0.0.4",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.10.5",
"@types/node": "^22.14.0",
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "8.24.0",
"@typescript-eslint/parser": "8.24.0",
"@typescript-eslint/eslint-plugin": "8.29.0",
"@typescript-eslint/parser": "8.29.0",
"@waveform-audio/inf": "^0.0.1",
"builtin-modules": "4.0.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"esbuild": "0.25.0",
"obsidian": "latest",
"obsidian-typings": "^2.8.1",
"esbuild": "0.25.2",
"obsidian": "^1.8.7",
"obsidian-typings": "^2.41.4",
"postcss": "^8.5.3",
"tailwind-merge": "^3.0.2",
"tailwind-merge": "^3.1.0",
"tailwindcss": "^3.4.17",
"tslib": "2.8.1",
"typescript": "5.7.3"
"typescript": "5.8.2"
},
"dependencies": {
"@radix-ui/react-dropdown-menu": "^2.1.6",
@ -55,7 +55,7 @@
"@radix-ui/react-switch": "^1.1.3",
"@radix-ui/react-tabs": "^1.1.3",
"lodash-es": "^4.17.21",
"lucide-react": "^0.476.0",
"lucide-react": "^0.487.0",
"react": "^18.3.0",
"react-dom": "^18.3.0",
"typesafe-i18n": "^5.26.2"

File diff suppressed because it is too large Load diff

BIN
screenshots/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View file

@ -1,3 +1,4 @@
import { getLanguage } from 'obsidian';
import { loadAllLocales } from './i18n/i18n-util.sync';
import { i18n } from './i18n/i18n-util';
import type { Locales } from './i18n/i18n-types';
@ -14,7 +15,8 @@ declare global {
let locale: Locales = 'en';
try {
locale = (window.i18next.language || '').startsWith('zh') ? 'zh' : 'en';
console.log(getLanguage());
locale = getLanguage().startsWith('zh') ? 'zh' : 'en';
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
catch (e) {

View file

@ -1,8 +1,8 @@
/* 引入 TailwindCSS 样式 */
@import "./globals.css";
@import './globals.css';
/* 白噪音状态栏和面板样式 */
.status-bar-item {
.white-noise-status-bar {
display: flex;
align-items: center;
gap: 6px;
@ -12,7 +12,7 @@
}
/* 状态栏悬停样式 */
.status-bar-item:hover {
.white-noise-status-bar:hover {
background-color: var(--interactive-hover);
}
@ -37,4 +37,4 @@
.white-noise-play-button polygon {
fill: currentColor;
stroke: currentColor;
}
}