1
0
mirror of https://github.com/lencx/ChatGPT.git synced 2024-10-01 01:06:13 -04:00
This commit is contained in:
lencx 2022-12-07 22:04:12 +08:00
parent 7a682d0177
commit dd51ffbf1d
3 changed files with 26 additions and 12 deletions

View File

@ -1,12 +1,16 @@
# UPDATE LOG
## v0.1.3
fix: only mac supports `TitleBarStyle`
## v0.1.2
- initialization
initialization
## v0.1.1
- initialization
initialization
## v0.1.0

View File

@ -36,16 +36,26 @@ document.addEventListener('DOMContentLoaded', async () => {
});
}
const topStyleDom = document.createElement("style");
topStyleDom.innerHTML = `#chatgpt-app-window-top{position:fixed;top:0;z-index:999999999;width:100%;height:24px;background:transparent;cursor:grab;cursor:-webkit-grab;user-select:none;-webkit-user-select:none;}#chatgpt-app-window-top:active {cursor:grabbing;cursor:-webkit-grabbing;}`;
document.head.appendChild(topStyleDom);
const topDom = document.createElement("div");
topDom.id = "chatgpt-app-window-top";
document.body.appendChild(topDom);
async function platform() {
return invoke('platform', {
__tauriModule: 'Os',
message: { cmd: 'platform' }
});
}
topDom.addEventListener("mousedown", () => invoke("drag_window"));
topDom.addEventListener("touchstart", () => invoke("drag_window"));
topDom.addEventListener("dblclick", () => invoke("fullscreen"));
const _platform = await platform();
if (/darwin/.test(_platform)) {
const topStyleDom = document.createElement("style");
topStyleDom.innerHTML = `#chatgpt-app-window-top{position:fixed;top:0;z-index:999999999;width:100%;height:24px;background:transparent;cursor:grab;cursor:-webkit-grab;user-select:none;-webkit-user-select:none;}#chatgpt-app-window-top:active {cursor:grabbing;cursor:-webkit-grabbing;}`;
document.head.appendChild(topStyleDom);
const topDom = document.createElement("div");
topDom.id = "chatgpt-app-window-top";
document.body.appendChild(topDom);
topDom.addEventListener("mousedown", () => invoke("drag_window"));
topDom.addEventListener("touchstart", () => invoke("drag_window"));
topDom.addEventListener("dblclick", () => invoke("fullscreen"));
}
document.addEventListener("click", (e) => {
const origin = e.target.closest("a");

View File

@ -7,7 +7,7 @@
},
"package": {
"productName": "ChatGPT",
"version": "0.1.2"
"version": "0.1.3"
},
"tauri": {
"allowlist": {