Fix group VN mode with reduced motion
| @@ -285,6 +285,12 @@ async function visualNovelUpdateLayers(container) { | ||
| 285 | 285 | let images = Array.from($('#visual-novel-wrapper .expression-holder')).sort(sortFunction); |
| 286 | 286 | let imagesWidth = []; |
| 287 | 287 | |
| 288 | + for (const image of images) { | |
| 289 | + if (image instanceof HTMLImageElement && !image.complete) { | |
| 290 | + await new Promise(resolve => image.addEventListener('load', resolve, { once: true })); | |
| 291 | + } | |
| 292 | + } | |
| 293 | + | |
| 288 | 294 | images.forEach(image => { |
| 289 | 295 | imagesWidth.push($(image).width()); |
| 290 | 296 | }); |
| @@ -320,9 +326,15 @@ async function visualNovelUpdateLayers(container) { | ||
| 320 | 326 | element.show(); |
| 321 | 327 | |
| 322 | 328 | const promise = new Promise(resolve => { |
| 329 | + if (power_user.reduced_motion) { | |
| 330 | + element.css('left', currentPosition + 'px'); | |
| 331 | + requestAnimationFrame(() => resolve()); | |
| 332 | + } | |
| 333 | + else { | |
| 323 | 334 | element.animate({ left: currentPosition + 'px' }, 500, () => { |
| 324 | 335 | resolve(); |
| 325 | 336 | }); |
| 337 | + } | |
| 326 | 338 | }); |
| 327 | 339 | |
| 328 | 340 | currentPosition += imagesWidth[index]; |