From bf30e14c3073d5f7bf2a2a4869ffc7d8a18b126a Mon Sep 17 00:00:00 2001 From: hi2hi Date: Fri, 20 Dec 2024 16:43:48 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=96=B0=E5=A2=9E=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=83=8C=E6=99=AF=E5=9B=BE=E7=89=87=20?= =?UTF-8?q?=E2=9C=A8=20=E6=96=B0=E5=A2=9E=E6=B5=85=E8=89=B2=E7=B3=BB?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=AE=BE=E5=AE=9A=EF=BC=8C=E9=80=82=E9=85=8D?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=83=8C=E6=99=AF=E5=9B=BE=E7=89=87?= =?UTF-8?q?=20=F0=9F=AA=84=20=E4=BF=AE=E6=94=B9=E5=9B=BE=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=96=B9=E5=BC=8F=E4=B8=BASVG=20=F0=9F=94=A7?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=9A=84=E7=8A=B6=E6=80=81=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/config.js | 2 + readme.md | 2 + src/App.vue | 6 +- src/components/charts/donut.js | 16 +++-- src/components/charts/line.js | 4 +- src/components/dot-dot-box.vue | 14 ++++- src/components/world-map/world-map.vue | 63 +++++++++++++++---- src/layout/components/header.vue | 11 ++++ src/layout/main.vue | 29 ++++++++- src/router/index.js | 13 ++-- .../server-list/server-option-box.vue | 36 ++++++++++- src/views/composable/server-status.js | 29 ++++++--- src/views/home.vue | 22 +++++++ 13 files changed, 209 insertions(+), 38 deletions(-) diff --git a/public/config.js b/public/config.js index fb731ca..0c99c80 100644 --- a/public/config.js +++ b/public/config.js @@ -3,6 +3,8 @@ window.$$nazhuaConfig = { // freeAmount: '白嫖', // 免费服务的费用名称 // infinityCycle: '长期有效', // 无限周期名称 // buyBtnText: '购买', // 购买按钮文案 + // customBackgroundImage: '', // 自定义的背景图片地址 + // lightBackground: true, // 启用了浅色系背景图,会强制关闭点点背景 // listServerItemType: 'row', // 服务器列表项类型 card/row row列表模式移动端自动切换至card // listServerStatusType: 'progress', // 服务器状态类型--列表 // listServerRealTimeShowLoad: false, // 列表显示服务器实时负载 diff --git a/readme.md b/readme.md index 835f1e6..4c8673a 100644 --- a/readme.md +++ b/readme.md @@ -185,6 +185,8 @@ window.$$nazhuaConfig = { freeAmount: '白嫖', // 免费服务的费用名称 infinityCycle: '长期有效', // 无限周期名称 buyBtnText: '购买', // 购买按钮文案 + customBackgroundImage: '', // 自定义的背景图片地址 + lightBackground: true, // 启用了浅色系背景图,会强制关闭点点背景 listServerItemType: 'row', // 服务器列表项类型 card/row row列表模式目前不兼容移动端 listServerStatusType: 'progress', // 服务器状态类型--列表 listServerRealTimeShowLoad: false, // 列表显示服务器实时负载 diff --git a/src/App.vue b/src/App.vue index 2948965..0be9a15 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,10 @@ diff --git a/src/components/charts/donut.js b/src/components/charts/donut.js index 7f1168a..a009836 100644 --- a/src/components/charts/donut.js +++ b/src/components/charts/donut.js @@ -1,5 +1,5 @@ import { use } from 'echarts/core'; -import { CanvasRenderer } from 'echarts/renderers'; +import { SVGRenderer } from 'echarts/renderers'; import { BarChart, } from 'echarts/charts'; @@ -10,7 +10,7 @@ import { import config from '@/config'; use([ - CanvasRenderer, + SVGRenderer, BarChart, PolarComponent, ]); @@ -80,8 +80,16 @@ export default (used, total, itemColors, size = 100) => ({ itemStyle: { color: typeof itemColors === 'string' ? itemColors : handleColor(itemColors?.used), borderRadius: 5, - shadowColor: config.nazhua.serverStatusLinear ? 'rgba(0, 0, 0, 0.5)' : undefined, - shadowBlur: config.nazhua.serverStatusLinear ? 10 : undefined, + shadowColor: (() => { + if (config.nazhua.serverStatusLinear) { + return 'rgba(0, 0, 0, 0.5)'; + } + if (config.nazhua.lightBackground) { + return 'rgba(0, 0, 0, 0.2)'; + } + return undefined; + })(), + shadowBlur: (config.nazhua.serverStatusLinear || config.nazhua.lightBackground) ? 10 : undefined, }, coordinateSystem: 'polar', cursor: 'default', diff --git a/src/components/charts/line.js b/src/components/charts/line.js index 491713f..28b902b 100644 --- a/src/components/charts/line.js +++ b/src/components/charts/line.js @@ -1,5 +1,5 @@ import { use } from 'echarts/core'; -import { CanvasRenderer } from 'echarts/renderers'; +import { SVGRenderer } from 'echarts/renderers'; import { LineChart } from 'echarts/charts'; import { TooltipComponent, @@ -12,7 +12,7 @@ import dayjs from 'dayjs'; import config from '@/config'; use([ - CanvasRenderer, + SVGRenderer, LineChart, TooltipComponent, // LegendComponent, diff --git a/src/components/dot-dot-box.vue b/src/components/dot-dot-box.vue index 5d334e4..a594356 100644 --- a/src/components/dot-dot-box.vue +++ b/src/components/dot-dot-box.vue @@ -2,7 +2,7 @@
@@ -16,6 +16,7 @@ */ import { computed } from 'vue'; +import config from '@/config'; const props = defineProps({ borderRadius: { @@ -32,6 +33,10 @@ const props = defineProps({ }, }); +const lightBackground = computed(() => config.nazhua.lightBackground); + +const hideDotBG = computed(() => lightBackground.value || config.nazhua?.hideDotBG === true); + const boxStyle = computed(() => { const style = {}; if (props.borderRadius) { @@ -68,9 +73,14 @@ const boxStyle = computed(() => { backdrop-filter: saturate(50%) blur(3px); &--hide { - background-color: rgba(#000, 0.8); + background-color: rgba(#000, 0.5); background-image: none; backdrop-filter: none; + transition: all 0.3s linear; + + &:hover { + background-color: rgba(#000, 0.8); + } } @media screen and (max-width: 768px) { diff --git a/src/components/world-map/world-map.vue b/src/components/world-map/world-map.vue index ee54982..39e236f 100644 --- a/src/components/world-map/world-map.vue +++ b/src/components/world-map/world-map.vue @@ -1,6 +1,9 @@