From ae280df2b8ba2d1ae5cd3a5e6bc6d503b2b3f424 Mon Sep 17 00:00:00 2001 From: syuilo <Syuilotan@yahoo.co.jp> Date: Fri, 24 Jun 2022 19:47:38 +0900 Subject: [PATCH] chore(client): tweak mini-chart rendering --- packages/client/src/components/mini-chart.vue | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/client/src/components/mini-chart.vue b/packages/client/src/components/mini-chart.vue index 34acb766a..5e842b197 100644 --- a/packages/client/src/components/mini-chart.vue +++ b/packages/client/src/components/mini-chart.vue @@ -2,21 +2,13 @@ <svg :viewBox="`0 0 ${ viewBoxX } ${ viewBoxY }`" style="overflow:visible"> <defs> <linearGradient :id="gradientId" x1="0" x2="0" y1="1" y2="0"> - <stop offset="0%" :stop-color="color"></stop> - <stop offset="100%" :stop-color="colorAlpha"></stop> + <stop offset="0%" :stop-color="color" stop-opacity="0"></stop> + <stop offset="100%" :stop-color="color" stop-opacity="0.65"></stop> </linearGradient> - <mask :id="maskId" x="0" y="0" :width="viewBoxX" :height="viewBoxY"> - <polygon - :points="polygonPoints" - fill="#fff" - fill-opacity="0.5" - /> - </mask> </defs> - <rect - x="-10" y="-10" - :width="viewBoxX + 20" :height="viewBoxY + 20" - :style="`stroke: none; fill: url(#${ gradientId }); mask: url(#${ maskId })`" + <polygon + :points="polygonPoints" + :style="`stroke: none; fill: url(#${ gradientId });`" /> <polyline :points="polylinePoints" @@ -45,7 +37,6 @@ const props = defineProps<{ const viewBoxX = 50; const viewBoxY = 50; const gradientId = uuid(); -const maskId = uuid(); let polylinePoints = $ref(''); let polygonPoints = $ref(''); let headX = $ref<number | null>(null); @@ -53,7 +44,6 @@ let headY = $ref<number | null>(null); let clock = $ref<number | null>(null); const accent = tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--accent')); const color = accent.toRgbString(); -const colorAlpha = accent.clone().setAlpha(1).toRgbString(); function draw(): void { const stats = props.src.slice().reverse();