Skip to content

Commit 9ea44aa

Browse files
committed
🌈 style: 优化导航栏右上角触发
1 parent 152dcc4 commit 9ea44aa

7 files changed

Lines changed: 162 additions & 39 deletions

File tree

.env.example

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## WEB 端口
2-
VITE_WEB_PORT = 14558
3-
## API 端口
4-
VITE_SERVER_PORT = 25884
5-
## API 地址 - 结尾不要加 /
6-
VITE_API_URL = /api/netease
1+
# WEB 端口
2+
VITE_WEB_PORT=14558
3+
# API 端口
4+
VITE_SERVER_PORT=25884
5+
# API 地址 - 结尾不要加 /
6+
VITE_API_URL=/api/netease

.github/workflows/dev.yml

Lines changed: 117 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -109,37 +109,135 @@ jobs:
109109
if: runner.os == 'Windows'
110110
run: pnpm build:win -- --x64 --arm64
111111
env:
112+
VITE_BUILD_TYPE: dev
112113
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113114
- name: Build macOS Universal App
114115
if: runner.os == 'macOS'
115116
run: pnpm build:mac -- --x64 --arm64
116117
shell: bash
117118
env:
119+
VITE_BUILD_TYPE: dev
118120
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119121
- name: Build Linux x64 & ARM64 App
120122
if: runner.os == 'Linux'
121123
run: pnpm build:linux -- --x64 --arm64
122124
shell: bash
123125
env:
126+
VITE_BUILD_TYPE: dev
124127
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125128

126129
# 分别上传
127-
- { name: Upload Artifacts - Windows Setup x64, if: runner.os == 'Windows', uses: actions/upload-artifact@v4, with: { name: SPlayer-Windows-setup-x64, path: dist/*-x64-setup.exe } }
128-
- { name: Upload Artifacts - Windows Setup arm64, if: runner.os == 'Windows', uses: actions/upload-artifact@v4, with: { name: SPlayer-Windows-setup-arm64, path: dist/*-arm64-setup.exe } }
129-
- { name: Upload Artifacts - Windows Portable x64, if: runner.os == 'Windows', uses: actions/upload-artifact@v4, with: { name: SPlayer-Windows-portable-x64, path: dist/*-x64-portable.exe } }
130-
- { name: Upload Artifacts - Windows Portable arm64, if: runner.os == 'Windows', uses: actions/upload-artifact@v4, with: { name: SPlayer-Windows-portable-arm64, path: dist/*-arm64-portable.exe } }
131-
- { name: Upload Artifacts - macOS DMG x64, if: runner.os == 'macOS', uses: actions/upload-artifact@v4, with: { name: SPlayer-macOS-dmg-x64, path: dist/*-x64.dmg } }
132-
- { name: Upload Artifacts - macOS DMG arm64, if: runner.os == 'macOS', uses: actions/upload-artifact@v4, with: { name: SPlayer-macOS-dmg-arm64, path: dist/*-arm64.dmg } }
133-
- { name: Upload Artifacts - macOS Zip x64, if: runner.os == 'macOS', uses: actions/upload-artifact@v4, with: { name: SPlayer-macOS-zip-x64, path: dist/*-x64.zip } }
134-
- { name: Upload Artifacts - macOS Zip arm64 , if: runner.os == 'macOS', uses: actions/upload-artifact@v4, with: { name: SPlayer-macOS-zip-arm64, path: dist/*-arm64.zip } }
135-
- { name: Upload Artifacts - Linux AppImage x64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-appimage-x64, path: dist/*-x86_64.AppImage } }
136-
- { name: Upload Artifacts - Linux AppImage arm64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-appimage-arm64, path: dist/*-arm64.AppImage } }
137-
- { name: Upload Artifacts - Linux Pacman x64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-pacman-x64, path: dist/*-x64.pacman } }
138-
- { name: Upload Artifacts - Linux Pacman arm64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-pacman-arm64, path: dist/*-aarch64.pacman } }
139-
- { name: Upload Artifacts - Linux DEB x64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-deb-x64, path: dist/*-amd64.deb } }
140-
- { name: Upload Artifacts - Linux DEB arm64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-deb-arm64, path: dist/*-arm64.deb } }
141-
- { name: Upload Artifacts - Linux RPM x64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-rpm-x64, path: dist/*-x86_64.rpm } }
142-
- { name: Upload Artifacts - Linux RPM arm64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-rpm-arm64, path: dist/*-aarch64.rpm } }
143-
- { name: Upload Artifacts - Linux Tar x64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-tar-x64, path: dist/*-x64.tar.gz } }
144-
- { name: Upload Artifacts - Linux Tar arm64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-tar-arm64, path: dist/*-arm64.tar.gz } }
145-
- { name: Upload Artifacts - Linux Snap x64, if: runner.os == 'Linux', uses: actions/upload-artifact@v4, with: { name: SPlayer-Linux-snap-x64, path: dist/*-amd64.snap } }
130+
- {
131+
name: Upload Artifacts - Windows Setup x64,
132+
if: runner.os == 'Windows',
133+
uses: actions/upload-artifact@v4,
134+
with: { name: SPlayer-Windows-setup-x64, path: dist/*-x64-setup.exe },
135+
}
136+
- {
137+
name: Upload Artifacts - Windows Setup arm64,
138+
if: runner.os == 'Windows',
139+
uses: actions/upload-artifact@v4,
140+
with: { name: SPlayer-Windows-setup-arm64, path: dist/*-arm64-setup.exe },
141+
}
142+
- {
143+
name: Upload Artifacts - Windows Portable x64,
144+
if: runner.os == 'Windows',
145+
uses: actions/upload-artifact@v4,
146+
with: { name: SPlayer-Windows-portable-x64, path: dist/*-x64-portable.exe },
147+
}
148+
- {
149+
name: Upload Artifacts - Windows Portable arm64,
150+
if: runner.os == 'Windows',
151+
uses: actions/upload-artifact@v4,
152+
with: { name: SPlayer-Windows-portable-arm64, path: dist/*-arm64-portable.exe },
153+
}
154+
- {
155+
name: Upload Artifacts - macOS DMG x64,
156+
if: runner.os == 'macOS',
157+
uses: actions/upload-artifact@v4,
158+
with: { name: SPlayer-macOS-dmg-x64, path: dist/*-x64.dmg },
159+
}
160+
- {
161+
name: Upload Artifacts - macOS DMG arm64,
162+
if: runner.os == 'macOS',
163+
uses: actions/upload-artifact@v4,
164+
with: { name: SPlayer-macOS-dmg-arm64, path: dist/*-arm64.dmg },
165+
}
166+
- {
167+
name: Upload Artifacts - macOS Zip x64,
168+
if: runner.os == 'macOS',
169+
uses: actions/upload-artifact@v4,
170+
with: { name: SPlayer-macOS-zip-x64, path: dist/*-x64.zip },
171+
}
172+
- {
173+
name: Upload Artifacts - macOS Zip arm64,
174+
if: runner.os == 'macOS',
175+
uses: actions/upload-artifact@v4,
176+
with: { name: SPlayer-macOS-zip-arm64, path: dist/*-arm64.zip },
177+
}
178+
- {
179+
name: Upload Artifacts - Linux AppImage x64,
180+
if: runner.os == 'Linux',
181+
uses: actions/upload-artifact@v4,
182+
with: { name: SPlayer-Linux-appimage-x64, path: dist/*-x86_64.AppImage },
183+
}
184+
- {
185+
name: Upload Artifacts - Linux AppImage arm64,
186+
if: runner.os == 'Linux',
187+
uses: actions/upload-artifact@v4,
188+
with: { name: SPlayer-Linux-appimage-arm64, path: dist/*-arm64.AppImage },
189+
}
190+
- {
191+
name: Upload Artifacts - Linux Pacman x64,
192+
if: runner.os == 'Linux',
193+
uses: actions/upload-artifact@v4,
194+
with: { name: SPlayer-Linux-pacman-x64, path: dist/*-x64.pacman },
195+
}
196+
- {
197+
name: Upload Artifacts - Linux Pacman arm64,
198+
if: runner.os == 'Linux',
199+
uses: actions/upload-artifact@v4,
200+
with: { name: SPlayer-Linux-pacman-arm64, path: dist/*-aarch64.pacman },
201+
}
202+
- {
203+
name: Upload Artifacts - Linux DEB x64,
204+
if: runner.os == 'Linux',
205+
uses: actions/upload-artifact@v4,
206+
with: { name: SPlayer-Linux-deb-x64, path: dist/*-amd64.deb },
207+
}
208+
- {
209+
name: Upload Artifacts - Linux DEB arm64,
210+
if: runner.os == 'Linux',
211+
uses: actions/upload-artifact@v4,
212+
with: { name: SPlayer-Linux-deb-arm64, path: dist/*-arm64.deb },
213+
}
214+
- {
215+
name: Upload Artifacts - Linux RPM x64,
216+
if: runner.os == 'Linux',
217+
uses: actions/upload-artifact@v4,
218+
with: { name: SPlayer-Linux-rpm-x64, path: dist/*-x86_64.rpm },
219+
}
220+
- {
221+
name: Upload Artifacts - Linux RPM arm64,
222+
if: runner.os == 'Linux',
223+
uses: actions/upload-artifact@v4,
224+
with: { name: SPlayer-Linux-rpm-arm64, path: dist/*-aarch64.rpm },
225+
}
226+
- {
227+
name: Upload Artifacts - Linux Tar x64,
228+
if: runner.os == 'Linux',
229+
uses: actions/upload-artifact@v4,
230+
with: { name: SPlayer-Linux-tar-x64, path: dist/*-x64.tar.gz },
231+
}
232+
- {
233+
name: Upload Artifacts - Linux Tar arm64,
234+
if: runner.os == 'Linux',
235+
uses: actions/upload-artifact@v4,
236+
with: { name: SPlayer-Linux-tar-arm64, path: dist/*-arm64.tar.gz },
237+
}
238+
- {
239+
name: Upload Artifacts - Linux Snap x64,
240+
if: runner.os == 'Linux',
241+
uses: actions/upload-artifact@v4,
242+
with: { name: SPlayer-Linux-snap-x64, path: dist/*-amd64.snap },
243+
}

env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export interface MainEnv {
22
readonly VITE_WEB_PORT: string;
33
readonly VITE_SERVER_PORT: string;
44
readonly VITE_API_URL: string;
5+
readonly VITE_BUILD_TYPE: string;
56
}

src/components/Layout/Nav.vue

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@
4949
<SvgIcon :name="isMax ? 'WindowRestore' : 'WindowMaximize'" />
5050
</template>
5151
</n-button>
52-
<n-button :focusable="false" title="关闭" tertiary circle @click="tryClose">
53-
<template #icon>
54-
<SvgIcon name="WindowClose" />
55-
</template>
56-
</n-button>
52+
<div class="close-button-wrapper" @click="tryClose" title="关闭">
53+
<n-button :focusable="false" title="关闭" tertiary circle @click.stop="tryClose">
54+
<template #icon>
55+
<SvgIcon name="WindowClose" />
56+
</template>
57+
</n-button>
58+
<div class="close-expanded-area"></div>
59+
</div>
5760
</n-flex>
5861
<!-- 关闭弹窗 -->
5962
<n-modal
@@ -236,6 +239,21 @@ onMounted(() => {
236239
.divider {
237240
margin: 0 0 0 12px;
238241
}
242+
.close-button-wrapper {
243+
position: relative;
244+
cursor: pointer;
245+
.close-expanded-area {
246+
position: fixed;
247+
top: 0;
248+
right: 0;
249+
width: 60px;
250+
height: 70px;
251+
background-color: transparent;
252+
cursor: pointer;
253+
-webkit-app-region: no-drag;
254+
z-index: 1000;
255+
}
256+
}
239257
}
240258
}
241259
.tip {

src/components/Setting/AboutSetting.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<n-flex align="center" class="about">
77
<SvgIcon name="SPlayer" size="26" />
88
<n-text class="logo-name">SPlayer</n-text>
9-
<n-tag :bordered="false" size="small" type="primary">
9+
<n-tag v-if="isDevBuild" size="small" type="warning" round> DEV </n-tag>
10+
<n-tag :bordered="false" size="small" type="primary" round>
1011
{{ packageJson.version }}
1112
</n-tag>
1213
</n-flex>
@@ -102,7 +103,7 @@ import { getUpdateLog, openLink } from "@/utils/helper";
102103
import { debounce } from "lodash-es";
103104
import { useStatusStore } from "@/stores";
104105
import packageJson from "@/../package.json";
105-
import { isElectron } from "@/utils/env";
106+
import { isDevBuild, isElectron } from "@/utils/env";
106107
107108
const statusStore = useStatusStore();
108109

src/components/Setting/MainSetting.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
{{ packageJson.author }}
2020
</n-text>
2121
<n-text class="name">SPlayer</n-text>
22-
<n-text class="version" depth="3">{{ packageJson.version }}</n-text>
22+
<n-tag v-if="isDevBuild" class="version" size="small" type="warning" round>
23+
DEV · v{{ packageJson.version }}
24+
</n-tag>
25+
<n-text v-else class="version" depth="3">v{{ packageJson.version }}</n-text>
2326
</div>
2427
</div>
2528
<n-scrollbar
@@ -53,8 +56,8 @@
5356
import type { MenuOption, NScrollbar } from "naive-ui";
5457
import type { SettingType } from "@/types/main";
5558
import { renderIcon } from "@/utils/helper";
59+
import { isDevBuild, isElectron } from "@/utils/env";
5660
import packageJson from "@/../package.json";
57-
import { isElectron } from "@/utils/env";
5861
5962
const props = defineProps<{ type: SettingType }>();
6063
@@ -145,10 +148,7 @@ const toGithub = () => {
145148
margin-right: 6px;
146149
}
147150
.version {
148-
&::before {
149-
content: "v";
150-
margin-right: 2px;
151-
}
151+
pointer-events: none;
152152
}
153153
.author {
154154
display: flex;

src/utils/env.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@ export const isLinux = userAgent.includes("Linux");
1414
export const isElectron = userAgent.includes("Electron") || typeof window?.electron !== "undefined";
1515

1616
/** 是否为移动端 */
17-
export const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
17+
export const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
18+
userAgent,
19+
);
20+
21+
/** 是否为 DEV 构建 */
22+
export const isDevBuild = import.meta.env.VITE_BUILD_TYPE === "dev";

0 commit comments

Comments
 (0)