Skip to content

Commit

Permalink
🌈 style: 更新样式优化
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Sep 27, 2024
1 parent 0c82d6a commit 3b5338d
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"electron-updater": "^6.3.4",
"file-saver": "^2.0.5",
"font-list": "^1.5.1",
"github-markdown-css": "^5.7.0",
"howler": "^2.2.4",
"js-cookie": "^3.0.5",
"jss": "^10.10.0",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 3 additions & 14 deletions src/components/Modal/UpdateApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
{{ data?.version || "v0.0.0" }}
</n-tag>
</n-flex>
<div v-if="data?.releaseNotes" class="changelog" v-html="data.releaseNotes" />
<div v-else class="changelog">暂无更新日志</div>
<div v-if="data?.releaseNotes" class="markdown-body" v-html="data.releaseNotes" />
<div v-else class="markdown-body">暂无更新日志</div>
<n-flex class="menu" justify="end">
<n-button strong secondary @click="emit('close')"> 取消 </n-button>
<n-button type="warning" strong secondary @click="goDownload"> 前往下载 </n-button>
Expand All @@ -25,9 +25,7 @@
import type { UpdateInfoType } from "@/types/main";
import packageJson from "@/../package.json";
defineProps<{
data: UpdateInfoType;
}>();
defineProps<{ data: UpdateInfoType }>();
const emit = defineEmits<{ close: [] }>();
Expand Down Expand Up @@ -76,15 +74,6 @@ const goDownload = () => {
font-size: 13px;
}
}
.changelog {
margin-top: 12px;
padding: 20px;
background-color: var(--n-border-color);
border-radius: 8px;
:deep(ul) {
margin: 1rem 0 0 1rem;
}
}
.menu {
margin-top: 20px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/SearchDefault.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
round
@click="emit('toSearch', item)"
>
{{ item }}
{{ item.length > 10 ? item.slice(0, 10) + "..." : item }}
</n-tag>
</n-flex>
</div>
Expand Down
17 changes: 6 additions & 11 deletions src/components/Setting/AboutSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
<n-tag :bordered="false" size="small" type="primary">
{{ newVersion?.version || "v0.0.0" }}
</n-tag>
<n-tag v-if="newVersion?.prerelease" class="test" size="small" type="warning">
测试版
</n-tag>
<n-text :depth="3" class="time">{{ newVersion?.time }}</n-text>
</n-flex>
<div class="changelog" v-html="newVersion?.changelog" />
<div class="markdown-body" v-html="newVersion?.changelog" />
</n-card>
</n-collapse-transition>
</div>
Expand All @@ -42,7 +45,7 @@
</n-tag>
<n-text :depth="3" class="time">{{ item?.time }}</n-text>
</n-flex>
<div class="changelog" v-html="item?.changelog" />
<div class="markdown-body" v-html="item?.changelog" />
</n-card>
</n-collapse-item>
</n-collapse>
Expand Down Expand Up @@ -135,22 +138,14 @@ onMounted(getUpdateData);
.version {
padding-left: 4px;
.n-tag {
pointer-events: none;
border-radius: 6px;
}
.time {
margin-left: auto;
font-size: 13px;
}
}
.changelog {
margin-top: 12px;
padding: 20px;
background-color: var(--n-border-color);
border-radius: 8px;
:deep(ul) {
margin: 1rem 0 0 1rem;
}
}
}
.link {
.link-item {
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import initIpc from "@/utils/initIpc";
// 全局样式
import "@/style/main.scss";
import "@/style/animate.scss";
import "github-markdown-css/github-markdown.css";

// 初始化 ipc
initIpc();
Expand Down
10 changes: 10 additions & 0 deletions src/style/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,13 @@ body {
background-color: var(--primary-hex);
color: var(--background-hex);
}

// markdown
.markdown-body {
--bgColor-default: var(--background-hex) !important;
--bgColor-muted: var(--background-hex) !important;
--fgColor-default: var(--n-text-color) !important;
margin-top: 12px !important;
padding: 20px;
border-radius: 8px;
}
2 changes: 2 additions & 0 deletions src/types/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export type UpdateLogType = {
changelog: string;
time: number;
url: string;
prerelease: boolean;
force?: boolean;
};

Expand All @@ -232,4 +233,5 @@ interface UpdateInfoType {
releaseDate: string;
releaseName: string;
releaseNotes: string;
prerelease: boolean;
}
1 change: 1 addition & 0 deletions src/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ export const getUpdateLog = async (): Promise<UpdateLogType[]> => {
changelog: await marked(v.body),
time: convertToLocalTime(v.published_at),
url: v.html_url,
prerelease: v.prerelease,
})),
);
return updateLogs;
Expand Down
5 changes: 1 addition & 4 deletions src/utils/initIpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ const initIpc = () => {
window.$message.success("当前已是最新版本");
});
// 有更新
window.electron.ipcRenderer.on("update-available", (_, info) => {
console.log(info);
openUpdateApp(info);
});
window.electron.ipcRenderer.on("update-available", (_, info) => openUpdateApp(info));
// 更新错误
window.electron.ipcRenderer.on("update-error", (_, error) => {
console.error("Error updating:", error);
Expand Down
2 changes: 2 additions & 0 deletions src/views/Home/HomeOnline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
<SongListCard
:data="musicStore.dailySongsData.list"
:title="dailySongsTitle"
:height="90"
description="根据你的音乐口味 · 每日更新"
size="small"
@click="router.push({ name: 'daily-songs' })"
/>
<!-- 我喜欢的音乐 -->
<SongListCard
:data="dataStore.likeSongsList.data"
:height="90"
title="我喜欢的音乐"
description="发现你独特的音乐品味"
size="small"
Expand Down

0 comments on commit 3b5338d

Please sign in to comment.