From 4b181a30da9aa53c68cbc151fed42027c40a18b4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 6 Jan 2023 20:25:08 +0900 Subject: [PATCH] tweak confetti --- packages/frontend/src/pages/user/home.vue | 4 +++- packages/frontend/src/scripts/confetti.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index 8c5c4c309..53ae6a2c5 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -188,7 +188,9 @@ onMounted(() => { const bm = parseInt(props.user.birthday.split('-')[1]); const bd = parseInt(props.user.birthday.split('-')[2]); if (m === bm && d === bd) { - confetti(); + confetti({ + duration: 1000 * 4 + }); } } }); diff --git a/packages/frontend/src/scripts/confetti.ts b/packages/frontend/src/scripts/confetti.ts index d1fbd0ee7..9e03acbf8 100644 --- a/packages/frontend/src/scripts/confetti.ts +++ b/packages/frontend/src/scripts/confetti.ts @@ -2,7 +2,7 @@ import _confetti from 'canvas-confetti'; import * as os from '@/os'; export function confetti(options: { duration?: number; } = {}) { - const duration = options.duration ?? 1000 * 5; + const duration = options.duration ?? 1000 * 4; const animationEnd = Date.now() + duration; const defaults = { startVelocity: 30, spread: 360, ticks: 60, zIndex: os.claimZIndex('high') };