feat: 添加eslint 和 桌面歌词(未完成)

This commit is contained in:
alger
2024-05-16 18:54:30 +08:00
parent 5e8676a039
commit a9e5bb33e4
65 changed files with 2724 additions and 2320 deletions
+37
View File
@@ -0,0 +1,37 @@
const { BrowserWindow } = require('electron');
let lyricWindow = null;
const loadLyricWindow = (ipcMain) => {
lyricWindow = new BrowserWindow({
width: 800,
height: 300,
frame: false,
show: false,
transparent: true,
webPreferences: {
nodeIntegration: true,
preload: `${__dirname}/preload.js`,
contextIsolation: false,
},
});
ipcMain.on('open-lyric', () => {
if (process.env.NODE_ENV === 'development') {
lyricWindow.webContents.openDevTools({ mode: 'detach' });
lyricWindow.loadURL('http://localhost:4678/#/lyric');
} else {
lyricWindow.loadURL(`file://${__dirname}/dist/index.html/#/lyric`);
}
lyricWindow.show();
});
ipcMain.on('send-lyric', (e, data) => {
lyricWindow.webContents.send('receive-lyric', data);
});
};
module.exports = {
loadLyricWindow,
};