@@ -11,7 +11,6 @@ export default async function({ addon }) {
11
11
const mediaQuery = window . matchMedia ( "(prefers-reduced-motion: reduce)" ) ;
12
12
const addonKey = "addonAnimations-" ;
13
13
const cubicAnimation = "cubic-bezier(0.63, 0.32, 0.08, 0.95)" ;
14
- const getAnim = ( time ) => { return `${ time } s ${ cubicAnimation } ` } ;
15
14
16
15
const styles = `
17
16
/* Top Bar Items */
@@ -110,15 +109,21 @@ export default async function({ addon }) {
110
109
animationEnabled = ! e . matches ;
111
110
} ) ;
112
111
113
- let needsInit = true , animateModals = true , animateLibraries = true , animateButtons = true ;
112
+ let needsInit = true , animateModals = true , animateLibraries = true , animateButtons = true , animationSpeed = 1 ;
114
113
let patchedBody = false , sbPatched = false , sbEverPatched = false , listenerAttached = false ;
115
114
116
115
function requestAddonState ( ) {
117
116
animateModals = addon . settings . get ( "animateModals" ) ;
118
117
animateLibraries = addon . settings . get ( "animateLibraries" ) ;
119
118
animateButtons = addon . settings . get ( "animateButtons" ) ;
119
+ animationSpeed = Number ( addon . settings . get ( "animateSpeed" ) ) / 100 ;
120
120
}
121
121
122
+ function getAnim ( time ) {
123
+ time *= animationSpeed ;
124
+ return `${ time } s ${ cubicAnimation } ` ;
125
+ } ;
126
+
122
127
function observeMenuScalers ( element , observerSub , observerAtt ) {
123
128
if ( ! animateModals ) return ;
124
129
if ( element . hasAttribute ( "addon-scale-listeners-bound" ) ) return ;
0 commit comments