File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ if (prefersReducedMotion) {
174174const heroZone = document . getElementById ( "hero-zone" ) || document . querySelector ( ".hero" ) ;
175175function triggerHeroPulse ( ) {
176176 if ( ! heroZone ) return ;
177+ if ( prefersReducedMotion ) return ;
177178 heroZone . classList . remove ( "pulse-hit" ) ;
178179 void heroZone . offsetWidth ;
179180 heroZone . classList . add ( "pulse-hit" ) ;
@@ -846,6 +847,7 @@ function playPulseSound(pulseCount = 1) {
846847
847848function triggerPenguinPowerUp ( ) {
848849 if ( ! penguinAvatar ) return ;
850+ if ( prefersReducedMotion ) return ;
849851
850852 penguinAvatar . classList . remove ( "power-up" ) ;
851853 // Restart animation if pulses happen quickly.
@@ -2202,7 +2204,8 @@ function showToast(message) {
22022204}
22032205
22042206function spawnSparks ( total ) {
2205- const { isConstrained, isFirefoxLike } = runtimeFlags ;
2207+ const { isConstrained, isFirefoxLike, saveData } = runtimeFlags ;
2208+ if ( prefersReducedMotion || saveData ) return ;
22062209 const densityScale = isConstrained ? 0.35 : ( isFirefoxLike ? 0.55 : 1 ) ;
22072210 const batchTotal = Math . max ( 3 , Math . round ( total * densityScale ) ) ;
22082211 const fragment = document . createDocumentFragment ( ) ;
You can’t perform that action at this time.
0 commit comments