tweak confetti

This commit is contained in:
syuilo 2023-01-06 20:25:08 +09:00
parent 70805e00eb
commit 4b181a30da
2 changed files with 4 additions and 2 deletions

View File

@ -188,7 +188,9 @@ onMounted(() => {
const bm = parseInt(props.user.birthday.split('-')[1]); const bm = parseInt(props.user.birthday.split('-')[1]);
const bd = parseInt(props.user.birthday.split('-')[2]); const bd = parseInt(props.user.birthday.split('-')[2]);
if (m === bm && d === bd) { if (m === bm && d === bd) {
confetti(); confetti({
duration: 1000 * 4
});
} }
} }
}); });

View File

@ -2,7 +2,7 @@ import _confetti from 'canvas-confetti';
import * as os from '@/os'; import * as os from '@/os';
export function confetti(options: { duration?: number; } = {}) { export function confetti(options: { duration?: number; } = {}) {
const duration = options.duration ?? 1000 * 5; const duration = options.duration ?? 1000 * 4;
const animationEnd = Date.now() + duration; const animationEnd = Date.now() + duration;
const defaults = { startVelocity: 30, spread: 360, ticks: 60, zIndex: os.claimZIndex('high') }; const defaults = { startVelocity: 30, spread: 360, ticks: 60, zIndex: os.claimZIndex('high') };