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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user