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(() => { onMounted(() => {
confetti(); confetti({
duration: 1000 * 3,
});
}); });
</script> </script>

View file

@ -1,8 +1,8 @@
import _confetti from 'canvas-confetti'; import _confetti from 'canvas-confetti';
import * as os from '@/os'; import * as os from '@/os';
export function confetti() { export function confetti(options: { duration?: number; } = {}) {
const duration = 1000 * 5; const duration = options.duration ?? 1000 * 5;
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') };