1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-05 04:15:55 +02:00

fix(frontend): confettiの実行がアニメーション設定を考慮していない問題を修正 (#16714)

* fix(frontend): confettiの実行がアニメーション設定を考慮していない問題を修正

* Update Changelog

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
かっこかり
2025-10-27 18:41:03 +09:00
committed by GitHub
parent 17da44078b
commit 4e16e23acd
5 changed files with 20 additions and 9 deletions

View File

@@ -5,13 +5,21 @@
import _confetti from 'canvas-confetti';
import * as os from '@/os.js';
import { prefer } from '@/preferences.js';
export function confetti(options: { duration?: number; } = {}) {
if (!prefer.s.animation) return;
const duration = options.duration ?? 1000 * 4;
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'),
} satisfies _confetti.Options;
function randomInRange(min, max) {
function randomInRange(min: number, max: number) {
return Math.random() * (max - min) + min;
}