From 41a5ad30c5113094b1df6c57e7e5a78af1015701 Mon Sep 17 00:00:00 2001 From: Daniel Dizdarevic Date: Tue, 31 Dec 2024 13:10:30 +0100 Subject: [PATCH] Fix effect collision --- src/mastodon/addons/snow.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mastodon/addons/snow.js b/src/mastodon/addons/snow.js index b04201b..2bdf6d2 100644 --- a/src/mastodon/addons/snow.js +++ b/src/mastodon/addons/snow.js @@ -4,6 +4,10 @@ import { reduceMotion } from 'mastodon/initial_state'; function animate(ctx, snowflakes, canvas, maxFlakes) { + // Check for other effects + if (window.fediday) { + return; // Don't show snow if confetti effect is there + } ctx.clearRect(0, 0, canvas.width, canvas.height); // Add new snowflake if we haven't reached the maximum if (snowflakes.length < maxFlakes && Math.random() < 0.05) { // 5% chance each frame to add a new flake @@ -42,10 +46,6 @@ function animate(ctx, snowflakes, canvas, maxFlakes) { } document.addEventListener('DOMContentLoaded', () => { - // Check if it's fediday - if (window.fediday) { - return; // Don't create snow effect if confetti effect is there - } // Check if reduced motion is enabled if (reduceMotion) { return; // Don't create snow effect if reduced motion is preferred