@@ -167,37 +167,11 @@ export function createAnimations(
167
167
queue : QueueSlice ,
168
168
elements : ElementsSlice
169
169
) {
170
- let tStyles = [ '0.35s' , 'cubic-bezier(0.5, 1, 0.25, 1)' ]
171
-
172
170
return {
173
171
isReducedMotion : ref ( false ) ,
174
- transitionStyles : null as null | Pick < CSSProperties , 'transitionDuration' | 'transitionTimingFunction' > , // prettier-ignore
175
172
setReducedMotion ( newVal : boolean ) {
176
173
this . isReducedMotion . value = newVal
177
174
} ,
178
- resetTransitionStyles ( ) {
179
- this . transitionStyles = null
180
- } ,
181
- syncTransitionStyles ( ) {
182
- const { enter } = config . animations . value
183
-
184
- if ( ! enter ) {
185
- tStyles = [ '0s' , 'ease' ]
186
- } else {
187
- const animEl = elements . root . value ?. querySelector ( `.${ enter } ` )
188
- if ( animEl ) {
189
- console . log ( 'Syncing transition styles' )
190
-
191
- const style = window . getComputedStyle ( animEl )
192
- tStyles = [ style . animationDuration , style . animationTimingFunction ]
193
- }
194
- }
195
-
196
- this . transitionStyles = {
197
- transitionDuration : tStyles [ 0 ] ,
198
- transitionTimingFunction : tStyles [ 1 ] ,
199
- }
200
- } ,
201
175
playLeave ( id : string , { isDestroy = false , isUserTriggered = false } = { } ) {
202
176
const { leave = '' } = config . animations . value
203
177
const item = items . get ( id )
@@ -247,19 +221,6 @@ export function createAnimations(
247
221
} )
248
222
} ,
249
223
updatePositions ( { isImmediate = false } = { } ) {
250
- if ( ! this . transitionStyles ) {
251
- // Runs the first time a notification is rendered
252
- window . requestAnimationFrame ( ( ) => {
253
- this . syncTransitionStyles ( )
254
- window . requestAnimationFrame ( ( ) => {
255
- this . updatePositionsImpl ( isImmediate )
256
- } )
257
- } )
258
- } else {
259
- this . updatePositionsImpl ( isImmediate )
260
- }
261
- } ,
262
- updatePositionsImpl ( isImmediate : boolean ) {
263
224
console . log ( 'Updating positions' )
264
225
265
226
const isReduced = this . isReducedMotion . value || isImmediate
@@ -276,9 +237,8 @@ export function createAnimations(
276
237
277
238
items . update ( id , {
278
239
positionStyles : {
279
- willChange : 'transform' ,
280
240
transform : `translate3d(0, ${ accPrevHeights } px, 0)` ,
281
- ... ( isReduced ? { transition : 'none' } : this . transitionStyles ) ,
241
+ transition : isReduced ? 'none' : config . transition . value ,
282
242
} ,
283
243
} )
284
244
0 commit comments