restructure to root, add tuner from jms

This commit is contained in:
vadimwit
2026-03-05 21:54:32 +00:00
parent 10962077bf
commit 850e87f90f
35 changed files with 388 additions and 1108 deletions
+40
View File
@@ -0,0 +1,40 @@
const { app, BrowserWindow } = require('electron')
const path = require('path')
const isDev = !app.isPackaged
function createWindow() {
const win = new BrowserWindow({
width: 1280,
height: 900,
minWidth: 900,
minHeight: 600,
title: 'WhatTheFlat',
webPreferences: {
preload: path.join(__dirname, 'preload.cjs'),
contextIsolation: true,
nodeIntegration: false,
},
})
if (isDev) {
// Dev: load from Vite dev server
win.loadURL('http://localhost:5173')
win.webContents.openDevTools()
} else {
// Production: load built files from disk
win.loadFile(path.join(__dirname, '../dist/index.html'))
}
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})
+8
View File
@@ -0,0 +1,8 @@
// Preload runs in a privileged context before the renderer.
// Expose only what the app actually needs from Node/Electron here.
// Currently the app is pure browser JS so nothing needs exposing.
const { contextBridge } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
platform: process.platform,
})