File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,9 +59,8 @@ mobile text region begins.
5959
6060Only the homepage particle field moves. Its transformations explain the current
6161chapter. Reduced-motion preferences place the particles directly into each
62- formation. Coarse-pointer screens up to 820px use the same static formations to
63- reduce battery use during the mobile reading journey. Interior pages do not use
64- decorative animation.
62+ formation. The particle field otherwise animates on both pointer and touch
63+ screens. Interior pages do not use decorative animation.
6564
6665## Language
6766
Original file line number Diff line number Diff line change 33 const canvas = document . querySelector ( "#diagram" ) ;
44 const context = canvas . getContext ( "2d" , { alpha : true } ) ;
55 const chapters = [ ...document . querySelectorAll ( ".chapter" ) ] ;
6- const reduceMotion =
7- matchMedia ( "(prefers-reduced-motion: reduce)" ) . matches
8- || matchMedia ( "(max-width: 820px) and (pointer: coarse)" ) . matches ;
6+ const reduceMotion = matchMedia ( "(prefers-reduced-motion: reduce)" ) . matches ;
97 const particleCount = 361 ;
108 const cellSize = 104 ;
119 const particles = [ ] ;
Original file line number Diff line number Diff line change @@ -402,22 +402,11 @@ function addThemeAwareCanvasPalette(source) {
402402
403403 function draw(now)`
404404 ) ;
405- const motionPreference =
406- ' const reduceMotion = matchMedia("(prefers-reduced-motion: reduce)").matches;' ;
407- if ( ! withParticles . includes ( motionPreference ) ) {
408- throw new Error ( "Could not find the prototype motion preference" ) ;
409- }
410- const withMobileMotion = withParticles . replace (
411- motionPreference ,
412- ` const reduceMotion =
413- matchMedia("(prefers-reduced-motion: reduce)").matches
414- || matchMedia("(max-width: 820px) and (pointer: coarse)").matches;`
415- ) ;
416405 const initialization = " resize();\n updateScrollState();" ;
417- if ( ! withMobileMotion . includes ( initialization ) ) {
406+ if ( ! withParticles . includes ( initialization ) ) {
418407 throw new Error ( "Could not find the prototype initialization" ) ;
419408 }
420- const withInitialization = withMobileMotion . replace (
409+ const withInitialization = withParticles . replace (
421410 initialization ,
422411 " syncPalette();\n resize();\n updateScrollState();"
423412 ) ;
You can’t perform that action at this time.
0 commit comments