Skip to content

Commit b908a49

Browse files
Make bubble fade-in delay offset configurable via URL param
Add ?bubbleFadeInDelay URL parameter to configure the delay offset between top and bottom bubble fade-in animations. Default remains 100ms offset (top: 400ms, bottom: 500ms). Follows the same pattern as ?bubbleWidth. Co-authored-by: Robert Anderson <robert@noisysocks.com>
1 parent b59639f commit b908a49

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

special-pages/pages/onboarding/app/v4/components/SingleStep.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import styles from './SingleStep.module.css';
88
/** @type {string|null} */
99
const bubbleWidthOverride = new URLSearchParams(window.location.search).get('bubbleWidth');
1010

11+
/** @type {string|null} */
12+
const bubbleFadeInDelayOverride = new URLSearchParams(window.location.search).get('bubbleFadeInDelay');
13+
1114
/**
1215
* Main layout component for v4 steps.
1316
* Steps with bubbles use absolute positioning; the layout measures bubble heights.
@@ -67,7 +70,16 @@ export function SingleStep() {
6770
exiting={globalState.exiting}
6871
onExitComplete={topBubble ? undefined : advance}
6972
progress={showProgress && !topBubble ? progress : undefined}
70-
fadeInDelay={topBubble ? 500 : undefined}
73+
fadeInDelay={
74+
topBubble
75+
? (() => {
76+
const defaultTopDelay = 400; // Default fade-in delay from CSS
77+
const defaultOffset = 100; // Default 100ms offset between top and bottom
78+
const offset = bubbleFadeInDelayOverride ? Number.parseInt(bubbleFadeInDelayOverride, 10) : defaultOffset;
79+
return defaultTopDelay + (Number.isNaN(offset) ? defaultOffset : offset);
80+
})()
81+
: undefined
82+
}
7183
>
7284
{bottomBubble?.content}
7385
</Bubble>

0 commit comments

Comments
 (0)