Skip to content

Commit

Permalink
Disable bubbles in problem pages
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Mar 12, 2024
1 parent 35a2b9d commit 62d55d1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/frontend/static/bubbles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 62d55d1

Please sign in to comment.