From 8a46ff73ef927fc4fabd447ca2b0ba0992294235 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 13 Mar 2018 02:37:55 +0100 Subject: [PATCH] Update animation speed --- src/common/constants.js | 2 +- src/core/element.js | 2 +- src/driver.scss | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/common/constants.js b/src/common/constants.js index 897fafc..b8c74e4 100644 --- a/src/common/constants.js +++ b/src/common/constants.js @@ -22,7 +22,7 @@ export const CLASS_PREV_STEP_BTN = 'driver-prev-btn'; export const CLASS_BTN_DISABLED = 'driver-disabled'; // It must match the one set in the animations in CSS file -export const ANIMATION_DURATION_MS = 200; +export const ANIMATION_DURATION_MS = 400; // language=HTML export const POPOVER_HTML = ` diff --git a/src/core/element.js b/src/core/element.js index 2371baf..f5939b1 100644 --- a/src/core/element.js +++ b/src/core/element.js @@ -231,7 +231,7 @@ export default class Element { const showAtPosition = this.getCalculatedPosition(); // For first highlight, show it immediately because there won't be any animation - const animationDuration = !this.overlay.lastHighlightedElement ? 0 : ANIMATION_DURATION_MS * 2; + const animationDuration = !this.overlay.lastHighlightedElement ? 0 : ANIMATION_DURATION_MS; this.animationTimeout = this.window.setTimeout(() => { this.popover.show(showAtPosition); diff --git a/src/driver.scss b/src/driver.scss index a2b8e6d..3ef2f85 100644 --- a/src/driver.scss +++ b/src/driver.scss @@ -120,11 +120,11 @@ div#driver-page-overlay { z-index: 100002 !important; // If you update this duration, make sure to update `ANIMATION_DURATION_MS` constant - -webkit-transition: all 0.2s; - -moz-transition: all 0.2s; - -ms-transition: all 0.2s; - -o-transition: all 0.2s; - transition: all 0.2s; + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -ms-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; } div#driver-highlighted-element-stage { @@ -138,11 +138,11 @@ div#driver-highlighted-element-stage { display: none; // If you update this duration, make sure to update `ANIMATION_DURATION_MS` constant - -webkit-transition: all 0.2s; - -moz-transition: all 0.2s; - -ms-transition: all 0.2s; - -o-transition: all 0.2s; - transition: all 0.2s; + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -ms-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; } .driver-highlighted-element {