+ login + Добро пожаловать! +
+Войдите в свой аккаунт
diff --git a/frontend/electron.d.ts b/frontend/electron.d.ts new file mode 100644 index 0000000..ae8b74e --- /dev/null +++ b/frontend/electron.d.ts @@ -0,0 +1,12 @@ +export type Platform = "win32" | "darwin" | "linux" + +export interface ElectronInterface { + desktop: true, + platform: Platform +} + +declare global { + interface Window { + electronInterface: ElectronInterface + } +} \ No newline at end of file diff --git a/frontend/electron/main.ts b/frontend/electron/main.ts index 4fab3df..55fbeb7 100644 --- a/frontend/electron/main.ts +++ b/frontend/electron/main.ts @@ -1,10 +1,21 @@ import { app, BrowserWindow } from 'electron'; +import path from "node:path"; app.whenReady().then(() => { const win = new BrowserWindow({ title: 'Main window', minWidth: 650, - minHeight: 420 + minHeight: 420, + webPreferences: { + preload: path.join(import.meta.dirname, "preload.mjs") + }, + titleBarStyle: "hidden", + ...(process.platform !== 'darwin' ? { titleBarOverlay: true } : {}), + trafficLightPosition: { + x: 16 - 4, + y: 16 - 4 + }, + titleBarOverlay: process.platform !== "darwin" }) // You can use `process.env.VITE_DEV_SERVER_URL` when the vite command is called `serve` diff --git a/frontend/electron/preload.ts b/frontend/electron/preload.ts index e69de29..4d99711 100644 --- a/frontend/electron/preload.ts +++ b/frontend/electron/preload.ts @@ -0,0 +1,9 @@ +import { contextBridge } from "electron"; +import type { ElectronInterface, Platform } from "../electron"; + +const electronInterface: ElectronInterface = { + desktop: true, + platform: process.platform as Platform +} + +contextBridge.exposeInMainWorld("electronInterface", electronInterface); \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 5a1549b..96eb4a7 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -7,185 +7,197 @@
- -Войдите в свой аккаунт
-Ещё нет аккаунта? Зарегистрируйтесь
-