mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-03 14:20:50 +08:00
✨ feat(打包初始化):
This commit is contained in:
48
app/main.js
Normal file
48
app/main.js
Normal file
@@ -0,0 +1,48 @@
|
||||
const { app, BrowserWindow, ipcMain } = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 1280,
|
||||
height: 900,
|
||||
frame: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
preload: path.join(__dirname, '/utils/preload.js'),
|
||||
},
|
||||
})
|
||||
win.setMinimumSize(1280, 900);
|
||||
win.loadURL('http://localhost:4678/')
|
||||
win.webContents.openDevTools({ mode: 'detach' })
|
||||
}
|
||||
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
|
||||
|
||||
ipcMain.on('minimize-window', (event) => {
|
||||
const win = BrowserWindow.fromWebContents(event.sender)
|
||||
win.minimize()
|
||||
})
|
||||
|
||||
ipcMain.on('maximize-window', (event) => {
|
||||
const win = BrowserWindow.fromWebContents(event.sender)
|
||||
if (win.isMaximized()) {
|
||||
win.unmaximize()
|
||||
} else {
|
||||
win.maximize()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.on('close-window', (event) => {
|
||||
const win = BrowserWindow.fromWebContents(event.sender)
|
||||
win.close()
|
||||
})
|
||||
|
||||
ipcMain.on('drag-start', (event, data) => {
|
||||
const win = BrowserWindow.fromWebContents(event.sender)
|
||||
win.webContents.beginFrameSubscription((frameBuffer) => {
|
||||
event.reply('frame-buffer', frameBuffer)
|
||||
})
|
||||
})
|
||||
8
app/utils/preload.js
Normal file
8
app/utils/preload.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron')
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
minimize: () => ipcRenderer.send('minimize-window'),
|
||||
maximize: () => ipcRenderer.send('maximize-window'),
|
||||
close: () => ipcRenderer.send('close-window'),
|
||||
dragStart: (data) => ipcRenderer.send('drag-start', data),
|
||||
})
|
||||
15
electron.js
15
electron.js
@@ -1,15 +0,0 @@
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
function createWindow () {
|
||||
const win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
}
|
||||
})
|
||||
|
||||
win.loadURL('http://localhost:4678/')
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
48
index.html
48
index.html
@@ -1,24 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>网抑云 | algerkong</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="//at.alicdn.com/t/font_2685283_5bo4ekd5wh.css"
|
||||
/>
|
||||
<link rel="stylesheet" href="./public/css/animate.css" />
|
||||
<style>
|
||||
:root {
|
||||
--animate-delay: 0.5s;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>网抑云 | algerkong</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="./public/icon/iconfont.css"
|
||||
/>
|
||||
<link rel="stylesheet" href="./public/css/animate.css" />
|
||||
<style>
|
||||
:root {
|
||||
--animate-delay: 0.5s;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,11 +1,15 @@
|
||||
{
|
||||
"name": "alger-music",
|
||||
"version": "0.0.0",
|
||||
"main": "./app/main.js",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview",
|
||||
"es": "vite && electron .",
|
||||
"eb": "vite build && electron-builder"
|
||||
"eb": "vite build && electron-builder",
|
||||
"start": "electron .",
|
||||
"e:b": "electron-builder"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/postcss7-compat": "^2.2.4",
|
||||
@@ -31,6 +35,7 @@
|
||||
"typescript": "^4.3.2",
|
||||
"vfonts": "^0.1.0",
|
||||
"vite": "^4.4.7",
|
||||
"vite-plugin-electron-builder": "^0.1.0",
|
||||
"vite-plugin-vue-devtools": "1.0.0-beta.5",
|
||||
"vue-tsc": "^0.0.24"
|
||||
}
|
||||
|
||||
BIN
public/icon.ico
Normal file
BIN
public/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
279
public/icon/iconfont.css
Normal file
279
public/icon/iconfont.css
Normal file
@@ -0,0 +1,279 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 2685283 */
|
||||
src: url('iconfont.woff2?t=1702897818159') format('woff2'),
|
||||
url('iconfont.woff?t=1702897818159') format('woff'),
|
||||
url('iconfont.ttf?t=1702897818159') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-maxsize:before {
|
||||
content: "\e692";
|
||||
}
|
||||
|
||||
.icon-close:before {
|
||||
content: "\e616";
|
||||
}
|
||||
|
||||
.icon-minisize:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.icon-shuaxin:before {
|
||||
content: "\e627";
|
||||
}
|
||||
|
||||
.icon-icon_error:before {
|
||||
content: "\e615";
|
||||
}
|
||||
|
||||
.icon-a-3User:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-Chat:before {
|
||||
content: "\e605";
|
||||
}
|
||||
|
||||
.icon-Category:before {
|
||||
content: "\e606";
|
||||
}
|
||||
|
||||
.icon-Document:before {
|
||||
content: "\e607";
|
||||
}
|
||||
|
||||
.icon-Heart:before {
|
||||
content: "\e608";
|
||||
}
|
||||
|
||||
.icon-Hide:before {
|
||||
content: "\e609";
|
||||
}
|
||||
|
||||
.icon-Home:before {
|
||||
content: "\e60a";
|
||||
}
|
||||
|
||||
.icon-a-Image2:before {
|
||||
content: "\e60b";
|
||||
}
|
||||
|
||||
.icon-Profile:before {
|
||||
content: "\e60c";
|
||||
}
|
||||
|
||||
.icon-Search:before {
|
||||
content: "\e60d";
|
||||
}
|
||||
|
||||
.icon-Paper:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
|
||||
.icon-Play:before {
|
||||
content: "\e60f";
|
||||
}
|
||||
|
||||
.icon-Setting:before {
|
||||
content: "\e610";
|
||||
}
|
||||
|
||||
.icon-a-TicketStar:before {
|
||||
content: "\e611";
|
||||
}
|
||||
|
||||
.icon-a-VolumeOff:before {
|
||||
content: "\e612";
|
||||
}
|
||||
|
||||
.icon-a-VolumeUp:before {
|
||||
content: "\e613";
|
||||
}
|
||||
|
||||
.icon-a-VolumeDown:before {
|
||||
content: "\e614";
|
||||
}
|
||||
|
||||
.icon-stop:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
||||
.icon-next:before {
|
||||
content: "\e6a9";
|
||||
}
|
||||
|
||||
.icon-prev:before {
|
||||
content: "\e6ac";
|
||||
}
|
||||
|
||||
.icon-play:before {
|
||||
content: "\e6aa";
|
||||
}
|
||||
|
||||
.icon-xiasanjiaoxing:before {
|
||||
content: "\e642";
|
||||
}
|
||||
|
||||
.icon-videofill:before {
|
||||
content: "\e7c7";
|
||||
}
|
||||
|
||||
.icon-favorfill:before {
|
||||
content: "\e64b";
|
||||
}
|
||||
|
||||
.icon-favor:before {
|
||||
content: "\e64c";
|
||||
}
|
||||
|
||||
.icon-loading:before {
|
||||
content: "\e64f";
|
||||
}
|
||||
|
||||
.icon-search:before {
|
||||
content: "\e65c";
|
||||
}
|
||||
|
||||
.icon-likefill:before {
|
||||
content: "\e668";
|
||||
}
|
||||
|
||||
.icon-like:before {
|
||||
content: "\e669";
|
||||
}
|
||||
|
||||
.icon-notificationfill:before {
|
||||
content: "\e66a";
|
||||
}
|
||||
|
||||
.icon-notification:before {
|
||||
content: "\e66b";
|
||||
}
|
||||
|
||||
.icon-evaluate:before {
|
||||
content: "\e672";
|
||||
}
|
||||
|
||||
.icon-homefill:before {
|
||||
content: "\e6bb";
|
||||
}
|
||||
|
||||
.icon-link:before {
|
||||
content: "\e6bf";
|
||||
}
|
||||
|
||||
.icon-roundaddfill:before {
|
||||
content: "\e6d8";
|
||||
}
|
||||
|
||||
.icon-roundadd:before {
|
||||
content: "\e6d9";
|
||||
}
|
||||
|
||||
.icon-add:before {
|
||||
content: "\e6da";
|
||||
}
|
||||
|
||||
.icon-appreciatefill:before {
|
||||
content: "\e6e3";
|
||||
}
|
||||
|
||||
.icon-forwardfill:before {
|
||||
content: "\e6ea";
|
||||
}
|
||||
|
||||
.icon-voicefill:before {
|
||||
content: "\e6f0";
|
||||
}
|
||||
|
||||
.icon-wefill:before {
|
||||
content: "\e6f4";
|
||||
}
|
||||
|
||||
.icon-keyboard:before {
|
||||
content: "\e71b";
|
||||
}
|
||||
|
||||
.icon-picfill:before {
|
||||
content: "\e72c";
|
||||
}
|
||||
|
||||
.icon-markfill:before {
|
||||
content: "\e730";
|
||||
}
|
||||
|
||||
.icon-presentfill:before {
|
||||
content: "\e732";
|
||||
}
|
||||
|
||||
.icon-peoplefill:before {
|
||||
content: "\e735";
|
||||
}
|
||||
|
||||
.icon-read:before {
|
||||
content: "\e742";
|
||||
}
|
||||
|
||||
.icon-backwardfill:before {
|
||||
content: "\e74d";
|
||||
}
|
||||
|
||||
.icon-playfill:before {
|
||||
content: "\e74f";
|
||||
}
|
||||
|
||||
.icon-all:before {
|
||||
content: "\e755";
|
||||
}
|
||||
|
||||
.icon-hotfill:before {
|
||||
content: "\e757";
|
||||
}
|
||||
|
||||
.icon-recordfill:before {
|
||||
content: "\e7a4";
|
||||
}
|
||||
|
||||
.icon-full:before {
|
||||
content: "\e7bc";
|
||||
}
|
||||
|
||||
.icon-favor_fill_light:before {
|
||||
content: "\e7ec";
|
||||
}
|
||||
|
||||
.icon-round_favor_fill:before {
|
||||
content: "\e80a";
|
||||
}
|
||||
|
||||
.icon-round_location_fill:before {
|
||||
content: "\e80b";
|
||||
}
|
||||
|
||||
.icon-round_like_fill:before {
|
||||
content: "\e80c";
|
||||
}
|
||||
|
||||
.icon-round_people_fill:before {
|
||||
content: "\e80d";
|
||||
}
|
||||
|
||||
.icon-round_skin_fill:before {
|
||||
content: "\e80e";
|
||||
}
|
||||
|
||||
.icon-broadcast_fill:before {
|
||||
content: "\e81d";
|
||||
}
|
||||
|
||||
.icon-card_fill:before {
|
||||
content: "\e81f";
|
||||
}
|
||||
|
||||
1
public/icon/iconfont.js
Normal file
1
public/icon/iconfont.js
Normal file
File diff suppressed because one or more lines are too long
471
public/icon/iconfont.json
Normal file
471
public/icon/iconfont.json
Normal file
@@ -0,0 +1,471 @@
|
||||
{
|
||||
"id": "2685283",
|
||||
"name": "music",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "1306794",
|
||||
"name": "maxsize",
|
||||
"font_class": "maxsize",
|
||||
"unicode": "e692",
|
||||
"unicode_decimal": 59026
|
||||
},
|
||||
{
|
||||
"icon_id": "4437591",
|
||||
"name": "close",
|
||||
"font_class": "close",
|
||||
"unicode": "e616",
|
||||
"unicode_decimal": 58902
|
||||
},
|
||||
{
|
||||
"icon_id": "5383753",
|
||||
"name": "minisize",
|
||||
"font_class": "minisize",
|
||||
"unicode": "e602",
|
||||
"unicode_decimal": 58882
|
||||
},
|
||||
{
|
||||
"icon_id": "13075017",
|
||||
"name": "刷新",
|
||||
"font_class": "shuaxin",
|
||||
"unicode": "e627",
|
||||
"unicode_decimal": 58919
|
||||
},
|
||||
{
|
||||
"icon_id": "24457556",
|
||||
"name": "icon_error",
|
||||
"font_class": "icon_error",
|
||||
"unicode": "e615",
|
||||
"unicode_decimal": 58901
|
||||
},
|
||||
{
|
||||
"icon_id": "24492642",
|
||||
"name": "3 User",
|
||||
"font_class": "a-3User",
|
||||
"unicode": "e601",
|
||||
"unicode_decimal": 58881
|
||||
},
|
||||
{
|
||||
"icon_id": "24492643",
|
||||
"name": "Chat",
|
||||
"font_class": "Chat",
|
||||
"unicode": "e605",
|
||||
"unicode_decimal": 58885
|
||||
},
|
||||
{
|
||||
"icon_id": "24492646",
|
||||
"name": "Category",
|
||||
"font_class": "Category",
|
||||
"unicode": "e606",
|
||||
"unicode_decimal": 58886
|
||||
},
|
||||
{
|
||||
"icon_id": "24492661",
|
||||
"name": "Document",
|
||||
"font_class": "Document",
|
||||
"unicode": "e607",
|
||||
"unicode_decimal": 58887
|
||||
},
|
||||
{
|
||||
"icon_id": "24492662",
|
||||
"name": "Heart",
|
||||
"font_class": "Heart",
|
||||
"unicode": "e608",
|
||||
"unicode_decimal": 58888
|
||||
},
|
||||
{
|
||||
"icon_id": "24492665",
|
||||
"name": "Hide",
|
||||
"font_class": "Hide",
|
||||
"unicode": "e609",
|
||||
"unicode_decimal": 58889
|
||||
},
|
||||
{
|
||||
"icon_id": "24492667",
|
||||
"name": "Home",
|
||||
"font_class": "Home",
|
||||
"unicode": "e60a",
|
||||
"unicode_decimal": 58890
|
||||
},
|
||||
{
|
||||
"icon_id": "24492678",
|
||||
"name": "Image 2",
|
||||
"font_class": "a-Image2",
|
||||
"unicode": "e60b",
|
||||
"unicode_decimal": 58891
|
||||
},
|
||||
{
|
||||
"icon_id": "24492684",
|
||||
"name": "Profile",
|
||||
"font_class": "Profile",
|
||||
"unicode": "e60c",
|
||||
"unicode_decimal": 58892
|
||||
},
|
||||
{
|
||||
"icon_id": "24492685",
|
||||
"name": "Search",
|
||||
"font_class": "Search",
|
||||
"unicode": "e60d",
|
||||
"unicode_decimal": 58893
|
||||
},
|
||||
{
|
||||
"icon_id": "24492687",
|
||||
"name": "Paper",
|
||||
"font_class": "Paper",
|
||||
"unicode": "e60e",
|
||||
"unicode_decimal": 58894
|
||||
},
|
||||
{
|
||||
"icon_id": "24492690",
|
||||
"name": "Play",
|
||||
"font_class": "Play",
|
||||
"unicode": "e60f",
|
||||
"unicode_decimal": 58895
|
||||
},
|
||||
{
|
||||
"icon_id": "24492698",
|
||||
"name": "Setting",
|
||||
"font_class": "Setting",
|
||||
"unicode": "e610",
|
||||
"unicode_decimal": 58896
|
||||
},
|
||||
{
|
||||
"icon_id": "24492708",
|
||||
"name": "Ticket Star",
|
||||
"font_class": "a-TicketStar",
|
||||
"unicode": "e611",
|
||||
"unicode_decimal": 58897
|
||||
},
|
||||
{
|
||||
"icon_id": "24492712",
|
||||
"name": "Volume Off",
|
||||
"font_class": "a-VolumeOff",
|
||||
"unicode": "e612",
|
||||
"unicode_decimal": 58898
|
||||
},
|
||||
{
|
||||
"icon_id": "24492713",
|
||||
"name": "Volume Up",
|
||||
"font_class": "a-VolumeUp",
|
||||
"unicode": "e613",
|
||||
"unicode_decimal": 58899
|
||||
},
|
||||
{
|
||||
"icon_id": "24492714",
|
||||
"name": "Volume Down",
|
||||
"font_class": "a-VolumeDown",
|
||||
"unicode": "e614",
|
||||
"unicode_decimal": 58900
|
||||
},
|
||||
{
|
||||
"icon_id": "18875422",
|
||||
"name": "暂停 停止 灰色",
|
||||
"font_class": "stop",
|
||||
"unicode": "e600",
|
||||
"unicode_decimal": 58880
|
||||
},
|
||||
{
|
||||
"icon_id": "15262786",
|
||||
"name": "1_music82",
|
||||
"font_class": "next",
|
||||
"unicode": "e6a9",
|
||||
"unicode_decimal": 59049
|
||||
},
|
||||
{
|
||||
"icon_id": "15262807",
|
||||
"name": "1_music83",
|
||||
"font_class": "prev",
|
||||
"unicode": "e6ac",
|
||||
"unicode_decimal": 59052
|
||||
},
|
||||
{
|
||||
"icon_id": "15262830",
|
||||
"name": "1_music81",
|
||||
"font_class": "play",
|
||||
"unicode": "e6aa",
|
||||
"unicode_decimal": 59050
|
||||
},
|
||||
{
|
||||
"icon_id": "15367",
|
||||
"name": "下三角形",
|
||||
"font_class": "xiasanjiaoxing",
|
||||
"unicode": "e642",
|
||||
"unicode_decimal": 58946
|
||||
},
|
||||
{
|
||||
"icon_id": "1096518",
|
||||
"name": "video_fill",
|
||||
"font_class": "videofill",
|
||||
"unicode": "e7c7",
|
||||
"unicode_decimal": 59335
|
||||
},
|
||||
{
|
||||
"icon_id": "29930",
|
||||
"name": "favor_fill",
|
||||
"font_class": "favorfill",
|
||||
"unicode": "e64b",
|
||||
"unicode_decimal": 58955
|
||||
},
|
||||
{
|
||||
"icon_id": "29931",
|
||||
"name": "favor",
|
||||
"font_class": "favor",
|
||||
"unicode": "e64c",
|
||||
"unicode_decimal": 58956
|
||||
},
|
||||
{
|
||||
"icon_id": "29934",
|
||||
"name": "loading",
|
||||
"font_class": "loading",
|
||||
"unicode": "e64f",
|
||||
"unicode_decimal": 58959
|
||||
},
|
||||
{
|
||||
"icon_id": "29947",
|
||||
"name": "search",
|
||||
"font_class": "search",
|
||||
"unicode": "e65c",
|
||||
"unicode_decimal": 58972
|
||||
},
|
||||
{
|
||||
"icon_id": "30417",
|
||||
"name": "like_fill",
|
||||
"font_class": "likefill",
|
||||
"unicode": "e668",
|
||||
"unicode_decimal": 58984
|
||||
},
|
||||
{
|
||||
"icon_id": "30418",
|
||||
"name": "like",
|
||||
"font_class": "like",
|
||||
"unicode": "e669",
|
||||
"unicode_decimal": 58985
|
||||
},
|
||||
{
|
||||
"icon_id": "30419",
|
||||
"name": "notification_fill",
|
||||
"font_class": "notificationfill",
|
||||
"unicode": "e66a",
|
||||
"unicode_decimal": 58986
|
||||
},
|
||||
{
|
||||
"icon_id": "30420",
|
||||
"name": "notification",
|
||||
"font_class": "notification",
|
||||
"unicode": "e66b",
|
||||
"unicode_decimal": 58987
|
||||
},
|
||||
{
|
||||
"icon_id": "30434",
|
||||
"name": "evaluate",
|
||||
"font_class": "evaluate",
|
||||
"unicode": "e672",
|
||||
"unicode_decimal": 58994
|
||||
},
|
||||
{
|
||||
"icon_id": "33519",
|
||||
"name": "home_fill",
|
||||
"font_class": "homefill",
|
||||
"unicode": "e6bb",
|
||||
"unicode_decimal": 59067
|
||||
},
|
||||
{
|
||||
"icon_id": "34922",
|
||||
"name": "link",
|
||||
"font_class": "link",
|
||||
"unicode": "e6bf",
|
||||
"unicode_decimal": 59071
|
||||
},
|
||||
{
|
||||
"icon_id": "38744",
|
||||
"name": "round_add_fill",
|
||||
"font_class": "roundaddfill",
|
||||
"unicode": "e6d8",
|
||||
"unicode_decimal": 59096
|
||||
},
|
||||
{
|
||||
"icon_id": "38746",
|
||||
"name": "round_add",
|
||||
"font_class": "roundadd",
|
||||
"unicode": "e6d9",
|
||||
"unicode_decimal": 59097
|
||||
},
|
||||
{
|
||||
"icon_id": "38747",
|
||||
"name": "add",
|
||||
"font_class": "add",
|
||||
"unicode": "e6da",
|
||||
"unicode_decimal": 59098
|
||||
},
|
||||
{
|
||||
"icon_id": "43903",
|
||||
"name": "appreciate_fill",
|
||||
"font_class": "appreciatefill",
|
||||
"unicode": "e6e3",
|
||||
"unicode_decimal": 59107
|
||||
},
|
||||
{
|
||||
"icon_id": "52506",
|
||||
"name": "forward_fill",
|
||||
"font_class": "forwardfill",
|
||||
"unicode": "e6ea",
|
||||
"unicode_decimal": 59114
|
||||
},
|
||||
{
|
||||
"icon_id": "55448",
|
||||
"name": "voice_fill",
|
||||
"font_class": "voicefill",
|
||||
"unicode": "e6f0",
|
||||
"unicode_decimal": 59120
|
||||
},
|
||||
{
|
||||
"icon_id": "61146",
|
||||
"name": "we_fill",
|
||||
"font_class": "wefill",
|
||||
"unicode": "e6f4",
|
||||
"unicode_decimal": 59124
|
||||
},
|
||||
{
|
||||
"icon_id": "90847",
|
||||
"name": "keyboard",
|
||||
"font_class": "keyboard",
|
||||
"unicode": "e71b",
|
||||
"unicode_decimal": 59163
|
||||
},
|
||||
{
|
||||
"icon_id": "127305",
|
||||
"name": "pic_fill",
|
||||
"font_class": "picfill",
|
||||
"unicode": "e72c",
|
||||
"unicode_decimal": 59180
|
||||
},
|
||||
{
|
||||
"icon_id": "143738",
|
||||
"name": "mark_fill",
|
||||
"font_class": "markfill",
|
||||
"unicode": "e730",
|
||||
"unicode_decimal": 59184
|
||||
},
|
||||
{
|
||||
"icon_id": "143740",
|
||||
"name": "present_fill",
|
||||
"font_class": "presentfill",
|
||||
"unicode": "e732",
|
||||
"unicode_decimal": 59186
|
||||
},
|
||||
{
|
||||
"icon_id": "158873",
|
||||
"name": "people_fill",
|
||||
"font_class": "peoplefill",
|
||||
"unicode": "e735",
|
||||
"unicode_decimal": 59189
|
||||
},
|
||||
{
|
||||
"icon_id": "176313",
|
||||
"name": "read",
|
||||
"font_class": "read",
|
||||
"unicode": "e742",
|
||||
"unicode_decimal": 59202
|
||||
},
|
||||
{
|
||||
"icon_id": "212324",
|
||||
"name": "backward_fill",
|
||||
"font_class": "backwardfill",
|
||||
"unicode": "e74d",
|
||||
"unicode_decimal": 59213
|
||||
},
|
||||
{
|
||||
"icon_id": "212328",
|
||||
"name": "play_fill",
|
||||
"font_class": "playfill",
|
||||
"unicode": "e74f",
|
||||
"unicode_decimal": 59215
|
||||
},
|
||||
{
|
||||
"icon_id": "240126",
|
||||
"name": "all",
|
||||
"font_class": "all",
|
||||
"unicode": "e755",
|
||||
"unicode_decimal": 59221
|
||||
},
|
||||
{
|
||||
"icon_id": "240128",
|
||||
"name": "hot_fill",
|
||||
"font_class": "hotfill",
|
||||
"unicode": "e757",
|
||||
"unicode_decimal": 59223
|
||||
},
|
||||
{
|
||||
"icon_id": "747747",
|
||||
"name": "record_fill",
|
||||
"font_class": "recordfill",
|
||||
"unicode": "e7a4",
|
||||
"unicode_decimal": 59300
|
||||
},
|
||||
{
|
||||
"icon_id": "1005712",
|
||||
"name": "full",
|
||||
"font_class": "full",
|
||||
"unicode": "e7bc",
|
||||
"unicode_decimal": 59324
|
||||
},
|
||||
{
|
||||
"icon_id": "1512759",
|
||||
"name": "favor_fill_light",
|
||||
"font_class": "favor_fill_light",
|
||||
"unicode": "e7ec",
|
||||
"unicode_decimal": 59372
|
||||
},
|
||||
{
|
||||
"icon_id": "4110741",
|
||||
"name": "round_favor_fill",
|
||||
"font_class": "round_favor_fill",
|
||||
"unicode": "e80a",
|
||||
"unicode_decimal": 59402
|
||||
},
|
||||
{
|
||||
"icon_id": "4110743",
|
||||
"name": "round_location_fill",
|
||||
"font_class": "round_location_fill",
|
||||
"unicode": "e80b",
|
||||
"unicode_decimal": 59403
|
||||
},
|
||||
{
|
||||
"icon_id": "4110745",
|
||||
"name": "round_like_fill",
|
||||
"font_class": "round_like_fill",
|
||||
"unicode": "e80c",
|
||||
"unicode_decimal": 59404
|
||||
},
|
||||
{
|
||||
"icon_id": "4110746",
|
||||
"name": "round_people_fill",
|
||||
"font_class": "round_people_fill",
|
||||
"unicode": "e80d",
|
||||
"unicode_decimal": 59405
|
||||
},
|
||||
{
|
||||
"icon_id": "4110750",
|
||||
"name": "round_skin_fill",
|
||||
"font_class": "round_skin_fill",
|
||||
"unicode": "e80e",
|
||||
"unicode_decimal": 59406
|
||||
},
|
||||
{
|
||||
"icon_id": "11778953",
|
||||
"name": "broadcast_fill",
|
||||
"font_class": "broadcast_fill",
|
||||
"unicode": "e81d",
|
||||
"unicode_decimal": 59421
|
||||
},
|
||||
{
|
||||
"icon_id": "12625085",
|
||||
"name": "card_fill",
|
||||
"font_class": "card_fill",
|
||||
"unicode": "e81f",
|
||||
"unicode_decimal": 59423
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
public/icon/iconfont.ttf
Normal file
BIN
public/icon/iconfont.ttf
Normal file
Binary file not shown.
BIN
public/icon/iconfont.woff
Normal file
BIN
public/icon/iconfont.woff
Normal file
Binary file not shown.
BIN
public/icon/iconfont.woff2
Normal file
BIN
public/icon/iconfont.woff2
Normal file
Binary file not shown.
10
src/electron.d.ts
vendored
Normal file
10
src/electron.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
electronAPI: {
|
||||
minimize: () => void
|
||||
maximize: () => void
|
||||
close: () => void
|
||||
dragStart: () => void
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="layout-page">
|
||||
<div class="layout-main">
|
||||
<title-bar />
|
||||
<div class="flex">
|
||||
<!-- 侧边菜单栏 -->
|
||||
<app-menu class="menu" :menus="menus" />
|
||||
@@ -37,7 +38,7 @@ import { defineAsyncComponent } from 'vue';
|
||||
const AppMenu = defineAsyncComponent(() => import('./components/AppMenu.vue'));
|
||||
const PlayBar = defineAsyncComponent(() => import('./components/PlayBar.vue'));
|
||||
const SearchBar = defineAsyncComponent(() => import('./components/SearchBar.vue'));
|
||||
|
||||
const TitleBar = defineAsyncComponent(() => import('./components/TitleBar.vue'));
|
||||
|
||||
|
||||
const store = useStore();
|
||||
@@ -63,7 +64,7 @@ const menus = store.state.menus;
|
||||
width: 90px;
|
||||
}
|
||||
.main {
|
||||
@apply pt-6 pr-6 flex-1 box-border;
|
||||
@apply pr-6 flex-1 box-border;
|
||||
height: 100vh;
|
||||
&-content {
|
||||
@apply rounded-2xl;
|
||||
|
||||
@@ -117,8 +117,8 @@ defineExpose({
|
||||
@apply flex-1 flex justify-center mr-24;
|
||||
|
||||
.img {
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
width: 350px;
|
||||
height: 350px;
|
||||
@apply rounded-xl;
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,8 @@ defineExpose({
|
||||
|
||||
.music-lrc {
|
||||
background-color: inherit;
|
||||
width: 800px;
|
||||
min-width: 400px;
|
||||
max-width: 800px;
|
||||
height: 550px;
|
||||
|
||||
&-text {
|
||||
|
||||
52
src/layout/components/TitleBar.vue
Normal file
52
src/layout/components/TitleBar.vue
Normal file
@@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<div id="title-bar" @mousedown="drag">
|
||||
<div id="title">Alger Music</div>
|
||||
<div id="buttons">
|
||||
<button @click="minimize">
|
||||
<i class="iconfont icon-minisize"></i>
|
||||
</button>
|
||||
<!-- <button @click="maximize">
|
||||
<i class="iconfont icon-maxsize"></i>
|
||||
</button> -->
|
||||
<button @click="close">
|
||||
<i class="iconfont icon-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
const minimize = () => {
|
||||
window.electronAPI.minimize()
|
||||
}
|
||||
|
||||
const maximize = () => {
|
||||
window.electronAPI.maximize()
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
window.electronAPI.close()
|
||||
}
|
||||
|
||||
const drag = (event: HTMLElement) => {
|
||||
window.electronAPI.dragStart(event)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
#title-bar {
|
||||
-webkit-app-region: drag;
|
||||
@apply flex justify-between text-white px-6 py-3 select-none relative;
|
||||
z-index: 9999999;
|
||||
}
|
||||
|
||||
#buttons {
|
||||
@apply flex gap-4;
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
button {
|
||||
@apply hover:text-green-500;
|
||||
}
|
||||
</style>
|
||||
10
src/shims-vue.d.ts
vendored
10
src/shims-vue.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
declare module '*.vue' {
|
||||
import { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
declare module '*.vue' {
|
||||
import { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
@@ -28,11 +28,11 @@ export const secondToMinute = (s: number) => {
|
||||
}
|
||||
|
||||
export const getIsMc = () => {
|
||||
return !!location.href.includes('mc.')
|
||||
return true
|
||||
}
|
||||
|
||||
export const getImgUrl = computed(() => (url: string, size: string) => {
|
||||
const bdUrl = 'https://image.baidu.com/search/down?url='
|
||||
const imgUrl = encodeURIComponent(`${url}?param=${size}`)
|
||||
return getIsMc() ? `${bdUrl}${imgUrl}` : `${url}?param=${size}`
|
||||
return `${bdUrl}${imgUrl}`
|
||||
})
|
||||
|
||||
@@ -1,11 +1,31 @@
|
||||
import { defineConfig } from "vite"
|
||||
import vue from "@vitejs/plugin-vue"
|
||||
import path from "path"
|
||||
import VueDevTools from "vite-plugin-vue-devtools"
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import path from 'path'
|
||||
import VueDevTools from 'vite-plugin-vue-devtools'
|
||||
// const { vitePluginElectronBuilder } = require('vite-plugin-electron-builder')
|
||||
import vitePluginElectronBuilder from 'vite-plugin-electron-builder'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue(), VueDevTools()],
|
||||
plugins: [
|
||||
vue(),
|
||||
VueDevTools(),
|
||||
vitePluginElectronBuilder({
|
||||
mainProcessFile: 'app/main.js',
|
||||
preloadDir: 'app/utils',
|
||||
builderOptions: {
|
||||
appId: 'com.alger.music',
|
||||
directories: {
|
||||
output: 'dist_electron',
|
||||
},
|
||||
files: ['dist/**/*', 'node_modules/**/*', 'package.json'],
|
||||
win: {
|
||||
icon: 'public/icon.ico',
|
||||
target: 'nsis',
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
|
||||
Reference in New Issue
Block a user