Skip to content

Commit 7e84b6f

Browse files
committed
Add animation duration
1 parent 1a36d65 commit 7e84b6f

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

docs/src/content/guides/configuration.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type Config = {
2222

2323
// Whether to animate the product tour. (default: true)
2424
animate?: boolean;
25+
// Animation duration in milliseconds. (default: 400ms)
26+
duration?: boolean;
2527
// Overlay color. (default: black)
2628
// This is useful when you have a dark background
2729
// and want to highlight elements with a light

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type Config = {
1212
steps?: DriveStep[];
1313

1414
animate?: boolean;
15+
duration?: number;
1516
overlayColor?: string;
1617
overlayOpacity?: number;
1718
smoothScroll?: boolean;

src/highlight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function refreshActiveHighlight() {
5757
}
5858

5959
function transferHighlight(toElement: Element, toStep: DriveStep) {
60-
const duration = 400;
60+
const duration = getConfig("duration") || 400;
6161
const start = Date.now();
6262

6363
const fromStep = getState("__activeStep");

0 commit comments

Comments
 (0)