This commit is contained in:
syuilo 2023-01-06 13:50:41 +09:00
parent 4d2d6154a3
commit c5cb786054
2 changed files with 5 additions and 3 deletions

View file

@ -26,7 +26,9 @@ const whatIsNew = () => {
};
onMounted(() => {
confetti();
confetti({
duration: 1000 * 3,
});
});
</script>

View file

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