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 @@