From 62d55d1cca6bd3e88e6c29d545da3474268061ec Mon Sep 17 00:00:00 2001 From: diamondburned Date: Tue, 12 Mar 2024 03:10:04 -0700 Subject: [PATCH] Disable bubbles in problem pages --- server/frontend/static/bubbles.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/frontend/static/bubbles.js b/server/frontend/static/bubbles.js index 15734b3..f275767 100644 --- a/server/frontend/static/bubbles.js +++ b/server/frontend/static/bubbles.js @@ -11,7 +11,10 @@ function enableBubbles() { document.body.appendChild(bubbles); const updateHeight = () => { - bubbles.style.setProperty("--page-height", document.body.scrollHeight + "px"); + bubbles.style.setProperty( + "--page-height", + document.body.scrollHeight + "px", + ); }; const resizeObserver = new ResizeObserver(() => updateHeight()); @@ -117,7 +120,8 @@ if (preference != null) { } else { const isReduced = window.matchMedia(`(prefers-reduced-motion: reduce)`) === true || - window.matchMedia(`(prefers-reduced-motion: reduce)`).matches === true; + window.matchMedia(`(prefers-reduced-motion: reduce)`).matches === true || + location.pathname.startsWith("/problems/"); // Disable bubbles on problem pages if (!isReduced) { enableBubbles(); }