✨ 更新文档
This commit is contained in:
10
README.md
10
README.md
@@ -76,7 +76,7 @@ npm run build
|
||||
|
||||
1. 修改 `src-tauri` 目录下的 `tauri.conf.json` 中的 `url、productName、icon、title、identifier` 这 5 个字段,其中 icon 可以从 icons 目录选择一个,也可以去 [macOSicons](https://macosicons.com/#/) 下载符合产品名称的
|
||||
2. 关于窗口属性设置,可以在 `tauri.conf.json` 修改 `windows` 属性对应的 `width/height`,是否全屏 `fullscreen`,是否可以调整大小 `resizable`,假如你不好适配沉浸式头部,可以将 `transparent` 设置成 `true` 即可。
|
||||
3. `npm run dev` 本地调试看看效果,此外可以打开 `main.rs` 中 devtools 两处注释(搜索 `_devtools`)进行容器调试
|
||||
3. `npm run dev` 本地调试看看效果,此外可以打开 `main.rs` 中两处注释 `_devtools` 进行容器调试
|
||||
4. `npm run build` 运行即可打包,假如有打开 devtools 模式,记得注释掉
|
||||
|
||||
## 高级
|
||||
@@ -84,19 +84,19 @@ npm run build
|
||||
#### 如何改写样式,如去掉原站广告、不想要的模块、甚至重新设计?
|
||||
|
||||
1. 首先需要打开 devtools 调试模式,找到你需要修改的样式名称,先在 devtools 里面验证效果
|
||||
2. 找到 `pake.js` 中样式位置(搜索 `style.innerHTML`),将需要覆盖的样式加上即可,有一些案例你可以模仿
|
||||
2. 找到 `pake.js` 中样式位置 `style.innerHTML` ,将需要覆盖的样式加上即可,有一些案例你可以模仿
|
||||
3. 正式打包前记得干掉 devtools 注释
|
||||
|
||||
#### 如何注入 JS 的逻辑,比如实现事件监听,比如说键盘快捷键?
|
||||
|
||||
1. 和上面1案例中准备工作一致
|
||||
2. 参考 `pake.js` 中事件监听(搜索`document.addEventListener`),直接编写即可,这里更多是基础前端的技术
|
||||
2. 参考 `pake.js` 中事件监听 `document.addEventListener`,直接编写即可,这里更多是基础前端的技术
|
||||
|
||||
#### 如何进行容器内的事件和 Pake 通信,比如说 Web 的拖拽、滚动、特殊点击传递啥的?
|
||||
|
||||
1. 和上面1案例中准备工作一致
|
||||
2. 参考 `pake.js` 中通信代码(搜索 `postMessage`),写好事件监听,然后用 `window.ipc.postMessage`将事件以及参数传递出来
|
||||
3. 然后参考容器接收事件(搜索 `window.drag_window`),自己处理即可,更多可以参考 tauri 以及 wry 的官方文档
|
||||
2. 参考 `pake.js` 中通信代码 `postMessage`,写好事件监听,然后用 `window.ipc.postMessage` 将事件以及参数传递出来
|
||||
3. 然后参考容器接收事件 `window.drag_window`,自己处理即可,更多可以参考 tauri 以及 wry 的官方文档
|
||||
|
||||
## 贡献者
|
||||
|
||||
|
||||
@@ -84,19 +84,19 @@ npm run build
|
||||
#### How do I rewrite the style, e.g. to remove ads from the original site, or even redesign it?
|
||||
|
||||
1. first open devtools debug mode, find the name of the style you want to change and verify the effect in devtools first.
|
||||
2. find the location of the style in `pake.js` (search for `style.innerHTML`) and add the style you need to override, there are some examples you can copy.
|
||||
2. find the location of the style in `pake.js` with `style.innerHTML` and add the style you need to override, there are some examples you can copy.
|
||||
3. Remember to remove the devtools comments before packaging.
|
||||
|
||||
#### How to inject js code, e.g. to implement event listeners, e.g. keyboard shortcuts?
|
||||
|
||||
1. Same preparation as in case 1 above.
|
||||
2. refer to the event listener in `pake.js` (search for `document.addEventListener`), and write it directly, it's more of a basic front-end technique here.
|
||||
2. refer to the event listener in `pake.js` with `document.addEventListener`, and write it directly, it's more of a basic front-end technique here.
|
||||
|
||||
#### How to communicate with Pake about events in containers, such as dragging and dropping, scrolling, special clicks on the Web, etc.?
|
||||
|
||||
1. the same preparation as in 1 above.
|
||||
2. refer to the communication code in `pake.js` (search for `postMessage`), write the event listener and then use `window.ipc.postMessage` to pass the event and its parameters.
|
||||
3. then refer to the container to receive events (search for `window.drag_window`) and handle them yourself. for more information, refer to tauri and wry's official documentation.
|
||||
2. refer to the communication code in `pake.js` with `postMessage`, write the event listener and then use `window.ipc.postMessage` to pass the event and its parameters.
|
||||
3. then refer to the container to receive events `window.drag_window` and handle them yourself, for more information, refer to tauri and wry's official documentation.
|
||||
|
||||
## Contributors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user