From 079f0dfd706817e24563dc40c66aaaa882c246bf Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 25 Aug 2025 21:09:40 +0900 Subject: [PATCH] refactor --- packages/frontend/src/pages/qr.show.vue | 70 ++++++++++++------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/frontend/src/pages/qr.show.vue b/packages/frontend/src/pages/qr.show.vue index 958eca3ccb..a2824f5b8a 100644 --- a/packages/frontend/src/pages/qr.show.vue +++ b/packages/frontend/src/pages/qr.show.vue @@ -89,43 +89,43 @@ function share() { }); } -onMounted(() => { - const qrCodeInstance = new QRCodeStyling({ - width: 512, - height: 512, - margin: 40, - type: 'canvas', - data: url.value, - image: instance.iconUrl ? getStaticImageUrl(instance.iconUrl) : '/favicon.ico', - qrOptions: { - typeNumber: 0, - mode: 'Byte', - errorCorrectionLevel: 'H', +const qrCodeInstance = new QRCodeStyling({ + width: 512, + height: 512, + margin: 40, + type: 'canvas', + data: url.value, + image: instance.iconUrl ? getStaticImageUrl(instance.iconUrl) : '/favicon.ico', + qrOptions: { + typeNumber: 0, + mode: 'Byte', + errorCorrectionLevel: 'H', + }, + imageOptions: { + hideBackgroundDots: true, + imageSize: 0.3, + margin: 12, + crossOrigin: 'anonymous', + }, + dotsOptions: { + color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 18)`).toRgbString(), + gradient: { + type: 'linear', + rotation: 1, // radian + colorStops: [ + { offset: 0, color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 25)`).toRgbString() }, + { offset: 0.5, color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 20)`).toRgbString() }, + { offset: 1, color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 6)`).toRgbString() }, + ], }, - imageOptions: { - hideBackgroundDots: true, - imageSize: 0.3, - margin: 12, - crossOrigin: 'anonymous', - }, - dotsOptions: { - color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 18)`).toRgbString(), - gradient: { - type: 'linear', - rotation: 1, // radian - colorStops: [ - { offset: 0, color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 25)`).toRgbString() }, - { offset: 0.5, color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 20)`).toRgbString() }, - { offset: 1, color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 6)`).toRgbString() }, - ], - }, - type: 'classy-rounded', - }, - backgroundOptions: { - color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 97)`).toRgbString(), - }, - }); + type: 'classy-rounded', + }, + backgroundOptions: { + color: tinycolor(`hsl(${avatarHsl.value.h}, 100, 97)`).toRgbString(), + }, +}); +onMounted(() => { if (qrCodeEl.value != null) { qrCodeInstance.append(qrCodeEl.value); }